CMS 3D CMS Logo

TrackToTrackComparisonHists.cc
Go to the documentation of this file.
3 
5 
10 
13 
14 //
15 // constructors and destructor
16 //
18  : monitoredTrackInputTag_(iConfig.getParameter<edm::InputTag>("monitoredTrack")),
19  referenceTrackInputTag_(iConfig.getParameter<edm::InputTag>("referenceTrack")),
20  topDirName_(iConfig.getParameter<std::string>("topDirName")),
21  dRmin_(iConfig.getParameter<double>("dRmin")),
22  pTCutForPlateau_(iConfig.getParameter<double>("pTCutForPlateau")),
23  dxyCutForPlateau_(iConfig.getParameter<double>("dxyCutForPlateau")),
24  dzWRTPvCut_(iConfig.getParameter<double>("dzWRTPvCut")),
25  requireValidHLTPaths_(iConfig.getParameter<bool>("requireValidHLTPaths")),
26  genTriggerEventFlag_(new GenericTriggerEventFlag(
27  iConfig.getParameter<edm::ParameterSet>("genericTriggerEventPSet"), consumesCollector(), *this))
28 
29 {
30  initialize_parameter(iConfig);
31 
32  //now do what ever initialization is needed
33  monitoredTrackToken_ = consumes<reco::TrackCollection>(monitoredTrackInputTag_);
34  referenceTrackToken_ = consumes<reco::TrackCollection>(referenceTrackInputTag_);
35  monitoredBSToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("monitoredBeamSpot"));
36  referenceBSToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("referenceBeamSpot"));
37  monitoredPVToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("monitoredPrimaryVertices"));
38  referencePVToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("referencePrimaryVertices"));
39  lumiScalersToken_ = consumes<LumiScalersCollection>(iConfig.getParameter<edm::InputTag>("scalers"));
41  consumes<OnlineLuminosityRecord>(iConfig.getParameter<edm::InputTag>("onlineMetaDataDigis"));
42 
45 
48 
49  matchTracksMEs_.label = "matches";
50 }
51 
54  genTriggerEventFlag_.reset();
55 }
56 
58 
60  LogDebug("TrackToTrackComparisonHists")
61  << " requireValidHLTPaths_ " << requireValidHLTPaths_ << " hltPathsAreValid_ " << hltPathsAreValid_ << "\n";
62  // if valid HLT paths are required,
63  // analyze event only if paths are valid
65  return;
66  }
67 
68  LogDebug("TrackToTrackComparisonHists") << " genTriggerEventFlag_->on() " << genTriggerEventFlag_->on()
69  << " accept: " << genTriggerEventFlag_->accept(iEvent, iSetup) << "\n";
70  // Filter out events if Trigger Filtering is requested
71  if (genTriggerEventFlag_->on() && !genTriggerEventFlag_->accept(iEvent, iSetup)) {
72  return;
73  }
74 
75  //
76  // Get Lumi/LS Info
77  //
78 
79  unsigned int ls = iEvent.id().luminosityBlock();
80 
81  double onlinelumi = -1.f;
82  double PU = -1.f;
83 
84  auto const lumiScalersHandle = iEvent.getHandle(lumiScalersToken_);
85  auto const onlineMetaDataDigisHandle = iEvent.getHandle(onlineMetaDataDigisToken_);
86 
87  if (onlineMetaDataDigisHandle.isValid()) {
88  onlinelumi = onlineMetaDataDigisHandle->instLumi();
89  PU = onlineMetaDataDigisHandle->avgPileUp();
90  } else if (lumiScalersHandle.isValid() and not lumiScalersHandle->empty()) {
91  edm::LogError("TrackToTrackComparisonHists") << "onlineMetaDataDigisHandle not found, trying SCAL";
92  auto const scalit = lumiScalersHandle->begin();
93  onlinelumi = scalit->instantLumi();
94  PU = scalit->pileup();
95  } else {
96  edm::LogError("TrackToTrackComparisonHists") << "lumiScalersHandle not found or empty, skipping event";
97  return;
98  }
99 
100  //
101  // Get Reference Track Info
102  //
103  edm::Handle<reco::TrackCollection> referenceTracksHandle;
104  iEvent.getByToken(referenceTrackToken_, referenceTracksHandle);
105  if (!referenceTracksHandle.isValid()) {
106  edm::LogError("TrackToTrackComparisonHists") << "referenceTracksHandle not found, skipping event";
107  return;
108  }
109  reco::TrackCollection referenceTracks = *referenceTracksHandle;
110 
111  edm::Handle<reco::BeamSpot> referenceBSHandle;
112  iEvent.getByToken(referenceBSToken_, referenceBSHandle);
113  if (!referenceBSHandle.isValid()) {
114  edm::LogError("TrackToTrackComparisonHists") << "referenceBSHandle not found, skipping event";
115  return;
116  }
117  reco::BeamSpot referenceBS = *referenceBSHandle;
118 
119  edm::Handle<reco::VertexCollection> referencePVHandle;
120  iEvent.getByToken(referencePVToken_, referencePVHandle);
121  if (!referencePVHandle.isValid()) {
122  edm::LogError("TrackToTrackComparisonHists") << "referencePVHandle not found, skipping event";
123  return;
124  }
125  if (referencePVHandle->empty()) {
126  edm::LogInfo("TrackToTrackComparisonHists") << "referencePVHandle->size is 0 ";
127  return;
128  }
129  reco::Vertex referencePV = referencePVHandle->at(0);
130 
131  //
132  // Get Monitored Track Info
133  //
134  edm::Handle<reco::TrackCollection> monitoredTracksHandle;
135  iEvent.getByToken(monitoredTrackToken_, monitoredTracksHandle);
136  if (!monitoredTracksHandle.isValid()) {
137  edm::LogError("TrackToTrackComparisonHists") << "monitoredTracksHandle not found, skipping event";
138  return;
139  }
140  reco::TrackCollection monitoredTracks = *monitoredTracksHandle;
141 
142  edm::Handle<reco::BeamSpot> monitoredBSHandle;
143  iEvent.getByToken(monitoredBSToken_, monitoredBSHandle);
144  if (!monitoredTracksHandle.isValid()) {
145  edm::LogError("TrackToTrackComparisonHists") << "monitoredBSHandle not found, skipping event";
146  return;
147  }
148  reco::BeamSpot monitoredBS = *monitoredBSHandle;
149 
150  edm::Handle<reco::VertexCollection> monitoredPVHandle;
151  iEvent.getByToken(monitoredPVToken_, monitoredPVHandle);
152  if (!monitoredPVHandle.isValid()) {
153  edm::LogError("TrackToTrackComparisonHists") << "monitoredPVHandle not found, skipping event";
154  return;
155  }
156  if (monitoredPVHandle->empty()) {
157  edm::LogInfo("TrackToTrackComparisonHists") << "monitoredPVHandle->size is 0 ";
158  return;
159  }
160  reco::Vertex monitoredPV = monitoredPVHandle->at(0);
161 
162  edm::LogInfo("TrackToTrackComparisonHists")
163  << "analyzing " << monitoredTrackInputTag_.process() << ":" << monitoredTrackInputTag_.label() << ":"
164  << monitoredTrackInputTag_.instance() << " w.r.t. " << referenceTrackInputTag_.process() << ":"
166 
167  //
168  // Build the dR maps
169  //
170  idx2idxByDoubleColl monitored2referenceColl;
171  fillMap(monitoredTracks, referenceTracks, monitored2referenceColl, dRmin_);
172 
173  idx2idxByDoubleColl reference2monitoredColl;
174  fillMap(referenceTracks, monitoredTracks, reference2monitoredColl, dRmin_);
175 
176  unsigned int nReferenceTracks(0); // Counts the number of refernce tracks
177  unsigned int nMatchedReferenceTracks(0); // Counts the number of matched refernce tracks
178  unsigned int nMonitoredTracks(0); // Counts the number of monitored tracks
179  unsigned int nUnmatchedMonitoredTracks(0); // Counts the number of unmatched monitored tracks
180 
181  //
182  // loop over reference tracks
183  //
184  LogDebug("TrackToTrackComparisonHists") << "\n# of tracks (reference): " << referenceTracks.size() << "\n";
185  for (idx2idxByDoubleColl::const_iterator pItr = reference2monitoredColl.begin(), eItr = reference2monitoredColl.end();
186  pItr != eItr;
187  ++pItr) {
188  nReferenceTracks++;
189  int trackIdx = pItr->first;
190  reco::Track track = referenceTracks.at(trackIdx);
191 
192  float dzWRTpv = track.dz(referencePV.position());
193  if (fabs(dzWRTpv) > dzWRTPvCut_)
194  continue;
195 
196  fill_generic_tracks_histos(*&referenceTracksMEs_, &track, &referenceBS, &referencePV, ls, onlinelumi, PU);
197 
198  std::map<double, int> trackDRmap = pItr->second;
199  if (trackDRmap.empty()) {
202  continue;
203  }
204 
205  double dRmin = trackDRmap.begin()->first;
208 
209  bool matched = false;
210  if (dRmin < dRmin_)
211  matched = true;
212 
213  if (matched) {
214  nMatchedReferenceTracks++;
215  fill_generic_tracks_histos(*&matchedReferenceTracksMEs_, &track, &referenceBS, &referencePV, ls, onlinelumi, PU);
218 
219  int matchedTrackIndex = trackDRmap[dRmin];
220  reco::Track matchedTrack = monitoredTracks.at(matchedTrackIndex);
221  fill_matching_tracks_histos(*&matchTracksMEs_, &track, &matchedTrack, &referenceBS, &referencePV);
222  }
223 
224  } // Over reference tracks
225 
226  //
227  // loop over monitoed tracks
228  //
229  LogDebug("TrackToTrackComparisonHists") << "\n# of tracks (monitored): " << monitoredTracks.size() << "\n";
230  for (idx2idxByDoubleColl::const_iterator pItr = monitored2referenceColl.begin(), eItr = monitored2referenceColl.end();
231  pItr != eItr;
232  ++pItr) {
233  nMonitoredTracks++;
234  int trackIdx = pItr->first;
235  reco::Track track = monitoredTracks.at(trackIdx);
236 
237  float dzWRTpv = track.dz(monitoredPV.position());
238  if (fabs(dzWRTpv) > dzWRTPvCut_)
239  continue;
240 
241  fill_generic_tracks_histos(*&monitoredTracksMEs_, &track, &monitoredBS, &monitoredPV, ls, onlinelumi, PU);
242 
243  std::map<double, int> trackDRmap = pItr->second;
244  if (trackDRmap.empty()) {
247  continue;
248  }
249 
250  double dRmin = trackDRmap.begin()->first;
253 
254  bool matched = false;
255  if (dRmin < dRmin_)
256  matched = true;
257 
258  if (!matched) {
259  nUnmatchedMonitoredTracks++;
261  *&unMatchedMonitoredTracksMEs_, &track, &monitoredBS, &monitoredPV, ls, onlinelumi, PU);
264  }
265 
266  } // over monitoed tracks
267 
268  edm::LogInfo("TrackToTrackComparisonHists")
269  << "Total reference tracks: " << nReferenceTracks << "\n"
270  << "Total matched reference tracks: " << nMatchedReferenceTracks << "\n"
271  << "Total monitored tracks: " << nMonitoredTracks << "\n"
272  << "Total unMatched monitored tracks: " << nUnmatchedMonitoredTracks << "\n";
273 }
274 
276  edm::Run const& iRun,
277  edm::EventSetup const& iSetup) {
279  genTriggerEventFlag_->initRun(iRun, iSetup);
280 
281  // check if every HLT path specified has a valid match in the HLT Menu
283  (genTriggerEventFlag_ && genTriggerEventFlag_->on() && genTriggerEventFlag_->allHLTPathsAreValid());
284 
285  // if valid HLT paths are required,
286  // create DQM outputs only if all paths are valid
288  return;
289  }
290 
292 
293  bookHistos(ibooker, referenceTracksMEs_, "ref", dir);
294  bookHistos(ibooker, matchedReferenceTracksMEs_, "ref_matched", dir);
295 
296  bookHistos(ibooker, monitoredTracksMEs_, "mon", dir);
297  bookHistos(ibooker, unMatchedMonitoredTracksMEs_, "mon_unMatched", dir);
298 
299  book_matching_tracks_histos(ibooker, matchTracksMEs_, "matches", dir);
300 }
301 
302 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
305 
306  desc.add<bool>("requireValidHLTPaths", true);
307 
308  desc.add<edm::InputTag>("monitoredTrack", edm::InputTag("hltMergedTracks"));
309  desc.add<edm::InputTag>("monitoredBeamSpot", edm::InputTag("hltOnlineBeamSpot"));
310  desc.add<edm::InputTag>("monitoredPrimaryVertices", edm::InputTag("hltVerticesPFSelector"));
311 
312  desc.add<edm::InputTag>("referenceTrack", edm::InputTag("generalTracks"));
313  desc.add<edm::InputTag>("referenceBeamSpot", edm::InputTag("offlineBeamSpot"));
314  desc.add<edm::InputTag>("referencePrimaryVertices", edm::InputTag("offlinePrimaryVertices"));
315  desc.add<edm::InputTag>("scalers", edm::InputTag("scalersRawToDigi"));
316  desc.add<edm::InputTag>("onlineMetaDataDigis", edm::InputTag("onlineMetaDataDigis"));
317 
318  desc.add<std::string>("topDirName", "HLT/Tracking/ValidationWRTOffline");
319  desc.add<double>("dRmin", 0.002);
320 
321  desc.add<double>("pTCutForPlateau", 0.9);
322  desc.add<double>("dxyCutForPlateau", 2.5);
323  desc.add<double>("dzWRTPvCut", 1e6);
324 
327  desc.add<edm::ParameterSetDescription>("genericTriggerEventPSet", genericTriggerEventPSet);
328 
331  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
332 
333  descriptions.add("trackToTrackComparisonHists", desc);
334 }
335 
337  reco::TrackCollection tracks2,
339  float dRMin) {
340  //
341  // loop on tracks1
342  //
343  int i = 0;
344  for (const auto& track1 : tracks1) {
345  std::map<double, int> tmp;
346  int j = 0;
347  float smallest_dR = 1e9;
348  int smallest_dR_j = -1;
349 
350  //
351  // loop on tracks2
352  //
353  for (const auto& track2 : tracks2) {
354  double dR = reco::deltaR(track1.eta(), track1.phi(), track2.eta(), track2.phi());
355 
356  if (dR < smallest_dR) {
357  smallest_dR = dR;
358  smallest_dR_j = j;
359  }
360 
361  if (dR < dRMin) {
362  tmp[dR] = j;
363  }
364 
365  j++;
366  }
367 
368  //
369  // If there are no tracks that pass the dR store the smallest (for debugging/validating matching)
370  //
371  if (tmp.empty())
372  tmp[smallest_dR] = smallest_dR_j;
373 
374  map.push_back(std::make_pair(i, tmp));
375  i++;
376  }
377 }
378 
380  generalME& mes,
381  TString label,
382  std::string& dir) {
383  book_generic_tracks_histos(ibooker, mes, label, dir);
384 }
385 
387  generalME& mes,
388  TString label,
389  std::string& dir) {
390  ibooker.cd();
391  ibooker.setCurrentFolder(dir);
392  (mes.h_pt) = ibooker.book1D(label + "_pt", "track p_{T}", Pt_nbin, Pt_rangeMin, Pt_rangeMax);
393  (mes.h_eta) = ibooker.book1D(label + "_eta", "track pseudorapidity", Eta_nbin, Eta_rangeMin, Eta_rangeMax);
394  (mes.h_phi) = ibooker.book1D(label + "_phi", "track #phi", Phi_nbin, Phi_rangeMin, Phi_rangeMax);
395  (mes.h_dxy) =
396  ibooker.book1D(label + "_dxy", "track transverse dca to beam spot", Dxy_nbin, Dxy_rangeMin, Dxy_rangeMax);
397  (mes.h_dz) = ibooker.book1D(label + "_dz", "track longitudinal dca to beam spot", Dz_nbin, Dz_rangeMin, Dz_rangeMax);
398  (mes.h_dxyWRTpv) = ibooker.book1D(
399  label + "_dxyWRTpv", "track transverse dca to primary vertex", Dxy_nbin, Dxy_rangeMin, Dxy_rangeMax);
400  (mes.h_dzWRTpv) = ibooker.book1D(
401  label + "_dzWRTpv", "track longitudinal dca to primary vertex", Dz_nbin, 0.1 * Dz_rangeMin, 0.1 * Dz_rangeMax);
402  (mes.h_charge) = ibooker.book1D(label + "_charge", "track charge", 5, -2, 2);
403  (mes.h_hits) = ibooker.book1D(label + "_hits", "track number of hits", 35, -0.5, 34.5);
404  (mes.h_dRmin) = ibooker.book1D(label + "_dRmin", "track min dR", 100, 0., 0.01);
405  (mes.h_dRmin_l) = ibooker.book1D(label + "_dRmin_l", "track min dR", 100, 0., 0.4);
406 
407  (mes.h_pt_vs_eta) = ibooker.book2D(label + "_ptVSeta",
408  "track p_{T} vs #eta",
409  Eta_nbin,
410  Eta_rangeMin,
411  Eta_rangeMax,
412  Pt_nbin,
413  Pt_rangeMin,
414  Pt_rangeMax);
415 
416  // counts of tracks vs lumi
417  // for this moment, xmin,xmax and binning are hardcoded, maybe in future in a config file!
418  // have to add (declare) this in the .h file as well
419  (mes.h_onlinelumi) = ibooker.book1D(label + "_onlinelumi",
420  "number of tracks vs onlinelumi",
424  (mes.h_ls) = ibooker.book1D(label + "_ls", "number of tracks vs ls", ls_nbin, ls_rangeMin, ls_rangeMax);
425  (mes.h_PU) = ibooker.book1D(label + "_PU", "number of tracks vs PU", PU_nbin, PU_rangeMin, PU_rangeMax);
426 }
427 
429  matchingME& mes,
430  TString label,
431  std::string& dir) {
432  ibooker.cd();
433  ibooker.setCurrentFolder(dir);
434 
435  (mes.h_hits_vs_hits) = ibooker.book2D(
436  label + "_hits_vs_hits", "monitored track # hits vs reference track # hits", 35, -0.5, 34.5, 35, -0.5, 34.5);
437  (mes.h_pt_vs_pt) = ibooker.book2D(label + "_pt_vs_pt",
438  "monitored track p_{T} vs reference track p_{T}",
439  Pt_nbin,
440  Pt_rangeMin,
441  Pt_rangeMax,
442  Pt_nbin,
443  Pt_rangeMin,
444  Pt_rangeMax);
445  (mes.h_eta_vs_eta) = ibooker.book2D(label + "_eta_vs_eta",
446  "monitored track #eta vs reference track #eta",
447  Eta_nbin,
448  Eta_rangeMin,
449  Eta_rangeMax,
450  Eta_nbin,
451  Eta_rangeMin,
452  Eta_rangeMax);
453  (mes.h_phi_vs_phi) = ibooker.book2D(label + "_phi_vs_phi",
454  "monitored track #phi vs reference track #phi",
455  Phi_nbin,
456  Phi_rangeMin,
457  Phi_rangeMax,
458  Phi_nbin,
459  Phi_rangeMin,
460  Phi_rangeMax);
461 
462  (mes.h_dPt) = ibooker.book1D(label + "_dPt", "#Delta track #P_T", ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax);
463  (mes.h_dEta) = ibooker.book1D(label + "_dEta", "#Delta track #eta", etaRes_nbin, etaRes_rangeMin, etaRes_rangeMax);
464  (mes.h_dPhi) = ibooker.book1D(label + "_dPhi", "#Delta track #phi", phiRes_nbin, phiRes_rangeMin, phiRes_rangeMax);
465  (mes.h_dDxy) = ibooker.book1D(
466  label + "_dDxy", "#Delta track transverse dca to beam spot", dxyRes_nbin, dxyRes_rangeMin, dxyRes_rangeMax);
467  (mes.h_dDz) = ibooker.book1D(
468  label + "_dDz", "#Delta track longitudinal dca to beam spot", dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax);
469  (mes.h_dDxyWRTpv) = ibooker.book1D(label + "_dDxyWRTpv",
470  "#Delta track transverse dca to primary vertex ",
471  dxyRes_nbin,
474  (mes.h_dDzWRTpv) = ibooker.book1D(label + "_dDzWRTpv",
475  "#Delta track longitudinal dca to primary vertex",
476  dzRes_nbin,
479  (mes.h_dCharge) = ibooker.book1D(label + "_dCharge", "#Delta track charge", 5, -2.5, 2.5);
480  (mes.h_dHits) = ibooker.book1D(label + "_dHits", "#Delta track number of hits", 39, -19.5, 19.5);
481 }
482 
484  reco::Track* trk,
486  reco::Vertex* pv,
487  unsigned int ls,
488  double onlinelumi,
489  double PU,
490  bool requirePlateau) {
491  float pt = trk->pt();
492  float eta = trk->eta();
493  float phi = trk->phi();
494  float dxy = trk->dxy(bs->position());
495  float dz = trk->dz(bs->position());
496  float dxyWRTpv = trk->dxy(pv->position());
497  float dzWRTpv = trk->dz(pv->position());
498  float charge = trk->charge();
499  float nhits = trk->hitPattern().numberOfValidHits();
500 
501  bool dxyOnPlateau = (fabs(dxyWRTpv) < dxyCutForPlateau_);
502  bool pTOnPlateau = (pt > pTCutForPlateau_);
503 
504  if (dxyOnPlateau || !requirePlateau) {
505  (mes.h_pt)->Fill(pt);
506  }
507 
508  if ((pTOnPlateau && dxyOnPlateau) || !requirePlateau) {
509  (mes.h_eta)->Fill(eta);
510  (mes.h_phi)->Fill(phi);
511  (mes.h_dz)->Fill(dz);
512  (mes.h_dzWRTpv)->Fill(dzWRTpv);
513  (mes.h_charge)->Fill(charge);
514  (mes.h_hits)->Fill(nhits);
515  (mes.h_onlinelumi)->Fill(onlinelumi);
516  (mes.h_ls)->Fill(ls);
517  (mes.h_PU)->Fill(PU);
518  }
519 
520  if (pTOnPlateau || !requirePlateau) {
521  (mes.h_dxy)->Fill(dxy);
522  (mes.h_dxyWRTpv)->Fill(dxyWRTpv);
523  }
524 
525  (mes.h_pt_vs_eta)->Fill(eta, pt);
526 }
527 
530  float mon_pt = mon->pt();
531  float mon_eta = mon->eta();
532  float mon_phi = mon->phi();
533  float mon_dxy = mon->dxy(bs->position());
534  float mon_dz = mon->dz(bs->position());
535  float mon_dxyWRTpv = mon->dxy(pv->position());
536  float mon_dzWRTpv = mon->dz(pv->position());
537  float mon_charge = mon->charge();
538  float mon_nhits = mon->hitPattern().numberOfValidHits();
539 
540  float ref_pt = ref->pt();
541  float ref_eta = ref->eta();
542  float ref_phi = ref->phi();
543  float ref_dxy = ref->dxy(bs->position());
544  float ref_dz = ref->dz(bs->position());
545  float ref_dxyWRTpv = ref->dxy(pv->position());
546  float ref_dzWRTpv = ref->dz(pv->position());
547  float ref_charge = ref->charge();
548  float ref_nhits = ref->hitPattern().numberOfValidHits();
549 
550  (mes.h_hits_vs_hits)->Fill(ref_nhits, mon_nhits);
551  (mes.h_pt_vs_pt)->Fill(ref_pt, mon_pt);
552  (mes.h_eta_vs_eta)->Fill(ref_eta, mon_eta);
553  (mes.h_phi_vs_phi)->Fill(ref_phi, mon_phi);
554 
555  (mes.h_dPt)->Fill(ref_pt - mon_pt);
556  (mes.h_dEta)->Fill(ref_eta - mon_eta);
557  (mes.h_dPhi)->Fill(ref_phi - mon_phi);
558  (mes.h_dDxy)->Fill(ref_dxy - mon_dxy);
559  (mes.h_dDz)->Fill(ref_dz - mon_dz);
560  (mes.h_dDxyWRTpv)->Fill(ref_dxyWRTpv - mon_dxyWRTpv);
561  (mes.h_dDzWRTpv)->Fill(ref_dzWRTpv - mon_dzWRTpv);
562  (mes.h_dCharge)->Fill(ref_charge - mon_charge);
563  (mes.h_dHits)->Fill(ref_nhits - mon_nhits);
564 }
565 
567  const edm::ParameterSet& pset = iConfig.getParameter<edm::ParameterSet>("histoPSet");
568 
569  Eta_rangeMin = pset.getParameter<double>("Eta_rangeMin");
570  Eta_rangeMax = pset.getParameter<double>("Eta_rangeMax");
571  Eta_nbin = pset.getParameter<unsigned int>("Eta_nbin");
572 
573  Pt_rangeMin = pset.getParameter<double>("Pt_rangeMin");
574  Pt_rangeMax = pset.getParameter<double>("Pt_rangeMax");
575  Pt_nbin = pset.getParameter<unsigned int>("Pt_nbin");
576 
577  Phi_rangeMin = pset.getParameter<double>("Phi_rangeMin");
578  Phi_rangeMax = pset.getParameter<double>("Phi_rangeMax");
579  Phi_nbin = pset.getParameter<unsigned int>("Phi_nbin");
580 
581  Dxy_rangeMin = pset.getParameter<double>("Dxy_rangeMin");
582  Dxy_rangeMax = pset.getParameter<double>("Dxy_rangeMax");
583  Dxy_nbin = pset.getParameter<unsigned int>("Dxy_nbin");
584 
585  Dz_rangeMin = pset.getParameter<double>("Dz_rangeMin");
586  Dz_rangeMax = pset.getParameter<double>("Dz_rangeMax");
587  Dz_nbin = pset.getParameter<unsigned int>("Dz_nbin");
588 
589  ptRes_rangeMin = pset.getParameter<double>("ptRes_rangeMin");
590  ptRes_rangeMax = pset.getParameter<double>("ptRes_rangeMax");
591  ptRes_nbin = pset.getParameter<unsigned int>("ptRes_nbin");
592 
593  phiRes_rangeMin = pset.getParameter<double>("phiRes_rangeMin");
594  phiRes_rangeMax = pset.getParameter<double>("phiRes_rangeMax");
595  phiRes_nbin = pset.getParameter<unsigned int>("phiRes_nbin");
596 
597  etaRes_rangeMin = pset.getParameter<double>("etaRes_rangeMin");
598  etaRes_rangeMax = pset.getParameter<double>("etaRes_rangeMax");
599  etaRes_nbin = pset.getParameter<unsigned int>("etaRes_nbin");
600 
601  dxyRes_rangeMin = pset.getParameter<double>("dxyRes_rangeMin");
602  dxyRes_rangeMax = pset.getParameter<double>("dxyRes_rangeMax");
603  dxyRes_nbin = pset.getParameter<unsigned int>("dxyRes_nbin");
604 
605  dzRes_rangeMin = pset.getParameter<double>("dzRes_rangeMin");
606  dzRes_rangeMax = pset.getParameter<double>("dzRes_rangeMax");
607  dzRes_nbin = pset.getParameter<unsigned int>("dzRes_nbin");
608 
609  ls_rangeMin = pset.getParameter<unsigned int>("ls_rangeMin");
610  ls_rangeMax = pset.getParameter<unsigned int>("ls_rangeMax");
611  ls_nbin = pset.getParameter<unsigned int>("ls_nbin");
612 
613  onlinelumi_rangeMin = pset.getParameter<double>("onlinelumi_rangeMin");
614  onlinelumi_rangeMax = pset.getParameter<double>("onlinelumi_rangeMax");
615  onlinelumi_nbin = pset.getParameter<unsigned int>("onlinelumi_nbin");
616 
617  PU_rangeMin = pset.getParameter<double>("PU_rangeMin");
618  PU_rangeMax = pset.getParameter<double>("PU_rangeMax");
619  PU_nbin = pset.getParameter<unsigned int>("PU_nbin");
620 }
621 
623  pset.add<double>("Eta_rangeMin", -2.5);
624  pset.add<double>("Eta_rangeMax", 2.5);
625  pset.add<unsigned int>("Eta_nbin", 50);
626 
627  pset.add<double>("Pt_rangeMin", 0.1);
628  pset.add<double>("Pt_rangeMax", 100.0);
629  pset.add<unsigned int>("Pt_nbin", 1000);
630 
631  pset.add<double>("Phi_rangeMin", -3.1416);
632  pset.add<double>("Phi_rangeMax", 3.1416);
633  pset.add<unsigned int>("Phi_nbin", 36);
634 
635  pset.add<double>("Dxy_rangeMin", -1.0);
636  pset.add<double>("Dxy_rangeMax", 1.0);
637  pset.add<unsigned int>("Dxy_nbin", 300);
638 
639  pset.add<double>("Dz_rangeMin", -30.0);
640  pset.add<double>("Dz_rangeMax", 30.0);
641  pset.add<unsigned int>("Dz_nbin", 60);
642 
643  pset.add<double>("ptRes_rangeMin", -0.1);
644  pset.add<double>("ptRes_rangeMax", 0.1);
645  pset.add<unsigned int>("ptRes_nbin", 100);
646 
647  pset.add<double>("phiRes_rangeMin", -0.01);
648  pset.add<double>("phiRes_rangeMax", 0.01);
649  pset.add<unsigned int>("phiRes_nbin", 300);
650 
651  pset.add<double>("etaRes_rangeMin", -0.01);
652  pset.add<double>("etaRes_rangeMax", 0.01);
653  pset.add<unsigned int>("etaRes_nbin", 300);
654 
655  pset.add<double>("dxyRes_rangeMin", -0.05);
656  pset.add<double>("dxyRes_rangeMax", 0.05);
657  pset.add<unsigned int>("dxyRes_nbin", 500);
658 
659  pset.add<double>("dzRes_rangeMin", -0.05);
660  pset.add<double>("dzRes_rangeMax", 0.05);
661  pset.add<unsigned int>("dzRes_nbin", 150);
662 
663  pset.add<unsigned int>("ls_rangeMin", 0);
664  pset.add<unsigned int>("ls_rangeMax", 3000);
665  pset.add<unsigned int>("ls_nbin", 300);
666 
667  pset.add<double>("onlinelumi_rangeMin", 0.0);
668  pset.add<double>("onlinelumi_rangeMax", 20000.0);
669  pset.add<unsigned int>("onlinelumi_nbin", 200);
670 
671  pset.add<double>("PU_rangeMin", 0.0);
672  pset.add<double>("PU_rangeMax", 120.0);
673  pset.add<unsigned int>("PU_nbin", 120);
674 }
edm::EDGetTokenT< reco::TrackCollection > monitoredTrackToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int numberOfValidHits() const
Definition: HitPattern.h:817
void beginJob(const edm::EventSetup &iSetup)
edm::EDGetTokenT< reco::BeamSpot > referenceBSToken_
edm::EDGetTokenT< reco::VertexCollection > monitoredPVToken_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
std::string const & instance() const
Definition: InputTag.h:37
const Point & position() const
position
Definition: Vertex.h:127
edm::EDGetTokenT< reco::TrackCollection > referenceTrackToken_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
double pt() const
track transverse momentum
Definition: TrackBase.h:637
char const * label
int charge() const
track electric charge
Definition: TrackBase.h:596
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:622
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::EDGetTokenT< OnlineLuminosityRecord > onlineMetaDataDigisToken_
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
std::vector< std::pair< int, std::map< double, int > > > idx2idxByDoubleColl
void fill_generic_tracks_histos(generalME &mes, reco::Track *trk, reco::BeamSpot *bs, reco::Vertex *pv, unsigned int ls, double onlinelumi, double PU, bool requirePlateau=true)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
def ls(path, rec=False)
Definition: eostools.py:349
edm::EDGetTokenT< LumiScalersCollection > lumiScalersToken_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
void initialize_parameter(const edm::ParameterSet &iConfig)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void fill_matching_tracks_histos(matchingME &mes, reco::Track *mon, reco::Track *ref, reco::BeamSpot *bs, reco::Vertex *pv)
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::BeamSpot > monitoredBSToken_
edm::EDGetTokenT< reco::VertexCollection > referencePVToken_
void fillMap(reco::TrackCollection tracks1, reco::TrackCollection tracks2, idx2idxByDoubleColl &map, float dRMin)
HLT enums.
void book_matching_tracks_histos(DQMStore::IBooker &ibooker, matchingME &mes, TString label, std::string &dir)
void book_generic_tracks_histos(DQMStore::IBooker &ibooker, generalME &mes, TString label, std::string &dir)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string const & process() const
Definition: InputTag.h:40
tmp
align.sh
Definition: createJobs.py:716
static void fillPSetDescription(edm::ParameterSetDescription &desc)
void bookHistos(DQMStore::IBooker &ibooker, generalME &mes, TString label, std::string &dir)
Definition: Run.h:45
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:608
#define LogDebug(id)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TrackToTrackComparisonHists(const edm::ParameterSet &)