ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
LArG4FastSimSvc Class Reference

Class for fast simulation option service. More...

#include <LArG4FastSimSvc.h>

Inheritance diagram for LArG4FastSimSvc:
Collaboration diagram for LArG4FastSimSvc:

Public Member Functions

virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual bool flagToShowerLib (const G4ParticleDefinition &particleType) const
 get switch for frozen showers More...
 
virtual double maxEneToShowerLib (const G4ParticleDefinition &particleType) const
 get lower energy limit for frozen showers More...
 
virtual double minEneToShowerLib (const G4ParticleDefinition &particleType) const
 get upper energy limit for frozen showers More...
 
virtual bool ContainLow () const
 Apply check containment at low eta. More...
 
virtual bool ContainHigh () const
 Apply check containment at high eta. More...
 
virtual bool ContainCrack () const
 Apply check containment in crack region. More...
 
virtual bool generateFSStartingPoints () const
 
virtual bool generateFSStartingPoint (const HepMC::GenEvent *ge)
 
virtual float generateFSStartingPointsRatio () const
 
virtual int DetectorTag () const
 
 LArG4FastSimSvc (const std::string &name, ISvcLocator *sl)
 Standard Constructor. More...
 
virtual ~LArG4FastSimSvc ()
 Standard Destructor. More...
 

Private Member Functions

void print () const
 dump object content More...
 

Private Attributes

bool m_e_FlagShowerLib
 switch for electron frozen showers
More...
 
double m_e_MinEneShowerLib
 lower energy limit for electron frozen showers More...
 
double m_e_MaxEneShowerLib
 upper energy limit for electron frozen showers More...
 
bool m_g_FlagShowerLib
 switch for photon frozen showers
More...
 
double m_g_MaxEneShowerLib
 lower energy limit for photon frozen showers
More...
 
double m_g_MinEneShowerLib
 upper energy limit for photon frozen showers
More...
 
bool m_Neut_FlagShowerLib
 switch for neutron frozen showers More...
 
double m_Neut_MinEneShowerLib
 lower energy limit for neutron frozen showers More...
 
double m_Neut_MaxEneShowerLib
 upper energy limit for neutron frozen showers More...
 
bool m_Pion_FlagShowerLib
 switch for pion frozen showers More...
 
double m_Pion_MinEneShowerLib
 lower energy limit for pion frozen showers More...
 
double m_Pion_MaxEneShowerLib
 upper energy limit for pion frozen showers More...
 
bool m_containLow
 switch for containment check at low eta More...
 
bool m_containHigh
 switch for containment check at high eta More...
 
bool m_containCrack
 switch for containment check in crack region More...
 
StringProperty m_generated_starting_points_file
 switch for shower starting point record More...
 
float m_generated_starting_points_ratio
 switch for shower starting point record More...
 
bool m_generate_starting_points
 
HepMC::IO_GenEvent * m_starting_points_file
 
int m_detector_tag
 name for the detector tag for the ShowerLibSvc More...
 
std::string m_detector_tag_str
 
std::map< std::string, int > m_detmap
 

Friends

class SvcFactory< LArG4FastSimSvc >
 

Detailed Description

Class for fast simulation option service.

Author
Wolfgang Ehrenfeld, University of Hamburg, Germany
Zachary Marshal

Definition at line 42 of file LArG4FastSimSvc.h.

Constructor & Destructor Documentation

◆ LArG4FastSimSvc()

LArG4FastSimSvc::LArG4FastSimSvc ( const std::string &  name,
ISvcLocator *  sl 
)

Standard Constructor.

Definition at line 19 of file LArG4FastSimSvc.cxx.

20  : base_class(name,sl),
25 {
26  declareProperty("EFlagToShowerLib", m_e_FlagShowerLib = true, "Switch for e+/- frozen showers");
27  declareProperty("EMinEneShowerLib", m_e_MinEneShowerLib = 0.0*CLHEP::GeV, "Minimum energy for e+/- frozen showers");
28  declareProperty("EMaxEneShowerLib", m_e_MaxEneShowerLib = 1.0*CLHEP::GeV, "Maximum energy for e+/- frozen showers");
29 
30  declareProperty("GFlagToShowerLib", m_g_FlagShowerLib = true, "Switch for photon frozen showers");
31  declareProperty("GMinEneShowerLib", m_g_MinEneShowerLib = 0.*CLHEP::GeV, "Minimum energy for photon frozen showers");
32  declareProperty("GMaxEneShowerLib", m_g_MaxEneShowerLib = 0.010*CLHEP::GeV, "Maximum energy for photon frozen showers");
33 
34  declareProperty("NeutFlagToShowerLib", m_Neut_FlagShowerLib = true, "Switch for neutron frozen showers");
35  declareProperty("NeutMinEneShowerLib", m_Neut_MinEneShowerLib = 0.0*CLHEP::GeV, "Minimum energy for neutron frozen showers");
36  declareProperty("NeutMaxEneShowerLib", m_Neut_MaxEneShowerLib = 0.1*CLHEP::GeV, "Maximum energy for neutron frozen showers");
37 
38  declareProperty("PionFlagToShowerLib", m_Pion_FlagShowerLib = true, "Switch for neutron frozen showers");
39  declareProperty("PionMinEneShowerLib", m_Pion_MinEneShowerLib = 0.0*CLHEP::GeV, "Minimum energy for neutron frozen showers");
40  declareProperty("PionMaxEneShowerLib", m_Pion_MaxEneShowerLib = 2.0*CLHEP::GeV, "Maximum energy for neutron frozen showers");
41 
42  declareProperty("ContainLow", m_containLow = true, "Switch for containment at low eta");
43  declareProperty("ContainHigh", m_containHigh = true, "Switch for containment at high eta");
44  declareProperty("ContainCrack", m_containCrack = true, "Switch for containment in the crack region");
45 
46  declareProperty("GeneratedStartingPointsFile", m_generated_starting_points_file = "", "Name of file for generated SPs. Do not touch until you want to produce a new library");
47  declareProperty("GeneratedStartingPointsRatio", m_generated_starting_points_ratio = 0.02, "Ratio of SPs that goes to output");
48 
49  /* BE SURE THIS ONE IS THE SAME AS IN LArG4ShowerLibSvc!!! */
50  enum DETECTOR {EMB=100000,EMEC=200000,FCAL1=300000,FCAL2=400000,FCAL3=500000,HECLOC=600000,HEC=700000};
51 
52  m_detmap["EMB"]=EMB;
53  m_detmap["EMEC"]=EMEC;
54  m_detmap["FCAL1"]=FCAL1;
55  m_detmap["FCAL2"]=FCAL2;
56  m_detmap["FCAL3"]=FCAL3;
57  m_detmap["HECLOC"]=HECLOC;
58  m_detmap["HEC"]=HEC;
59 
60 }

◆ ~LArG4FastSimSvc()

LArG4FastSimSvc::~LArG4FastSimSvc ( )
virtual

Standard Destructor.

Definition at line 64 of file LArG4FastSimSvc.cxx.

65 {
66 }

Member Function Documentation

◆ ContainCrack()

bool LArG4FastSimSvc::ContainCrack ( ) const
inlinevirtual

Apply check containment in crack region.

Definition at line 154 of file LArG4FastSimSvc.h.

◆ ContainHigh()

bool LArG4FastSimSvc::ContainHigh ( ) const
inlinevirtual

Apply check containment at high eta.

Definition at line 153 of file LArG4FastSimSvc.h.

◆ ContainLow()

bool LArG4FastSimSvc::ContainLow ( ) const
inlinevirtual

Apply check containment at low eta.

Definition at line 152 of file LArG4FastSimSvc.h.

◆ DetectorTag()

int LArG4FastSimSvc::DetectorTag ( ) const
inlinevirtual

Definition at line 158 of file LArG4FastSimSvc.h.

158 { return m_detector_tag; }

◆ finalize()

StatusCode LArG4FastSimSvc::finalize ( )
virtual

Definition at line 104 of file LArG4FastSimSvc.cxx.

105 {
106  msg(MSG::INFO) << "Finalizing fast simulation service. " << endmsg;
107 
109  delete m_starting_points_file;
110  }
111  return StatusCode::SUCCESS;
112 }

◆ flagToShowerLib()

bool LArG4FastSimSvc::flagToShowerLib ( const G4ParticleDefinition &  particleType) const
inlinevirtual

get switch for frozen showers

Definition at line 108 of file LArG4FastSimSvc.h.

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 }

◆ generateFSStartingPoint()

bool LArG4FastSimSvc::generateFSStartingPoint ( const HepMC::GenEvent *  ge)
virtual

Definition at line 150 of file LArG4FastSimSvc.cxx.

151 {
153  return false;
154  m_starting_points_file->write_event(ge);
155  return true;
156 }

◆ generateFSStartingPoints()

bool LArG4FastSimSvc::generateFSStartingPoints ( ) const
inlinevirtual

Definition at line 156 of file LArG4FastSimSvc.h.

156 { return m_generate_starting_points; }

◆ generateFSStartingPointsRatio()

float LArG4FastSimSvc::generateFSStartingPointsRatio ( ) const
inlinevirtual

Definition at line 157 of file LArG4FastSimSvc.h.

◆ initialize()

StatusCode LArG4FastSimSvc::initialize ( )
virtual

Definition at line 69 of file LArG4FastSimSvc.cxx.

70 {
71  msg(MSG::INFO) << "Initializing" << endmsg;
72 
73  if (name().find("EMB") != std::string::npos) {
74  m_detector_tag_str = "EMB";
75  } else if (name().find("EMEC") != std::string::npos) {
76  m_detector_tag_str = "EMEC";
77  } else if (name().find("FCAL2") != std::string::npos) {
78  m_detector_tag_str = "FCAL2";
79  } else if (name().find("FCAL") != std::string::npos) {
80  m_detector_tag_str = "FCAL1";
81  } else if (name().find("HEC") != std::string::npos) {
82  m_detector_tag_str = "HEC";
83  } else if (name().find("DeadMaterial") != std::string::npos) {
84  m_detector_tag_str = "DM";
85  } else {
86  m_detector_tag_str = "UNKNOWN";
87  }
88  m_detector_tag = 0;
89  if (m_detmap.find(m_detector_tag_str) != m_detmap.end()){
91  }
93 
95  m_starting_points_file = new HepMC::IO_GenEvent(m_generated_starting_points_file.value().c_str(),std::ios::out);
96  }
97  // list all properties
98  this->print();
99 
100  return StatusCode::SUCCESS;
101 }

◆ maxEneToShowerLib()

double LArG4FastSimSvc::maxEneToShowerLib ( const G4ParticleDefinition &  particleType) const
inlinevirtual

get lower energy limit for frozen showers

Definition at line 137 of file LArG4FastSimSvc.h.

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 }

◆ minEneToShowerLib()

double LArG4FastSimSvc::minEneToShowerLib ( const G4ParticleDefinition &  particleType) const
inlinevirtual

get upper energy limit for frozen showers

Definition at line 122 of file LArG4FastSimSvc.h.

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 }

◆ print()

void LArG4FastSimSvc::print ( ) const
private

dump object content

Definition at line 115 of file LArG4FastSimSvc.cxx.

116 {
117  msg(MSG::INFO) << "List of Frozen Shower options:" << endmsg;
118  msg(MSG::INFO) << "Detector tag is " << m_detector_tag_str << endmsg;
120  msg(MSG::INFO) << "Starting points will be saved to " << m_generated_starting_points_file.value() << endmsg;
121  }
122 
123  if (this->m_e_FlagShowerLib) {
124  msg(MSG::INFO) << "Electrons energy range [MeV] for Frozen Showers ["
125  << this->m_e_MinEneShowerLib << " -- " << this->m_e_MaxEneShowerLib << "]" << endmsg;
126  } else {
127  msg(MSG::INFO) << "Electrons wont be parameterized" << endmsg;
128  }
129 
130  if (this->m_g_FlagShowerLib) {
131  msg(MSG::INFO) << "Photons energy range [MeV] for Frozen Showers ["
132  << this->m_g_MinEneShowerLib << " -- " << this->m_g_MaxEneShowerLib << "]" << endmsg;
133  } else {
134  msg(MSG::INFO) << "Photons wont be parameterized" << endmsg;
135  }
136 
137  if (this->m_Neut_FlagShowerLib) {
138  msg(MSG::INFO) << "Neutrons energy range [MeV] for Frozen Showers ["
139  << this->m_Neut_MinEneShowerLib << " -- " << this->m_Neut_MaxEneShowerLib << "]" << endmsg;
140  } else {
141  msg(MSG::INFO) << "Neutrons wont be parameterized" << endmsg;
142  }
143 
144  // the containment checks
145  msg(MSG::INFO) << "Containment check at low eta: " << (this->m_containLow ? "YES" : "NO") << endmsg;
146  msg(MSG::INFO) << "Containment check at crack eta: " << (this->m_containCrack ? "YES" : "NO") << endmsg;
147  msg(MSG::INFO) << "Containment check at high eta: " << (this->m_containHigh ? "YES" : "NO") << endmsg;
148 }

Friends And Related Function Documentation

◆ SvcFactory< LArG4FastSimSvc >

friend class SvcFactory< LArG4FastSimSvc >
friend

Definition at line 61 of file LArG4FastSimSvc.h.

Member Data Documentation

◆ m_containCrack

bool LArG4FastSimSvc::m_containCrack
private

switch for containment check in crack region

Definition at line 94 of file LArG4FastSimSvc.h.

◆ m_containHigh

bool LArG4FastSimSvc::m_containHigh
private

switch for containment check at high eta

Definition at line 93 of file LArG4FastSimSvc.h.

◆ m_containLow

bool LArG4FastSimSvc::m_containLow
private

switch for containment check at low eta

Definition at line 92 of file LArG4FastSimSvc.h.

◆ m_detector_tag

int LArG4FastSimSvc::m_detector_tag
private

name for the detector tag for the ShowerLibSvc

Definition at line 100 of file LArG4FastSimSvc.h.

◆ m_detector_tag_str

std::string LArG4FastSimSvc::m_detector_tag_str
private

Definition at line 101 of file LArG4FastSimSvc.h.

◆ m_detmap

std::map<std::string,int> LArG4FastSimSvc::m_detmap
private

Definition at line 102 of file LArG4FastSimSvc.h.

◆ m_e_FlagShowerLib

bool LArG4FastSimSvc::m_e_FlagShowerLib
private

switch for electron frozen showers

Definition at line 76 of file LArG4FastSimSvc.h.

◆ m_e_MaxEneShowerLib

double LArG4FastSimSvc::m_e_MaxEneShowerLib
private

upper energy limit for electron frozen showers

Definition at line 78 of file LArG4FastSimSvc.h.

◆ m_e_MinEneShowerLib

double LArG4FastSimSvc::m_e_MinEneShowerLib
private

lower energy limit for electron frozen showers

Definition at line 77 of file LArG4FastSimSvc.h.

◆ m_g_FlagShowerLib

bool LArG4FastSimSvc::m_g_FlagShowerLib
private

switch for photon frozen showers

Definition at line 80 of file LArG4FastSimSvc.h.

◆ m_g_MaxEneShowerLib

double LArG4FastSimSvc::m_g_MaxEneShowerLib
private

lower energy limit for photon frozen showers

Definition at line 81 of file LArG4FastSimSvc.h.

◆ m_g_MinEneShowerLib

double LArG4FastSimSvc::m_g_MinEneShowerLib
private

upper energy limit for photon frozen showers

Definition at line 82 of file LArG4FastSimSvc.h.

◆ m_generate_starting_points

bool LArG4FastSimSvc::m_generate_starting_points
private

Definition at line 98 of file LArG4FastSimSvc.h.

◆ m_generated_starting_points_file

StringProperty LArG4FastSimSvc::m_generated_starting_points_file
private

switch for shower starting point record

Definition at line 96 of file LArG4FastSimSvc.h.

◆ m_generated_starting_points_ratio

float LArG4FastSimSvc::m_generated_starting_points_ratio
private

switch for shower starting point record

Definition at line 97 of file LArG4FastSimSvc.h.

◆ m_Neut_FlagShowerLib

bool LArG4FastSimSvc::m_Neut_FlagShowerLib
private

switch for neutron frozen showers

Definition at line 84 of file LArG4FastSimSvc.h.

◆ m_Neut_MaxEneShowerLib

double LArG4FastSimSvc::m_Neut_MaxEneShowerLib
private

upper energy limit for neutron frozen showers

Definition at line 86 of file LArG4FastSimSvc.h.

◆ m_Neut_MinEneShowerLib

double LArG4FastSimSvc::m_Neut_MinEneShowerLib
private

lower energy limit for neutron frozen showers

Definition at line 85 of file LArG4FastSimSvc.h.

◆ m_Pion_FlagShowerLib

bool LArG4FastSimSvc::m_Pion_FlagShowerLib
private

switch for pion frozen showers

Definition at line 88 of file LArG4FastSimSvc.h.

◆ m_Pion_MaxEneShowerLib

double LArG4FastSimSvc::m_Pion_MaxEneShowerLib
private

upper energy limit for pion frozen showers

Definition at line 90 of file LArG4FastSimSvc.h.

◆ m_Pion_MinEneShowerLib

double LArG4FastSimSvc::m_Pion_MinEneShowerLib
private

lower energy limit for pion frozen showers

Definition at line 89 of file LArG4FastSimSvc.h.

◆ m_starting_points_file

HepMC::IO_GenEvent* LArG4FastSimSvc::m_starting_points_file
private

Definition at line 99 of file LArG4FastSimSvc.h.


The documentation for this class was generated from the following files:
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
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
LArSamples::HEC
@ HEC
Definition: CaloId.h:26
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
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
LArG4FastSimSvc::m_detector_tag
int m_detector_tag
name for the detector tag for the ShowerLibSvc
Definition: LArG4FastSimSvc.h:100
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::m_detmap
std::map< std::string, int > m_detmap
Definition: LArG4FastSimSvc.h:102
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
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
particleType
Definition: particleType.h:29
LArG4FastSimSvc::m_containCrack
bool m_containCrack
switch for containment check in crack region
Definition: LArG4FastSimSvc.h:94
LArSamples::EMEC
@ EMEC
Definition: CaloId.h:25
LArG4FastSimSvc::m_Pion_MinEneShowerLib
double m_Pion_MinEneShowerLib
lower energy limit for pion frozen showers
Definition: LArG4FastSimSvc.h:89
LArSamples::EMB
@ EMB
Definition: CaloId.h:25
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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::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
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
LArG4FastSimSvc::m_Neut_MaxEneShowerLib
double m_Neut_MaxEneShowerLib
upper energy limit for neutron frozen showers
Definition: LArG4FastSimSvc.h:86
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
LArG4FastSimSvc::m_e_MaxEneShowerLib
double m_e_MaxEneShowerLib
upper energy limit for electron frozen showers
Definition: LArG4FastSimSvc.h:78