ATLAS Offline Software
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
16 #include "FastShowerConfigStruct.h"
17 
18 // Forward declarations
20 #include "AtlasHepMC/IO_GenEvent.h"
21 #ifdef HEPMC3
22 #include "HepMC3/WriterAscii.h"
23 #endif
24 
26 class ILArG4ShowerLibSvc;
27 
28 
30 class LArFastShower : public G4VFastSimulationModel
31 {
32  public:
33 
35  LArFastShower(const std::string& name, 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 
58  protected:
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 
82  private:
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
LArFastShower::~LArFastShower
virtual ~LArFastShower()
Destructor.
Definition: LArFastShower.h:39
LArFastShower::CheckContainment
virtual G4bool CheckContainment(const G4FastTrack &fastTrack)
Function to check the containment of a shower within a regular detector region.
Definition: LArFastShower.cxx:275
ILArG4ShowerLibSvc
Definition: ILArG4ShowerLibSvc.h:19
IO_GenEvent.h
LArFastShower::showerLibSvc
ILArG4ShowerLibSvc * showerLibSvc()
Definition: LArFastShower.cxx:93
LArFastShower::ForcedDeny
virtual G4bool ForcedDeny(const G4FastTrack &)
If it returns true, the particle will be returned to G4 without further checks.
Definition: LArFastShower.cxx:482
IFastSimDedicatedSD
This is the interface for the fast simulation dedicated sensitive detector.
Definition: IFastSimDedicatedSD.h:13
LArFastShower::minEneToShowerLib
double minEneToShowerLib(const G4ParticleDefinition &particleType) const
get upper energy limit for frozen showers
Definition: LArFastShower.cxx:416
LArFastShower::m_detector_tag_str
std::string m_detector_tag_str
Definition: LArFastShower.h:97
LArFastShower::m_eventNum
int m_eventNum
Definition: LArFastShower.h:100
particleType
Definition: particleType.h:29
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
LArFastShower::DoIt
void DoIt(const G4FastTrack &, G4FastStep &) override
Assigns the track to the appropriate method for application of the fast simulation.
Definition: LArFastShower.cxx:184
LArFastShower::GetGenEvent
std::unique_ptr< const HepMC::GenEvent > GetGenEvent(const G4FastTrack &fastTrack)
Definition: LArFastShower.cxx:357
LArFastShower::fastShowerSD
IFastSimDedicatedSD * fastShowerSD()
Definition: LArFastShower.cxx:84
LArFastShower::generateFSStartingPoint
bool generateFSStartingPoint(std::unique_ptr< const HepMC::GenEvent > &ge) const
Definition: LArFastShower.cxx:447
LArFastShower::LArFastShower
LArFastShower(const std::string &name, const FastShowerConfigStruct &config, IFastSimDedicatedSD *fastSimDedicatedSD)
Constructor.
Definition: LArFastShower.cxx:37
LArFastShower::m_generate_starting_points
bool m_generate_starting_points
Definition: LArFastShower.h:91
LArFastShower::ModelTrigger
virtual G4bool ModelTrigger(const G4FastTrack &) override
Determines the applicability of the fast sim model to this particular track.
Definition: LArFastShower.cxx:129
FastShowerConfigStruct
Definition: FastShowerConfigStruct.h:12
GenEvent_fwd.h
LArFastShower::UseShowerLib
void UseShowerLib(const G4FastTrack &, G4FastStep &)
Function for the application of shower library.
Definition: LArFastShower.cxx:224
LArFastShower::flagToShowerLib
bool flagToShowerLib(const G4ParticleDefinition &particleType) const
get switch for frozen showers
Definition: LArFastShower.cxx:401
LArFastShower
NEEDS DOCUMENTATION.
Definition: LArFastShower.h:31
LArFastShower::m_showerLibSvc
ILArG4ShowerLibSvc * m_showerLibSvc
Pointer to the shower library service.
Definition: LArFastShower.h:88
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArFastShower::ForcedAccept
virtual G4bool ForcedAccept(const G4FastTrack &)
If it returns true, the particle will be parameterized without further checks.
Definition: LArFastShower.cxx:458
LArFastShower::KillParticle
void KillParticle(const G4FastTrack &, G4FastStep &)
Method to kill a particle and deposit its energy using exponential decay function.
Definition: LArFastShower.cxx:209
FastShowerConfigStruct.h
LArFastShower::m_applicableMap
std::map< int, bool > m_applicableMap
Definition: LArFastShower.h:101
LArFastShower::m_configuration
const FastShowerConfigStruct m_configuration
Definition: LArFastShower.h:83
LArFastShower::m_starting_points_file
std::shared_ptr< HepMC::IO_GenEvent > m_starting_points_file
Definition: LArFastShower.h:95
LArFastShower::m_fastSimDedicatedSD
IFastSimDedicatedSD * m_fastSimDedicatedSD
Shower library sensitive detector for this shower.
Definition: LArFastShower.h:86
LArFastShower::maxEneToShowerLib
double maxEneToShowerLib(const G4ParticleDefinition &particleType) const
get lower energy limit for frozen showers
Definition: LArFastShower.cxx:432
LArFastShower::IsApplicable
G4bool IsApplicable(const G4ParticleDefinition &) override
Determines the applicability of the fast sim model to this particle type Called once for each track p...
Definition: LArFastShower.cxx:106
LArFastShower::m_detmap
std::map< std::string, int > m_detmap
Definition: LArFastShower.h:98