ATLAS Offline Software
TestShowerLib.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef SHOWER_LIB_TEST_SHOWER_LIB_H
7 #define SHOWER_LIB_TEST_SHOWER_LIB_H
8 
9 // STL includes
10 #include <list>
11 
12 // local includes
14 
15 // G4 forward declarations
16 class G4Track;
17 // forward declarations in namespace
19 // Namespace for the ShowerLib related classes
20 namespace ShowerLib {
21 
35  class TestShowerLib : public IShowerLib {
36 
37  public:
38 
40  static IShowerLib* readFromROOTFile(TFile* source);
41 
43  static IShowerLib* createEmptyLib(const std::string& inputFile);
44 
46  virtual ~TestShowerLib();
47 
49  virtual std::vector<EnergySpot>* getShower(const G4Track* track, ShowerLibStatistics* stats, int randomShift) const;
51  virtual double getContainmentZ(const G4Track* track) const;
53  virtual double getContainmentR(const G4Track* track) const;
55  virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
57  virtual bool writeToROOT(TFile* dest);
58 
59  virtual ShowerLibStatistics* createStatistics() const;
60 
61  inline virtual const std::string getName() const { return "Test Energy ShowerLib"; }
62 
63  protected:
64 
65  virtual const std::string printParameters() const {return "";}
66 
67  private:
68 
70 
71  struct genInfo {
72  std::unique_ptr<HepMC::FourVector> vertex;
73  std::unique_ptr<HepMC::FourVector> momentum;
74  };
75 
76  typedef std::pair<genInfo,Shower> storedShower;
77  typedef std::list<storedShower> library;
78 
80  bool read(TTree* source);
82  bool write(TTree* dest) const;
83 
85  };
86 
87 } // namespace ShowerLib
88 
89 #endif // SHOWER_LIB_ETA_SHOWER_LIB_H
ShowerLib::TestShowerLib::getName
virtual const std::string getName() const
Definition: TestShowerLib.h:61
ShowerLib::Shower
Class for shower library shower.
Definition: Shower.h:36
ShowerLib::TestShowerLib::readFromROOTFile
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
Definition: TestShowerLib.cxx:41
ShowerLib::ShowerLibStatistics
Definition: ShowerLibStatistics.h:20
ShowerLib::TestShowerLib::~TestShowerLib
virtual ~TestShowerLib()
default destructor
Definition: TestShowerLib.cxx:37
ShowerLib::TestShowerLib::read
bool read(TTree *source)
read library from given TTree
Definition: TestShowerLib.cxx:187
ShowerLib::TestShowerLib::m_libData
library m_libData
Definition: TestShowerLib.h:84
ShowerLib::TestShowerLib::getShower
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const
get shower for given G4 track
Definition: TestShowerLib.cxx:118
ShowerLib::TestShowerLib::library
std::list< storedShower > library
Definition: TestShowerLib.h:77
ShowerLib::TestShowerLib::TestShowerLib
TestShowerLib()
Definition: TestShowerLib.h:69
ShowerLib::TestShowerLib::createEmptyLib
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
Definition: TestShowerLib.cxx:67
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ShowerLib::TestShowerLib::write
bool write(TTree *dest) const
write library to given TTree
Definition: TestShowerLib.cxx:233
ShowerLib::TestShowerLib::getContainmentR
virtual double getContainmentR(const G4Track *track) const
get average lateral spread of the showers for the given energy
Definition: TestShowerLib.cxx:140
ShowerLib::TestShowerLib::getContainmentZ
virtual double getContainmentZ(const G4Track *track) const
get average length of showers for the given energy
Definition: TestShowerLib.cxx:129
SimpleVector.h
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
ShowerLib::IShowerLib
Class for shower library shower lib interface.
Definition: IShowerLib.h:40
ShowerLib::TestShowerLib::createStatistics
virtual ShowerLibStatistics * createStatistics() const
Definition: TestShowerLib.cxx:281
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
ShowerLib::TestShowerLib::genInfo::vertex
std::unique_ptr< HepMC::FourVector > vertex
Definition: TestShowerLib.h:72
ShowerLib::TestShowerLib::writeToROOT
virtual bool writeToROOT(TFile *dest)
write library to ROOT file
Definition: TestShowerLib.cxx:167
ShowerLib::TestShowerLib::genInfo
Definition: TestShowerLib.h:71
ShowerLib::TestShowerLib::storeShower
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)
store shower in the library
Definition: TestShowerLib.cxx:151
ShowerLib::TestShowerLib::printParameters
virtual const std::string printParameters() const
Definition: TestShowerLib.h:65
IShowerLib.h
ShowerLib
Namespace for the ShowerLib related classes.
Definition: LArG4GenShowerLib.h:19
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
ShowerLib::TestShowerLib::storedShower
std::pair< genInfo, Shower > storedShower
Definition: TestShowerLib.h:76
ShowerLib::TestShowerLib
Class for shower library shower lib.
Definition: TestShowerLib.h:35
ShowerLib::TestShowerLib::genInfo::momentum
std::unique_ptr< HepMC::FourVector > momentum
Definition: TestShowerLib.h:73