CMS 3D CMS Logo

HIPMonitorConfig.cc
Go to the documentation of this file.
2 
4  : cfgMonitor(cfg.getParameter<edm::ParameterSet>("monitorConfig")),
5  outfilecore(cfgMonitor.getParameter<std::string>("outfile")),
6  maxEventsPerJob(cfgMonitor.getParameter<int>("maxEventsPerJob")),
7  fillTrackMonitoring(cfgMonitor.getParameter<bool>("fillTrackMonitoring")),
8  maxTracks(cfgMonitor.getParameter<int>("maxTracks")),
9  trackmonitorvars(maxEventsPerJob, maxTracks),
10  fillTrackHitMonitoring(cfgMonitor.getParameter<bool>("fillTrackHitMonitoring")),
11  maxHits(cfgMonitor.getParameter<int>("maxHits")),
12  hitmonitorvars(maxHits),
13  eventCounter(0),
14  hitCounter(0) {
15  outfile = cfg.getParameter<std::string>("outpath") + outfilecore;
16 }
17 
19  : cfgMonitor(other.cfgMonitor),
20  outfilecore(other.outfilecore),
21  maxEventsPerJob(other.maxEventsPerJob),
22  fillTrackMonitoring(other.fillTrackMonitoring),
24  fillTrackHitMonitoring(other.fillTrackHitMonitoring),
27  eventCounter(other.eventCounter),
28  hitCounter(other.hitCounter) {}
29 
31  bool res = (maxEventsPerJob < 0 || maxEventsPerJob > eventCounter);
32  eventCounter++;
33  return res;
34 }
36  bool res = (maxHits < 0 || maxHits > hitCounter);
37  hitCounter++;
38  return res;
39 }
40 
42  if (tree != nullptr) {
43  tree->Branch("Ntracks", &m_Ntracks);
44  tree->Branch("Nhits", &m_Nhits);
45  //tree->Branch("DataType", &m_datatype); This is done in HIPAlignmentAlgorithm
46  tree->Branch("nhPXB", &m_nhPXB);
47  tree->Branch("nhPXF", &m_nhPXF);
48  tree->Branch("nhTIB", &m_nhTIB);
49  tree->Branch("nhTOB", &m_nhTOB);
50  tree->Branch("nhTID", &m_nhTID);
51  tree->Branch("nhTEC", &m_nhTEC);
52  tree->Branch("Pt", &m_Pt);
53  tree->Branch("P", &m_P);
54  tree->Branch("Eta", &m_Eta);
55  tree->Branch("Phi", &m_Phi);
56  tree->Branch("Chi2n", &m_Chi2n);
57  tree->Branch("d0", &m_d0);
58  tree->Branch("dz", &m_dz);
59  tree->Branch("wt", &m_wt);
60  }
61 }
63  if (tree != nullptr) {
64  tree->Branch("Id", &m_detId, "Id/i");
65  tree->Branch("sinTheta", &m_sinTheta);
66  tree->Branch("impactAngle", &m_angle);
67  tree->Branch("wt", &m_hitwt);
68  tree->Branch("probPresent", &m_hasHitProb);
69  tree->Branch("probXY", &m_probXY);
70  tree->Branch("probQ", &m_probQ);
71  tree->Branch("qualityWord", &m_rawQualityWord);
72  }
73 }
75  if (tree == nullptr)
76  return;
77  if (maxNEvents >= 0 && nEvents >= maxNEvents)
78  return;
79 
80  bool doFill = false;
81  m_Ntracks = m_Pt.size();
82  if (m_Ntracks == 0)
83  return;
84 
85  if (maxTracksRcd < 0)
86  doFill = true;
87  else if (nTracks < maxTracksRcd) {
88  if ((nTracks + m_Ntracks) < maxTracksRcd)
89  doFill = true;
90  else {
91  int NewSize = maxTracksRcd - nTracks;
92  if ((int)m_Pt.size() < NewSize)
93  NewSize = m_Pt.size();
94 
95  // Do not touch m_Ntracks, just resize these vectors
96  resizeVectors(NewSize);
97 
98  doFill = true;
99  }
100  } else {
101  // Record only m_Ntracks
102  int tmpNtracks = m_Ntracks;
103  resetPerEvent();
104  m_Ntracks = tmpNtracks;
105 
106  doFill = true;
107  }
108 
109  if (doFill) {
110  tree->Fill();
111  nEvents++;
112  nTracks += m_Ntracks;
113  }
114 
115  resetPerEvent();
116 }
118  if (tree == nullptr)
119  return;
120 
121  bool doFill = (maxHitsRcd < 0 || nHits < maxHitsRcd);
122 
123  if (doFill) {
124  tree->Fill();
125  nHits++;
126  }
127 
128  resetPerHit();
129 }
HIPHitMonitorVariables::m_probQ
float m_probQ
Definition: HIPMonitorConfig.h:87
HIPHitMonitorVariables::maxHitsRcd
const int maxHitsRcd
Definition: HIPMonitorConfig.h:83
HIPTrackMonitorVariables::fill
void fill() override
Definition: HIPMonitorConfig.cc:74
electrons_cff.bool
bool
Definition: electrons_cff.py:372
HIPMonitorConfig::outfile
std::string outfile
Definition: HIPMonitorConfig.h:127
HIPTrackMonitorVariables::m_Phi
std::vector< float > m_Phi
Definition: HIPMonitorConfig.h:29
HIPHitMonitorVariables::fill
void fill() override
Definition: HIPMonitorConfig.cc:117
HIPTrackMonitorVariables::maxNEvents
const int maxNEvents
Definition: HIPMonitorConfig.h:24
HIPTrackMonitorVariables::resetPerEvent
void resetPerEvent()
Definition: HIPMonitorConfig.h:44
edm
HLT enums.
Definition: AlignableModifier.h:19
tree
Definition: tree.py:1
HIPHitMonitorVariables::m_hitwt
float m_hitwt
Definition: HIPMonitorConfig.h:87
HIPTrackMonitorVariables::m_nhTEC
std::vector< int > m_nhTEC
Definition: HIPMonitorConfig.h:30
HIPTrackMonitorVariables::maxTracksRcd
const int maxTracksRcd
Definition: HIPMonitorConfig.h:25
HIPTrackMonitorVariables::m_nhTOB
std::vector< int > m_nhTOB
Definition: HIPMonitorConfig.h:30
HIPMonitorConfig::hitCounter
int hitCounter
Definition: HIPMonitorConfig.h:130
HIPTrackMonitorVariables::m_wt
std::vector< float > m_wt
Definition: HIPMonitorConfig.h:29
HIPTrackMonitorVariables::bookBranches
void bookBranches() override
Definition: HIPMonitorConfig.cc:41
HIPTrackMonitorVariables::m_Chi2n
std::vector< float > m_Chi2n
Definition: HIPMonitorConfig.h:29
HIPMonitorConfig::checkNhits
bool checkNhits()
Definition: HIPMonitorConfig.cc:35
HIPHitMonitorVariables::m_detId
align::ID m_detId
Definition: HIPMonitorConfig.h:89
HIPTrackMonitorVariables::m_P
std::vector< float > m_P
Definition: HIPMonitorConfig.h:29
HIPTrackMonitorVariables::resizeVectors
void resizeVectors(int NewSize)
Definition: HIPMonitorConfig.h:63
HIPTrackMonitorVariables::nTracks
int nTracks
Definition: HIPMonitorConfig.h:27
trackingPlots.other
other
Definition: trackingPlots.py:1465
NuclearSeed_cfi.maxHits
maxHits
Definition: NuclearSeed_cfi.py:21
HIPHitMonitorVariables::m_hasHitProb
bool m_hasHitProb
Definition: HIPMonitorConfig.h:86
HIPTrackMonitorVariables::nEvents
int nEvents
Definition: HIPMonitorConfig.h:26
HIPTrackMonitorVariables::m_dz
std::vector< float > m_dz
Definition: HIPMonitorConfig.h:29
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HIPTrackMonitorVariables::m_Pt
std::vector< float > m_Pt
Definition: HIPMonitorConfig.h:29
HIPHitMonitorVariables::resetPerHit
void resetPerHit()
Definition: HIPMonitorConfig.h:92
HIPMonitorConfig
Definition: HIPMonitorConfig.h:112
edm::ParameterSet
Definition: ParameterSet.h:36
ParameterSet
Definition: Functions.h:16
HIPHitMonitorVariables::m_angle
float m_angle
Definition: HIPMonitorConfig.h:87
HIPTrackMonitorVariables::m_nhTIB
std::vector< int > m_nhTIB
Definition: HIPMonitorConfig.h:30
HIPTrackMonitorVariables::m_nhPXF
std::vector< int > m_nhPXF
Definition: HIPMonitorConfig.h:30
HIPTrackMonitorVariables::m_d0
std::vector< float > m_d0
Definition: HIPMonitorConfig.h:29
createfilelist.int
int
Definition: createfilelist.py:10
HIPMonitorConfig::HIPMonitorConfig
HIPMonitorConfig(const edm::ParameterSet &cfg)
Definition: HIPMonitorConfig.cc:3
res
Definition: Electron.h:6
HIPHitMonitorVariables::nHits
int nHits
Definition: HIPMonitorConfig.h:84
looper.cfg
cfg
Definition: looper.py:297
HIPTrackMonitorVariables::m_nhTID
std::vector< int > m_nhTID
Definition: HIPMonitorConfig.h:30
std
Definition: JetResolutionObject.h:76
HIPTrackMonitorVariables::m_Nhits
std::vector< int > m_Nhits
Definition: HIPMonitorConfig.h:30
HIPHitMonitorVariables::m_sinTheta
float m_sinTheta
Definition: HIPMonitorConfig.h:87
HIPMonitorConfig::outfilecore
const std::string outfilecore
Definition: HIPMonitorConfig.h:115
cuy.doFill
doFill
Definition: cuy.py:576
timingPdfMaker.outfile
outfile
Definition: timingPdfMaker.py:351
HIPTrackMonitorVariables::m_Ntracks
int m_Ntracks
Definition: HIPMonitorConfig.h:28
HIPMonitorConfig::checkNevents
bool checkNevents()
Definition: HIPMonitorConfig.cc:30
HIPTrackMonitorVariables::m_Eta
std::vector< float > m_Eta
Definition: HIPMonitorConfig.h:29
HLT_2018_cff.maxTracks
maxTracks
Definition: HLT_2018_cff.py:31798
HIPTrackMonitorVariables::m_nhPXB
std::vector< int > m_nhPXB
Definition: HIPMonitorConfig.h:30
HIPMonitorConfig::eventCounter
int eventCounter
Definition: HIPMonitorConfig.h:129
HIPHitMonitorVariables::m_rawQualityWord
unsigned int m_rawQualityWord
Definition: HIPMonitorConfig.h:88
HIPHitMonitorVariables::m_probXY
float m_probXY
Definition: HIPMonitorConfig.h:87
HIPMonitorConfig.h
HIPHitMonitorVariables::bookBranches
void bookBranches() override
Definition: HIPMonitorConfig.cc:62