ATLAS Offline Software
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
15 class G4Track;
16 
17 // Namespace for the ShowerLib related classes
18 namespace ShowerLib {
19 
20  // forward declarations in namespace
21 
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 
74  virtual ShowerLibStatistics* createStatistics() const;
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
108  double m_xrodcent;
109  double m_yrodcent;
110  double m_step;
111 
112 #ifndef __FSLIB_NO_BACKWARD_COMPAT__
113  bool m_compat;
114 #endif
115 
116  };
117 
118 } // namespace ShowerLib
119 
120 #endif // SHOWER_LIB_FCALDIST_SHOWER_LIB_H
ShowerLib::Shower
Class for shower library shower.
Definition: Shower.h:36
ShowerLib::ShowerLibStatistics
Definition: ShowerLibStatistics.h:20
ShowerLib::FCALDistEtaEnergyShowerLib::~FCALDistEtaEnergyShowerLib
virtual ~FCALDistEtaEnergyShowerLib()
default destructor
Definition: FCALDistEtaEnergyShowerLib.h:46
ShowerLib::FCALDistEtaEnergyShowerLib::readStructure
bool readStructure(std::map< float, std::vector< float > > &structure)
Definition: FCALDistEtaEnergyShowerLib.cxx:779
ShowerLib::FCALDistEtaEnergyShowerLib::printParameters
virtual const std::string printParameters() const
Definition: FCALDistEtaEnergyShowerLib.cxx:771
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ShowerLib::FCALDistEtaEnergyShowerLib::distance
float distance(double x, double y) const
Definition: FCALDistEtaEnergyShowerLib.cxx:39
x
#define x
ShowerLib::FCALDistEtaEnergyShowerLib::getContainmentZ
virtual double getContainmentZ(const G4Track *track) const
get average length of showers for the given energy
Definition: FCALDistEtaEnergyShowerLib.cxx:359
ShowerLib::FCALDistEtaEnergyShowerLib::distbin
std::map< float, Shower > distbin
Definition: FCALDistEtaEnergyShowerLib.h:101
ShowerLib::FCALDistEtaEnergyShowerLib::m_xrodcent
double m_xrodcent
Definition: FCALDistEtaEnergyShowerLib.h:108
ShowerLib::FCALDistEtaEnergyShowerLib::write
bool write(TTree *dest) const
write library to given TTree
Definition: FCALDistEtaEnergyShowerLib.cxx:697
ShowerLib::FCALDistEtaEnergyShowerLib::library
std::map< float, etabin > library
Definition: FCALDistEtaEnergyShowerLib.h:103
ShowerLib::FCALDistEtaEnergyShowerLib::getName
virtual const std::string getName() const
Definition: FCALDistEtaEnergyShowerLib.h:76
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
ShowerLib::FCALDistEtaEnergyShowerLib::read
bool read(TTree *source)
read library from given TTree
Definition: FCALDistEtaEnergyShowerLib.cxx:615
ShowerLib::FCALDistEtaEnergyShowerLib::createEmptyLib
static IShowerLib * createEmptyLib(const std::string &inputFile)
factory method. create empty library with the given structure. returns NULL if file is invalid.
Definition: FCALDistEtaEnergyShowerLib.cxx:94
ShowerLib::FCALDistEtaEnergyShowerLib::storeShower
virtual bool storeShower(HepMC::ConstGenParticlePtr genParticle, const Shower *shower)
store shower in the library
Definition: FCALDistEtaEnergyShowerLib.cxx:551
ShowerLib::FCALDistEtaEnergyShowerLib::m_yrodcent
double m_yrodcent
Definition: FCALDistEtaEnergyShowerLib.h:109
ShowerLib::FCALDistEtaEnergyShowerLib::m_compat
bool m_compat
Definition: FCALDistEtaEnergyShowerLib.h:113
ShowerLib::IShowerLib
Class for shower library shower lib interface.
Definition: IShowerLib.h:40
ShowerLib::FCALDistEtaEnergyShowerLib::m_libData
library m_libData
Definition: FCALDistEtaEnergyShowerLib.h:105
ShowerLib::FCALDistEtaEnergyShowerLib::etabin
std::map< float, distbin > etabin
Definition: FCALDistEtaEnergyShowerLib.h:102
ShowerLib::FCALDistEtaEnergyShowerLib::m_step
double m_step
Definition: FCALDistEtaEnergyShowerLib.h:110
ShowerLib::FCALDistEtaEnergyShowerLib::FCALDistEtaEnergyShowerLib
FCALDistEtaEnergyShowerLib()
Definition: FCALDistEtaEnergyShowerLib.h:84
ShowerLib::FCALDistEtaEnergyShowerLib::readFromROOTFile
static IShowerLib * readFromROOTFile(TFile *source)
factory method. create a library from root file. returns NULL if file is invalid.
Definition: FCALDistEtaEnergyShowerLib.cxx:56
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
ShowerLib::FCALDistEtaEnergyShowerLib::writeToROOT
virtual bool writeToROOT(TFile *dest)
write library to ROOT file
Definition: FCALDistEtaEnergyShowerLib.cxx:595
ShowerLib::FCALDistEtaEnergyShowerLib::getShower
virtual std::vector< EnergySpot > * getShower(const G4Track *track, ShowerLibStatistics *stats, int randomShift) const
get shower for given G4 track
Definition: FCALDistEtaEnergyShowerLib.cxx:247
ShowerLib::FCALDistEtaEnergyShowerLib
Class for shower library shower lib.
Definition: FCALDistEtaEnergyShowerLib.h:35
y
#define y
ShowerLib::FCALDistEtaEnergyShowerLib::getContainmentR
virtual double getContainmentR(const G4Track *track) const
get average lateral spread of the showers for the given energy
Definition: FCALDistEtaEnergyShowerLib.cxx:455
ShowerLib::FCALDistEtaEnergyShowerLib::createStatistics
virtual ShowerLibStatistics * createStatistics() const
Definition: FCALDistEtaEnergyShowerLib.cxx:794
IShowerLib.h
ShowerLib
Namespace for the ShowerLib related classes.
Definition: LArG4GenShowerLib.h:19
copySelective.source
string source
Definition: copySelective.py:32
xAOD::track
@ track
Definition: TrackingPrimitives.h:512