CMS 3D CMS Logo

MaterialAccountingTrack.h
Go to the documentation of this file.
1 #ifndef MaterialAccountingTrack_h
2 #define MaterialAccountingTrack_h
3 
4 #include <vector>
8 
9 // keep material accounting informations on a per-track basis
11 private:
12  // this values are optimized to avoid resizing
13  enum { kSteps = 600, kDetectors = 30 };
14 
15 public:
17  m_steps.reserve(kSteps);
18  m_detectors.reserve(kDetectors);
19  }
20 
21  void reset(void) {
22  m_total.clear();
23  m_steps.clear();
24  m_steps.reserve(kSteps);
25  m_steps.push_back(m_total);
26  m_detector.clear();
27  m_detectors.clear();
28  m_detectors.reserve(kDetectors);
29  }
30 
32  m_total += step;
33  m_steps.push_back(step);
34  }
35 
36  void enterDetector(const GlobalPoint& position, double cosTheta);
37  void leaveDetector(double cosTheta);
38 
39  const MaterialAccountingStep& summary() const { return m_total; }
40 
41  const std::vector<MaterialAccountingDetector>& detectors() const { return m_detectors; }
42 
43  std::vector<MaterialAccountingDetector>& detectors() { return m_detectors; }
44 
45  const std::vector<MaterialAccountingStep>& steps() const { return m_steps; }
46 
47  std::vector<MaterialAccountingStep>& steps() { return m_steps; }
48 
49 private:
50  MaterialAccountingStep m_total; // cache position along track (length and material)
51  MaterialAccountingDetector m_detector; // keep track of current detector
52  std::vector<MaterialAccountingStep> m_steps;
53  std::vector<MaterialAccountingDetector> m_detectors;
54 };
55 
56 #endif // MaterialAccountingTrack_h
MaterialAccountingTrack::m_steps
std::vector< MaterialAccountingStep > m_steps
Definition: MaterialAccountingTrack.h:52
MaterialAccountingStep.h
step
step
Definition: StallMonitor.cc:94
MaterialAccountingTrack::m_detectors
std::vector< MaterialAccountingDetector > m_detectors
Definition: MaterialAccountingTrack.h:53
MaterialAccountingTrack::kSteps
Definition: MaterialAccountingTrack.h:13
MaterialAccountingTrack::step
void step(const MaterialAccountingStep &step)
Definition: MaterialAccountingTrack.h:31
MaterialAccountingDetector
Definition: MaterialAccountingDetector.h:15
MaterialAccountingTrack::MaterialAccountingTrack
MaterialAccountingTrack(void)
Definition: MaterialAccountingTrack.h:16
MaterialAccountingTrack::detectors
const std::vector< MaterialAccountingDetector > & detectors() const
Definition: MaterialAccountingTrack.h:41
MaterialAccountingTrack::enterDetector
void enterDetector(const GlobalPoint &position, double cosTheta)
Definition: MaterialAccountingTrack.cc:6
MaterialAccountingTrack::summary
const MaterialAccountingStep & summary() const
Definition: MaterialAccountingTrack.h:39
Point3DBase< float, GlobalTag >
MaterialAccountingTrack::m_detector
MaterialAccountingDetector m_detector
Definition: MaterialAccountingTrack.h:51
MaterialAccountingTrack::detectors
std::vector< MaterialAccountingDetector > & detectors()
Definition: MaterialAccountingTrack.h:43
MaterialAccountingTrack::m_total
MaterialAccountingStep m_total
Definition: MaterialAccountingTrack.h:50
MaterialAccountingTrack::kDetectors
Definition: MaterialAccountingTrack.h:13
MaterialAccountingTrack::steps
std::vector< MaterialAccountingStep > & steps()
Definition: MaterialAccountingTrack.h:47
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
MaterialAccountingTrack
Definition: MaterialAccountingTrack.h:10
MaterialAccountingDetector::clear
void clear(void)
Definition: MaterialAccountingDetector.h:24
MaterialAccountingTrack::leaveDetector
void leaveDetector(double cosTheta)
Definition: MaterialAccountingTrack.cc:12
MaterialAccountingStep
Definition: MaterialAccountingStep.h:9
MaterialAccountingDetector.h
GlobalPoint.h
MaterialAccountingStep::clear
void clear(void)
Definition: MaterialAccountingStep.h:16
MaterialAccountingTrack::reset
void reset(void)
Definition: MaterialAccountingTrack.h:21
MaterialAccountingTrack::steps
const std::vector< MaterialAccountingStep > & steps() const
Definition: MaterialAccountingTrack.h:45