CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HIPMonitorConfig.h
Go to the documentation of this file.
1 #ifndef Alignment_HIPAlignmentAlgorithm_HIPMonitorConfig_h
2 #define Alignment_HIPAlignmentAlgorithm_HIPMonitorConfig_h
3 
4 #include <vector>
5 #include <string>
6 #include "TTree.h"
9 
11 protected:
12  TTree* tree;
13 
14 public:
15  HIPMonitorVariables() : tree(nullptr) {}
16  virtual ~HIPMonitorVariables() {}
17 
18  void setTree(TTree* tree_) { tree = tree_; }
19  virtual void bookBranches() = 0;
20  virtual void fill() = 0;
21 };
23 public:
24  const int maxNEvents;
25  const int maxTracksRcd;
26  int nEvents;
27  int nTracks;
28  int m_Ntracks;
29  std::vector<float> m_Pt, m_Eta, m_Phi, m_Chi2n, m_P, m_d0, m_dz, m_wt;
31 
32  HIPTrackMonitorVariables(int maxNEvents_ = -1, int maxTracksRcd_ = -1)
34  maxNEvents(maxNEvents_),
35  maxTracksRcd(maxTracksRcd_),
36  nEvents(0),
37  nTracks(0),
38  m_Ntracks(0) {}
39 
40  void bookBranches() override;
41  void fill() override;
42 
43 protected:
44  void resetPerEvent() {
45  // Do not reset nTracks
46  m_Ntracks = 0;
47  m_Pt.clear();
48  m_Eta.clear();
49  m_Phi.clear();
50  m_Chi2n.clear();
51  m_P.clear();
52  m_d0.clear();
53  m_dz.clear();
54  m_wt.clear();
55  m_Nhits.clear();
56  m_nhPXB.clear();
57  m_nhPXF.clear();
58  m_nhTIB.clear();
59  m_nhTOB.clear();
60  m_nhTID.clear();
61  m_nhTEC.clear();
62  }
63  void resizeVectors(int NewSize) {
64  m_Pt.resize(NewSize);
65  m_Eta.resize(NewSize);
66  m_Phi.resize(NewSize);
67  m_Chi2n.resize(NewSize);
68  m_P.resize(NewSize);
69  m_d0.resize(NewSize);
70  m_dz.resize(NewSize);
71  m_wt.resize(NewSize);
72  m_Nhits.resize(NewSize);
73  m_nhPXB.resize(NewSize);
74  m_nhPXF.resize(NewSize);
75  m_nhTIB.resize(NewSize);
76  m_nhTOB.resize(NewSize);
77  m_nhTID.resize(NewSize);
78  m_nhTEC.resize(NewSize);
79  }
80 };
82 public:
83  const int maxHitsRcd;
84  int nHits;
85 
88  unsigned int m_rawQualityWord;
90 
91 protected:
92  void resetPerHit() {
93  m_hasHitProb = false;
94  m_sinTheta = 0;
95  m_hitwt = 1;
96  m_angle = 0;
97  m_probXY = -1;
98  m_probQ = -1;
99  m_rawQualityWord = 9999;
100  m_detId = 0;
101  }
102 
103 public:
104  HIPHitMonitorVariables(int maxHitsRcd_ = -1) : HIPMonitorVariables(), maxHitsRcd(maxHitsRcd_), nHits(0) {
105  resetPerHit();
106  }
107 
108  void bookBranches() override;
109  void fill() override;
110 };
111 
114 
116 
117  const int maxEventsPerJob;
118 
120  const int maxTracks;
122 
124  const int maxHits;
126 
128 
131 
133  HIPMonitorConfig(const HIPMonitorConfig& other);
135 
136  bool checkNevents();
137  bool checkNhits();
138 };
139 
140 #endif
std::vector< float > m_P
std::vector< int > m_nhTIB
tuple cfg
Definition: looper.py:296
virtual void fill()=0
std::vector< float > m_Eta
std::vector< float > m_d0
HIPTrackMonitorVariables(int maxNEvents_=-1, int maxTracksRcd_=-1)
uint32_t ID
Definition: Definitions.h:24
std::vector< int > m_Nhits
const bool fillTrackHitMonitoring
std::vector< float > m_Pt
void bookBranches() override
std::vector< int > m_nhPXB
std::vector< float > m_wt
std::vector< int > m_nhTID
const edm::ParameterSet cfgMonitor
std::vector< float > m_Phi
const int maxEventsPerJob
HIPHitMonitorVariables hitmonitorvars
std::vector< int > m_nhTEC
const bool fillTrackMonitoring
unsigned int m_rawQualityWord
void setTree(TTree *tree_)
std::vector< int > m_nhTOB
HIPTrackMonitorVariables trackmonitorvars
const std::string outfilecore
virtual void bookBranches()=0
void bookBranches() override
virtual ~HIPMonitorVariables()
std::vector< int > m_nhPXF
HIPHitMonitorVariables(int maxHitsRcd_=-1)
std::vector< float > m_dz
void resizeVectors(int NewSize)
HIPMonitorConfig(const edm::ParameterSet &cfg)
std::vector< float > m_Chi2n