ATLAS Offline Software
LArG4FastSimSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef LARG4FASTSIMSVC_LARG4FASTSIMSVC_H
5 #define LARG4FASTSIMSVC_LARG4FASTSIMSVC_H
6 
7 // local includes
10 
11 // Minimal service includes
12 #include "GaudiKernel/StatusCode.h"
13 //#include "GaudiKernel/Service.h"
14 #include "Gaudi/Property.h"
15 
16 #include "G4Electron.hh"
17 #include "G4Positron.hh"
18 #include "G4Gamma.hh"
19 #include "G4Neutron.hh"
20 #include "G4PionPlus.hh"
21 #include "G4PionMinus.hh"
22 
23 // STL includes
24 #include <string>
25 #include <map>
26 
27 template <class TYPE> class SvcFactory;
28 
30 
31 
42 class LArG4FastSimSvc : public extends<AthService, ILArG4FastSimSvc> {
43 
44  public:
45 
46  virtual StatusCode initialize();
47  virtual StatusCode finalize();
48 
49  inline virtual bool flagToShowerLib ( const G4ParticleDefinition& particleType ) const;
50  inline virtual double maxEneToShowerLib( const G4ParticleDefinition& particleType ) const;
51  inline virtual double minEneToShowerLib( const G4ParticleDefinition& particleType ) const;
52 
53  inline virtual bool ContainLow() const;
54  inline virtual bool ContainHigh() const;
55  inline virtual bool ContainCrack() const;
56 
57  inline virtual bool generateFSStartingPoints() const;
58  virtual bool generateFSStartingPoint( const HepMC::GenEvent * ge);
59  inline virtual float generateFSStartingPointsRatio() const;
60 
61  inline virtual int DetectorTag() const;
62 
63  friend class SvcFactory<LArG4FastSimSvc>;
64 
66  LArG4FastSimSvc(const std::string& name, ISvcLocator* sl);
67 
69  virtual ~LArG4FastSimSvc();
70 
71  private:
72 
73  void print() const;
74 
75  // data members
79 
83 
87 
91 
92  bool m_containLow;
95 
99  HepMC::IO_GenEvent * m_starting_points_file;
101  std::string m_detector_tag_str;
102  std::map<std::string,int> m_detmap;
103 
104 
105 };
106 
107 // Get methods
108 inline bool LArG4FastSimSvc::flagToShowerLib( const G4ParticleDefinition& particleType ) const
109 {
110  if ( &particleType == G4Electron::ElectronDefinition() ||
111  &particleType == G4Positron::PositronDefinition() ) {
112  return m_e_FlagShowerLib;
113  } else if ( &particleType == G4Gamma::GammaDefinition() ) {
114  return m_g_FlagShowerLib;
115  } else if ( &particleType == G4Neutron::NeutronDefinition() ) {
116  return m_Neut_FlagShowerLib;
117  } else if ( &particleType == G4PionPlus::PionPlusDefinition() ||
118  &particleType == G4PionMinus::PionMinusDefinition() ) {
119  return m_Pion_FlagShowerLib;
120  } else return false;
121 }
122 inline double LArG4FastSimSvc::minEneToShowerLib( const G4ParticleDefinition& particleType ) const
123 {
124  if ( &particleType == G4Electron::ElectronDefinition() ||
125  &particleType == G4Positron::PositronDefinition() ) {
126  return m_e_MinEneShowerLib;
127  } else if ( &particleType == G4Gamma::GammaDefinition() ) {
128  return m_g_MinEneShowerLib;
129  } else if ( &particleType == G4Neutron::NeutronDefinition() ) {
130  return m_Neut_MinEneShowerLib;
131  } else if ( &particleType == G4PionPlus::PionPlusDefinition() ||
132  &particleType == G4PionMinus::PionMinusDefinition() ) {
133  return m_Pion_MinEneShowerLib;
134  } else return 0.0;
135 }
136 
137 inline double LArG4FastSimSvc::maxEneToShowerLib( const G4ParticleDefinition& particleType ) const
138 {
139  if ( &particleType == G4Electron::ElectronDefinition() ||
140  &particleType == G4Positron::PositronDefinition() ) {
141  return m_e_MaxEneShowerLib;
142  } else if ( &particleType == G4Gamma::GammaDefinition() ) {
143  return m_g_MaxEneShowerLib;
144  } else if ( &particleType == G4Neutron::NeutronDefinition() ) {
145  return m_Neut_MaxEneShowerLib;
146  } else if ( &particleType == G4PionPlus::PionPlusDefinition() ||
147  &particleType == G4PionMinus::PionMinusDefinition() ) {
148  return m_Pion_MaxEneShowerLib;
149  } else return 0.0;
150 }
151 
152 inline bool LArG4FastSimSvc::ContainLow() const { return m_containLow; }
153 inline bool LArG4FastSimSvc::ContainHigh() const { return m_containHigh; }
154 inline bool LArG4FastSimSvc::ContainCrack() const { return m_containCrack; }
155 
158 inline int LArG4FastSimSvc::DetectorTag() const { return m_detector_tag; }
159 #endif // LARG4FASTSIMSVC_LARG4FASTSIMSVC_H
LArG4FastSimSvc::m_containLow
bool m_containLow
switch for containment check at low eta
Definition: LArG4FastSimSvc.h:92
LArG4FastSimSvc::m_detector_tag_str
std::string m_detector_tag_str
Definition: LArG4FastSimSvc.h:101
LArG4FastSimSvc::m_e_MinEneShowerLib
double m_e_MinEneShowerLib
lower energy limit for electron frozen showers
Definition: LArG4FastSimSvc.h:77
LArG4FastSimSvc::m_generated_starting_points_file
StringProperty m_generated_starting_points_file
switch for shower starting point record
Definition: LArG4FastSimSvc.h:96
LArG4FastSimSvc::m_detector_tag
int m_detector_tag
name for the detector tag for the ShowerLibSvc
Definition: LArG4FastSimSvc.h:100
LArG4FastSimSvc::generateFSStartingPointsRatio
virtual float generateFSStartingPointsRatio() const
Definition: LArG4FastSimSvc.h:157
LArG4FastSimSvc::m_Neut_MinEneShowerLib
double m_Neut_MinEneShowerLib
lower energy limit for neutron frozen showers
Definition: LArG4FastSimSvc.h:85
LArG4FastSimSvc::print
void print() const
dump object content
Definition: LArG4FastSimSvc.cxx:115
LArG4FastSimSvc::initialize
virtual StatusCode initialize()
Definition: LArG4FastSimSvc.cxx:69
LArG4FastSimSvc::m_detmap
std::map< std::string, int > m_detmap
Definition: LArG4FastSimSvc.h:102
SvcFactory
Definition: AthCnvSvc.h:28
LArG4FastSimSvc
Class for fast simulation option service.
Definition: LArG4FastSimSvc.h:42
LArG4FastSimSvc::ContainLow
virtual bool ContainLow() const
Apply check containment at low eta.
Definition: LArG4FastSimSvc.h:152
LArG4FastSimSvc::m_containHigh
bool m_containHigh
switch for containment check at high eta
Definition: LArG4FastSimSvc.h:93
LArG4FastSimSvc::m_starting_points_file
HepMC::IO_GenEvent * m_starting_points_file
Definition: LArG4FastSimSvc.h:99
LArG4FastSimSvc::finalize
virtual StatusCode finalize()
Definition: LArG4FastSimSvc.cxx:104
LArG4FastSimSvc::maxEneToShowerLib
virtual double maxEneToShowerLib(const G4ParticleDefinition &particleType) const
get lower energy limit for frozen showers
Definition: LArG4FastSimSvc.h:137
particleType
Definition: particleType.h:29
LArG4FastSimSvc::m_containCrack
bool m_containCrack
switch for containment check in crack region
Definition: LArG4FastSimSvc.h:94
LArG4FastSimSvc::ContainCrack
virtual bool ContainCrack() const
Apply check containment in crack region.
Definition: LArG4FastSimSvc.h:154
LArG4FastSimSvc::DetectorTag
virtual int DetectorTag() const
Definition: LArG4FastSimSvc.h:158
LArG4FastSimSvc::m_Pion_MinEneShowerLib
double m_Pion_MinEneShowerLib
lower energy limit for pion frozen showers
Definition: LArG4FastSimSvc.h:89
LArG4FastSimSvc::generateFSStartingPoints
virtual bool generateFSStartingPoints() const
Definition: LArG4FastSimSvc.h:156
ILArG4FastSimSvc.h
LArG4FastSimSvc::LArG4FastSimSvc
LArG4FastSimSvc(const std::string &name, ISvcLocator *sl)
Standard Constructor.
Definition: LArG4FastSimSvc.cxx:19
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4FastSimSvc::ContainHigh
virtual bool ContainHigh() const
Apply check containment at high eta.
Definition: LArG4FastSimSvc.h:153
IO_GenEvent_fwd.h
LArG4FastSimSvc::generateFSStartingPoint
virtual bool generateFSStartingPoint(const HepMC::GenEvent *ge)
Definition: LArG4FastSimSvc.cxx:150
LArG4FastSimSvc::m_g_MaxEneShowerLib
double m_g_MaxEneShowerLib
lower energy limit for photon frozen showers
Definition: LArG4FastSimSvc.h:81
LArG4FastSimSvc::m_Pion_MaxEneShowerLib
double m_Pion_MaxEneShowerLib
upper energy limit for pion frozen showers
Definition: LArG4FastSimSvc.h:90
LArG4FastSimSvc::m_generated_starting_points_ratio
float m_generated_starting_points_ratio
switch for shower starting point record
Definition: LArG4FastSimSvc.h:97
LArG4FastSimSvc::m_Neut_FlagShowerLib
bool m_Neut_FlagShowerLib
switch for neutron frozen showers
Definition: LArG4FastSimSvc.h:84
LArG4FastSimSvc::~LArG4FastSimSvc
virtual ~LArG4FastSimSvc()
Standard Destructor.
Definition: LArG4FastSimSvc.cxx:64
LArG4FastSimSvc::minEneToShowerLib
virtual double minEneToShowerLib(const G4ParticleDefinition &particleType) const
get upper energy limit for frozen showers
Definition: LArG4FastSimSvc.h:122
LArG4FastSimSvc::m_Pion_FlagShowerLib
bool m_Pion_FlagShowerLib
switch for pion frozen showers
Definition: LArG4FastSimSvc.h:88
LArG4FastSimSvc::m_generate_starting_points
bool m_generate_starting_points
Definition: LArG4FastSimSvc.h:98
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArG4FastSimSvc::m_g_FlagShowerLib
bool m_g_FlagShowerLib
switch for photon frozen showers
Definition: LArG4FastSimSvc.h:80
LArG4FastSimSvc::m_e_FlagShowerLib
bool m_e_FlagShowerLib
switch for electron frozen showers
Definition: LArG4FastSimSvc.h:76
LArG4FastSimSvc::m_g_MinEneShowerLib
double m_g_MinEneShowerLib
upper energy limit for photon frozen showers
Definition: LArG4FastSimSvc.h:82
LArG4FastSimSvc::flagToShowerLib
virtual bool flagToShowerLib(const G4ParticleDefinition &particleType) const
get switch for frozen showers
Definition: LArG4FastSimSvc.h:108
AthService.h
LArG4FastSimSvc::m_Neut_MaxEneShowerLib
double m_Neut_MaxEneShowerLib
upper energy limit for neutron frozen showers
Definition: LArG4FastSimSvc.h:86
LArG4FastSimSvc::m_e_MaxEneShowerLib
double m_e_MaxEneShowerLib
upper energy limit for electron frozen showers
Definition: LArG4FastSimSvc.h:78