CMS 3D CMS Logo

QcdUeDQM.cc
Go to the documentation of this file.
1 /*
2  This is the DQM code for UE physics plots
3  11/12/2009 Sunil Bansal
4 */
35 #include <TString.h>
36 #include <TMath.h>
37 #include <TH1F.h>
38 #include <TH2F.h>
39 #include <TH3F.h>
40 #include <TProfile.h>
41 using namespace std;
42 using namespace edm;
43 
44 #define CP(level) if (level >= verbose_)
45 
46 struct deleter {
47  void operator()(TH3F *&h) {
48  delete h;
49  h = nullptr;
50  }
51 };
52 
54  : hltResName_(parameters.getUntrackedParameter<string>("hltTrgResults")),
55  verbose_(parameters.getUntrackedParameter<int>("verbose", 3)),
56  tgeo_(nullptr),
57  repSumMap_(nullptr),
58  repSummary_(nullptr),
59  h2TrigCorr_(nullptr),
60  ptMin_(parameters.getParameter<double>("ptMin")),
61  minRapidity_(parameters.getParameter<double>("minRapidity")),
62  maxRapidity_(parameters.getParameter<double>("maxRapidity")),
63  tip_(parameters.getParameter<double>("tip")),
64  lip_(parameters.getParameter<double>("lip")),
65  diffvtxbs_(parameters.getParameter<double>("diffvtxbs")),
66  ptErr_pt_(parameters.getParameter<double>("ptErr_pt")),
67  vtxntk_(parameters.getParameter<double>("vtxntk")),
68  minHit_(parameters.getParameter<int>("minHit")),
69  pxlLayerMinCut_(parameters.getParameter<double>("pxlLayerMinCut")),
70  requirePIX1_(parameters.getParameter<bool>("requirePIX1")),
71  min3DHit_(parameters.getParameter<int>("min3DHit")),
72  maxChi2_(parameters.getParameter<double>("maxChi2")),
73  bsuse_(parameters.getParameter<bool>("bsuse")),
74  allowTriplets_(parameters.getParameter<bool>("allowTriplets")),
75  bsPos_(parameters.getParameter<double>("bsPos")),
76  caloJetLabel_(consumes<reco::CaloJetCollection>(
77  parameters.getUntrackedParameter<edm::InputTag>("caloJetTag"))),
78  chargedJetLabel_(consumes<reco::TrackJetCollection>(
79  parameters.getUntrackedParameter<edm::InputTag>("chargedJetTag"))),
80  trackLabel_(consumes<reco::TrackCollection>(
81  parameters.getUntrackedParameter<edm::InputTag>("trackTag"))),
82  vtxLabel_(consumes<reco::VertexCollection>(
83  parameters.getUntrackedParameter<edm::InputTag>("vtxTag"))),
84  bsLabel_(consumes<reco::BeamSpot>(
85  parameters.getParameter<edm::InputTag>("beamSpotTag"))) {
86  // Constructor.
87  std::vector<std::string> quality =
88  parameters.getParameter<std::vector<std::string> >("quality");
89  for (unsigned int j = 0; j < quality.size(); j++)
90  quality_.push_back(reco::TrackBase::qualityByName(quality[j]));
91  std::vector<std::string> algorithm =
92  parameters.getParameter<std::vector<std::string> >("algorithm");
93  for (unsigned int j = 0; j < algorithm.size(); j++)
94  algorithm_.push_back(reco::TrackBase::algoByName(algorithm[j]));
95 
96  if (parameters.exists("hltTrgNames"))
97  hltTrgNames_ =
98  parameters.getUntrackedParameter<vector<string> >("hltTrgNames");
99 
100  if (parameters.exists("hltProcNames"))
101  hltProcNames_ =
102  parameters.getUntrackedParameter<vector<string> >("hltProcNames");
103  else {
104  // hltProcNames_.push_back("FU");
105  hltProcNames_.push_back("HLT");
106  }
107 
108  isHltConfigSuccessful_ = false; // init
109 }
110 
112  // Destructor.
113 }
114 
115 void QcdUeDQM::dqmBeginRun(const Run &run, const EventSetup &iSetup) {
116  // indicating change of HLT cfg at run boundries
117  // for HLTConfigProvider::init()
118  bool isHltCfgChange = false;
119  isHltConfigSuccessful_ = false; // init
120 
121  string teststr;
122  for (size_t i = 0; i < hltProcNames_.size(); ++i) {
123  if (i > 0) teststr += ", ";
124  teststr += hltProcNames_.at(i);
125  if (hltConfig.init(run, iSetup, hltProcNames_.at(i), isHltCfgChange)) {
126  isHltConfigSuccessful_ = true;
128  if (hltResName_.find(':') == string::npos)
129  hltUsedResName_ += "::";
130  else
131  hltUsedResName_ += ":";
133  break;
134  }
135  }
136 
137  if (!isHltConfigSuccessful_) return;
138 
139  // setup "Any" bit
140  hltTrgBits_.clear();
141  hltTrgBits_.push_back(-1);
142  hltTrgDeci_.clear();
143  hltTrgDeci_.push_back(true);
144  hltTrgUsedNames_.clear();
145  hltTrgUsedNames_.push_back("Any");
146 
147  // figure out relation of trigger name to trigger bit and store used trigger
148  // names/bits
149  for (size_t i = 0; i < hltTrgNames_.size(); ++i) {
150  const string &n1(hltTrgNames_.at(i));
151  // unsigned int hlt_prescale = hltConfig.prescaleValue(iSetup, n1);
152  // cout<<"trigger=="<<n1<<"presc=="<<hlt_prescale<<endl;
153  bool found = false;
154  for (size_t j = 0; j < hltConfig.size(); ++j) {
155  const string &n2(hltConfig.triggerName(j));
156  if (n2 == n1) {
157  hltTrgBits_.push_back(j);
158  hltTrgUsedNames_.push_back(n1);
159  hltTrgDeci_.push_back(false);
160  found = true;
161  break;
162  }
163  }
164  if (!found) {
165  CP(2) cout << "Could not find trigger bit" << endl;
166  }
167  }
168  isHltConfigSuccessful_ = true;
169 }
170 
172  edm::EventSetup const &) {
173  // Book histograms if needed.
174  iBooker.setCurrentFolder("Physics/QcdUe");
175 
176  if (true) {
177  const int Nx = hltTrgUsedNames_.size();
178  const double x1 = -0.5;
179  const double x2 = Nx - 0.5;
180  h2TrigCorr_ = iBooker.book2D("h2TriCorr", "Trigger bit x vs y;y&&!x;x&&y",
181  Nx, x1, x2, Nx, x1, x2);
182  for (size_t i = 1; i <= hltTrgUsedNames_.size(); ++i) {
185  }
186  TH1 *h = h2TrigCorr_->getTH1();
187  if (h) h->SetStats(false);
188  }
189  book1D(iBooker, hNevts_, "hNevts", "number of events", 2, 0, 2);
190  book1D(iBooker, hNtrackerLayer_, "hNtrackerLayer",
191  "number of tracker layers;multiplicity", 20, -0.5, 19.5);
192  book1D(iBooker, hNtrackerPixelLayer_, "hNtrackerPixelLayer",
193  "number of pixel layers;multiplicity", 10, -0.5, 9.5);
194  book1D(iBooker, hNtrackerStripPixelLayer_, "hNtrackerStripPixelLayer",
195  "number of strip + pixel layers;multiplicity", 30, -0.5, 39.5);
196  book1D(iBooker, hRatioPtErrorPt_, "hRatioPtErrorPt",
197  "ratio of pT error and track pT", 25, 0., 5.);
198  book1D(iBooker, hTrkPt_, "hTrkPt", "pT of all tracks", 50, 0., 50.);
199  book1D(iBooker, hTrkEta_, "hTrkEta", "eta of all tracks", 40, -4., 4.);
200  book1D(iBooker, hTrkPhi_, "hTrkPhi", "phi of all tracks", 40, -4., 4.);
201  book1D(
202  iBooker, hRatioDxySigmaDxyBS_, "hRatioDxySigmaDxyBS",
203  "ratio of transverse impact parameter and its significance wrt beam spot",
204  60, -10., 10);
205  book1D(iBooker, hRatioDxySigmaDxyPV_, "hRatioDxySigmaDxyPV",
206  "ratio of transverse impact parameter and its significance wrt PV", 60,
207  -10., 10);
208  book1D(iBooker, hRatioDzSigmaDzBS_, "hRatioDzSigmaDzBS",
209  "ratio of longitudinal impact parameter and its significance wrt beam "
210  "spot",
211  80, -20., 20);
212  book1D(iBooker, hRatioDzSigmaDzPV_, "hRatioDzSigmaDzPV",
213  "ratio of longitudinal impact parameter and its significance wrt PV",
214  80, -20., 20);
215  book1D(iBooker, hTrkChi2_, "hTrkChi2", "track chi2", 30, 0., 30);
216  book1D(iBooker, hTrkNdof_, "hTrkNdof", "track NDOF", 100, 0, 100);
217 
218  book1D(iBooker, hNgoodTrk_, "hNgoodTrk", "number of good tracks", 50, -0.5,
219  49.5);
220 
221  book1D(iBooker, hGoodTrkPt500_, "hGoodTrkPt500",
222  "pT of all good tracks with pT > 500 MeV", 50, 0., 50.);
223  book1D(iBooker, hGoodTrkEta500_, "hGoodTrkEta500",
224  "eta of all good tracks pT > 500 MeV", 40, -4., 4.);
225  book1D(iBooker, hGoodTrkPhi500_, "hGoodTrkPhi500",
226  "phi of all good tracks pT > 500 MeV", 40, -4., 4.);
227 
228  book1D(iBooker, hGoodTrkPt900_, "hGoodTrkPt900",
229  "pT of all good tracks with pT > 900 MeV", 50, 0., 50.);
230  book1D(iBooker, hGoodTrkEta900_, "hGoodTrkEta900",
231  "eta of all good tracks pT > 900 MeV", 40, -4., 4.);
232  book1D(iBooker, hGoodTrkPhi900_, "hGoodTrkPhi900",
233  "phi of all good tracks pT > 900 MeV", 40, -4., 4.);
234 
235  book1D(iBooker, hNvertices_, "hNvertices", "number of vertices", 5, -0.5,
236  4.5);
237  book1D(iBooker, hVertex_z_, "hVertex_z", "z position of vertex; z[cm]", 200,
238  -50, 50);
239  book1D(iBooker, hVertex_y_, "hVertex_y", "y position of vertex; y[cm]", 100,
240  -5, 5);
241  book1D(iBooker, hVertex_x_, "hVertex_x", "x position of vertex; x[cm]", 100,
242  -5, 5);
243  book1D(iBooker, hVertex_ndof_, "hVertex_ndof", "ndof of vertex", 100, 0, 100);
244  book1D(iBooker, hVertex_rho_, "hVertex_rho", "rho of vertex", 100, 0, 5);
245  book1D(iBooker, hVertex_z_bs_, "hVertex_z_bs",
246  "z position of vertex from beamspot; z[cm]", 200, -50, 50);
247 
248  book1D(iBooker, hBeamSpot_z_, "hBeamSpot_z", "z position of beamspot; z[cm]",
249  100, -20, 20);
250  book1D(iBooker, hBeamSpot_y_, "hBeamSpot_y", "y position of beamspot; y[cm]",
251  50, -10, 10);
252  book1D(iBooker, hBeamSpot_x_, "hBeamSpot_x", "x position of beamspot; x[cm]",
253  50, -10, 10);
254 
255  if (true) {
256  const int Nx = 25;
257  const double x1 = 0.0;
258  const double x2 = 50.0;
259  book1D(iBooker, hLeadingTrack_pTSpectrum_, "hLeadingTrack_pTSpectrum",
260  "pT spectrum of leading track;pT(GeV/c)", Nx, x1, x2);
262  "hLeadingChargedJet_pTSpectrum",
263  "pT spectrum of leading track jet;pT(GeV/c)", Nx, x1, x2);
264  }
265 
266  if (true) {
267  const int Nx = 24;
268  const double x1 = -4.;
269  const double x2 = 4.;
270  book1D(iBooker, hLeadingTrack_phiSpectrum_, "hLeadingTrack_phiSpectrum",
271  "#phi spectrum of leading track;#phi", Nx, x1, x2);
273  "hLeadingChargedJet_phiSpectrum",
274  "#phi spectrum of leading track jet;#phi", Nx, x1, x2);
275  }
276 
277  if (true) {
278  const int Nx = 24;
279  const double x1 = -4.;
280  const double x2 = 4.;
281  book1D(iBooker, hLeadingTrack_etaSpectrum_, "hLeadingTrack_etaSpectrum",
282  "#eta spectrum of leading track;#eta", Nx, x1, x2);
284  "hLeadingChargedJet_etaSpectrum",
285  "#eta spectrum of leading track jet;#eta", Nx, x1, x2);
286  }
287 
288  if (true) {
289  const int Nx = 75;
290  const double x1 = 0.0;
291  const double x2 = 75.0;
292  const double y1 = 0.;
293  const double y2 = 10.;
295  "hdNdEtadPhi_pTMax_Toward500",
296  "Average number of tracks (pT > 500 MeV) in toward region vs "
297  "leading track pT;pT(GeV/c);dN/d#eta d#phi",
298  Nx, x1, x2, y1, y2, false, false);
300  "hdNdEtadPhi_pTMax_Transverse500",
301  "Average number of tracks (pT > 500 MeV) in transverse region "
302  "vs leading track pT;pT(GeV/c);dN/d#eta d#phi",
303  Nx, x1, x2, y1, y2, false, false);
305  "hdNdEtadPhi_pTMax_Away500",
306  "Average number of tracks (pT > 500 MeV) in away region vs "
307  "leading track pT;pT(GeV/c);dN/d#eta d#phi",
308  Nx, x1, x2, y1, y2, false, false);
310  "hdNdEtadPhi_trackJet_Toward500",
311  "Average number of tracks (pT > 500 MeV) in toward region vs "
312  "leading track jet pT;pT(GeV/c);dN/d#eta d#phi",
313  Nx, x1, x2, y1, y2);
315  "hdNdEtadPhi_trackJet_Transverse500",
316  "Average number of tracks (pT > 500 MeV) in transverse region "
317  "vs leading track jet pT;pT(GeV/c);dN/d#eta d#phi",
318  Nx, x1, x2, y1, y2, false, false);
320  "hdNdEtadPhi_trackJet_Away500",
321  "Average number of tracks (pT > 500 MeV) in away region vs "
322  "leading track jet pT;pT(GeV/c);dN/d#eta d#phi",
323  Nx, x1, x2, y1, y2, false, false);
324 
326  "hpTSumdEtadPhi_pTMax_Toward500",
327  "Average number of tracks (pT > 500 MeV) in toward region vs "
328  "leading track pT;pT(GeV/c);dpTSum/d#eta d#phi",
329  Nx, x1, x2, y1, y2, false, false);
331  "hpTSumdEtadPhi_pTMax_Transverse500",
332  "Average number of tracks (pT > 500 MeV) in transverse region "
333  "vs leading track pT;pT(GeV/c);dpTSum/d#eta d#phi",
334  Nx, x1, x2, y1, y2, false, false);
336  "hpTSumdEtadPhi_pTMax_Away500",
337  "Average number of tracks (pT > 500 MeV) in away region vs "
338  "leading track pT;pT(GeV/c);dpTSum/d#eta d#phi",
339  Nx, x1, x2, y1, y2, false, false);
341  "hpTSumdEtadPhi_trackJet_Toward500",
342  "Average number of tracks (pT > 500 MeV) in toward region vs "
343  "leading track jet pT;pT(GeV/c);dpTSum/d#eta d#phi",
344  Nx, x1, x2, y1, y2, false, false);
346  "hpTSumdEtadPhi_trackJet_Transverse500",
347  "Average number of tracks (pT > 500 MeV) in transverse region "
348  "vs leading track jet pT;pT(GeV/c);dpTSum/d#eta d#phi",
349  Nx, x1, x2, y1, y2, false, false);
351  "hpTSumdEtadPhi_trackJet_Away500",
352  "Average number of tracks (pT > 500 MeV) in away region vs "
353  "leading track jet pT;pT(GeV/c);dpTSum/d#eta d#phi",
354  Nx, x1, x2, y1, y2, false, false);
355 
357  "hdNdEtadPhi_pTMax_Toward900",
358  "Average number of tracks (pT > 900 MeV) in toward region vs "
359  "leading track pT;pT(GeV/c);dN/d#eta d#phi",
360  Nx, x1, x2, y1, y2, false, false);
362  "hdNdEtadPhi_pTMax_Transverse900",
363  "Average number of tracks (pT > 900 MeV) in transverse region "
364  "vs leading track pT;pT(GeV/c);dN/d#eta d#phi",
365  Nx, x1, x2, y1, y2, false, false);
367  "hdNdEtadPhi_pTMax_Away900",
368  "Average number of tracks (pT > 900 MeV) in away region vs "
369  "leading track pT;pT(GeV/c);dN/d#eta d#phi",
370  Nx, x1, x2, y1, y2, false, false);
372  "hdNdEtadPhi_trackJet_Toward900",
373  "Average number of tracks (pT > 900 MeV) in toward region vs "
374  "leading track jet pT;pT(GeV/c);dN/d#eta d#phi",
375  Nx, x1, x2, y1, y2);
377  "hdNdEtadPhi_trackJet_Transverse900",
378  "Average number of tracks (pT > 900 MeV) in transverse region "
379  "vs leading track jet pT;pT(GeV/c);dN/d#eta d#phi",
380  Nx, x1, x2, y1, y2, false, false);
382  "hdNdEtadPhi_trackJet_Away900",
383  "Average number of tracks (pT > 900 MeV) in away region vs "
384  "leading track jet pT;pT(GeV/c);dN/d#eta d#phi",
385  Nx, x1, x2, y1, y2, false, false);
386 
388  "hpTSumdEtadPhi_pTMax_Toward900",
389  "Average number of tracks (pT > 900 MeV) in toward region vs "
390  "leading track pT;pT(GeV/c);dpTSum/d#eta d#phi",
391  Nx, x1, x2, y1, y2, false, false);
393  "hpTSumdEtadPhi_pTMax_Transverse900",
394  "Average number of tracks (pT > 900 MeV) in transverse region "
395  "vs leading track pT;pT(GeV/c);dpTSum/d#eta d#phi",
396  Nx, x1, x2, y1, y2, false, false);
398  "hpTSumdEtadPhi_pTMax_Away900",
399  "Average number of tracks (pT > 900 MeV) in away region vs "
400  "leading track pT;pT(GeV/c);dpTSum/d#eta d#phi",
401  Nx, x1, x2, y1, y2, false, false);
403  "hpTSumdEtadPhi_trackJet_Toward900",
404  "Average number of tracks (pT > 900 MeV) in toward region vs "
405  "leading track jet pT;pT(GeV/c);dpTSum/d#eta d#phi",
406  Nx, x1, x2, y1, y2, false, false);
408  "hpTSumdEtadPhi_trackJet_Transverse900",
409  "Average number of tracks (pT > 900 MeV) in transverse region "
410  "vs leading track jet pT;pT(GeV/c);dpTSum/d#eta d#phi",
411  Nx, x1, x2, y1, y2, false, false);
413  "hpTSumdEtadPhi_trackJet_Away900",
414  "Average number of tracks (pT > 900 MeV) in away region vs "
415  "leading track jet pT;pT(GeV/c);dpTSum/d#eta d#phi",
416  Nx, x1, x2, y1, y2, false, false);
417  }
418 
419  if (true) {
420  const int Nx = 20;
421  const double x1 = 0.0;
422  const double x2 = 20.0;
423 
424  book1D(iBooker, hChargedJetMulti_, "hChargedJetMulti",
425  "Charged jet multiplicity;multiplicities", Nx, x1, x2);
426  }
427 
428  if (true) {
429  const int Nx = 60;
430  const double x1 = -180.0;
431  const double x2 = 180.0;
432 
433  book1D(iBooker, hdPhi_maxpTTrack_tracks_, "hdPhi_maxpTTrack_tracks",
434  "delta phi between leading tracks and other "
435  "tracks;#Delta#phi(leading track-track)",
436  Nx, x1, x2);
437  book1D(iBooker, hdPhi_chargedJet_tracks_, "hdPhi_chargedJet_tracks",
438  "delta phi between leading charged jet and "
439  "tracks;#Delta#phi(leading charged jet-track)",
440  Nx, x1, x2);
441  }
442 }
443 
444 void QcdUeDQM::analyze(const Event &iEvent, const EventSetup &iSetup) {
445  if (!isHltConfigSuccessful_) return;
446 
447  // Analyze the given event.
448 
450  bool ValidBS_ = iEvent.getByToken(bsLabel_, beamSpot);
451  if (!ValidBS_) return;
452 
454  bool ValidTrack_ = iEvent.getByToken(trackLabel_, tracks);
455  if (!ValidTrack_) return;
456 
458  bool ValidTrackJet_ = iEvent.getByToken(chargedJetLabel_, trkJets);
459  if (!ValidTrackJet_) return;
460 
462  bool ValidCaloJet_ = iEvent.getByToken(caloJetLabel_, calJets);
463  if (!ValidCaloJet_) return;
464 
466  bool ValidVtxColl_ = iEvent.getByToken(vtxLabel_, vertexColl);
467  if (!ValidVtxColl_) return;
468 
469  reco::TrackCollection tracks_sort = *tracks;
470  std::sort(tracks_sort.begin(), tracks_sort.end(), PtSorter());
471 
472  // get tracker geometry
473  /* ESHandle<TrackerGeometry> trackerHandle;
474  iSetup.get<TrackerDigiGeometryRecord>().get(trackerHandle);
475  tgeo_ = trackerHandle.product();
476  if (!tgeo_)return;
477  */
478  selected_.clear();
479  fillHltBits(iEvent, iSetup);
480  // select good tracks
481  if (fillVtxPlots(beamSpot.product(), vertexColl)) {
482  fill1D(hNevts_, 1);
483  for (reco::TrackCollection::const_iterator Trk = tracks_sort.begin();
484  Trk != tracks_sort.end(); ++Trk) {
485  if (trackSelection(*Trk, beamSpot.product(), vtx1, vertexColl->size()))
486  selected_.push_back(&*Trk);
487  }
488 
490  fillChargedJetSpectra(trkJets);
491  // fillCaloJetSpectra(calJets);
493  if (!trkJets->empty()) fillUE_with_ChargedJets(selected_, trkJets);
494  // if(calJets->size()>0)fillUE_with_CaloJets(selected_,calJets);
495  }
496 }
497 
499  std::vector<MonitorElement *> &mes,
500  const std::string &name, const std::string &title, int nx,
501  double x1, double x2, bool sumw2, bool sbox) {
502  // Book 1D histos.
503  for (size_t i = 0; i < hltTrgUsedNames_.size(); ++i) {
504  std::string folderName = "Physics/QcdUe/" + hltTrgUsedNames_.at(i);
505  iBooker.setCurrentFolder(folderName);
506  MonitorElement *e = iBooker.book1D(
507  Form("%s_%s", name.c_str(), hltTrgUsedNames_.at(i).c_str()),
508  Form("%s: %s", hltTrgUsedNames_.at(i).c_str(), title.c_str()), nx, x1,
509  x2);
510  TH1 *h1 = e->getTH1();
511  if (sumw2) {
512  if (0 == h1->GetSumw2N()) { // protect against re-summing (would cause
513  // exception)
514  h1->Sumw2();
515  }
516  }
517  h1->SetStats(sbox);
518  mes.push_back(e);
519  }
520 }
521 
523  std::vector<MonitorElement *> &mes,
524  const std::string &name, const std::string &title,
525  int nx, double x1, double x2, double y1, double y2,
526  bool sumw2, bool sbox) {
527  // Book Profile histos.
528 
529  for (size_t i = 0; i < hltTrgUsedNames_.size(); ++i) {
530  std::string folderName = "Physics/QcdUe/" + hltTrgUsedNames_.at(i);
531  iBooker.setCurrentFolder(folderName);
532  MonitorElement *e = iBooker.bookProfile(
533  Form("%s_%s", name.c_str(), hltTrgUsedNames_.at(i).c_str()),
534  Form("%s: %s", hltTrgUsedNames_.at(i).c_str(), title.c_str()), nx, x1,
535  x2, y1, y2, " ");
536  mes.push_back(e);
537  }
538 }
539 
540 void QcdUeDQM::fill1D(std::vector<TH1F *> &hs, double val, double w) {
541  // Loop over histograms and fill if trigger has fired.
542 
543  for (size_t i = 0; i < hs.size(); ++i) {
544  if (!hltTrgDeci_.at(i)) continue;
545  hs.at(i)->Fill(val, w);
546  }
547 }
548 
549 //--------------------------------------------------------------------------------------------------
550 void QcdUeDQM::fill1D(std::vector<MonitorElement *> &mes, double val,
551  double w) {
552  // Loop over histograms and fill if trigger has fired.
553 
554  for (size_t i = 0; i < mes.size(); ++i) {
555  if (!hltTrgDeci_.at(i)) continue;
556  mes.at(i)->Fill(val, w);
557  }
558 }
559 
560 //--------------------------------------------------------------------------------------------------
561 void QcdUeDQM::setLabel1D(std::vector<MonitorElement *> &mes) {
562  // Loop over histograms and fill if trigger has fired.
563  string cut[5] = {"Nevt", "vtx!=bmspt", "Zvtx<10cm", "pT>1GeV",
564  "trackFromVtx"};
565  for (size_t i = 0; i < mes.size(); ++i) {
566  if (!hltTrgDeci_.at(i)) continue;
567  for (size_t j = 1; j < 6; j++) mes.at(i)->setBinLabel(j, cut[j - 1], 1);
568  }
569 }
570 
571 //--------------------------------------------------------------------------------------------------
572 void QcdUeDQM::fill2D(std::vector<TH2F *> &hs, double valx, double valy,
573  double w) {
574  // Loop over histograms and fill if trigger has fired.
575 
576  for (size_t i = 0; i < hs.size(); ++i) {
577  if (!hltTrgDeci_.at(i)) continue;
578  hs.at(i)->Fill(valx, valy, w);
579  }
580 }
581 
582 //--------------------------------------------------------------------------------------------------
583 void QcdUeDQM::fill2D(std::vector<MonitorElement *> &mes, double valx,
584  double valy, double w) {
585  // Loop over histograms and fill if trigger has fired.
586 
587  for (size_t i = 0; i < mes.size(); ++i) {
588  if (!hltTrgDeci_.at(i)) continue;
589  mes.at(i)->Fill(valx, valy, w);
590  }
591 }
592 //--------------------------------------------------------------------------------------------------
593 void QcdUeDQM::fillProfile(std::vector<TProfile *> &hs, double valx,
594  double valy, double w) {
595  // Loop over histograms and fill if trigger has fired.
596 
597  for (size_t i = 0; i < hs.size(); ++i) {
598  if (!hltTrgDeci_.at(i)) continue;
599  hs.at(i)->Fill(valx, valy, w);
600  }
601 }
602 
603 //--------------------------------------------------------------------------------------------------
604 void QcdUeDQM::fillProfile(std::vector<MonitorElement *> &mes, double valx,
605  double valy, double w) {
606  // Loop over histograms and fill if trigger has fired.
607 
608  for (size_t i = 0; i < mes.size(); ++i) {
609  if (!hltTrgDeci_.at(i)) continue;
610  const double y = valy * w;
611  mes.at(i)->Fill(valx, y);
612  }
613 }
614 
615 //--------------------------------------------------------------------------------------------------
617  const reco::Vertex &vtx, int sizevtx) {
618  bool goodTrk = false;
619 
620  if (sizevtx != 1) return false; // selection events with only a vertex
621 
622  // Fill basic information of all the tracks
625 
629 
630  fill1D(hRatioPtErrorPt_, (trk.ptError() / trk.pt()));
631  fill1D(hTrkPt_, trk.pt());
632  fill1D(hTrkEta_, trk.eta());
633  fill1D(hTrkPhi_, trk.phi());
634  fill1D(hRatioDxySigmaDxyBS_, (trk.dxy(bs->position()) / trk.dxyError()));
635  fill1D(hRatioDxySigmaDxyPV_, (trk.dxy(vtx.position()) / trk.dxyError()));
636  fill1D(hRatioDzSigmaDzBS_, (trk.dz(bs->position()) / trk.dzError()));
637  fill1D(hRatioDzSigmaDzPV_, (trk.dz(vtx.position()) / trk.dzError()));
639  fill1D(hTrkNdof_, trk.ndof());
640 
641  fill1D(hBeamSpot_x_, bs->x0());
642  fill1D(hBeamSpot_y_, bs->y0());
643  fill1D(hBeamSpot_z_, bs->z0());
644 
645  // number of layers
646  bool layerMinCutbool =
650 
651  // number of pixel layers
652  bool pxlLayerMinCutbool =
654 
655  // cut on the hits in pixel layers
656  bool hasPIX1 = false;
657  if (requirePIX1_) {
658  const reco::HitPattern &p = trk.hitPattern();
659  for (int i = 0; i < p.numberOfAllHits(reco::HitPattern::TRACK_HITS); i++) {
663  reco::HitPattern::getLayer(hit) == 1) {
664  hasPIX1 = true;
665  break;
666  }
667  }
668  } else {
669  hasPIX1 = true;
670  }
671 
672  // cut on the pT error
673  bool ptErrorbool =
674  (trk.ptError() / trk.pt() < ptErr_pt_ ||
677 
678  // quality cut
679  bool quality_ok = true;
680  if (!quality_.empty()) {
681  quality_ok = false;
682  for (unsigned int i = 0; i < quality_.size(); ++i) {
683  if (trk.quality(quality_[i])) {
684  quality_ok = true;
685  break;
686  }
687  }
688  }
689  //-----
690  bool algo_ok = true;
691  if (!algorithm_.empty()) {
692  if (std::find(algorithm_.begin(), algorithm_.end(), trk.algo()) ==
693  algorithm_.end())
694  algo_ok = false;
695  }
696 
697  if (bsuse_ == 1) {
698  if (hasPIX1 && pxlLayerMinCutbool && layerMinCutbool &&
701  min3DHit_ &&
702  ptErrorbool && fabs(trk.pt()) >= ptMin_ && trk.eta() >= minRapidity_ &&
703  trk.eta() <= maxRapidity_ &&
704  fabs(trk.dxy(bs->position()) / trk.dxyError()) < tip_ &&
705  fabs(trk.dz(bs->position()) / trk.dzError()) < lip_ &&
706  trk.normalizedChi2() <= maxChi2_ && quality_ok && algo_ok) {
707  goodTrk = true;
708  }
709  }
710 
711  if (bsuse_ == 0) {
712  if (hasPIX1 && pxlLayerMinCutbool && layerMinCutbool &&
715  min3DHit_ &&
716  ptErrorbool && fabs(trk.pt()) >= ptMin_ && trk.eta() >= minRapidity_ &&
717  trk.eta() <= maxRapidity_ &&
718  fabs(trk.dxy(vtx.position()) / trk.dxyError()) < tip_ &&
719  fabs(trk.dz(vtx.position()) / trk.dzError()) < lip_ &&
720  trk.normalizedChi2() <= maxChi2_ && quality_ok && algo_ok) {
721  goodTrk = true;
722  }
723  }
724 
725  return goodTrk;
726 }
727 
728 //--------------------------------------------------------------------------------------------------
730  const edm::Handle<reco::VertexCollection> vtxColl) {
731  const reco::VertexCollection theVertices = *(vtxColl.product());
732  bool goodVtx = false;
733  fill1D(hNvertices_, theVertices.size());
734  for (reco::VertexCollection::const_iterator vertexIt = theVertices.begin();
735  vertexIt != theVertices.end(); ++vertexIt) {
736  fill1D(hVertex_z_, vertexIt->z());
737  fill1D(hVertex_y_, vertexIt->y());
738  fill1D(hVertex_x_, vertexIt->x());
739  fill1D(hVertex_ndof_, vertexIt->ndof());
740  fill1D(hVertex_rho_, vertexIt->position().rho());
741  fill1D(hVertex_z_bs_, (vertexIt->z() - bs->z0()));
742 
743  if (fabs(vertexIt->z() - bs->z0()) < diffvtxbs_ && vertexIt->ndof() >= 4 &&
744  vertexIt->position().rho() <= 2.0) {
745  goodVtx = true;
746  vtx1 = (*vertexIt);
747 
748  break;
749  }
750  } // Loop over vertcies
751  return goodVtx;
752 }
753 //--------------------------------------------------------------------------------------------------
754 void QcdUeDQM::fillpTMaxRelated(const std::vector<const reco::Track *> &track) {
755  fill1D(hNgoodTrk_, track.size());
756  if (!track.empty()) {
757  fill1D(hLeadingTrack_pTSpectrum_, track[0]->pt());
758  fill1D(hLeadingTrack_phiSpectrum_, track[0]->phi());
759  fill1D(hLeadingTrack_etaSpectrum_, track[0]->eta());
760  }
761  for (size_t i = 0; i < track.size(); i++) {
762  fill1D(hGoodTrkPt500_, track[i]->pt());
763  fill1D(hGoodTrkEta500_, track[i]->eta());
764  fill1D(hGoodTrkPhi500_, track[i]->phi());
765  if (track[i]->pt() > 0.9) {
766  fill1D(hGoodTrkPt900_, track[i]->pt());
767  fill1D(hGoodTrkEta900_, track[i]->eta());
768  fill1D(hGoodTrkPhi900_, track[i]->phi());
769  }
770  }
771 }
772 
774  const edm::Handle<reco::TrackJetCollection> trackJets) {
775  fill1D(hChargedJetMulti_, trackJets->size());
776  for (reco::TrackJetCollection::const_iterator f = trackJets->begin();
777  f != trackJets->end(); f++) {
778  if (f != trackJets->begin()) continue;
782  }
783 }
784 
785 /*
786 void QcdUeDQM::fillCaloJetSpectra(const edm::Handle<reco::CaloJetCollection>
787 caloJets)
788 {
789  fill1D(hCaloJetMulti_,caloJets->size());
790  for( reco::CaloJetCollection::const_iterator f = caloJets->begin(); f !=
791 caloJets->end(); f++)
792  {
793  if(f != caloJets->begin())continue;
794  fill1D(hLeadingCaloJet_pTSpectrum_,f->pt());
795  fill1D(hLeadingCaloJet_etaSpectrum_,f->eta());
796  fill1D(hLeadingCaloJet_phiSpectrum_,f->phi());
797  }
798 
799 }
800 
801 
802 */
803 
804 /*
805  weight for transverse/toward/away region = 0.12
806 
807 
808 */
809 
811  const std::vector<const reco::Track *> &track) {
812  double w = 0.119;
813  // double w = 1.;
814  double nTrk500_TransReg = 0;
815  double nTrk500_AwayReg = 0;
816  double nTrk500_TowardReg = 0;
817 
818  double pTSum500_TransReg = 0;
819  double pTSum500_AwayReg = 0;
820  double pTSum500_TowardReg = 0;
821 
822  double nTrk900_TransReg = 0;
823  double nTrk900_AwayReg = 0;
824  double nTrk900_TowardReg = 0;
825 
826  double pTSum900_TransReg = 0;
827  double pTSum900_AwayReg = 0;
828  double pTSum900_TowardReg = 0;
829  if (!track.empty()) {
830  if (track[0]->pt() > 1.) {
831  for (size_t i = 1; i < track.size(); i++) {
832  double dphi =
833  (180. / PI) * (deltaPhi(track[0]->phi(), track[i]->phi()));
835  if (fabs(dphi) > 60. && fabs(dphi) < 120.) {
836  pTSum500_TransReg = pTSum500_TransReg + track[i]->pt();
837  nTrk500_TransReg++;
838  if (track[i]->pt() > 0.9) {
839  pTSum900_TransReg = pTSum900_TransReg + track[i]->pt();
840  nTrk900_TransReg++;
841  }
842  }
843 
844  if (fabs(dphi) > 120. && fabs(dphi) < 180.) {
845  pTSum500_AwayReg = pTSum500_AwayReg + track[i]->pt();
846  nTrk500_AwayReg++;
847  if (track[i]->pt() > 0.9) {
848  pTSum900_AwayReg = pTSum900_AwayReg + track[i]->pt();
849  nTrk900_AwayReg++;
850  }
851  }
852 
853  if (fabs(dphi) < 60.) {
854  pTSum500_TowardReg = pTSum500_TowardReg + track[i]->pt();
855  nTrk500_TowardReg++;
856  if (track[i]->pt() > 0.9) {
857  pTSum900_TowardReg = pTSum900_TowardReg + track[i]->pt();
858  nTrk900_TowardReg++;
859  }
860  }
861  } // track loop
862  } // leading track
863  // non empty collection
864  fillProfile(hdNdEtadPhi_pTMax_Toward500_, track[0]->pt(), nTrk500_TowardReg,
865  w);
867  nTrk500_TransReg, w);
868  fillProfile(hdNdEtadPhi_pTMax_Away500_, track[0]->pt(), nTrk500_AwayReg, w);
869 
871  pTSum500_TowardReg, w);
873  pTSum500_TransReg, w);
874  fillProfile(hpTSumdEtadPhi_pTMax_Away500_, track[0]->pt(), pTSum500_AwayReg,
875  w);
876 
877  fillProfile(hdNdEtadPhi_pTMax_Toward900_, track[0]->pt(), nTrk900_TowardReg,
878  w);
880  nTrk900_TransReg, w);
881  fillProfile(hdNdEtadPhi_pTMax_Away900_, track[0]->pt(), nTrk900_AwayReg, w);
882 
884  pTSum900_TowardReg, w);
886  pTSum900_TransReg, w);
887  fillProfile(hpTSumdEtadPhi_pTMax_Away900_, track[0]->pt(), pTSum900_AwayReg,
888  w);
889  }
890 }
891 
893  const std::vector<const reco::Track *> &track,
894  const edm::Handle<reco::TrackJetCollection> &trackJets) {
895  double w = 0.119;
896  double nTrk500_TransReg = 0;
897  double nTrk500_AwayReg = 0;
898  double nTrk500_TowardReg = 0;
899 
900  double pTSum500_TransReg = 0;
901  double pTSum500_AwayReg = 0;
902  double pTSum500_TowardReg = 0;
903 
904  double nTrk900_TransReg = 0;
905  double nTrk900_AwayReg = 0;
906  double nTrk900_TowardReg = 0;
907 
908  double pTSum900_TransReg = 0;
909  double pTSum900_AwayReg = 0;
910  double pTSum900_TowardReg = 0;
911 
912  if (!(trackJets->empty()) && (trackJets->begin())->pt() > 1.) {
913  double jetPhi = (trackJets->begin())->phi();
914  for (size_t i = 0; i < track.size(); i++) {
915  double dphi = (180. / PI) * (deltaPhi(jetPhi, track[i]->phi()));
917  if (fabs(dphi) > 60. && fabs(dphi) < 120.) {
918  pTSum500_TransReg = pTSum500_TransReg + track[i]->pt();
919  nTrk500_TransReg++;
920  if (track[i]->pt() > 0.9) {
921  pTSum900_TransReg = pTSum900_TransReg + track[i]->pt();
922  nTrk900_TransReg++;
923  }
924  }
925 
926  if (fabs(dphi) > 120. && fabs(dphi) < 180.) {
927  pTSum500_AwayReg = pTSum500_AwayReg + track[i]->pt();
928  nTrk500_AwayReg++;
929  if (track[i]->pt() > 0.9) {
930  pTSum900_AwayReg = pTSum900_AwayReg + track[i]->pt();
931  nTrk900_AwayReg++;
932  }
933  }
934  if (fabs(dphi) < 60.) {
935  pTSum500_TowardReg = pTSum500_TowardReg + track[i]->pt();
936  nTrk500_TowardReg++;
937  if (track[i]->pt() > 0.9) {
938  pTSum900_TowardReg = pTSum900_TowardReg + track[i]->pt();
939  nTrk900_TowardReg++;
940  }
941  }
942  } // tracks loop
943 
944  } // leading track jet
945 
946  fillProfile(hdNdEtadPhi_trackJet_Toward500_, (trackJets->begin())->pt(),
947  nTrk500_TowardReg, w);
948  fillProfile(hdNdEtadPhi_trackJet_Transverse500_, (trackJets->begin())->pt(),
949  nTrk500_TransReg, w);
950  fillProfile(hdNdEtadPhi_trackJet_Away500_, (trackJets->begin())->pt(),
951  nTrk500_AwayReg, w);
952 
953  fillProfile(hpTSumdEtadPhi_trackJet_Toward500_, (trackJets->begin())->pt(),
954  pTSum500_TowardReg, w);
956  (trackJets->begin())->pt(), pTSum500_TransReg, w);
957  fillProfile(hpTSumdEtadPhi_trackJet_Away500_, (trackJets->begin())->pt(),
958  pTSum500_AwayReg, w);
959 
960  fillProfile(hdNdEtadPhi_trackJet_Toward900_, (trackJets->begin())->pt(),
961  nTrk900_TowardReg, w);
962  fillProfile(hdNdEtadPhi_trackJet_Transverse900_, (trackJets->begin())->pt(),
963  nTrk900_TransReg, w);
964  fillProfile(hdNdEtadPhi_trackJet_Away900_, (trackJets->begin())->pt(),
965  nTrk900_AwayReg, w);
966 
967  fillProfile(hpTSumdEtadPhi_trackJet_Toward900_, (trackJets->begin())->pt(),
968  pTSum900_TowardReg, w);
970  (trackJets->begin())->pt(), pTSum900_TransReg, w);
971  fillProfile(hpTSumdEtadPhi_trackJet_Away900_, (trackJets->begin())->pt(),
972  pTSum900_AwayReg, w);
973 }
974 
975 /*
976 void QcdUeDQM:: fillUE_with_CaloJets(const std::vector<const reco::Track *>
977 &track, const edm::Handle<reco::CaloJetCollection> &caloJets)
978 {
979 double w = 0.119;
980 double nTrk500_TransReg = 0;
981 double nTrk500_AwayReg = 0;
982 double nTrk500_TowardReg = 0;
983 
984 double pTSum500_TransReg = 0;
985 double pTSum500_AwayReg = 0;
986 double pTSum500_TowardReg = 0;
987 
988 double nTrk900_TransReg = 0;
989 double nTrk900_AwayReg = 0;
990 double nTrk900_TowardReg = 0;
991 
992 double pTSum900_TransReg = 0;
993 double pTSum900_AwayReg = 0;
994 double pTSum900_TowardReg = 0;
995  if(!(caloJets->empty()) && (caloJets->begin())->pt() > 1.)
996  {
997  double jetPhi = (caloJets->begin())->phi();
998  for(size_t i = 0; i < track.size();i++)
999  {
1000  double dphi =
1001 (180./PI)*(deltaPhi(jetPhi,track[i]->phi()));
1002  fill1D(hdPhi_caloJet_tracks_,dphi);
1003  if(fabs(dphi)>60. && fabs(dphi)<120.)
1004  {
1005  pTSum500_TransReg = pTSum500_TransReg +
1006 track[i]->pt();
1007  nTrk500_TransReg++;
1008  if(track[i]->pt() > 0.9)
1009  {
1010  pTSum900_TransReg = pTSum900_TransReg +
1011 track[i]->pt();
1012  nTrk900_TransReg++;
1013  }
1014  }
1015  if(fabs(dphi)>120. && fabs(dphi)<180.)
1016  {
1017  pTSum500_AwayReg = pTSum500_AwayReg +
1018 track[i]->pt();
1019  nTrk500_AwayReg++;
1020  if(track[i]->pt() > 0.9)
1021  {
1022  pTSum900_AwayReg = pTSum900_AwayReg +
1023 track[i]->pt();
1024  nTrk900_AwayReg++;
1025  }
1026  }
1027  if(fabs(dphi)<60.)
1028  {
1029  pTSum500_TowardReg = pTSum500_TowardReg +
1030 track[i]->pt();
1031  nTrk500_TowardReg++;
1032  if(track[i]->pt() > 0.9)
1033  {
1034  pTSum900_TowardReg = pTSum900_TowardReg +
1035 track[i]->pt();
1036  nTrk900_TowardReg++;
1037  }
1038  }
1039  }// tracks loop
1040 
1041  }// leading calo jet
1042  fillProfile(hdNdEtadPhi_caloJet_Toward500_,
1043 (caloJets->begin())->pt(),nTrk500_TowardReg,w);
1044  fillProfile(hdNdEtadPhi_caloJet_Transverse500_,
1045 (caloJets->begin())->pt(),nTrk500_TransReg,w);
1046  fillProfile(hdNdEtadPhi_caloJet_Away500_,
1047 (caloJets->begin())->pt(),nTrk500_AwayReg,w);
1048 
1049  fillProfile(hpTSumdEtadPhi_caloJet_Toward500_,
1050 (caloJets->begin())->pt(),pTSum500_TowardReg,w);
1051  fillProfile(hpTSumdEtadPhi_caloJet_Transverse500_,
1052 (caloJets->begin())->pt(),pTSum500_TransReg,w);
1053  fillProfile(hpTSumdEtadPhi_caloJet_Away500_,
1054 (caloJets->begin())->pt(),pTSum500_AwayReg,w);
1055 
1056  fillProfile(hdNdEtadPhi_caloJet_Toward900_,
1057 (caloJets->begin())->pt(),nTrk900_TowardReg,w);
1058  fillProfile(hdNdEtadPhi_caloJet_Transverse900_,
1059 (caloJets->begin())->pt(),nTrk900_TransReg,w);
1060  fillProfile(hdNdEtadPhi_caloJet_Away900_,
1061 (caloJets->begin())->pt(),nTrk900_AwayReg,w);
1062 
1063  fillProfile(hpTSumdEtadPhi_caloJet_Toward900_,
1064 (caloJets->begin())->pt(),pTSum900_TowardReg,w);
1065  fillProfile(hpTSumdEtadPhi_caloJet_Transverse900_,
1066 (caloJets->begin())->pt(),pTSum900_TransReg,w);
1067  fillProfile(hpTSumdEtadPhi_caloJet_Away900_,
1068 (caloJets->begin())->pt(),pTSum900_AwayReg,w);
1069 
1070 
1071 }
1072 
1073 */
1074 void QcdUeDQM::fillHltBits(const Event &iEvent, const EventSetup &iSetup) {
1075  // Fill HLT trigger bits.
1076 
1077  Handle<TriggerResults> triggerResultsHLT;
1078  getProduct(hltUsedResName_, triggerResultsHLT, iEvent);
1079 
1080  /* const unsigned int ntrigs(triggerResultsHLT.product()->size());
1081  if( ntrigs != 0 ) {
1082  const edm::TriggerNames & triggerNames =
1083  iEvent.triggerNames(*triggerResultsHLT);
1084  for (unsigned int j=0; j!=ntrigs; j++) {
1085  // if(triggerResultsHLT->accept(j)){
1086  // unsigned int hlt_prescale = hltConfig_.prescaleValue(iEvent, iSetup,
1087  triggerName);
1088  cout<<"trigger fired"<<triggerNames.triggerName(j)<<endl;
1089  for(unsigned int itrigName = 0; itrigName < hltTrgNames_.size();
1090  itrigName++ ) {
1091  unsigned int hlt_prescale = hltConfig.prescaleValue(iEvent, iSetup,
1092  hltTrgNames_[itrigName]);
1093 
1094  if(triggerNames.triggerIndex(hltTrgNames_[itrigName]) >= (unsigned
1095  int)ntrigs ) continue;
1096  // if(
1097  triggerResultsHLT->accept(triggerNames.triggerIndex(hltTrgNames_[itrigName]))
1098  )cout<<hltTrgNames_[itrigName]<<endl;
1099 
1100  }
1101  }
1102  }
1103  // }
1104  */
1105  for (size_t i = 0; i < hltTrgBits_.size(); ++i) {
1106  if (hltTrgBits_.at(i) < 0) continue; // ignore unknown trigger
1107  size_t tbit = hltTrgBits_.at(i);
1108  if (tbit < triggerResultsHLT->size()) {
1109  hltTrgDeci_[i] = triggerResultsHLT->accept(tbit);
1110  }
1111  }
1112  // fill correlation histogram
1113  for (size_t i = 0; i < hltTrgBits_.size(); ++i) {
1114  if (hltTrgDeci_.at(i)) h2TrigCorr_->Fill(i, i);
1115  for (size_t j = i + 1; j < hltTrgBits_.size(); ++j) {
1116  if (hltTrgDeci_.at(i) && hltTrgDeci_.at(j)) h2TrigCorr_->Fill(i, j);
1117  if (hltTrgDeci_.at(i) && !hltTrgDeci_.at(j)) h2TrigCorr_->Fill(j, i);
1118  }
1119  }
1120 }
unsigned int size() const
number of trigger paths in trigger table
bool bsuse_
Definition: QcdUeDQM.h:392
size
Write out results.
std::vector< MonitorElement * > hdNdEtadPhi_trackJet_Toward900_
Definition: QcdUeDQM.h:313
T getParameter(std::string const &) const
double z0() const
z coordinate
Definition: BeamSpot.h:68
T getUntrackedParameter(std::string const &, T const &) const
static uint32_t getLayer(uint16_t pattern)
Definition: HitPattern.h:701
void getProduct(const std::string name, edm::Handle< TYPE > &prod, const edm::Event &event) const
Definition: QcdUeDQM.h:409
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:565
std::vector< MonitorElement * > hpTSumdEtadPhi_trackJet_Transverse900_
Definition: QcdUeDQM.h:367
void fillHltBits(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: QcdUeDQM.cc:1074
const std::string & triggerName(unsigned int triggerIndex) const
const double w
Definition: UKUtility.cc:23
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void fill1D(std::vector< TH1F * > &hs, double val, double w=1.)
Definition: QcdUeDQM.cc:540
bool trackSelection(const reco::Track &trk, const reco::BeamSpot *bs, const reco::Vertex &vtx, int sizevtx)
Definition: QcdUeDQM.cc:616
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:561
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
std::vector< MonitorElement * > hTrkNdof_
Definition: QcdUeDQM.h:141
std::vector< MonitorElement * > hGoodTrkPhi500_
Definition: QcdUeDQM.h:132
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< MonitorElement * > hdNdEtadPhi_pTMax_Transverse500_
Definition: QcdUeDQM.h:205
std::vector< MonitorElement * > hpTSumdEtadPhi_pTMax_Away900_
Definition: QcdUeDQM.h:342
std::vector< MonitorElement * > hLeadingChargedJet_phiSpectrum_
Definition: QcdUeDQM.h:194
double dxyError() const
error on dxy
Definition: TrackBase.h:796
std::vector< MonitorElement * > hTrkChi2_
Definition: QcdUeDQM.h:140
std::vector< MonitorElement * > hVertex_z_bs_
Definition: QcdUeDQM.h:149
std::vector< MonitorElement * > hGoodTrkEta900_
Definition: QcdUeDQM.h:134
std::vector< MonitorElement * > hGoodTrkPt900_
Definition: QcdUeDQM.h:133
std::string hltUsedResName_
Definition: QcdUeDQM.h:114
bool accept() const
Has at least one path accepted the event?
std::vector< MonitorElement * > hpTSumdEtadPhi_trackJet_Away500_
Definition: QcdUeDQM.h:280
std::vector< MonitorElement * > hpTSumdEtadPhi_trackJet_Away900_
Definition: QcdUeDQM.h:370
TH1 * getTH1() const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
bool exists(std::string const &parameterName) const
checks if a parameter exists
void bookProfile(DQMStore::IBooker &, std::vector< MonitorElement * > &mes, const std::string &name, const std::string &title, int nx, double x1, double x2, double y1, double y2, bool sumw2=true, bool sbox=true)
Definition: QcdUeDQM.cc:522
std::vector< std::string > hltTrgUsedNames_
Definition: QcdUeDQM.h:113
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
std::vector< MonitorElement * > hTrkEta_
Definition: QcdUeDQM.h:127
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< MonitorElement * > hdNdEtadPhi_trackJet_Away500_
Definition: QcdUeDQM.h:234
edm::EDGetTokenT< reco::TrackCollection > trackLabel_
Definition: QcdUeDQM.h:397
std::vector< MonitorElement * > hpTSumdEtadPhi_pTMax_Transverse500_
Definition: QcdUeDQM.h:249
bool fillVtxPlots(const reco::BeamSpot *bs, const edm::Handle< reco::VertexCollection > vtxColl)
Definition: QcdUeDQM.cc:729
edm::EDGetTokenT< reco::CaloJetCollection > caloJetLabel_
Definition: QcdUeDQM.h:395
void fillProfile(std::vector< TProfile * > &hs, double valx, double valy, double w=1.)
Definition: QcdUeDQM.cc:593
void fillUE_with_ChargedJets(const std::vector< const reco::Track * > &track, const edm::Handle< reco::TrackJetCollection > &trackJets)
Definition: QcdUeDQM.cc:892
double ptErr_pt_
Definition: QcdUeDQM.h:385
std::vector< MonitorElement * > hLeadingChargedJet_etaSpectrum_
Definition: QcdUeDQM.h:190
std::vector< MonitorElement * > hdNdEtadPhi_pTMax_Away900_
Definition: QcdUeDQM.h:302
void setLabel1D(std::vector< MonitorElement * > &mes)
Definition: QcdUeDQM.cc:561
std::vector< MonitorElement * > hLeadingTrack_etaSpectrum_
Definition: QcdUeDQM.h:157
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:501
#define nullptr
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
void operator()(TH3F *&h)
Definition: QcdUeDQM.cc:47
bool requirePIX1_
Definition: QcdUeDQM.h:389
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:520
const Point & position() const
position
Definition: Vertex.h:109
std::vector< MonitorElement * > hLeadingChargedJet_pTSpectrum_
Definition: QcdUeDQM.h:166
std::vector< MonitorElement * > hGoodTrkPhi900_
Definition: QcdUeDQM.h:135
bool isHltConfigSuccessful_
Definition: QcdUeDQM.h:64
void fillUE_with_MaxpTtrack(const std::vector< const reco::Track * > &track)
Definition: QcdUeDQM.cc:810
std::vector< std::string > hltTrgNames_
Definition: QcdUeDQM.h:109
edm::EDGetTokenT< reco::TrackJetCollection > chargedJetLabel_
Definition: QcdUeDQM.h:396
std::vector< MonitorElement * > hpTSumdEtadPhi_trackJet_Toward500_
Definition: QcdUeDQM.h:265
void Fill(long long x)
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:788
TrackAlgorithm algo() const
Definition: TrackBase.h:497
std::vector< MonitorElement * > hVertex_ndof_
Definition: QcdUeDQM.h:147
std::vector< MonitorElement * > hVertex_rho_
Definition: QcdUeDQM.h:148
int iEvent
Definition: GenABIO.cc:230
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:343
std::vector< MonitorElement * > hNtrackerLayer_
Definition: QcdUeDQM.h:122
std::vector< MonitorElement * > hRatioDzSigmaDzBS_
Definition: QcdUeDQM.h:138
std::vector< std::string > hltProcNames_
Definition: QcdUeDQM.h:108
std::string hltResName_
Definition: QcdUeDQM.h:107
MonitorElement * h2TrigCorr_
Definition: QcdUeDQM.h:119
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:555
std::vector< MonitorElement * > hVertex_y_
Definition: QcdUeDQM.h:145
double pt() const
track transverse momentum
Definition: TrackBase.h:621
std::vector< MonitorElement * > hpTSumdEtadPhi_pTMax_Toward500_
Definition: QcdUeDQM.h:241
double maxChi2_
Definition: QcdUeDQM.h:391
std::vector< int > hltTrgBits_
Definition: QcdUeDQM.h:111
std::vector< MonitorElement * > hpTSumdEtadPhi_trackJet_Toward900_
Definition: QcdUeDQM.h:355
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:763
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:808
HLTConfigProvider hltConfig
Definition: QcdUeDQM.h:105
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::vector< MonitorElement * > hdNdEtadPhi_trackJet_Away900_
Definition: QcdUeDQM.h:324
double lip_
Definition: QcdUeDQM.h:383
double f[11][100]
reco::Vertex vtx1
Definition: QcdUeDQM.h:404
std::vector< MonitorElement * > hVertex_x_
Definition: QcdUeDQM.h:146
std::vector< MonitorElement * > hLeadingTrack_phiSpectrum_
Definition: QcdUeDQM.h:159
std::vector< MonitorElement * > hChargedJetMulti_
Definition: QcdUeDQM.h:162
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
Definition: QcdUeDQM.h:401
std::vector< MonitorElement * > hpTSumdEtadPhi_pTMax_Toward900_
Definition: QcdUeDQM.h:331
#define PI
Definition: QcdUeDQM.h:36
std::vector< MonitorElement * > hdNdEtadPhi_trackJet_Transverse900_
Definition: QcdUeDQM.h:321
std::vector< MonitorElement * > hdNdEtadPhi_pTMax_Transverse900_
Definition: QcdUeDQM.h:295
std::vector< MonitorElement * > hGoodTrkPt500_
Definition: QcdUeDQM.h:130
std::vector< MonitorElement * > hdNdEtadPhi_pTMax_Toward500_
Definition: QcdUeDQM.h:199
std::vector< MonitorElement * > hTrkPhi_
Definition: QcdUeDQM.h:128
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:609
double dzError() const
error on dz
Definition: TrackBase.h:814
std::vector< MonitorElement * > hdNdEtadPhi_pTMax_Toward900_
Definition: QcdUeDQM.h:289
std::vector< MonitorElement * > hdPhi_maxpTTrack_tracks_
Definition: QcdUeDQM.h:181
edm::EDGetTokenT< reco::BeamSpot > bsLabel_
Definition: QcdUeDQM.h:399
std::vector< MonitorElement * > hdNdEtadPhi_trackJet_Toward500_
Definition: QcdUeDQM.h:223
edm::EDGetTokenT< reco::VertexCollection > vtxLabel_
Definition: QcdUeDQM.h:398
std::vector< MonitorElement * > hNvertices_
Definition: QcdUeDQM.h:143
std::vector< MonitorElement * > hdNdEtadPhi_pTMax_Away500_
Definition: QcdUeDQM.h:212
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
std::vector< MonitorElement * > hpTSumdEtadPhi_trackJet_Transverse500_
Definition: QcdUeDQM.h:277
bool allowTriplets_
Definition: QcdUeDQM.h:393
std::vector< MonitorElement * > hNgoodTrk_
Definition: QcdUeDQM.h:129
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
double ptMin_
Definition: QcdUeDQM.h:379
T const * product() const
Definition: Handle.h:81
std::vector< MonitorElement * > hpTSumdEtadPhi_pTMax_Away500_
Definition: QcdUeDQM.h:252
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< MonitorElement * > hBeamSpot_y_
Definition: QcdUeDQM.h:152
double diffvtxbs_
Definition: QcdUeDQM.h:384
double minRapidity_
Definition: QcdUeDQM.h:380
std::vector< MonitorElement * > hLeadingTrack_pTSpectrum_
Definition: QcdUeDQM.h:155
int min3DHit_
Definition: QcdUeDQM.h:390
std::vector< MonitorElement * > hRatioDxySigmaDxyBS_
Definition: QcdUeDQM.h:136
container selected_
Definition: QcdUeDQM.h:403
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:510
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: QcdUeDQM.cc:171
std::vector< MonitorElement * > hRatioDxySigmaDxyPV_
Definition: QcdUeDQM.h:137
std::vector< MonitorElement * > hdPhi_chargedJet_tracks_
Definition: QcdUeDQM.h:186
std::vector< MonitorElement * > hNtrackerStripPixelLayer_
Definition: QcdUeDQM.h:124
double pxlLayerMinCut_
Definition: QcdUeDQM.h:388
std::vector< MonitorElement * > hNevts_
Definition: QcdUeDQM.h:121
std::vector< TrackJet > TrackJetCollection
collection of TrackJet objects
fixed size matrix
HLT enums.
QcdUeDQM(const edm::ParameterSet &parameters)
Definition: QcdUeDQM.cc:53
~QcdUeDQM() override
Definition: QcdUeDQM.cc:111
std::vector< MonitorElement * > hBeamSpot_x_
Definition: QcdUeDQM.h:153
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
double y0() const
y coordinate
Definition: BeamSpot.h:66
void book1D(DQMStore::IBooker &, std::vector< MonitorElement * > &mes, const std::string &name, const std::string &title, int nx, double x1, double x2, bool sumw2=true, bool sbox=true)
Definition: QcdUeDQM.cc:498
const Point & position() const
position
Definition: BeamSpot.h:62
std::vector< MonitorElement * > hTrkPt_
Definition: QcdUeDQM.h:126
std::vector< MonitorElement * > hGoodTrkEta500_
Definition: QcdUeDQM.h:131
void fillChargedJetSpectra(const edm::Handle< reco::TrackJetCollection > trackJets)
Definition: QcdUeDQM.cc:773
std::vector< reco::TrackBase::TrackQuality > quality_
Definition: QcdUeDQM.h:400
std::vector< MonitorElement * > hdNdEtadPhi_trackJet_Transverse500_
Definition: QcdUeDQM.h:231
void fillpTMaxRelated(const std::vector< const reco::Track * > &track)
Definition: QcdUeDQM.cc:754
double maxRapidity_
Definition: QcdUeDQM.h:381
void fill2D(std::vector< TH2F * > &hs, double valx, double valy, double w=1.)
Definition: QcdUeDQM.cc:572
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:516
std::vector< MonitorElement * > hVertex_z_
Definition: QcdUeDQM.h:144
std::vector< MonitorElement * > hRatioDzSigmaDzPV_
Definition: QcdUeDQM.h:139
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
#define CP(level)
Definition: QcdUeDQM.cc:44
int minHit_
Definition: QcdUeDQM.h:387
std::vector< MonitorElement * > hRatioPtErrorPt_
Definition: QcdUeDQM.h:125
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: QcdUeDQM.cc:444
std::vector< MonitorElement * > hNtrackerPixelLayer_
Definition: QcdUeDQM.h:123
std::vector< MonitorElement * > hBeamSpot_z_
Definition: QcdUeDQM.h:151
Definition: Run.h:44
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Definition: QcdUeDQM.cc:115
double tip_
Definition: QcdUeDQM.h:382
std::vector< MonitorElement * > hpTSumdEtadPhi_pTMax_Transverse900_
Definition: QcdUeDQM.h:339
double x0() const
x coordinate
Definition: BeamSpot.h:64
std::vector< bool > hltTrgDeci_
Definition: QcdUeDQM.h:112