ATLAS Offline Software
LArG4GenShowerLib.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef LARG4GENSHOWERLIB_LARG4GENSHLIB_H
6 #define LARG4GENSHOWERLIB_LARG4GENSHLIB_H
7 
8 // STL includes
9 #include <string>
10 #include <list>
11 #include <map>
12 
14 
15 // CLHEP include(s)
16 #include "CLHEP/Vector/ThreeVector.h"
17 
18 // forward includes in namespaces
19 namespace ShowerLib {
20  class IShowerLib;
21  class StepInfoCollection;
22  class StepInfo;
23  typedef std::list<StepInfo*> StepInfoList;
24 }
26 
27 
41 
42  public:
44 
45  virtual StatusCode initialize() override;
46  virtual StatusCode finalize() override;
47  virtual StatusCode execute() override;
48 
49  private:
50 
51  void clusterize(ShowerLib::StepInfoList* stepinfo);
52 
54 
56 
58 
59  void truncate(ShowerLib::StepInfoList* stepinfo);
60 
64  void calculateMoments(const ShowerLib::StepInfoCollection& eventSteps,
65  double& weights, double& xavfra, double& yavfra, double& ravfra);
67  void addingTagsToLibrary();
68 
69  /* data members */
70  DoubleProperty m_maxDistance {this, "MaxDistance", 50000.
71  , "max distance squared after which the hits will be truncated"};
72  DoubleProperty m_maxRadius {this, "MaxRadius", 25.
73  , "maximal radius squared until two hits will be combined"};
74  DoubleProperty m_minEnergy {this, "MinEnergy", .99
75  , "energy border, that truncation won't cross"};
76  DoubleProperty m_containmentEnergy {this, "ContainmentEnergy", 0.95
77  , "energy fraction that will be inside containment borders"};
78  DoubleProperty m_energyFraction {this, "EnergyFraction", .02
79  , "the allowed amount of energy that can be deposited outside calorimeter region"};
80  StringProperty m_physicslist_name {this, "PhysicsList", "FTFP_BERT"
81  , "Geant4 PhysicsList used in the simulation"};
82  StringArrayProperty m_lib_struct_files {this, "LibStructFiles", {}
83  , "List of files to read library structures from"};
84 
85  typedef std::map<std::string, ShowerLib::IShowerLib*> libMap;
88 
90  int m_stat_valid{0};
92  int m_stat_nolib{0};
93 
94  std::map<ShowerLib::IShowerLib*, int> m_stat_lib_saved;
95  std::map<ShowerLib::IShowerLib*, int> m_stat_lib_notsaved;
96 }; // class LArG4GenShowerLib
97 
98 #endif // LARG4GENSHOWERLIB_LARG4GENSHLIB_H
LArG4GenShowerLib::truncate
void truncate(ShowerLib::StepInfoList *stepinfo)
Definition: LArG4GenShowerLib.cxx:374
LArG4GenShowerLib::m_energyFraction
DoubleProperty m_energyFraction
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: LArG4GenShowerLib.h:78
LArG4GenShowerLib::m_stat_lib_notsaved
std::map< ShowerLib::IShowerLib *, int > m_stat_lib_notsaved
Definition: LArG4GenShowerLib.h:95
ShowerLib::StepInfoList
std::list< StepInfo * > StepInfoList
Definition: LArG4GenShowerLib.h:22
LArG4GenShowerLib::getStepInfo
const ShowerLib::StepInfoCollection * getStepInfo()
Definition: LArG4GenShowerLib.cxx:272
LArG4GenShowerLib::m_libraries
libMap m_libraries
pointer to shower library
Definition: LArG4GenShowerLib.h:86
LArG4GenShowerLib::m_maxRadius
DoubleProperty m_maxRadius
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: LArG4GenShowerLib.h:72
GenParticle_fwd.h
ShowerLib::StepInfoCollection
Class for collection of StepInfo class (G4 hits)
Definition: StepInfoCollection.h:32
LArG4GenShowerLib::copyStepInfo
ShowerLib::StepInfoList * copyStepInfo(const ShowerLib::StepInfoCollection *stepinfo)
Definition: LArG4GenShowerLib.cxx:281
LArG4GenShowerLib::copyStepInfoZeroCleanup
ShowerLib::StepInfoList * copyStepInfoZeroCleanup(const ShowerLib::StepInfoCollection *stepinfo)
Definition: LArG4GenShowerLib.cxx:294
LArG4GenShowerLib::m_maxDistance
DoubleProperty m_maxDistance
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: LArG4GenShowerLib.h:70
LArG4GenShowerLib::initialize
virtual StatusCode initialize() override
Definition: LArG4GenShowerLib.cxx:84
LArG4GenShowerLib::m_lib_struct_files
StringArrayProperty m_lib_struct_files
Definition: LArG4GenShowerLib.h:82
LArG4GenShowerLib::m_stat_invalid
int m_stat_invalid
Definition: LArG4GenShowerLib.h:91
LArG4GenShowerLib::m_stat_numshowers
int m_stat_numshowers
Definition: LArG4GenShowerLib.h:89
AthAlgorithm.h
LArG4GenShowerLib::m_physicslist_name
StringProperty m_physicslist_name
Definition: LArG4GenShowerLib.h:80
LArG4GenShowerLib::m_stat_valid
int m_stat_valid
Definition: LArG4GenShowerLib.h:90
LArG4GenShowerLib::addingTagsToLibrary
void addingTagsToLibrary()
adding tag information (release, detector description, ...) to library comment
Definition: LArG4GenShowerLib.cxx:408
LArG4GenShowerLib::m_stat_nolib
int m_stat_nolib
Definition: LArG4GenShowerLib.h:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArG4GenShowerLib::clusterize
void clusterize(ShowerLib::StepInfoList *stepinfo)
Definition: LArG4GenShowerLib.cxx:323
LArG4GenShowerLib::m_minEnergy
DoubleProperty m_minEnergy
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: LArG4GenShowerLib.h:74
AthAlgorithm
Definition: AthAlgorithm.h:47
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
LArG4GenShowerLib::m_libraries_by_filename
libMap m_libraries_by_filename
Definition: LArG4GenShowerLib.h:87
weights
Definition: herwig7_interface.h:38
LArG4GenShowerLib::calculateMoments
void calculateMoments(const ShowerLib::StepInfoCollection &eventSteps, double &weights, double &xavfra, double &yavfra, double &ravfra)
calculate moments from StepInfoCollection
Definition: LArG4GenShowerLib.cxx:486
LArG4GenShowerLib::getParticleFromMC
HepMC::ConstGenParticlePtr getParticleFromMC()
return first MC truth particle for event
Definition: LArG4GenShowerLib.cxx:256
LArG4GenShowerLib::m_containmentEnergy
DoubleProperty m_containmentEnergy
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: LArG4GenShowerLib.h:76
LArG4GenShowerLib::execute
virtual StatusCode execute() override
Definition: LArG4GenShowerLib.cxx:125
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
ShowerLib
Namespace for the ShowerLib related classes.
Definition: StepInfo.h:17
LArG4GenShowerLib::libMap
std::map< std::string, ShowerLib::IShowerLib * > libMap
Definition: LArG4GenShowerLib.h:85
LArG4GenShowerLib
Class for shower library generation algorithm.
Definition: LArG4GenShowerLib.h:40
LArG4GenShowerLib::finalize
virtual StatusCode finalize() override
Definition: LArG4GenShowerLib.cxx:447
LArG4GenShowerLib::m_stat_lib_saved
std::map< ShowerLib::IShowerLib *, int > m_stat_lib_saved
Definition: LArG4GenShowerLib.h:94