ATLAS Offline Software
Loading...
Searching...
No Matches
FCALDistEnergyShowerLib.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_ENERGY_SHOWER_LIB_H
6#define SHOWER_LIB_FCALDIST_ENERGY_SHOWER_LIB_H
7
8// STL includes
9#include <map>
10#include <vector>
11
12// local includes
14
15// G4 forward declarations
16class G4Track;
17
18// Namespace for the ShowerLib related classes
19namespace ShowerLib {
20
21 // forward declarations in namespace
22
35
37
38 public:
39
41 static IShowerLib* readFromROOTFile(TFile* source);
42
44 static IShowerLib* createEmptyLib(const std::string& inputFile);
45
48 {
49 for ( auto& dist : m_libData) { // dist 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 m_libData.clear();
59 }
60
62 virtual std::vector<EnergySpot>* getShower(const G4Track* track, ShowerLibStatistics* stats, int randomShift) const;
64 virtual double getContainmentZ(const G4Track* track) const;
66 virtual double getContainmentR(const G4Track* track) const;
68 virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle,const Shower* shower);
70 virtual bool writeToROOT(TFile* dest);
71
73
74 inline virtual const std::string getName() const { return "FCALDist Energy ShowerLib"; }
75
76 protected:
77
78 virtual const std::string printParameters() const;
79
80 private:
81
83
85 bool read(TTree* source);
87 bool write(TTree* dest) const;
89 bool readStructure(std::vector<float>& structure);
90
91 float distance(double x, double y) const;
92
93 typedef std::map<float,Shower> distbin;
94 typedef std::map<float,distbin> library;
95
97
98 //distance calculator parameters
99 double m_xrodcent;
101 double m_step;
102
103 };
104
105} // namespace ShowerLib
106
107#endif // SHOWER_LIB_FCALDIST_SHOWER_LIB_H
#define y
#define x
virtual ~FCALDistEnergyShowerLib()
default destructor
virtual ShowerLibStatistics * createStatistics() const
bool write(TTree *dest) const
write library to given TTree
virtual const std::string printParameters() const
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)
store shower in the library
bool read(TTree *source)
read library from given TTree
virtual bool writeToROOT(TFile *dest)
write library to ROOT file
virtual const std::string getName() const
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
float distance(double x, double y) const
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const
get shower for given G4 track
bool readStructure(std::vector< float > &structure)
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
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