CMS 3D CMS Logo

DD4hep_MaterialAccountingGroup.h
Go to the documentation of this file.
1 #ifndef DD4hep_MaterialAccountingGroup_h
2 #define DD4hep_MaterialAccountingGroup_h
3 
4 #include <string>
5 #include <stdexcept>
6 #include <utility>
7 #include <memory>
8 
10 
13 
15 
16 #include "BoundingBox.h"
17 
18 class TH1;
19 class TH1F;
20 class TProfile;
21 class TFile;
22 
24 private:
27  void savePlot(std::shared_ptr<TH1F> plot, const std::string& name);
28  void savePlot(std::shared_ptr<TProfile> plot, float average, const std::string& name);
29 
31  std::vector<GlobalPoint> m_elements;
35  unsigned int m_tracks;
36  bool m_counted;
38 
39  std::shared_ptr<TH1F> m_dedx_spectrum;
40  std::shared_ptr<TH1F> m_radlen_spectrum;
41  std::shared_ptr<TProfile> m_dedx_vs_eta;
42  std::shared_ptr<TProfile> m_dedx_vs_z;
43  std::shared_ptr<TProfile> m_dedx_vs_r;
44  std::shared_ptr<TProfile> m_radlen_vs_eta;
45  std::shared_ptr<TProfile> m_radlen_vs_z;
46  std::shared_ptr<TProfile> m_radlen_vs_r;
47 
48  mutable TFile* m_file;
49 
50  static constexpr double s_tolerance = 0.01;
51 
52 public:
55 
57  void endOfTrack(void);
58  bool isInside(const MaterialAccountingDetector& detector) const;
59  std::pair<double, double> getBoundingR() const { return m_boundingbox.range_r(); };
60  std::pair<double, double> getBoundingZ() const { return m_boundingbox.range_z(); };
61  MaterialAccountingStep average(void) const;
62  double averageLength(void) const;
63  double averageRadiationLengths(void) const;
64  double averageEnergyLoss(void) const;
65  double sigmaLength(void) const;
66  double sigmaRadiationLengths(void) const;
67  double sigmaEnergyLoss(void) const;
68  unsigned int tracks(void) const { return m_tracks; }
69  const std::string& name(void) const { return m_name; }
70  std::string info(void) const;
71  void savePlots(void);
72 
73  const std::vector<GlobalPoint>& elements(void) const { return m_elements; }
74 };
75 
76 #endif
DD4hep_MaterialAccountingGroup::tracks
unsigned int tracks(void) const
Definition: DD4hep_MaterialAccountingGroup.h:68
DD4hep_MaterialAccountingGroup::m_elements
std::vector< GlobalPoint > m_elements
Definition: DD4hep_MaterialAccountingGroup.h:31
DD4hep_MaterialAccountingGroup::m_buffer
MaterialAccountingStep m_buffer
Definition: DD4hep_MaterialAccountingGroup.h:37
DD4hep_MaterialAccountingGroup::m_file
TFile * m_file
Definition: DD4hep_MaterialAccountingGroup.h:48
MaterialAccountingStep.h
DD4hep_MaterialAccountingGroup::addDetector
bool addDetector(const MaterialAccountingDetector &detector)
Definition: DD4hep_MaterialAccountingGroup.cc:119
geometry
Definition: geometry.py:1
DD4hep_MaterialAccountingGroup::m_radlen_vs_eta
std::shared_ptr< TProfile > m_radlen_vs_eta
Definition: DD4hep_MaterialAccountingGroup.h:44
DD4hep_MaterialAccountingGroup::endOfTrack
void endOfTrack(void)
Definition: DD4hep_MaterialAccountingGroup.cc:129
DD4hep_MaterialAccountingGroup::sigmaRadiationLengths
double sigmaRadiationLengths(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:227
DD4hep_MaterialAccountingGroup::DD4hep_MaterialAccountingGroup
DD4hep_MaterialAccountingGroup(const DD4hep_MaterialAccountingGroup &layer)=delete
DD4hep_MaterialAccountingGroup::sigmaLength
double sigmaLength(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:223
plotFactory.plot
plot
Definition: plotFactory.py:109
DD4hep_MaterialAccountingGroup::m_name
std::string m_name
Definition: DD4hep_MaterialAccountingGroup.h:30
DD4hep_MaterialAccountingGroup::m_counted
bool m_counted
Definition: DD4hep_MaterialAccountingGroup.h:36
BoundingBox
Definition: BoundingBox.h:12
DD4hep_MaterialAccountingGroup
Definition: DD4hep_MaterialAccountingGroup.h:23
MaterialAccountingDetector
Definition: MaterialAccountingDetector.h:15
DD4hep_MaterialAccountingGroup::isInside
bool isInside(const MaterialAccountingDetector &detector) const
Definition: DD4hep_MaterialAccountingGroup.cc:89
DD4hep_MaterialAccountingGroup::s_tolerance
static constexpr double s_tolerance
Definition: DD4hep_MaterialAccountingGroup.h:50
DD4hep_MaterialAccountingGroup::info
std::string info(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:199
DDCompactView.h
DD4hep_MaterialAccountingGroup::m_accounting
MaterialAccountingStep m_accounting
Definition: DD4hep_MaterialAccountingGroup.h:33
DD4hep_MaterialAccountingGroup::operator=
DD4hep_MaterialAccountingGroup & operator=(const DD4hep_MaterialAccountingGroup &layer)=delete
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DD4hep_MaterialAccountingGroup::averageLength
double averageLength(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:215
DD4hep_MaterialAccountingGroup::m_boundingbox
BoundingBox m_boundingbox
Definition: DD4hep_MaterialAccountingGroup.h:32
DD4hep_MaterialAccountingGroup::sigmaEnergyLoss
double sigmaEnergyLoss(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:233
BoundingBox::range_r
std::pair< double, double > range_r() const
Definition: BoundingBox.h:25
BoundingBox::range_z
std::pair< double, double > range_z() const
Definition: BoundingBox.h:27
DD4hep_MaterialAccountingGroup::m_radlen_spectrum
std::shared_ptr< TH1F > m_radlen_spectrum
Definition: DD4hep_MaterialAccountingGroup.h:40
average
Definition: average.py:1
DD4hep_MaterialAccountingGroup::m_radlen_vs_r
std::shared_ptr< TProfile > m_radlen_vs_r
Definition: DD4hep_MaterialAccountingGroup.h:46
DD4hep_MaterialAccountingGroup::~DD4hep_MaterialAccountingGroup
~DD4hep_MaterialAccountingGroup(void)
DD4hep_MaterialAccountingGroup::savePlots
void savePlots(void)
Definition: DD4hep_MaterialAccountingGroup.cc:151
DD4hep_MaterialAccountingGroup::average
MaterialAccountingStep average(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:211
DD4hep_MaterialAccountingGroup::elements
const std::vector< GlobalPoint > & elements(void) const
Definition: DD4hep_MaterialAccountingGroup.h:73
DD4hep_MaterialAccountingGroup::averageEnergyLoss
double averageEnergyLoss(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:219
DD4hep_MaterialAccountingGroup::m_dedx_vs_z
std::shared_ptr< TProfile > m_dedx_vs_z
Definition: DD4hep_MaterialAccountingGroup.h:42
DD4hep_MaterialAccountingGroup::getBoundingR
std::pair< double, double > getBoundingR() const
Definition: DD4hep_MaterialAccountingGroup.h:59
DD4hep_MaterialAccountingGroup::m_radlen_vs_z
std::shared_ptr< TProfile > m_radlen_vs_z
Definition: DD4hep_MaterialAccountingGroup.h:45
DD4hep_MaterialAccountingGroup::m_dedx_spectrum
std::shared_ptr< TH1F > m_dedx_spectrum
Definition: DD4hep_MaterialAccountingGroup.h:39
MaterialAccountingStep
Definition: MaterialAccountingStep.h:9
DD4hep_MaterialAccountingGroup::m_tracks
unsigned int m_tracks
Definition: DD4hep_MaterialAccountingGroup.h:35
cms::DDCompactView
Definition: DDCompactView.h:29
DD4hep_MaterialAccountingGroup::averageRadiationLengths
double averageRadiationLengths(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:237
DD4hep_MaterialAccountingGroup::m_dedx_vs_r
std::shared_ptr< TProfile > m_dedx_vs_r
Definition: DD4hep_MaterialAccountingGroup.h:43
DD4hep_MaterialAccountingGroup::m_dedx_vs_eta
std::shared_ptr< TProfile > m_dedx_vs_eta
Definition: DD4hep_MaterialAccountingGroup.h:41
GeomDetEnumerators.h
DD4hep_MaterialAccountingGroup::getBoundingZ
std::pair< double, double > getBoundingZ() const
Definition: DD4hep_MaterialAccountingGroup.h:60
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
BoundingBox.h
MaterialAccountingDetector.h
DD4hep_MaterialAccountingGroup::name
const std::string & name(void) const
Definition: DD4hep_MaterialAccountingGroup.h:69
DD4hep_MaterialAccountingGroup::savePlot
void savePlot(std::shared_ptr< TH1F > plot, const std::string &name)
Definition: DD4hep_MaterialAccountingGroup.cc:166
DD4hep_MaterialAccountingGroup::m_errors
MaterialAccountingStep m_errors
Definition: DD4hep_MaterialAccountingGroup.h:34