ATLAS Offline Software
Loading...
Searching...
No Matches
IShowerLib.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef SHOWER_LIB_ISHOWER_LIB_H
6#define SHOWER_LIB_ISHOWER_LIB_H
7
8// STL includes
9#include <string>
10#include <vector>
12
15
16// forward declarations
17class G4Track;
18class TFile;
19class TTree;
20
22
23// Namespace for the ShowerLib related classes
24namespace ShowerLib {
25
26
39
40 class IShowerLib {
41
42 public:
43
45 virtual ~IShowerLib() {}
46
48 virtual std::vector<EnergySpot>* getShower(const G4Track* track, ShowerLibStatistics* stats, int randomShift) const = 0;
50 virtual double getContainmentZ(const G4Track* track) const = 0;
52 virtual double getContainmentR(const G4Track* track) const = 0;
54 virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower) = 0;
56 virtual bool writeToROOT(TFile* dest) = 0;
57
60 const std::string statistics() const;
61
63 inline virtual const std::string detector() const;
64// //! set detector tag
65// inline virtual void detector(const std::string& det);
67 inline virtual int particle_id() const;
68// //! set particle tag
69// inline virtual void particle_id(const int particle_id);
71 inline virtual const std::string release() const;
73 inline virtual void release(const std::string& release);
75 inline virtual const std::string geometry() const;
77 inline virtual void geometry(const std::string& geometry);
79 inline virtual const std::string geantVersion() const;
81 inline virtual void geantVersion(const std::string& version);
83 inline virtual const std::string physicsList() const;
85 inline virtual void physicsList(const std::string& list);
87 inline virtual const std::string comment() const;
89 inline virtual void comment(const std::string& comment);
91 inline virtual void addComment(const std::string& comment);
92
93 inline virtual const std::string getName() const { return "IShowerLib"; }
94
95 protected:
96
98 IShowerLib() : m_detector("NotSet"), m_particle(0), m_release("NotSet"), m_geometry("NotSet"), m_geantVersion("NotSet"), m_physicsList("NotSet"), m_filled(false) {}
100 bool readMeta(TTree* source);
102 bool writeMeta(TTree* dest) const;
103
104 virtual const std::string printParameters() const = 0;
105
106 std::string m_detector;
108 std::string m_release;
109 std::string m_geometry;
110 std::string m_geantVersion;
111 std::string m_physicsList;
112 std::string m_comment;
113
114 bool m_filled;
115
116 };
117
118
119 // inline functions
120
121 const std::string IShowerLib::detector() const { return m_detector; }
122 //void IShowerLib::detector(const std::string& det) { m_detector = det; }
123
124 int IShowerLib::particle_id() const { return m_particle; }
125 //void IShowerLib::particle_id(const int particle) { m_particle = particle; }
126
127 const std::string IShowerLib::release() const { return m_release; }
128 void IShowerLib::release(const std::string& release) { m_release = release; }
129
130 const std::string IShowerLib::geometry() const { return m_geometry; }
131 void IShowerLib::geometry(const std::string& geometry) { m_geometry = geometry; }
132
133 const std::string IShowerLib::geantVersion() const { return m_geantVersion; }
134 void IShowerLib::geantVersion(const std::string& version) { m_geantVersion = version; }
135
136 const std::string IShowerLib::physicsList() const { return m_physicsList; }
137 void IShowerLib::physicsList(const std::string& list) { m_physicsList = list; }
138
139 const std::string IShowerLib::comment() const { return m_comment; }
140 void IShowerLib::comment(const std::string& comment) { m_comment = comment; }
141 void IShowerLib::addComment(const std::string& comment) { m_comment += comment; }
142
143} // namespace ShowerLib
144
145#endif // SHOWER_LIB_ISHOWER_LIB_H
bool readMeta(TTree *source)
read metadata from the given TTree
std::string m_geantVersion
geant 4 version
Definition IShowerLib.h:110
virtual const std::string geometry() const
get Geometry tag
Definition IShowerLib.h:130
IShowerLib()
default constructor
Definition IShowerLib.h:98
virtual const std::string release() const
get Release tag
Definition IShowerLib.h:127
virtual void addComment(const std::string &comment)
add given string to comment
Definition IShowerLib.h:141
const std::string statistics() const
print library statistics
virtual int particle_id() const
get particle tag
Definition IShowerLib.h:124
virtual const std::string geantVersion() const
get geant version tag
Definition IShowerLib.h:133
virtual const std::string physicsList() const
get geant 4 physics list name
Definition IShowerLib.h:136
std::string m_release
atlas software release
Definition IShowerLib.h:108
int m_particle
ID of the generated particles.
Definition IShowerLib.h:107
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const =0
get shower for given G4 track
virtual bool writeToROOT(TFile *dest)=0
write library to ROOT file
virtual const std::string printParameters() const =0
virtual double getContainmentR(const G4Track *track) const =0
get average lateral spread of the showers for the given energy
virtual const std::string comment() const
get comment
Definition IShowerLib.h:139
bool writeMeta(TTree *dest) const
write metadata to the given TTree
std::string m_detector
name of the detector
Definition IShowerLib.h:106
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)=0
store shower in the library
virtual double getContainmentZ(const G4Track *track) const =0
get average length of showers for the given energy
virtual ShowerLibStatistics * createStatistics() const =0
std::string m_comment
comment
Definition IShowerLib.h:112
virtual const std::string detector() const
get detector tag
Definition IShowerLib.h:121
bool m_filled
is the library read from ROOT or from structure file
Definition IShowerLib.h:114
std::string m_physicsList
used geant 4 physics list
Definition IShowerLib.h:111
virtual ~IShowerLib()
empty destructor
Definition IShowerLib.h:45
virtual const std::string getName() const
Definition IShowerLib.h:93
std::string m_geometry
atlas geometry version
Definition IShowerLib.h:109
Class for shower library shower.
Definition Shower.h:36
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
Namespace for the ShowerLib related classes.
Definition StepInfo.h:17