ATLAS Offline Software
Loading...
Searching...
No Matches
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
16class G4Track;
17// forward declarations in namespace
19// Namespace for the ShowerLib related classes
20namespace ShowerLib {
21
34
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
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
IShowerLib()
default constructor
Definition IShowerLib.h:98
Class for shower library shower.
Definition Shower.h:36
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const
get shower for given G4 track
virtual const std::string getName() const
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)
store shower in the library
std::pair< genInfo, Shower > storedShower
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
virtual bool writeToROOT(TFile *dest)
write library to ROOT file
virtual double getContainmentR(const G4Track *track) const
get average lateral spread of the showers for the given energy
virtual double getContainmentZ(const G4Track *track) const
get average length of showers for the given energy
bool write(TTree *dest) const
write library to given TTree
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
virtual ~TestShowerLib()
default destructor
bool read(TTree *source)
read library from given TTree
std::list< storedShower > library
virtual const std::string printParameters() const
virtual ShowerLibStatistics * createStatistics() const
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
Namespace for the ShowerLib related classes.
Definition StepInfo.h:17
std::unique_ptr< HepMC::FourVector > momentum
std::unique_ptr< HepMC::FourVector > vertex