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
std::pair< double, double > getBoundingZ() const
bool addDetector(const MaterialAccountingDetector &detector)
DD4hep_MaterialAccountingGroup(const DD4hep_MaterialAccountingGroup &layer)=delete
const std::string & name(void) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
std::pair< double, double > range_z() const
Definition: BoundingBox.h:29
std::pair< double, double > getBoundingR() const
DD4hep_MaterialAccountingGroup & operator=(const DD4hep_MaterialAccountingGroup &layer)=delete
MaterialAccountingStep average(void) const
std::pair< double, double > range_r() const
Definition: BoundingBox.h:27
bool isInside(const MaterialAccountingDetector &detector) const
const std::vector< GlobalPoint > & elements(void) const
std::shared_ptr< TProfile > m_radlen_vs_eta
void savePlot(std::shared_ptr< TH1F > &plot, const std::string &name)