ATLAS Offline Software
Loading...
Searching...
No Matches
EtaEnergyShowerLib.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
6#ifndef SHOWER_LIB_ETA_ENERGY_SHOWER_LIB_H
7#define SHOWER_LIB_ETA_ENERGY_SHOWER_LIB_H
8
9// STL includes
10#include <map>
11#include <vector>
12
13// local includes
15
16// G4 forward declarations
17class G4Track;
18
19// Namespace for the ShowerLib related classes
20namespace ShowerLib {
21
34
36
37 public:
38
40 static IShowerLib* readFromROOTFile(TFile* source);
41
43 static IShowerLib* createEmptyLib(const std::string& inputFile);
44
47 {
48 for ( auto& eta : m_libData) { // eta bins
49 for (auto& ene : eta.second ) { // energy map
50 for ( auto& spot : ene.second ) {
51 delete spot;
52 }
53 ene.second.clear();
54 }
55 eta.second.clear();
56 }
57 m_libData.clear();
58 }
59
61 virtual std::vector<EnergySpot>* getShower(const G4Track* track, ShowerLibStatistics* stats, int randomShift) const;
63 virtual double getContainmentZ(const G4Track* track) const;
65 virtual double getContainmentR(const G4Track* track) const;
67 virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
69 virtual bool writeToROOT(TFile* dest);
70
72
73 inline virtual const std::string getName() const { return "Eta Energy ShowerLib"; }
74
75 protected:
76
77 virtual const std::string printParameters() const {return "";}
78
79 private:
80
82
84 bool read(TTree* source);
86 bool write(TTree* dest) const;
88 bool readStructure(std::vector<float>& structure);
89
90 bool checkEtaAndStuff(const G4Track* track) const;
91
93
94 typedef std::map<float,Shower> etabin;
95 typedef std::map<float,etabin> library;
96
99
100 };
101
102} // namespace ShowerLib
103
104#endif // SHOWER_LIB_ETA_SHOWER_LIB_H
Scalar eta() const
pseudorapidity method
std::map< float, Shower > etabin
virtual const std::string printParameters() const
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
bool write(TTree *dest) const
write library to given TTree
bool read(TTree *source)
read library from given TTree
std::map< float, etabin > library
virtual const std::string getName() const
virtual double getContainmentZ(const G4Track *track) const
get average length of showers for the given energy
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)
store shower in the library
virtual ShowerLibStatistics * createStatistics() const
virtual bool writeToROOT(TFile *dest)
write library to ROOT file
bool readStructure(std::vector< float > &structure)
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const
get shower for given G4 track
bool checkEtaAndStuff(const G4Track *track) const
virtual double getContainmentR(const G4Track *track) const
get average lateral spread of the showers for the given energy
virtual ~EtaEnergyShowerLib()
default destructor
IShowerLib()
default constructor
Definition IShowerLib.h:98
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