ATLAS Offline Software
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>
11 #include "LArG4Code/EnergySpot.h"
12 
13 #include "LArG4ShowerLib/Shower.h"
15 
16 // forward declarations
17 class G4Track;
18 class TFile;
19 class TTree;
20 
22 
23 // Namespace for the ShowerLib related classes
24 namespace ShowerLib {
25 
26 
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 
58  virtual ShowerLibStatistics* createStatistics() const = 0;
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
ShowerLib::IShowerLib::~IShowerLib
virtual ~IShowerLib()
empty destructor
Definition: IShowerLib.h:45
ShowerLib::IShowerLib::m_detector
std::string m_detector
name of the detector
Definition: IShowerLib.h:106
ShowerLib::IShowerLib::getContainmentZ
virtual double getContainmentZ(const G4Track *track) const =0
get average length of showers for the given energy
ShowerLib::IShowerLib::release
virtual const std::string release() const
get Release tag
Definition: IShowerLib.h:127
ShowerLib::Shower
Class for shower library shower.
Definition: Shower.h:36
ShowerLib::ShowerLibStatistics
Definition: ShowerLibStatistics.h:20
ShowerLib::IShowerLib::getContainmentR
virtual double getContainmentR(const G4Track *track) const =0
get average lateral spread of the showers for the given energy
ShowerLib::IShowerLib::detector
virtual const std::string detector() const
get detector tag
Definition: IShowerLib.h:121
ShowerLib::IShowerLib::statistics
const std::string statistics() const
print library statistics
Definition: IShowerLib.cxx:71
ShowerLib::IShowerLib::m_release
std::string m_release
atlas software release
Definition: IShowerLib.h:108
ShowerLib::IShowerLib::printParameters
virtual const std::string printParameters() const =0
ShowerLib::IShowerLib::m_comment
std::string m_comment
comment
Definition: IShowerLib.h:112
GenParticle_fwd.h
ShowerLib::IShowerLib::getName
virtual const std::string getName() const
Definition: IShowerLib.h:93
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
ShowerLib::IShowerLib::m_filled
bool m_filled
is the library read from ROOT or from structure file
Definition: IShowerLib.h:114
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ShowerLib::IShowerLib::createStatistics
virtual ShowerLibStatistics * createStatistics() const =0
ShowerLib::IShowerLib::particle_id
virtual int particle_id() const
get particle tag
Definition: IShowerLib.h:124
ShowerLib::IShowerLib::writeMeta
bool writeMeta(TTree *dest) const
write metadata to the given TTree
Definition: IShowerLib.cxx:40
ShowerLib::IShowerLib::storeShower
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)=0
store shower in the library
ShowerLib::IShowerLib::writeToROOT
virtual bool writeToROOT(TFile *dest)=0
write library to ROOT file
ShowerLib::IShowerLib::m_particle
int m_particle
ID of the generated particles.
Definition: IShowerLib.h:107
ShowerLib::IShowerLib::m_geometry
std::string m_geometry
atlas geometry version
Definition: IShowerLib.h:109
LArG4GenerateShowerLib.geometry
geometry
Definition: LArG4GenerateShowerLib.py:19
ShowerLib::IShowerLib
Class for shower library shower lib interface.
Definition: IShowerLib.h:40
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
ShowerLib::IShowerLib::getShower
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const =0
get shower for given G4 track
ShowerLib::IShowerLib::readMeta
bool readMeta(TTree *source)
read metadata from the given TTree
Definition: IShowerLib.cxx:16
CaloCondBlobAlgs_fillNoiseFromASCII.comment
string comment
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:27
ShowerLib::IShowerLib::IShowerLib
IShowerLib()
default constructor
Definition: IShowerLib.h:98
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
Shower.h
ShowerLib::IShowerLib::m_geantVersion
std::string m_geantVersion
geant 4 version
Definition: IShowerLib.h:110
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
ShowerLib::IShowerLib::geometry
virtual const std::string geometry() const
get Geometry tag
Definition: IShowerLib.h:130
EnergySpot.h
get_generator_info.version
version
Definition: get_generator_info.py:33
ShowerLib::IShowerLib::addComment
virtual void addComment(const std::string &comment)
add given string to comment
Definition: IShowerLib.h:141
ShowerLib::IShowerLib::geantVersion
virtual const std::string geantVersion() const
get geant version tag
Definition: IShowerLib.h:133
ShowerLib::IShowerLib::comment
virtual const std::string comment() const
get comment
Definition: IShowerLib.h:139
ShowerLib::IShowerLib::m_physicsList
std::string m_physicsList
used geant 4 physics list
Definition: IShowerLib.h:111
ShowerLib
Namespace for the ShowerLib related classes.
Definition: LArG4GenShowerLib.h:19
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
ShowerLib::IShowerLib::physicsList
virtual const std::string physicsList() const
get geant 4 physics list name
Definition: IShowerLib.h:136
ShowerLibStatistics.h