CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
58  bool addDetector(const MaterialAccountingDetector& detector);
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
const std::vector< GlobalPoint > & elements(void) const
bool addDetector(const MaterialAccountingDetector &detector)
DD4hep_MaterialAccountingGroup(const DD4hep_MaterialAccountingGroup &layer)=delete
constexpr std::array< uint8_t, layerIndexSize > layer
std::pair< double, double > range_r() const
Definition: BoundingBox.h:27
DD4hep_MaterialAccountingGroup & operator=(const DD4hep_MaterialAccountingGroup &layer)=delete
def plot
Definition: bigModule.py:18
std::pair< double, double > getBoundingR() const
std::pair< double, double > getBoundingZ() const
const std::string & name(void) const
bool isInside(const MaterialAccountingDetector &detector) const
std::pair< double, double > range_z() const
Definition: BoundingBox.h:29
MaterialAccountingStep average(void) const
std::shared_ptr< TProfile > m_radlen_vs_eta
void savePlot(std::shared_ptr< TH1F > &plot, const std::string &name)