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 public:
27 
28 private:
29  void savePlot(std::shared_ptr<TH1F>& plot, const std::string& name);
30  void savePlot(std::shared_ptr<TProfile>& plot, float average, const std::string& name);
31 
33  std::vector<GlobalPoint> m_elements;
37  unsigned int m_tracks;
38  bool m_counted;
40 
41  std::shared_ptr<TH1F> m_dedx_spectrum;
42  std::shared_ptr<TH1F> m_radlen_spectrum;
43  std::shared_ptr<TProfile> m_dedx_vs_eta;
44  std::shared_ptr<TProfile> m_dedx_vs_z;
45  std::shared_ptr<TProfile> m_dedx_vs_r;
46  std::shared_ptr<TProfile> m_radlen_vs_eta;
47  std::shared_ptr<TProfile> m_radlen_vs_z;
48  std::shared_ptr<TProfile> m_radlen_vs_r;
49 
50  std::unique_ptr<TFile> m_file;
51 
52  static constexpr double s_tolerance = 0.01;
53 
54 public:
57 
59  void endOfTrack(void);
60  bool isInside(const MaterialAccountingDetector& detector) const;
61  std::pair<double, double> getBoundingR() const { return m_boundingbox.range_r(); };
62  std::pair<double, double> getBoundingZ() const { return m_boundingbox.range_z(); };
63  MaterialAccountingStep average(void) const;
64  double averageLength(void) const;
65  double averageRadiationLengths(void) const;
66  double averageEnergyLoss(void) const;
67  double sigmaLength(void) const;
68  double sigmaRadiationLengths(void) const;
69  double sigmaEnergyLoss(void) const;
70  unsigned int tracks(void) const { return m_tracks; }
71  const std::string& name(void) const { return m_name; }
72  std::string info(void) const;
73  void savePlots(void);
74 
75  const std::vector<GlobalPoint>& elements(void) const { return m_elements; }
76 };
77 
78 #endif
DD4hep_MaterialAccountingGroup::tracks
unsigned int tracks(void) const
Definition: DD4hep_MaterialAccountingGroup.h:70
DD4hep_MaterialAccountingGroup::m_elements
std::vector< GlobalPoint > m_elements
Definition: DD4hep_MaterialAccountingGroup.h:33
DD4hep_MaterialAccountingGroup::m_buffer
MaterialAccountingStep m_buffer
Definition: DD4hep_MaterialAccountingGroup.h:39
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:46
DD4hep_MaterialAccountingGroup::endOfTrack
void endOfTrack(void)
Definition: DD4hep_MaterialAccountingGroup.cc:129
DD4hep_MaterialAccountingGroup::sigmaRadiationLengths
double sigmaRadiationLengths(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:226
DD4hep_MaterialAccountingGroup::DD4hep_MaterialAccountingGroup
DD4hep_MaterialAccountingGroup(const DD4hep_MaterialAccountingGroup &layer)=delete
DD4hep_MaterialAccountingGroup::sigmaLength
double sigmaLength(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:222
plotFactory.plot
plot
Definition: plotFactory.py:109
DD4hep_MaterialAccountingGroup::m_name
std::string m_name
Definition: DD4hep_MaterialAccountingGroup.h:32
DD4hep_MaterialAccountingGroup::m_counted
bool m_counted
Definition: DD4hep_MaterialAccountingGroup.h:38
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:52
DD4hep_MaterialAccountingGroup::info
std::string info(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:198
DDCompactView.h
DD4hep_MaterialAccountingGroup::m_accounting
MaterialAccountingStep m_accounting
Definition: DD4hep_MaterialAccountingGroup.h:35
DD4hep_MaterialAccountingGroup::operator=
DD4hep_MaterialAccountingGroup & operator=(const DD4hep_MaterialAccountingGroup &layer)=delete
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DD4hep_MaterialAccountingGroup::averageLength
double averageLength(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:214
DD4hep_MaterialAccountingGroup::m_boundingbox
BoundingBox m_boundingbox
Definition: DD4hep_MaterialAccountingGroup.h:34
DD4hep_MaterialAccountingGroup::sigmaEnergyLoss
double sigmaEnergyLoss(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:232
BoundingBox::range_r
std::pair< double, double > range_r() const
Definition: BoundingBox.h:27
BoundingBox::range_z
std::pair< double, double > range_z() const
Definition: BoundingBox.h:29
DD4hep_MaterialAccountingGroup::m_radlen_spectrum
std::shared_ptr< TH1F > m_radlen_spectrum
Definition: DD4hep_MaterialAccountingGroup.h:42
average
Definition: average.py:1
DD4hep_MaterialAccountingGroup::m_radlen_vs_r
std::shared_ptr< TProfile > m_radlen_vs_r
Definition: DD4hep_MaterialAccountingGroup.h:48
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:210
DD4hep_MaterialAccountingGroup::elements
const std::vector< GlobalPoint > & elements(void) const
Definition: DD4hep_MaterialAccountingGroup.h:75
DD4hep_MaterialAccountingGroup::averageEnergyLoss
double averageEnergyLoss(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:218
DD4hep_MaterialAccountingGroup::m_dedx_vs_z
std::shared_ptr< TProfile > m_dedx_vs_z
Definition: DD4hep_MaterialAccountingGroup.h:44
DD4hep_MaterialAccountingGroup::getBoundingR
std::pair< double, double > getBoundingR() const
Definition: DD4hep_MaterialAccountingGroup.h:61
DD4hep_MaterialAccountingGroup::m_radlen_vs_z
std::shared_ptr< TProfile > m_radlen_vs_z
Definition: DD4hep_MaterialAccountingGroup.h:47
DD4hep_MaterialAccountingGroup::m_dedx_spectrum
std::shared_ptr< TH1F > m_dedx_spectrum
Definition: DD4hep_MaterialAccountingGroup.h:41
MaterialAccountingStep
Definition: MaterialAccountingStep.h:9
DD4hep_MaterialAccountingGroup::m_tracks
unsigned int m_tracks
Definition: DD4hep_MaterialAccountingGroup.h:37
cms::DDCompactView
Definition: DDCompactView.h:31
DD4hep_MaterialAccountingGroup::averageRadiationLengths
double averageRadiationLengths(void) const
Definition: DD4hep_MaterialAccountingGroup.cc:236
DD4hep_MaterialAccountingGroup::m_dedx_vs_r
std::shared_ptr< TProfile > m_dedx_vs_r
Definition: DD4hep_MaterialAccountingGroup.h:45
DD4hep_MaterialAccountingGroup::m_dedx_vs_eta
std::shared_ptr< TProfile > m_dedx_vs_eta
Definition: DD4hep_MaterialAccountingGroup.h:43
GeomDetEnumerators.h
DD4hep_MaterialAccountingGroup::getBoundingZ
std::pair< double, double > getBoundingZ() const
Definition: DD4hep_MaterialAccountingGroup.h:62
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
BoundingBox.h
MaterialAccountingDetector.h
DD4hep_MaterialAccountingGroup::m_file
std::unique_ptr< TFile > m_file
Definition: DD4hep_MaterialAccountingGroup.h:50
DD4hep_MaterialAccountingGroup::name
const std::string & name(void) const
Definition: DD4hep_MaterialAccountingGroup.h:71
DD4hep_MaterialAccountingGroup::savePlot
void savePlot(std::shared_ptr< TH1F > &plot, const std::string &name)
Definition: DD4hep_MaterialAccountingGroup.cc:165
DD4hep_MaterialAccountingGroup::m_errors
MaterialAccountingStep m_errors
Definition: DD4hep_MaterialAccountingGroup.h:36