ATLAS Offline Software
Loading...
Searching...
No Matches
LArFastShower.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LARG4FASTSIMULATION_LARFASTSHOWER_H
6#define LARG4FASTSIMULATION_LARFASTSHOWER_H
7
8// STL includes
9#include <string>
10#include <map>
11
12// Geant4 includes
13#include "G4VFastSimulationModel.hh"
14
15// Local includes
17
18// Forward declarations
21#ifdef HEPMC3
22#include "HepMC3/WriterAscii.h"
23#endif
24
27
28
30class LArFastShower : public G4VFastSimulationModel
31{
32public:
33
35 LArFastShower(const std::string& name, G4Region* region, const FastShowerConfigStruct& config,
36 IFastSimDedicatedSD* fastSimDedicatedSD);
37
39 virtual ~LArFastShower() {}
40
44 G4bool IsApplicable(const G4ParticleDefinition&) override;
45
49 virtual G4bool ModelTrigger(const G4FastTrack &) override;
50
51 virtual G4bool ForcedAccept(const G4FastTrack &);
52 virtual G4bool ForcedDeny (const G4FastTrack &);
53
56 void DoIt(const G4FastTrack&, G4FastStep&) override;
57
58protected:
59
62
64 void KillParticle(const G4FastTrack&, G4FastStep&);
66 void UseShowerLib(const G4FastTrack&, G4FastStep&);
67
69 virtual G4bool CheckContainment(const G4FastTrack &fastTrack);
70
71 std::unique_ptr<const HepMC::GenEvent> GetGenEvent(const G4FastTrack &fastTrack);
72
74 bool flagToShowerLib ( const G4ParticleDefinition& particleType ) const;
76 double maxEneToShowerLib( const G4ParticleDefinition& particleType ) const;
78 double minEneToShowerLib( const G4ParticleDefinition& particleType ) const;
79
80 bool generateFSStartingPoint( std::unique_ptr<const HepMC::GenEvent> &ge) const;
81
82private:
84
89
90 // data members for configuration
92#ifdef HEPMC3
93 std::shared_ptr<HepMC3::WriterAscii> m_starting_points_file;
94#else
95 std::shared_ptr<HepMC::IO_GenEvent> m_starting_points_file;
96#endif
97 std::string m_detector_tag_str;
98 std::map<std::string,int> m_detmap;
99
101 std::map<int,bool> m_applicableMap;
102
103};
104
105#endif //LARG4FASTSIMULATION_LARFASTSHOWER_H
This is the interface for the fast simulation dedicated sensitive detector.
ILArG4ShowerLibSvc * showerLibSvc()
void KillParticle(const G4FastTrack &, G4FastStep &)
Method to kill a particle and deposit its energy using exponential decay function.
ILArG4ShowerLibSvc * m_showerLibSvc
Pointer to the shower library service.
IFastSimDedicatedSD * fastShowerSD()
virtual G4bool ForcedAccept(const G4FastTrack &)
If it returns true, the particle will be parameterized without further checks.
void UseShowerLib(const G4FastTrack &, G4FastStep &)
Function for the application of shower library.
LArFastShower(const std::string &name, G4Region *region, const FastShowerConfigStruct &config, IFastSimDedicatedSD *fastSimDedicatedSD)
Constructor.
virtual G4bool ForcedDeny(const G4FastTrack &)
If it returns true, the particle will be returned to G4 without further checks.
bool generateFSStartingPoint(std::unique_ptr< const HepMC::GenEvent > &ge) const
bool flagToShowerLib(const G4ParticleDefinition &particleType) const
get switch for frozen showers
double minEneToShowerLib(const G4ParticleDefinition &particleType) const
get upper energy limit for frozen showers
double maxEneToShowerLib(const G4ParticleDefinition &particleType) const
get lower energy limit for frozen showers
std::map< int, bool > m_applicableMap
virtual G4bool ModelTrigger(const G4FastTrack &) override
Determines the applicability of the fast sim model to this particular track.
std::unique_ptr< const HepMC::GenEvent > GetGenEvent(const G4FastTrack &fastTrack)
std::shared_ptr< HepMC::IO_GenEvent > m_starting_points_file
bool m_generate_starting_points
G4bool IsApplicable(const G4ParticleDefinition &) override
Determines the applicability of the fast sim model to this particle type Called once for each track p...
const FastShowerConfigStruct m_configuration
std::string m_detector_tag_str
virtual ~LArFastShower()
Destructor.
void DoIt(const G4FastTrack &, G4FastStep &) override
Assigns the track to the appropriate method for application of the fast simulation.
virtual G4bool CheckContainment(const G4FastTrack &fastTrack)
Function to check the containment of a shower within a regular detector region.
std::map< std::string, int > m_detmap
IFastSimDedicatedSD * m_fastSimDedicatedSD
Shower library sensitive detector for this shower.