ATLAS Offline Software
Loading...
Searching...
No Matches
FCALDistEtaEnergyShowerLib.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_FCALDIST_ETA_ENERGY_SHOWER_LIB_H
6#define SHOWER_LIB_FCALDIST_ETA_ENERGY_SHOWER_LIB_H
7// STL includes
8#include <map>
9#include <vector>
10
11// local includes
13
14// G4 forward declarations
15class G4Track;
16
17// Namespace for the ShowerLib related classes
18namespace ShowerLib {
19
20 // forward declarations in namespace
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) { // dist bins
49 for ( auto& dist : eta.second ) { // eta bins
50 for (auto& ene : dist.second ) { // energy map
51 for ( auto& spot : ene.second ) {
52 delete spot;
53 }
54 ene.second.clear();
55 }
56 dist.second.clear();
57 }
58 eta.second.clear();
59 }
60 m_libData.clear();
61 }
62
64 virtual std::vector<EnergySpot>* getShower(const G4Track* track, ShowerLibStatistics* stats, int randomShift) const;
66 virtual double getContainmentZ(const G4Track* track) const;
68 virtual double getContainmentR(const G4Track* track) const;
70 virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
72 virtual bool writeToROOT(TFile* dest);
73
75
76 inline virtual const std::string getName() const { return "FCALDist Eta Energy ShowerLib"; }
77
78 protected:
79
80 virtual const std::string printParameters() const;
81
82 private:
83
85 ,m_yrodcent(0.0)
86 ,m_step(0.0)
87#ifndef __FSLIB_NO_BACKWARD_COMPAT__
88 ,m_compat(false)
89#endif
90 {}
91
93 bool read(TTree* source);
95 bool write(TTree* dest) const;
97 bool readStructure(std::map<float, std::vector<float> >& structure);
98
99 float distance(double x, double y) const;
100
101 typedef std::map<float,Shower> distbin;
102 typedef std::map<float,distbin> etabin;
103 typedef std::map<float,etabin> library;
104
106
107 //distance calculator parameters
110 double m_step;
111
112#ifndef __FSLIB_NO_BACKWARD_COMPAT__
114#endif
115
116 };
117
118} // namespace ShowerLib
119
120#endif // SHOWER_LIB_FCALDIST_SHOWER_LIB_H
Scalar eta() const
pseudorapidity method
#define y
#define x
virtual double getContainmentR(const G4Track *track) const
get average lateral spread of the showers for the given energy
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
bool readStructure(std::map< float, std::vector< float > > &structure)
virtual ~FCALDistEtaEnergyShowerLib()
default destructor
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)
store shower in the library
bool read(TTree *source)
read library from given TTree
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 std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const
get shower for given G4 track
virtual bool writeToROOT(TFile *dest)
write library to ROOT file
virtual const std::string getName() const
virtual ShowerLibStatistics * createStatistics() const
virtual const std::string printParameters() const
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