CMS 3D CMS Logo

Phase2OTValidateTrackingParticles.cc
Go to the documentation of this file.
1 // Package: SiOuterTrackerV
2 // Class: SiOuterTrackerV
3 
4 // Original Author: Emily MacDonald
5 
6 // system include files
7 #include <memory>
8 #include <numeric>
9 #include <vector>
22 
40 
42 public:
45  void analyze(const edm::Event &, const edm::EventSetup &) override;
46  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
47  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
48  // Tracking particle distributions
52 
53  // pT and eta for efficiency plots
54  MonitorElement *tp_pt = nullptr; // denominator
55  MonitorElement *tp_pt_zoom = nullptr; // denominator
56  MonitorElement *tp_eta = nullptr; // denominator
57  MonitorElement *tp_d0 = nullptr; // denominator
58  MonitorElement *tp_VtxR = nullptr; // denominator (also known as vxy)
59  MonitorElement *tp_VtxZ = nullptr; // denominator
60  MonitorElement *match_tp_pt = nullptr; // numerator
61  MonitorElement *match_tp_pt_zoom = nullptr; // numerator
62  MonitorElement *match_tp_eta = nullptr; // numerator
63  MonitorElement *match_tp_d0 = nullptr; // numerator
64  MonitorElement *match_tp_VtxR = nullptr; // numerator (also known as vxy)
65  MonitorElement *match_tp_VtxZ = nullptr; // numerator
66 
67  // 1D intermediate resolution plots (pT and eta)
68  MonitorElement *res_eta = nullptr; // for all eta and pT
69  MonitorElement *res_pt = nullptr; // for all eta and pT
70  MonitorElement *res_ptRel = nullptr; // for all eta and pT (delta(pT)/pT)
107 
108  // For d0
115 
116 private:
121  ttClusterMCTruthToken_; // MC truth association map for clusters
123  ttStubMCTruthToken_; // MC truth association map for stubs
125  ttTrackMCTruthToken_; // MC truth association map for tracks
130  double TP_minPt;
131  double TP_maxEta;
132  double TP_maxVtxZ;
134 };
135 
136 //
137 // constructors and destructor
138 //
140  : m_topoToken(esConsumes()), conf_(iConfig) {
141  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
143  consumes<std::vector<TrackingParticle>>(conf_.getParameter<edm::InputTag>("trackingParticleToken"));
145  consumes<TTStubAssociationMap<Ref_Phase2TrackerDigi_>>(conf_.getParameter<edm::InputTag>("MCTruthStubInputTag"));
146  ttClusterMCTruthToken_ = consumes<TTClusterAssociationMap<Ref_Phase2TrackerDigi_>>(
147  conf_.getParameter<edm::InputTag>("MCTruthClusterInputTag"));
148  ttTrackMCTruthToken_ = consumes<TTTrackAssociationMap<Ref_Phase2TrackerDigi_>>(
149  conf_.getParameter<edm::InputTag>("MCTruthTrackInputTag"));
150  L1Tk_minNStub = conf_.getParameter<int>("L1Tk_minNStub"); // min number of stubs in the track
151  L1Tk_maxChi2dof = conf_.getParameter<double>("L1Tk_maxChi2dof"); // maximum chi2/dof of the track
152  TP_minNStub = conf_.getParameter<int>("TP_minNStub"); // min number of stubs in the tracking particle to
153  //min number of layers with stubs in the tracking particle to consider matching
154  TP_minNLayersStub = conf_.getParameter<int>("TP_minNLayersStub");
155  TP_minPt = conf_.getParameter<double>("TP_minPt"); // min pT to consider matching
156  TP_maxEta = conf_.getParameter<double>("TP_maxEta"); // max eta to consider matching
157  TP_maxVtxZ = conf_.getParameter<double>("TP_maxVtxZ"); // max vertZ (or z0) to consider matching
158 }
159 
161 
162 // member functions
163 
164 // ------------ method called for each event ------------
166  // Tracking Particles
167  edm::Handle<std::vector<TrackingParticle>> trackingParticleHandle;
168  iEvent.getByToken(trackingParticleToken_, trackingParticleHandle);
169 
170  // Truth Association Maps
172  iEvent.getByToken(ttTrackMCTruthToken_, MCTruthTTTrackHandle);
174  iEvent.getByToken(ttClusterMCTruthToken_, MCTruthTTClusterHandle);
176  iEvent.getByToken(ttStubMCTruthToken_, MCTruthTTStubHandle);
177 
178  // Geometries
179  const TrackerTopology *const tTopo = &iSetup.getData(m_topoToken);
180 
181  // Loop over tracking particles
182  int this_tp = 0;
183  for (const auto &iterTP : *trackingParticleHandle) {
184  edm::Ptr<TrackingParticle> tp_ptr(trackingParticleHandle, this_tp);
185  this_tp++;
186 
187  // int tmp_eventid = iterTP.eventId().event();
188  float tmp_tp_pt = iterTP.pt();
189  float tmp_tp_phi = iterTP.phi();
190  float tmp_tp_eta = iterTP.eta();
191 
192  //Calculate nLayers variable
193  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
194  theStubRefs = MCTruthTTStubHandle->findTTStubRefs(tp_ptr);
195 
196  int hasStubInLayer[11] = {0};
197  for (unsigned int is = 0; is < theStubRefs.size(); is++) {
198  DetId detid(theStubRefs.at(is)->getDetId());
199  int layer = -1;
200  if (detid.subdetId() == StripSubdetector::TOB)
201  layer = static_cast<int>(tTopo->layer(detid)) - 1; //fill in array as entries 0-5
202  else if (detid.subdetId() == StripSubdetector::TID)
203  layer = static_cast<int>(tTopo->layer(detid)) + 5; //fill in array as entries 6-10
204 
205  //treat genuine stubs separately (==2 is genuine, ==1 is not)
206  if (MCTruthTTStubHandle->findTrackingParticlePtr(theStubRefs.at(is)).isNull() && hasStubInLayer[layer] < 2)
207  hasStubInLayer[layer] = 1;
208  else
209  hasStubInLayer[layer] = 2;
210  }
211 
212  int nStubLayerTP = 0;
213  for (int isum = 0; isum < 11; isum++) {
214  if (hasStubInLayer[isum] >= 1)
215  nStubLayerTP += 1;
216  }
217 
218  if (std::fabs(tmp_tp_eta) > TP_maxEta)
219  continue;
220  // Fill the 1D distribution plots for tracking particles, to monitor change in stub definition
221  if (tmp_tp_pt > TP_minPt && nStubLayerTP >= TP_minNLayersStub) {
222  trackParts_Pt->Fill(tmp_tp_pt);
223  trackParts_Eta->Fill(tmp_tp_eta);
224  trackParts_Phi->Fill(tmp_tp_phi);
225  }
226 
227  // if (TP_select_eventid == 0 && tmp_eventid != 0)
228  // continue; //only care about tracking particles from the primary interaction for efficiency/resolution
229  int nStubTP = -1;
230  if (MCTruthTTStubHandle.isValid()) {
231  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
232  theStubRefs = MCTruthTTStubHandle->findTTStubRefs(tp_ptr);
233  nStubTP = (int)theStubRefs.size();
234  }
235  if (MCTruthTTClusterHandle.isValid() && MCTruthTTClusterHandle->findTTClusterRefs(tp_ptr).empty())
236  continue;
237 
238  float tmp_tp_vz = iterTP.vz();
239  float tmp_tp_vx = iterTP.vx();
240  float tmp_tp_vy = iterTP.vy();
241  float tmp_tp_charge = tp_ptr->charge();
242  int tmp_tp_pdgid = iterTP.pdgId();
243 
244  // ----------------------------------------------------------------------------------------------
245  // calculate d0 and VtxZ propagated back to the IP, pass if greater than max
246  // VtxZ
247  float tmp_tp_t = tan(2.0 * atan(1.0) - 2.0 * atan(exp(-tmp_tp_eta)));
248  float delx = -tmp_tp_vx;
249  float dely = -tmp_tp_vy;
250  float K = 0.01 * 0.5696 / tmp_tp_pt * tmp_tp_charge; // curvature correction
251  float A = 1. / (2. * K);
252  float tmp_tp_x0p = delx - A * sin(tmp_tp_phi);
253  float tmp_tp_y0p = dely + A * cos(tmp_tp_phi);
254  float tmp_tp_rp = sqrt(tmp_tp_x0p * tmp_tp_x0p + tmp_tp_y0p * tmp_tp_y0p);
255  static double pi = 4.0 * atan(1.0);
256  float delphi = tmp_tp_phi - atan2(-K * tmp_tp_x0p, K * tmp_tp_y0p);
257  if (delphi < -pi)
258  delphi += 2.0 * pi;
259  if (delphi > pi)
260  delphi -= 2.0 * pi;
261 
262  float tmp_tp_VtxZ = tmp_tp_vz + tmp_tp_t * delphi / (2.0 * K);
263  float tmp_tp_VtxR = sqrt(tmp_tp_vx * tmp_tp_vx + tmp_tp_vy * tmp_tp_vy);
264  float tmp_tp_d0 = tmp_tp_charge * tmp_tp_rp - (1. / (2. * K));
265 
266  // simpler formula for d0, in cases where the charge is zero:
267  // https://github.com/cms-sw/cmssw/blob/master/DataFormats/TrackReco/interface/TrackBase.h
268  float other_d0 = -tmp_tp_vx * sin(tmp_tp_phi) + tmp_tp_vy * cos(tmp_tp_phi);
269  tmp_tp_d0 = tmp_tp_d0 * (-1); // fix d0 sign
270  if (K == 0) {
271  tmp_tp_d0 = other_d0;
272  tmp_tp_VtxZ = tmp_tp_vz;
273  }
274  if (std::fabs(tmp_tp_VtxZ) > TP_maxVtxZ)
275  continue;
276 
277  // To make efficiency plots where the denominator has NO stub cuts
278  if (tmp_tp_VtxR < 1.0) {
279  tp_pt->Fill(tmp_tp_pt); //pT effic, no cut on pT, but VtxR cut
280  if (tmp_tp_pt <= 10)
281  tp_pt_zoom->Fill(tmp_tp_pt); //pT effic, no cut on pT, but VtxR cut
282  }
283  if (tmp_tp_pt < TP_minPt)
284  continue;
285  tp_VtxR->Fill(tmp_tp_VtxR); // VtxR efficiency has no cut on VtxR
286  if (tmp_tp_VtxR > 1.0)
287  continue;
288  tp_eta->Fill(tmp_tp_eta);
289  tp_d0->Fill(tmp_tp_d0);
290  tp_VtxZ->Fill(tmp_tp_VtxZ);
291 
292  if (nStubTP < TP_minNStub || nStubLayerTP < TP_minNLayersStub)
293  continue; //nStub cut not included in denominator of efficiency plots
294 
295  // ----------------------------------------------------------------------------------------------
296  // look for L1 tracks matched to the tracking particle
297  int tp_nMatch = 0;
298  int i_track = -1;
299  float i_chi2dof = 99999;
300  if (MCTruthTTTrackHandle.isValid()) {
301  std::vector<edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>>> matchedTracks =
302  MCTruthTTTrackHandle->findTTTrackPtrs(tp_ptr);
303 
304  // ----------------------------------------------------------------------------------------------
305  // loop over matched L1 tracks
306  // here, "match" means tracks that can be associated to a TrackingParticle
307  // with at least one hit of at least one of its clusters
308  // https://twiki.cern.ch/twiki/bin/viewauth/CMS/SLHCTrackerTriggerSWTools#MC_truth_for_TTTrack
309  int trkCounter = 0;
310  for (const auto &thisTrack : matchedTracks) {
311  if (!MCTruthTTTrackHandle->isGenuine(thisTrack))
312  continue;
313  // ----------------------------------------------------------------------------------------------
314  // further require L1 track to be (loosely) genuine, that there is only
315  // one TP matched to the track
316  // + have >= L1Tk_minNStub stubs for it to be a valid match
317  int tmp_trk_nstub = thisTrack->getStubRefs().size();
318  if (tmp_trk_nstub < L1Tk_minNStub)
319  continue;
320  float dmatch_pt = 999;
321  float dmatch_eta = 999;
322  float dmatch_phi = 999;
323  int match_id = 999;
324 
325  edm::Ptr<TrackingParticle> my_tp = MCTruthTTTrackHandle->findTrackingParticlePtr(thisTrack);
326  dmatch_pt = std::fabs(my_tp->p4().pt() - tmp_tp_pt);
327  dmatch_eta = std::fabs(my_tp->p4().eta() - tmp_tp_eta);
328  dmatch_phi = std::fabs(my_tp->p4().phi() - tmp_tp_phi);
329  match_id = my_tp->pdgId();
330  float tmp_trk_chi2dof = thisTrack->chi2Red();
331 
332  // ensure that track is uniquely matched to the TP we are looking at!
333  if (dmatch_pt < 0.1 && dmatch_eta < 0.1 && dmatch_phi < 0.1 && tmp_tp_pdgid == match_id) {
334  tp_nMatch++;
335  if (i_track < 0 || tmp_trk_chi2dof < i_chi2dof) {
336  i_track = trkCounter;
337  i_chi2dof = tmp_trk_chi2dof;
338  }
339  }
340  trkCounter++;
341  } // end loop over matched L1 tracks
342 
343  if (tp_nMatch < 1)
344  continue;
345  // Get information on the matched tracks
346  float tmp_matchtrk_pt = -999;
347  float tmp_matchtrk_eta = -999;
348  float tmp_matchtrk_phi = -999;
349  float tmp_matchtrk_VtxZ = -999;
350  float tmp_matchtrk_chi2dof = -999;
351  int tmp_matchTrk_nStub = -999;
352  float tmp_matchtrk_d0 = -999;
353 
354  tmp_matchtrk_pt = matchedTracks[i_track]->momentum().perp();
355  tmp_matchtrk_eta = matchedTracks[i_track]->momentum().eta();
356  tmp_matchtrk_phi = matchedTracks[i_track]->momentum().phi();
357  tmp_matchtrk_VtxZ = matchedTracks[i_track]->z0();
358  tmp_matchtrk_chi2dof = matchedTracks[i_track]->chi2Red();
359  tmp_matchTrk_nStub = (int)matchedTracks[i_track]->getStubRefs().size();
360 
361  //for d0
362  float tmp_matchtrk_x0 = matchedTracks[i_track]->POCA().x();
363  float tmp_matchtrk_y0 = matchedTracks[i_track]->POCA().y();
364  tmp_matchtrk_d0 = -tmp_matchtrk_x0 * sin(tmp_matchtrk_phi) + tmp_matchtrk_y0 * cos(tmp_matchtrk_phi);
365 
366  //Add cuts for the matched tracks, numerator
367  if (tmp_matchTrk_nStub < L1Tk_minNStub || tmp_matchtrk_chi2dof > L1Tk_maxChi2dof)
368  continue;
369 
370  // fill matched track histograms (if passes all criteria)
371  match_tp_pt->Fill(tmp_tp_pt);
372  if (tmp_tp_pt > 0 && tmp_tp_pt <= 10)
373  match_tp_pt_zoom->Fill(tmp_tp_pt);
374  match_tp_eta->Fill(tmp_tp_eta);
375  match_tp_d0->Fill(tmp_tp_d0);
376  match_tp_VtxR->Fill(tmp_tp_VtxR);
377  match_tp_VtxZ->Fill(tmp_tp_VtxZ);
378 
379  // Eta and pT histograms for resolution
380  float pt_diff = tmp_matchtrk_pt - tmp_tp_pt;
381  float pt_res = pt_diff / tmp_tp_pt;
382  float eta_res = tmp_matchtrk_eta - tmp_tp_eta;
383  float phi_res = tmp_matchtrk_phi - tmp_tp_phi;
384  float VtxZ_res = tmp_matchtrk_VtxZ - tmp_tp_VtxZ;
385  float d0_res = tmp_matchtrk_d0 - tmp_tp_d0;
386 
387  // fill total resolution histograms
388  res_pt->Fill(pt_diff);
389  res_ptRel->Fill(pt_res);
390  res_eta->Fill(eta_res);
391 
392  // Fill resolution plots for different abs(eta) bins:
393  // (0, 0.7), (0.7, 1.0), (1.0, 1.2), (1.2, 1.6), (1.6, 2.0), (2.0, 2.4)
394  if (std::fabs(tmp_tp_eta) >= 0 && std::fabs(tmp_tp_eta) < 0.7) {
395  reseta_eta0to0p7->Fill(eta_res);
396  resphi_eta0to0p7->Fill(phi_res);
397  resVtxZ_eta0to0p7->Fill(VtxZ_res);
398  resd0_eta0to0p7->Fill(d0_res);
399  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
400  respt_eta0to0p7_pt2to3->Fill(pt_res);
401  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
402  respt_eta0to0p7_pt3to8->Fill(pt_res);
403  else if (tmp_tp_pt >= 8)
405  } else if (std::fabs(tmp_tp_eta) >= 0.7 && std::fabs(tmp_tp_eta) < 1.0) {
406  reseta_eta0p7to1->Fill(eta_res);
407  resphi_eta0p7to1->Fill(phi_res);
408  resVtxZ_eta0p7to1->Fill(VtxZ_res);
409  resd0_eta0p7to1->Fill(d0_res);
410  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
411  respt_eta0p7to1_pt2to3->Fill(pt_res);
412  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
413  respt_eta0p7to1_pt3to8->Fill(pt_res);
414  else if (tmp_tp_pt >= 8)
416  } else if (std::fabs(tmp_tp_eta) >= 1.0 && std::fabs(tmp_tp_eta) < 1.2) {
417  reseta_eta1to1p2->Fill(eta_res);
418  resphi_eta1to1p2->Fill(phi_res);
419  resVtxZ_eta1to1p2->Fill(VtxZ_res);
420  resd0_eta1to1p2->Fill(d0_res);
421  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
422  respt_eta1to1p2_pt2to3->Fill(pt_res);
423  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
424  respt_eta1to1p2_pt3to8->Fill(pt_res);
425  else if (tmp_tp_pt >= 8)
427  } else if (std::fabs(tmp_tp_eta) >= 1.2 && std::fabs(tmp_tp_eta) < 1.6) {
428  reseta_eta1p2to1p6->Fill(eta_res);
429  resphi_eta1p2to1p6->Fill(phi_res);
430  resVtxZ_eta1p2to1p6->Fill(VtxZ_res);
431  resd0_eta1p2to1p6->Fill(d0_res);
432  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
434  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
436  else if (tmp_tp_pt >= 8)
438  } else if (std::fabs(tmp_tp_eta) >= 1.6 && std::fabs(tmp_tp_eta) < 2.0) {
439  reseta_eta1p6to2->Fill(eta_res);
440  resphi_eta1p6to2->Fill(phi_res);
441  resVtxZ_eta1p6to2->Fill(VtxZ_res);
442  resd0_eta1p6to2->Fill(d0_res);
443  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
444  respt_eta1p6to2_pt2to3->Fill(pt_res);
445  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
446  respt_eta1p6to2_pt3to8->Fill(pt_res);
447  else if (tmp_tp_pt >= 8)
449  } else if (std::fabs(tmp_tp_eta) >= 2.0 && std::fabs(tmp_tp_eta) <= 2.4) {
450  reseta_eta2to2p4->Fill(eta_res);
451  resphi_eta2to2p4->Fill(phi_res);
452  resVtxZ_eta2to2p4->Fill(VtxZ_res);
453  resd0_eta2to2p4->Fill(d0_res);
454  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
455  respt_eta2to2p4_pt2to3->Fill(pt_res);
456  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
457  respt_eta2to2p4_pt3to8->Fill(pt_res);
458  else if (tmp_tp_pt >= 8)
460  }
461  } //if MC TTTrack handle is valid
462  } //end loop over tracking particles
463 } // end of method
464 
465 // ------------ method called once each job just before starting event loop
466 // ------------
468  edm::Run const &run,
469  edm::EventSetup const &es) {
470  // Histogram setup and definitions
472  iBooker.setCurrentFolder(topFolderName_ + "/trackParticles");
473 
474  // 1D: pT
475  edm::ParameterSet psTrackParts_Pt = conf_.getParameter<edm::ParameterSet>("TH1TrackParts_Pt");
476  HistoName = "trackParts_Pt";
477  trackParts_Pt = iBooker.book1D(HistoName,
478  HistoName,
479  psTrackParts_Pt.getParameter<int32_t>("Nbinsx"),
480  psTrackParts_Pt.getParameter<double>("xmin"),
481  psTrackParts_Pt.getParameter<double>("xmax"));
482  trackParts_Pt->setAxisTitle("p_{T} [GeV]", 1);
483  trackParts_Pt->setAxisTitle("# tracking particles", 2);
484 
485  // 1D: eta
486  edm::ParameterSet psTrackParts_Eta = conf_.getParameter<edm::ParameterSet>("TH1TrackParts_Eta");
487  HistoName = "trackParts_Eta";
488  trackParts_Eta = iBooker.book1D(HistoName,
489  HistoName,
490  psTrackParts_Eta.getParameter<int32_t>("Nbinsx"),
491  psTrackParts_Eta.getParameter<double>("xmin"),
492  psTrackParts_Eta.getParameter<double>("xmax"));
493  trackParts_Eta->setAxisTitle("#eta", 1);
494  trackParts_Eta->setAxisTitle("# tracking particles", 2);
495 
496  // 1D: phi
497  edm::ParameterSet psTrackParts_Phi = conf_.getParameter<edm::ParameterSet>("TH1TrackParts_Phi");
498  HistoName = "trackParts_Phi";
499  trackParts_Phi = iBooker.book1D(HistoName,
500  HistoName,
501  psTrackParts_Phi.getParameter<int32_t>("Nbinsx"),
502  psTrackParts_Phi.getParameter<double>("xmin"),
503  psTrackParts_Phi.getParameter<double>("xmax"));
504  trackParts_Phi->setAxisTitle("#phi", 1);
505  trackParts_Phi->setAxisTitle("# tracking particles", 2);
506 
507  // 1D plots for efficiency
508  iBooker.setCurrentFolder(topFolderName_ + "/Efficiency");
509  // pT
510  edm::ParameterSet psEffic_pt = conf_.getParameter<edm::ParameterSet>("TH1Effic_pt");
511  HistoName = "tp_pt";
512  tp_pt = iBooker.book1D(HistoName,
513  HistoName,
514  psEffic_pt.getParameter<int32_t>("Nbinsx"),
515  psEffic_pt.getParameter<double>("xmin"),
516  psEffic_pt.getParameter<double>("xmax"));
517  tp_pt->setAxisTitle("p_{T} [GeV]", 1);
518  tp_pt->setAxisTitle("# tracking particles", 2);
519 
520  // Matched TP's pT
521  HistoName = "match_tp_pt";
522  match_tp_pt = iBooker.book1D(HistoName,
523  HistoName,
524  psEffic_pt.getParameter<int32_t>("Nbinsx"),
525  psEffic_pt.getParameter<double>("xmin"),
526  psEffic_pt.getParameter<double>("xmax"));
527  match_tp_pt->setAxisTitle("p_{T} [GeV]", 1);
528  match_tp_pt->setAxisTitle("# matched tracking particles", 2);
529 
530  // pT zoom (0-10 GeV)
531  edm::ParameterSet psEffic_pt_zoom = conf_.getParameter<edm::ParameterSet>("TH1Effic_pt_zoom");
532  HistoName = "tp_pt_zoom";
533  tp_pt_zoom = iBooker.book1D(HistoName,
534  HistoName,
535  psEffic_pt_zoom.getParameter<int32_t>("Nbinsx"),
536  psEffic_pt_zoom.getParameter<double>("xmin"),
537  psEffic_pt_zoom.getParameter<double>("xmax"));
538  tp_pt_zoom->setAxisTitle("p_{T} [GeV]", 1);
539  tp_pt_zoom->setAxisTitle("# tracking particles", 2);
540 
541  // Matched pT zoom (0-10 GeV)
542  HistoName = "match_tp_pt_zoom";
544  HistoName,
545  psEffic_pt_zoom.getParameter<int32_t>("Nbinsx"),
546  psEffic_pt_zoom.getParameter<double>("xmin"),
547  psEffic_pt_zoom.getParameter<double>("xmax"));
548  match_tp_pt_zoom->setAxisTitle("p_{T} [GeV]", 1);
549  match_tp_pt_zoom->setAxisTitle("# matched tracking particles", 2);
550 
551  // eta
552  edm::ParameterSet psEffic_eta = conf_.getParameter<edm::ParameterSet>("TH1Effic_eta");
553  HistoName = "tp_eta";
554  tp_eta = iBooker.book1D(HistoName,
555  HistoName,
556  psEffic_eta.getParameter<int32_t>("Nbinsx"),
557  psEffic_eta.getParameter<double>("xmin"),
558  psEffic_eta.getParameter<double>("xmax"));
559  tp_eta->setAxisTitle("#eta", 1);
560  tp_eta->setAxisTitle("# tracking particles", 2);
561 
562  // Matched eta
563  HistoName = "match_tp_eta";
564  match_tp_eta = iBooker.book1D(HistoName,
565  HistoName,
566  psEffic_eta.getParameter<int32_t>("Nbinsx"),
567  psEffic_eta.getParameter<double>("xmin"),
568  psEffic_eta.getParameter<double>("xmax"));
569  match_tp_eta->setAxisTitle("#eta", 1);
570  match_tp_eta->setAxisTitle("# matched tracking particles", 2);
571 
572  // d0
573  edm::ParameterSet psEffic_d0 = conf_.getParameter<edm::ParameterSet>("TH1Effic_d0");
574  HistoName = "tp_d0";
575  tp_d0 = iBooker.book1D(HistoName,
576  HistoName,
577  psEffic_d0.getParameter<int32_t>("Nbinsx"),
578  psEffic_d0.getParameter<double>("xmin"),
579  psEffic_d0.getParameter<double>("xmax"));
580  tp_d0->setAxisTitle("d_{0} [cm]", 1);
581  tp_d0->setAxisTitle("# tracking particles", 2);
582 
583  // Matched d0
584  HistoName = "match_tp_d0";
585  match_tp_d0 = iBooker.book1D(HistoName,
586  HistoName,
587  psEffic_d0.getParameter<int32_t>("Nbinsx"),
588  psEffic_d0.getParameter<double>("xmin"),
589  psEffic_d0.getParameter<double>("xmax"));
590  match_tp_d0->setAxisTitle("d_{0} [cm]", 1);
591  match_tp_d0->setAxisTitle("# matched tracking particles", 2);
592 
593  // VtxR (also known as vxy)
594  edm::ParameterSet psEffic_VtxR = conf_.getParameter<edm::ParameterSet>("TH1Effic_VtxR");
595  HistoName = "tp_VtxR";
596  tp_VtxR = iBooker.book1D(HistoName,
597  HistoName,
598  psEffic_VtxR.getParameter<int32_t>("Nbinsx"),
599  psEffic_VtxR.getParameter<double>("xmin"),
600  psEffic_VtxR.getParameter<double>("xmax"));
601  tp_VtxR->setAxisTitle("d_{xy} [cm]", 1);
602  tp_VtxR->setAxisTitle("# tracking particles", 2);
603 
604  // Matched VtxR
605  HistoName = "match_tp_VtxR";
606  match_tp_VtxR = iBooker.book1D(HistoName,
607  HistoName,
608  psEffic_VtxR.getParameter<int32_t>("Nbinsx"),
609  psEffic_VtxR.getParameter<double>("xmin"),
610  psEffic_VtxR.getParameter<double>("xmax"));
611  match_tp_VtxR->setAxisTitle("d_{xy} [cm]", 1);
612  match_tp_VtxR->setAxisTitle("# matched tracking particles", 2);
613 
614  // VtxZ
615  edm::ParameterSet psEffic_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1Effic_VtxZ");
616  HistoName = "tp_VtxZ";
617  tp_VtxZ = iBooker.book1D(HistoName,
618  HistoName,
619  psEffic_VtxZ.getParameter<int32_t>("Nbinsx"),
620  psEffic_VtxZ.getParameter<double>("xmin"),
621  psEffic_VtxZ.getParameter<double>("xmax"));
622  tp_VtxZ->setAxisTitle("z_{0} [cm]", 1);
623  tp_VtxZ->setAxisTitle("# tracking particles", 2);
624 
625  // Matched d0
626  HistoName = "match_tp_VtxZ";
627  match_tp_VtxZ = iBooker.book1D(HistoName,
628  HistoName,
629  psEffic_VtxZ.getParameter<int32_t>("Nbinsx"),
630  psEffic_VtxZ.getParameter<double>("xmin"),
631  psEffic_VtxZ.getParameter<double>("xmax"));
632  match_tp_VtxZ->setAxisTitle("z_{0} [cm]", 1);
633  match_tp_VtxZ->setAxisTitle("# matched tracking particles", 2);
634 
635  // 1D plots for resolution
636  iBooker.setCurrentFolder(topFolderName_ + "/Resolution");
637  // full pT
638  edm::ParameterSet psRes_pt = conf_.getParameter<edm::ParameterSet>("TH1Res_pt");
639  HistoName = "res_pt";
640  res_pt = iBooker.book1D(HistoName,
641  HistoName,
642  psRes_pt.getParameter<int32_t>("Nbinsx"),
643  psRes_pt.getParameter<double>("xmin"),
644  psRes_pt.getParameter<double>("xmax"));
645  res_pt->setAxisTitle("p_{T} [GeV]", 1);
646  res_pt->setAxisTitle("# tracking particles", 2);
647 
648  // Full eta
649  edm::ParameterSet psRes_eta = conf_.getParameter<edm::ParameterSet>("TH1Res_eta");
650  HistoName = "res_eta";
651  res_eta = iBooker.book1D(HistoName,
652  HistoName,
653  psRes_eta.getParameter<int32_t>("Nbinsx"),
654  psRes_eta.getParameter<double>("xmin"),
655  psRes_eta.getParameter<double>("xmax"));
656  res_eta->setAxisTitle("#eta", 1);
657  res_eta->setAxisTitle("# tracking particles", 2);
658 
659  // Relative pT
660  edm::ParameterSet psRes_ptRel = conf_.getParameter<edm::ParameterSet>("TH1Res_ptRel");
661  HistoName = "res_ptRel";
662  res_ptRel = iBooker.book1D(HistoName,
663  HistoName,
664  psRes_ptRel.getParameter<int32_t>("Nbinsx"),
665  psRes_ptRel.getParameter<double>("xmin"),
666  psRes_ptRel.getParameter<double>("xmax"));
667  res_ptRel->setAxisTitle("Relative p_{T} [GeV]", 1);
668  res_ptRel->setAxisTitle("# tracking particles", 2);
669 
670  // Eta parts (for resolution)
671  // Eta 1 (0 to 0.7)
672  HistoName = "reseta_eta0to0p7";
674  HistoName,
675  psRes_eta.getParameter<int32_t>("Nbinsx"),
676  psRes_eta.getParameter<double>("xmin"),
677  psRes_eta.getParameter<double>("xmax"));
678  reseta_eta0to0p7->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
679  reseta_eta0to0p7->setAxisTitle("# tracking particles", 2);
680 
681  // Eta 2 (0.7 to 1.0)
682  HistoName = "reseta_eta0p7to1";
684  HistoName,
685  psRes_eta.getParameter<int32_t>("Nbinsx"),
686  psRes_eta.getParameter<double>("xmin"),
687  psRes_eta.getParameter<double>("xmax"));
688  reseta_eta0p7to1->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
689  reseta_eta0p7to1->setAxisTitle("# tracking particles", 2);
690 
691  // Eta 3 (1.0 to 1.2)
692  HistoName = "reseta_eta1to1p2";
694  HistoName,
695  psRes_eta.getParameter<int32_t>("Nbinsx"),
696  psRes_eta.getParameter<double>("xmin"),
697  psRes_eta.getParameter<double>("xmax"));
698  reseta_eta1to1p2->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
699  reseta_eta1to1p2->setAxisTitle("# tracking particles", 2);
700 
701  // Eta 4 (1.2 to 1.6)
702  HistoName = "reseta_eta1p2to1p6";
704  HistoName,
705  psRes_eta.getParameter<int32_t>("Nbinsx"),
706  psRes_eta.getParameter<double>("xmin"),
707  psRes_eta.getParameter<double>("xmax"));
708  reseta_eta1p2to1p6->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
709  reseta_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
710 
711  // Eta 5 (1.6 to 2.0)
712  HistoName = "reseta_eta1p6to2";
714  HistoName,
715  psRes_eta.getParameter<int32_t>("Nbinsx"),
716  psRes_eta.getParameter<double>("xmin"),
717  psRes_eta.getParameter<double>("xmax"));
718  reseta_eta1p6to2->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
719  reseta_eta1p6to2->setAxisTitle("# tracking particles", 2);
720 
721  // Eta 6 (2.0 to 2.4)
722  HistoName = "reseta_eta2to2p4";
724  HistoName,
725  psRes_eta.getParameter<int32_t>("Nbinsx"),
726  psRes_eta.getParameter<double>("xmin"),
727  psRes_eta.getParameter<double>("xmax"));
728  reseta_eta2to2p4->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
729  reseta_eta2to2p4->setAxisTitle("# tracking particles", 2);
730 
731  // pT parts for resolution (pT res vs eta)
732  // pT a (2 to 3 GeV)
733  // Eta 1 (0 to 0.7)
734  HistoName = "respt_eta0to0p7_pt2to3";
736  HistoName,
737  psRes_pt.getParameter<int32_t>("Nbinsx"),
738  psRes_pt.getParameter<double>("xmin"),
739  psRes_pt.getParameter<double>("xmax"));
740  respt_eta0to0p7_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
741  respt_eta0to0p7_pt2to3->setAxisTitle("# tracking particles", 2);
742 
743  // Eta 2 (0.7 to 1.0)
744  HistoName = "respt_eta0p7to1_pt2to3";
746  HistoName,
747  psRes_pt.getParameter<int32_t>("Nbinsx"),
748  psRes_pt.getParameter<double>("xmin"),
749  psRes_pt.getParameter<double>("xmax"));
750  respt_eta0p7to1_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
751  respt_eta0p7to1_pt2to3->setAxisTitle("# tracking particles", 2);
752 
753  // Eta 3 (1.0 to 1.2)
754  HistoName = "respt_eta1to1p2_pt2to3";
756  HistoName,
757  psRes_pt.getParameter<int32_t>("Nbinsx"),
758  psRes_pt.getParameter<double>("xmin"),
759  psRes_pt.getParameter<double>("xmax"));
760  respt_eta1to1p2_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
761  respt_eta1to1p2_pt2to3->setAxisTitle("# tracking particles", 2);
762 
763  // Eta 4 (1.2 to 1.6)
764  HistoName = "respt_eta1p2to1p6_pt2to3";
766  HistoName,
767  psRes_pt.getParameter<int32_t>("Nbinsx"),
768  psRes_pt.getParameter<double>("xmin"),
769  psRes_pt.getParameter<double>("xmax"));
770  respt_eta1p2to1p6_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
771  respt_eta1p2to1p6_pt2to3->setAxisTitle("# tracking particles", 2);
772 
773  // Eta 5 (1.6 to 2.0)
774  HistoName = "respt_eta1p6to2_pt2to3";
776  HistoName,
777  psRes_pt.getParameter<int32_t>("Nbinsx"),
778  psRes_pt.getParameter<double>("xmin"),
779  psRes_pt.getParameter<double>("xmax"));
780  respt_eta1p6to2_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
781  respt_eta1p6to2_pt2to3->setAxisTitle("# tracking particles", 2);
782 
783  // Eta 6 (2.0 to 2.4)
784  HistoName = "respt_eta2to2p4_pt2to3";
786  HistoName,
787  psRes_pt.getParameter<int32_t>("Nbinsx"),
788  psRes_pt.getParameter<double>("xmin"),
789  psRes_pt.getParameter<double>("xmax"));
790  respt_eta2to2p4_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
791  respt_eta2to2p4_pt2to3->setAxisTitle("# tracking particles", 2);
792 
793  // pT b (3 to 8 GeV)
794  // Eta 1 (0 to 0.7)
795  HistoName = "respt_eta0to0p7_pt3to8";
797  HistoName,
798  psRes_pt.getParameter<int32_t>("Nbinsx"),
799  psRes_pt.getParameter<double>("xmin"),
800  psRes_pt.getParameter<double>("xmax"));
801  respt_eta0to0p7_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
802  respt_eta0to0p7_pt3to8->setAxisTitle("# tracking particles", 2);
803 
804  // Eta 2 (0.7 to 1.0)
805  HistoName = "respt_eta0p7to1_pt3to8";
807  HistoName,
808  psRes_pt.getParameter<int32_t>("Nbinsx"),
809  psRes_pt.getParameter<double>("xmin"),
810  psRes_pt.getParameter<double>("xmax"));
811  respt_eta0p7to1_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
812  respt_eta0p7to1_pt3to8->setAxisTitle("# tracking particles", 2);
813 
814  // Eta 3 (1.0 to 1.2)
815  HistoName = "respt_eta1to1p2_pt3to8";
817  HistoName,
818  psRes_pt.getParameter<int32_t>("Nbinsx"),
819  psRes_pt.getParameter<double>("xmin"),
820  psRes_pt.getParameter<double>("xmax"));
821  respt_eta1to1p2_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
822  respt_eta1to1p2_pt3to8->setAxisTitle("# tracking particles", 2);
823 
824  // Eta 4 (1.2 to 1.6)
825  HistoName = "respt_eta1p2to1p6_pt3to8";
827  HistoName,
828  psRes_pt.getParameter<int32_t>("Nbinsx"),
829  psRes_pt.getParameter<double>("xmin"),
830  psRes_pt.getParameter<double>("xmax"));
831  respt_eta1p2to1p6_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
832  respt_eta1p2to1p6_pt3to8->setAxisTitle("# tracking particles", 2);
833 
834  // Eta 5 (1.6 to 2.0)
835  HistoName = "respt_eta1p6to2_pt3to8";
837  HistoName,
838  psRes_pt.getParameter<int32_t>("Nbinsx"),
839  psRes_pt.getParameter<double>("xmin"),
840  psRes_pt.getParameter<double>("xmax"));
841  respt_eta1p6to2_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
842  respt_eta1p6to2_pt3to8->setAxisTitle("# tracking particles", 2);
843 
844  // Eta 6 (2.0 to 2.4)
845  HistoName = "respt_eta2to2p4_pt3to8";
847  HistoName,
848  psRes_pt.getParameter<int32_t>("Nbinsx"),
849  psRes_pt.getParameter<double>("xmin"),
850  psRes_pt.getParameter<double>("xmax"));
851  respt_eta2to2p4_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
852  respt_eta2to2p4_pt3to8->setAxisTitle("# tracking particles", 2);
853 
854  // pT c (>8 GeV)
855  // Eta 1 (0 to 0.7)
856  HistoName = "respt_eta0to0p7_pt8toInf";
858  HistoName,
859  psRes_pt.getParameter<int32_t>("Nbinsx"),
860  psRes_pt.getParameter<double>("xmin"),
861  psRes_pt.getParameter<double>("xmax"));
862  respt_eta0to0p7_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
863  respt_eta0to0p7_pt8toInf->setAxisTitle("# tracking particles", 2);
864 
865  // Eta 2 (0.7 to 1.0)
866  HistoName = "respt_eta0p7to1_pt8toInf";
868  HistoName,
869  psRes_pt.getParameter<int32_t>("Nbinsx"),
870  psRes_pt.getParameter<double>("xmin"),
871  psRes_pt.getParameter<double>("xmax"));
872  respt_eta0p7to1_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
873  respt_eta0p7to1_pt8toInf->setAxisTitle("# tracking particles", 2);
874 
875  // Eta 3 (1.0 to 1.2)
876  HistoName = "respt_eta1to1p2_pt8toInf";
878  HistoName,
879  psRes_pt.getParameter<int32_t>("Nbinsx"),
880  psRes_pt.getParameter<double>("xmin"),
881  psRes_pt.getParameter<double>("xmax"));
882  respt_eta1to1p2_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
883  respt_eta1to1p2_pt8toInf->setAxisTitle("# tracking particles", 2);
884 
885  // Eta 4 (1.2 to 1.6)
886  HistoName = "respt_eta1p2to1p6_pt8toInf";
888  HistoName,
889  psRes_pt.getParameter<int32_t>("Nbinsx"),
890  psRes_pt.getParameter<double>("xmin"),
891  psRes_pt.getParameter<double>("xmax"));
892  respt_eta1p2to1p6_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
893  respt_eta1p2to1p6_pt8toInf->setAxisTitle("# tracking particles", 2);
894 
895  // Eta 5 (1.6 to 2.0)
896  HistoName = "respt_eta1p6to2_pt8toInf";
898  HistoName,
899  psRes_pt.getParameter<int32_t>("Nbinsx"),
900  psRes_pt.getParameter<double>("xmin"),
901  psRes_pt.getParameter<double>("xmax"));
902  respt_eta1p6to2_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
903  respt_eta1p6to2_pt8toInf->setAxisTitle("# tracking particles", 2);
904 
905  // Eta 6 (2.0 to 2.4)
906  HistoName = "respt_eta2to2p4_pt8toInf";
908  HistoName,
909  psRes_pt.getParameter<int32_t>("Nbinsx"),
910  psRes_pt.getParameter<double>("xmin"),
911  psRes_pt.getParameter<double>("xmax"));
912  respt_eta2to2p4_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
913  respt_eta2to2p4_pt8toInf->setAxisTitle("# tracking particles", 2);
914 
915  // Phi parts (for resolution)
916  // Eta 1 (0 to 0.7)
917  edm::ParameterSet psRes_phi = conf_.getParameter<edm::ParameterSet>("TH1Res_phi");
918  HistoName = "resphi_eta0to0p7";
920  HistoName,
921  psRes_phi.getParameter<int32_t>("Nbinsx"),
922  psRes_phi.getParameter<double>("xmin"),
923  psRes_phi.getParameter<double>("xmax"));
924  resphi_eta0to0p7->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
925  resphi_eta0to0p7->setAxisTitle("# tracking particles", 2);
926 
927  // Eta 2 (0.7 to 1.0)
928  HistoName = "resphi_eta0p7to1";
930  HistoName,
931  psRes_phi.getParameter<int32_t>("Nbinsx"),
932  psRes_phi.getParameter<double>("xmin"),
933  psRes_phi.getParameter<double>("xmax"));
934  resphi_eta0p7to1->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
935  resphi_eta0p7to1->setAxisTitle("# tracking particles", 2);
936 
937  // Eta 3 (1.0 to 1.2)
938  HistoName = "resphi_eta1to1p2";
940  HistoName,
941  psRes_phi.getParameter<int32_t>("Nbinsx"),
942  psRes_phi.getParameter<double>("xmin"),
943  psRes_phi.getParameter<double>("xmax"));
944  resphi_eta1to1p2->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
945  resphi_eta1to1p2->setAxisTitle("# tracking particles", 2);
946 
947  // Eta 4 (1.2 to 1.6)
948  HistoName = "resphi_eta1p2to1p6";
950  HistoName,
951  psRes_phi.getParameter<int32_t>("Nbinsx"),
952  psRes_phi.getParameter<double>("xmin"),
953  psRes_phi.getParameter<double>("xmax"));
954  resphi_eta1p2to1p6->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
955  resphi_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
956 
957  // Eta 5 (1.6 to 2.0)
958  HistoName = "resphi_eta1p6to2";
960  HistoName,
961  psRes_phi.getParameter<int32_t>("Nbinsx"),
962  psRes_phi.getParameter<double>("xmin"),
963  psRes_phi.getParameter<double>("xmax"));
964  resphi_eta1p6to2->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
965  resphi_eta1p6to2->setAxisTitle("# tracking particles", 2);
966 
967  // Eta 6 (2.0 to 2.4)
968  HistoName = "resphi_eta2to2p4";
970  HistoName,
971  psRes_phi.getParameter<int32_t>("Nbinsx"),
972  psRes_phi.getParameter<double>("xmin"),
973  psRes_phi.getParameter<double>("xmax"));
974  resphi_eta2to2p4->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
975  resphi_eta2to2p4->setAxisTitle("# tracking particles", 2);
976 
977  // VtxZ parts (for resolution)
978  // Eta 1 (0 to 0.7)
979  edm::ParameterSet psRes_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1Res_VtxZ");
980  HistoName = "resVtxZ_eta0to0p7";
982  HistoName,
983  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
984  psRes_VtxZ.getParameter<double>("xmin"),
985  psRes_VtxZ.getParameter<double>("xmax"));
986  resVtxZ_eta0to0p7->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
987  resVtxZ_eta0to0p7->setAxisTitle("# tracking particles", 2);
988 
989  // Eta 2 (0.7 to 1.0)
990  HistoName = "resVtxZ_eta0p7to1";
992  HistoName,
993  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
994  psRes_VtxZ.getParameter<double>("xmin"),
995  psRes_VtxZ.getParameter<double>("xmax"));
996  resVtxZ_eta0p7to1->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
997  resVtxZ_eta0p7to1->setAxisTitle("# tracking particles", 2);
998 
999  // Eta 3 (1.0 to 1.2)
1000  HistoName = "resVtxZ_eta1to1p2";
1002  HistoName,
1003  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
1004  psRes_VtxZ.getParameter<double>("xmin"),
1005  psRes_VtxZ.getParameter<double>("xmax"));
1006  resVtxZ_eta1to1p2->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
1007  resVtxZ_eta1to1p2->setAxisTitle("# tracking particles", 2);
1008 
1009  // Eta 4 (1.2 to 1.6)
1010  HistoName = "resVtxZ_eta1p2to1p6";
1012  HistoName,
1013  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
1014  psRes_VtxZ.getParameter<double>("xmin"),
1015  psRes_VtxZ.getParameter<double>("xmax"));
1016  resVtxZ_eta1p2to1p6->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
1017  resVtxZ_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
1018 
1019  // Eta 5 (1.6 to 2.0)
1020  HistoName = "resVtxZ_eta1p6to2";
1022  HistoName,
1023  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
1024  psRes_VtxZ.getParameter<double>("xmin"),
1025  psRes_VtxZ.getParameter<double>("xmax"));
1026  resVtxZ_eta1p6to2->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
1027  resVtxZ_eta1p6to2->setAxisTitle("# tracking particles", 2);
1028 
1029  // Eta 6 (2.0 to 2.4)
1030  HistoName = "resVtxZ_eta2to2p4";
1032  HistoName,
1033  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
1034  psRes_VtxZ.getParameter<double>("xmin"),
1035  psRes_VtxZ.getParameter<double>("xmax"));
1036  resVtxZ_eta2to2p4->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
1037  resVtxZ_eta2to2p4->setAxisTitle("# tracking particles", 2);
1038 
1039  // d0 parts (for resolution)
1040  // Eta 1 (0 to 0.7)
1041  edm::ParameterSet psRes_d0 = conf_.getParameter<edm::ParameterSet>("TH1Res_d0");
1042  HistoName = "resd0_eta0to0p7";
1043  resd0_eta0to0p7 = iBooker.book1D(HistoName,
1044  HistoName,
1045  psRes_d0.getParameter<int32_t>("Nbinsx"),
1046  psRes_d0.getParameter<double>("xmin"),
1047  psRes_d0.getParameter<double>("xmax"));
1048  resd0_eta0to0p7->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1049  resd0_eta0to0p7->setAxisTitle("# tracking particles", 2);
1050 
1051  // Eta 2 (0.7 to 1.0)
1052  HistoName = "resd0_eta0p7to1";
1053  resd0_eta0p7to1 = iBooker.book1D(HistoName,
1054  HistoName,
1055  psRes_d0.getParameter<int32_t>("Nbinsx"),
1056  psRes_d0.getParameter<double>("xmin"),
1057  psRes_d0.getParameter<double>("xmax"));
1058  resd0_eta0p7to1->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1059  resd0_eta0p7to1->setAxisTitle("# tracking particles", 2);
1060 
1061  // Eta 3 (1.0 to 1.2)
1062  HistoName = "resd0_eta1to1p2";
1063  resd0_eta1to1p2 = iBooker.book1D(HistoName,
1064  HistoName,
1065  psRes_d0.getParameter<int32_t>("Nbinsx"),
1066  psRes_d0.getParameter<double>("xmin"),
1067  psRes_d0.getParameter<double>("xmax"));
1068  resd0_eta1to1p2->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1069  resd0_eta1to1p2->setAxisTitle("# tracking particles", 2);
1070 
1071  // Eta 4 (1.2 to 1.6)
1072  HistoName = "resd0_eta1p2to1p6";
1074  HistoName,
1075  psRes_d0.getParameter<int32_t>("Nbinsx"),
1076  psRes_d0.getParameter<double>("xmin"),
1077  psRes_d0.getParameter<double>("xmax"));
1078  resd0_eta1p2to1p6->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1079  resd0_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
1080 
1081  // Eta 5 (1.6 to 2.0)
1082  HistoName = "resd0_eta1p6to2";
1083  resd0_eta1p6to2 = iBooker.book1D(HistoName,
1084  HistoName,
1085  psRes_d0.getParameter<int32_t>("Nbinsx"),
1086  psRes_d0.getParameter<double>("xmin"),
1087  psRes_d0.getParameter<double>("xmax"));
1088  resd0_eta1p6to2->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1089  resd0_eta1p6to2->setAxisTitle("# tracking particles", 2);
1090 
1091  // Eta 6 (2.0 to 2.4)
1092  HistoName = "resd0_eta2to2p4";
1093  resd0_eta2to2p4 = iBooker.book1D(HistoName,
1094  HistoName,
1095  psRes_d0.getParameter<int32_t>("Nbinsx"),
1096  psRes_d0.getParameter<double>("xmin"),
1097  psRes_d0.getParameter<double>("xmax"));
1098  resd0_eta2to2p4->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1099  resd0_eta2to2p4->setAxisTitle("# tracking particles", 2);
1100 
1101 } // end of method
1102 
1106  // OuterTrackerMonitorTrackingParticles
1108  {
1110  psd0.add<int>("Nbinsx", 45);
1111  psd0.add<double>("xmax", 3);
1112  psd0.add<double>("xmin", -3);
1113  desc.add<edm::ParameterSetDescription>("TH1TrackParts_Eta", psd0);
1114  }
1115  {
1117  psd0.add<int>("Nbinsx", 60);
1118  psd0.add<double>("xmax", 3.141592653589793);
1119  psd0.add<double>("xmin", -3.141592653589793);
1120  desc.add<edm::ParameterSetDescription>("TH1TrackParts_Phi", psd0);
1121  }
1122  {
1124  psd0.add<int>("Nbinsx", 45);
1125  psd0.add<double>("xmax", 100);
1126  psd0.add<double>("xmin", 0);
1127  desc.add<edm::ParameterSetDescription>("TH1TrackParts_Pt", psd0);
1128  }
1129  {
1131  psd0.add<int>("Nbinsx", 200);
1132  psd0.add<double>("xmax", 0.5);
1133  psd0.add<double>("xmin", -0.5);
1134  desc.add<edm::ParameterSetDescription>("TH1Res_ptRel", psd0);
1135  }
1136  {
1138  psd0.add<int>("Nbinsx", 50);
1139  psd0.add<double>("xmax", 100);
1140  psd0.add<double>("xmin", 0);
1141  desc.add<edm::ParameterSetDescription>("TH1Effic_pt", psd0);
1142  }
1143  {
1145  psd0.add<int>("Nbinsx", 50);
1146  psd0.add<double>("xmax", 10);
1147  psd0.add<double>("xmin", 0);
1148  desc.add<edm::ParameterSetDescription>("TH1Effic_pt_zoom", psd0);
1149  }
1150  {
1152  psd0.add<int>("Nbinsx", 50);
1153  psd0.add<double>("xmax", 2.5);
1154  psd0.add<double>("xmin", -2.5);
1155  desc.add<edm::ParameterSetDescription>("TH1Effic_eta", psd0);
1156  }
1157  {
1159  psd0.add<int>("Nbinsx", 50);
1160  psd0.add<double>("xmax", 2);
1161  psd0.add<double>("xmin", -2);
1162  desc.add<edm::ParameterSetDescription>("TH1Effic_d0", psd0);
1163  }
1164  {
1166  psd0.add<int>("Nbinsx", 50);
1167  psd0.add<double>("xmax", 5);
1168  psd0.add<double>("xmin", -5);
1169  desc.add<edm::ParameterSetDescription>("TH1Effic_VtxR", psd0);
1170  }
1171  {
1173  psd0.add<int>("Nbinsx", 50);
1174  psd0.add<double>("xmax", 30);
1175  psd0.add<double>("xmin", -30);
1176  desc.add<edm::ParameterSetDescription>("TH1Effic_VtxZ", psd0);
1177  }
1178  {
1180  psd0.add<int>("Nbinsx", 100);
1181  psd0.add<double>("xmax", 0.2);
1182  psd0.add<double>("xmin", -0.2);
1183  desc.add<edm::ParameterSetDescription>("TH1Res_pt", psd0);
1184  }
1185  {
1187  psd0.add<int>("Nbinsx", 100);
1188  psd0.add<double>("xmax", 0.01);
1189  psd0.add<double>("xmin", -0.01);
1190  desc.add<edm::ParameterSetDescription>("TH1Res_eta", psd0);
1191  }
1192  {
1194  psd0.add<int>("Nbinsx", 100);
1195  psd0.add<double>("xmax", 0.01);
1196  psd0.add<double>("xmin", -0.01);
1197  desc.add<edm::ParameterSetDescription>("TH1Res_phi", psd0);
1198  }
1199  {
1201  psd0.add<int>("Nbinsx", 100);
1202  psd0.add<double>("xmax", 1.0);
1203  psd0.add<double>("xmin", -1.0);
1204  desc.add<edm::ParameterSetDescription>("TH1Res_VtxZ", psd0);
1205  }
1206  {
1208  psd0.add<int>("Nbinsx", 100);
1209  psd0.add<double>("xmax", 0.05);
1210  psd0.add<double>("xmin", -0.05);
1211  desc.add<edm::ParameterSetDescription>("TH1Res_d0", psd0);
1212  }
1213  desc.add<std::string>("TopFolderName", "TrackerPhase2OTL1TrackV");
1214  desc.add<edm::InputTag>("trackingParticleToken", edm::InputTag("mix", "MergedTrackTruth"));
1215  desc.add<edm::InputTag>("MCTruthStubInputTag", edm::InputTag("TTStubAssociatorFromPixelDigis", "StubAccepted"));
1216  desc.add<edm::InputTag>("MCTruthTrackInputTag", edm::InputTag("TTTrackAssociatorFromPixelDigis", "Level1TTTracks"));
1217  desc.add<edm::InputTag>("MCTruthClusterInputTag",
1218  edm::InputTag("TTClusterAssociatorFromPixelDigis", "ClusterAccepted"));
1219  desc.add<int>("L1Tk_minNStub", 4);
1220  desc.add<double>("L1Tk_maxChi2dof", 25.0);
1221  desc.add<int>("TP_minNStub", 4);
1222  desc.add<int>("TP_minNLayersStub", 4);
1223  desc.add<double>("TP_minPt", 2.0);
1224  desc.add<double>("TP_maxEta", 2.4);
1225  desc.add<double>("TP_maxVtxZ", 15.0);
1226  descriptions.add("Phase2OTValidateTrackingParticles", desc);
1227  // or use the following to generate the label from the module's C++ type
1228  //descriptions.addWithDefaultLabel(desc);
1229 }
1230 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
int pdgId() const
PDG ID.
Phase2OTValidateTrackingParticles(const edm::ParameterSet &)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double isum
unsigned int layer(const DetId &id) const
const Double_t pi
void Fill(long long x)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoToken
edm::EDGetTokenT< std::vector< TrackingParticle > > trackingParticleToken_
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static constexpr auto TOB
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > ttTrackMCTruthToken_
edm::EDGetTokenT< TTClusterAssociationMap< Ref_Phase2TrackerDigi_ > > ttClusterMCTruthToken_
Definition: DetId.h:17
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const LorentzVector & p4() const
Four-momentum Lorentz vector. Note this is taken from the first SimTrack only.
std::string HistoName
bool isValid() const
Definition: HandleBase.h:70
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: APVGainStruct.h:7
edm::EDGetTokenT< TTStubAssociationMap< Ref_Phase2TrackerDigi_ > > ttStubMCTruthToken_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
static constexpr auto TID
Definition: Run.h:45
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)