CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OuterTrackerMonitorTrackingParticles.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 <fstream>
8 #include <iostream>
9 #include <memory>
10 #include <numeric>
11 #include <vector>
12 
13 // user include files
34 
36 
37 //
38 // constructors and destructor
39 //
41  : m_topoToken(esConsumes()), conf_(iConfig) {
42  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
44  consumes<std::vector<TrackingParticle>>(conf_.getParameter<edm::InputTag>("trackingParticleToken"));
46  consumes<TTStubAssociationMap<Ref_Phase2TrackerDigi_>>(conf_.getParameter<edm::InputTag>("MCTruthStubInputTag"));
47  ttClusterMCTruthToken_ = consumes<TTClusterAssociationMap<Ref_Phase2TrackerDigi_>>(
48  conf_.getParameter<edm::InputTag>("MCTruthClusterInputTag"));
49  ttTrackMCTruthToken_ = consumes<TTTrackAssociationMap<Ref_Phase2TrackerDigi_>>(
50  conf_.getParameter<edm::InputTag>("MCTruthTrackInputTag"));
51  L1Tk_minNStub = conf_.getParameter<int>("L1Tk_minNStub"); // min number of stubs in the track
52  L1Tk_maxChi2dof = conf_.getParameter<double>("L1Tk_maxChi2dof"); // maximum chi2/dof of the track
53  TP_minNStub = conf_.getParameter<int>("TP_minNStub"); // min number of stubs in the tracking particle to
54  //min number of layers with stubs in the tracking particle to consider matching
55  TP_minNLayersStub = conf_.getParameter<int>("TP_minNLayersStub");
56  TP_minPt = conf_.getParameter<double>("TP_minPt"); // min pT to consider matching
57  TP_maxEta = conf_.getParameter<double>("TP_maxEta"); // max eta to consider matching
58  TP_maxVtxZ = conf_.getParameter<double>("TP_maxVtxZ"); // max vertZ (or z0) to consider matching
59 }
60 
62  // do anything here that needs to be done at desctruction time
63  // (e.g. close files, deallocate resources etc.)
64 }
65 
66 // member functions
67 
68 // ------------ method called for each event ------------
70  // Tracking Particles
71  edm::Handle<std::vector<TrackingParticle>> trackingParticleHandle;
72  iEvent.getByToken(trackingParticleToken_, trackingParticleHandle);
73 
74  // Truth Association Maps
76  iEvent.getByToken(ttTrackMCTruthToken_, MCTruthTTTrackHandle);
78  iEvent.getByToken(ttClusterMCTruthToken_, MCTruthTTClusterHandle);
80  iEvent.getByToken(ttStubMCTruthToken_, MCTruthTTStubHandle);
81 
82  // Geometries
83  const TrackerTopology *const tTopo = &iSetup.getData(m_topoToken);
84 
85  // Loop over tracking particles
86  int this_tp = 0;
87  for (const auto &iterTP : *trackingParticleHandle) {
88  edm::Ptr<TrackingParticle> tp_ptr(trackingParticleHandle, this_tp);
89  this_tp++;
90 
91  // int tmp_eventid = iterTP.eventId().event();
92  float tmp_tp_pt = iterTP.pt();
93  float tmp_tp_phi = iterTP.phi();
94  float tmp_tp_eta = iterTP.eta();
95 
96  //Calculate nLayers variable
97  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
98  theStubRefs = MCTruthTTStubHandle->findTTStubRefs(tp_ptr);
99 
100  int hasStubInLayer[11] = {0};
101  for (unsigned int is = 0; is < theStubRefs.size(); is++) {
102  DetId detid(theStubRefs.at(is)->getDetId());
103  int layer = -1;
104  if (detid.subdetId() == StripSubdetector::TOB)
105  layer = static_cast<int>(tTopo->layer(detid)) - 1; //fill in array as entries 0-5
106  else if (detid.subdetId() == StripSubdetector::TID)
107  layer = static_cast<int>(tTopo->layer(detid)) + 5; //fill in array as entries 6-10
108 
109  //treat genuine stubs separately (==2 is genuine, ==1 is not)
110  if (MCTruthTTStubHandle->findTrackingParticlePtr(theStubRefs.at(is)).isNull() && hasStubInLayer[layer] < 2)
111  hasStubInLayer[layer] = 1;
112  else
113  hasStubInLayer[layer] = 2;
114  }
115 
116  int nStubLayerTP = 0;
117  for (int isum = 0; isum < 11; isum++) {
118  if (hasStubInLayer[isum] >= 1)
119  nStubLayerTP += 1;
120  }
121 
122  if (std::fabs(tmp_tp_eta) > TP_maxEta)
123  continue;
124  // Fill the 1D distribution plots for tracking particles, to monitor change in stub definition
125  if (tmp_tp_pt > TP_minPt && nStubLayerTP >= TP_minNLayersStub) {
126  trackParts_Pt->Fill(tmp_tp_pt);
127  trackParts_Eta->Fill(tmp_tp_eta);
128  trackParts_Phi->Fill(tmp_tp_phi);
129  }
130 
131  // if (TP_select_eventid == 0 && tmp_eventid != 0)
132  // continue; //only care about tracking particles from the primary interaction for efficiency/resolution
133  int nStubTP = -1;
134  if (MCTruthTTStubHandle.isValid()) {
135  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
136  theStubRefs = MCTruthTTStubHandle->findTTStubRefs(tp_ptr);
137  nStubTP = (int)theStubRefs.size();
138  }
139  if (MCTruthTTClusterHandle.isValid() && MCTruthTTClusterHandle->findTTClusterRefs(tp_ptr).empty())
140  continue;
141 
142  float tmp_tp_vz = iterTP.vz();
143  float tmp_tp_vx = iterTP.vx();
144  float tmp_tp_vy = iterTP.vy();
145  float tmp_tp_charge = tp_ptr->charge();
146  int tmp_tp_pdgid = iterTP.pdgId();
147 
148  // ----------------------------------------------------------------------------------------------
149  // calculate d0 and VtxZ propagated back to the IP, pass if greater than max
150  // VtxZ
151  float tmp_tp_t = tan(2.0 * atan(1.0) - 2.0 * atan(exp(-tmp_tp_eta)));
152  float delx = -tmp_tp_vx;
153  float dely = -tmp_tp_vy;
154  float K = 0.01 * 0.5696 / tmp_tp_pt * tmp_tp_charge; // curvature correction
155  float A = 1. / (2. * K);
156  float tmp_tp_x0p = delx - A * sin(tmp_tp_phi);
157  float tmp_tp_y0p = dely + A * cos(tmp_tp_phi);
158  float tmp_tp_rp = sqrt(tmp_tp_x0p * tmp_tp_x0p + tmp_tp_y0p * tmp_tp_y0p);
159  static double pi = 4.0 * atan(1.0);
160  float delphi = tmp_tp_phi - atan2(-K * tmp_tp_x0p, K * tmp_tp_y0p);
161  if (delphi < -pi)
162  delphi += 2.0 * pi;
163  if (delphi > pi)
164  delphi -= 2.0 * pi;
165 
166  float tmp_tp_VtxZ = tmp_tp_vz + tmp_tp_t * delphi / (2.0 * K);
167  float tmp_tp_VtxR = sqrt(tmp_tp_vx * tmp_tp_vx + tmp_tp_vy * tmp_tp_vy);
168  float tmp_tp_d0 = tmp_tp_charge * tmp_tp_rp - (1. / (2. * K));
169 
170  // simpler formula for d0, in cases where the charge is zero:
171  // https://github.com/cms-sw/cmssw/blob/master/DataFormats/TrackReco/interface/TrackBase.h
172  float other_d0 = -tmp_tp_vx * sin(tmp_tp_phi) + tmp_tp_vy * cos(tmp_tp_phi);
173  tmp_tp_d0 = tmp_tp_d0 * (-1); // fix d0 sign
174  if (K == 0) {
175  tmp_tp_d0 = other_d0;
176  tmp_tp_VtxZ = tmp_tp_vz;
177  }
178  if (std::fabs(tmp_tp_VtxZ) > TP_maxVtxZ)
179  continue;
180 
181  // To make efficiency plots where the denominator has NO stub cuts
182  if (tmp_tp_VtxR < 1.0) {
183  tp_pt->Fill(tmp_tp_pt); //pT effic, no cut on pT, but VtxR cut
184  if (tmp_tp_pt <= 10)
185  tp_pt_zoom->Fill(tmp_tp_pt); //pT effic, no cut on pT, but VtxR cut
186  }
187  if (tmp_tp_pt < TP_minPt)
188  continue;
189  tp_VtxR->Fill(tmp_tp_VtxR); // VtxR efficiency has no cut on VtxR
190  if (tmp_tp_VtxR > 1.0)
191  continue;
192  tp_eta->Fill(tmp_tp_eta);
193  tp_d0->Fill(tmp_tp_d0);
194  tp_VtxZ->Fill(tmp_tp_VtxZ);
195 
196  if (nStubTP < TP_minNStub || nStubLayerTP < TP_minNLayersStub)
197  continue; //nStub cut not included in denominator of efficiency plots
198 
199  // ----------------------------------------------------------------------------------------------
200  // look for L1 tracks matched to the tracking particle
201  int tp_nMatch = 0;
202  int i_track = -1;
203  float i_chi2dof = 99999;
204  if (MCTruthTTTrackHandle.isValid()) {
205  std::vector<edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>>> matchedTracks =
206  MCTruthTTTrackHandle->findTTTrackPtrs(tp_ptr);
207 
208  // ----------------------------------------------------------------------------------------------
209  // loop over matched L1 tracks
210  // here, "match" means tracks that can be associated to a TrackingParticle
211  // with at least one hit of at least one of its clusters
212  // https://twiki.cern.ch/twiki/bin/viewauth/CMS/SLHCTrackerTriggerSWTools#MC_truth_for_TTTrack
213  int trkCounter = 0;
214  for (const auto &thisTrack : matchedTracks) {
215  if (!MCTruthTTTrackHandle->isGenuine(thisTrack))
216  continue;
217  // ----------------------------------------------------------------------------------------------
218  // further require L1 track to be (loosely) genuine, that there is only
219  // one TP matched to the track
220  // + have >= L1Tk_minNStub stubs for it to be a valid match
221  int tmp_trk_nstub = thisTrack->getStubRefs().size();
222  if (tmp_trk_nstub < L1Tk_minNStub)
223  continue;
224  float dmatch_pt = 999;
225  float dmatch_eta = 999;
226  float dmatch_phi = 999;
227  int match_id = 999;
228 
229  edm::Ptr<TrackingParticle> my_tp = MCTruthTTTrackHandle->findTrackingParticlePtr(thisTrack);
230  dmatch_pt = std::fabs(my_tp->p4().pt() - tmp_tp_pt);
231  dmatch_eta = std::fabs(my_tp->p4().eta() - tmp_tp_eta);
232  dmatch_phi = std::fabs(my_tp->p4().phi() - tmp_tp_phi);
233  match_id = my_tp->pdgId();
234  float tmp_trk_chi2dof = thisTrack->chi2Red();
235 
236  // ensure that track is uniquely matched to the TP we are looking at!
237  if (dmatch_pt < 0.1 && dmatch_eta < 0.1 && dmatch_phi < 0.1 && tmp_tp_pdgid == match_id) {
238  tp_nMatch++;
239  if (i_track < 0 || tmp_trk_chi2dof < i_chi2dof) {
240  i_track = trkCounter;
241  i_chi2dof = tmp_trk_chi2dof;
242  }
243  }
244  trkCounter++;
245  } // end loop over matched L1 tracks
246 
247  if (tp_nMatch < 1)
248  continue;
249  // Get information on the matched tracks
250  float tmp_matchtrk_pt = -999;
251  float tmp_matchtrk_eta = -999;
252  float tmp_matchtrk_phi = -999;
253  float tmp_matchtrk_VtxZ = -999;
254  float tmp_matchtrk_chi2dof = -999;
255  int tmp_matchTrk_nStub = -999;
256  float tmp_matchtrk_d0 = -999;
257 
258  tmp_matchtrk_pt = matchedTracks[i_track]->momentum().perp();
259  tmp_matchtrk_eta = matchedTracks[i_track]->momentum().eta();
260  tmp_matchtrk_phi = matchedTracks[i_track]->momentum().phi();
261  tmp_matchtrk_VtxZ = matchedTracks[i_track]->z0();
262  tmp_matchtrk_chi2dof = matchedTracks[i_track]->chi2Red();
263  tmp_matchTrk_nStub = (int)matchedTracks[i_track]->getStubRefs().size();
264 
265  //for d0
266  float tmp_matchtrk_x0 = matchedTracks[i_track]->POCA().x();
267  float tmp_matchtrk_y0 = matchedTracks[i_track]->POCA().y();
268  tmp_matchtrk_d0 = -tmp_matchtrk_x0 * sin(tmp_matchtrk_phi) + tmp_matchtrk_y0 * cos(tmp_matchtrk_phi);
269 
270  //Add cuts for the matched tracks, numerator
271  if (tmp_matchTrk_nStub < L1Tk_minNStub || tmp_matchtrk_chi2dof > L1Tk_maxChi2dof)
272  continue;
273 
274  // fill matched track histograms (if passes all criteria)
275  match_tp_pt->Fill(tmp_tp_pt);
276  if (tmp_tp_pt > 0 && tmp_tp_pt <= 10)
277  match_tp_pt_zoom->Fill(tmp_tp_pt);
278  match_tp_eta->Fill(tmp_tp_eta);
279  match_tp_d0->Fill(tmp_tp_d0);
280  match_tp_VtxR->Fill(tmp_tp_VtxR);
281  match_tp_VtxZ->Fill(tmp_tp_VtxZ);
282 
283  // Eta and pT histograms for resolution
284  float pt_diff = tmp_matchtrk_pt - tmp_tp_pt;
285  float pt_res = pt_diff / tmp_tp_pt;
286  float eta_res = tmp_matchtrk_eta - tmp_tp_eta;
287  float phi_res = tmp_matchtrk_phi - tmp_tp_phi;
288  float VtxZ_res = tmp_matchtrk_VtxZ - tmp_tp_VtxZ;
289  float d0_res = tmp_matchtrk_d0 - tmp_tp_d0;
290 
291  // fill total resolution histograms
292  res_pt->Fill(pt_diff);
293  res_ptRel->Fill(pt_res);
294  res_eta->Fill(eta_res);
295 
296  // Fill resolution plots for different abs(eta) bins:
297  // (0, 0.7), (0.7, 1.0), (1.0, 1.2), (1.2, 1.6), (1.6, 2.0), (2.0, 2.4)
298  if (std::fabs(tmp_tp_eta) >= 0 && std::fabs(tmp_tp_eta) < 0.7) {
299  reseta_eta0to0p7->Fill(eta_res);
300  resphi_eta0to0p7->Fill(phi_res);
301  resVtxZ_eta0to0p7->Fill(VtxZ_res);
302  resd0_eta0to0p7->Fill(d0_res);
303  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
304  respt_eta0to0p7_pt2to3->Fill(pt_res);
305  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
306  respt_eta0to0p7_pt3to8->Fill(pt_res);
307  else if (tmp_tp_pt >= 8)
309  } else if (std::fabs(tmp_tp_eta) >= 0.7 && std::fabs(tmp_tp_eta) < 1.0) {
310  reseta_eta0p7to1->Fill(eta_res);
311  resphi_eta0p7to1->Fill(phi_res);
312  resVtxZ_eta0p7to1->Fill(VtxZ_res);
313  resd0_eta0p7to1->Fill(d0_res);
314  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
315  respt_eta0p7to1_pt2to3->Fill(pt_res);
316  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
317  respt_eta0p7to1_pt3to8->Fill(pt_res);
318  else if (tmp_tp_pt >= 8)
320  } else if (std::fabs(tmp_tp_eta) >= 1.0 && std::fabs(tmp_tp_eta) < 1.2) {
321  reseta_eta1to1p2->Fill(eta_res);
322  resphi_eta1to1p2->Fill(phi_res);
323  resVtxZ_eta1to1p2->Fill(VtxZ_res);
324  resd0_eta1to1p2->Fill(d0_res);
325  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
326  respt_eta1to1p2_pt2to3->Fill(pt_res);
327  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
328  respt_eta1to1p2_pt3to8->Fill(pt_res);
329  else if (tmp_tp_pt >= 8)
331  } else if (std::fabs(tmp_tp_eta) >= 1.2 && std::fabs(tmp_tp_eta) < 1.6) {
332  reseta_eta1p2to1p6->Fill(eta_res);
333  resphi_eta1p2to1p6->Fill(phi_res);
334  resVtxZ_eta1p2to1p6->Fill(VtxZ_res);
335  resd0_eta1p2to1p6->Fill(d0_res);
336  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
338  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
340  else if (tmp_tp_pt >= 8)
342  } else if (std::fabs(tmp_tp_eta) >= 1.6 && std::fabs(tmp_tp_eta) < 2.0) {
343  reseta_eta1p6to2->Fill(eta_res);
344  resphi_eta1p6to2->Fill(phi_res);
345  resVtxZ_eta1p6to2->Fill(VtxZ_res);
346  resd0_eta1p6to2->Fill(d0_res);
347  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
348  respt_eta1p6to2_pt2to3->Fill(pt_res);
349  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
350  respt_eta1p6to2_pt3to8->Fill(pt_res);
351  else if (tmp_tp_pt >= 8)
353  } else if (std::fabs(tmp_tp_eta) >= 2.0 && std::fabs(tmp_tp_eta) <= 2.4) {
354  reseta_eta2to2p4->Fill(eta_res);
355  resphi_eta2to2p4->Fill(phi_res);
356  resVtxZ_eta2to2p4->Fill(VtxZ_res);
357  resd0_eta2to2p4->Fill(d0_res);
358  if (tmp_tp_pt >= 2 && tmp_tp_pt < 3)
359  respt_eta2to2p4_pt2to3->Fill(pt_res);
360  else if (tmp_tp_pt >= 3 && tmp_tp_pt < 8)
361  respt_eta2to2p4_pt3to8->Fill(pt_res);
362  else if (tmp_tp_pt >= 8)
364  }
365  } //if MC TTTrack handle is valid
366  } //end loop over tracking particles
367 } // end of method
368 
369 // ------------ method called once each job just before starting event loop
370 // ------------
372  edm::Run const &run,
373  edm::EventSetup const &es) {
374  // Histogram setup and definitions
376  iBooker.setCurrentFolder(topFolderName_ + "/trackParticles");
377 
378  // 1D: pT
379  edm::ParameterSet psTrackParts_Pt = conf_.getParameter<edm::ParameterSet>("TH1TrackParts_Pt");
380  HistoName = "trackParts_Pt";
381  trackParts_Pt = iBooker.book1D(HistoName,
382  HistoName,
383  psTrackParts_Pt.getParameter<int32_t>("Nbinsx"),
384  psTrackParts_Pt.getParameter<double>("xmin"),
385  psTrackParts_Pt.getParameter<double>("xmax"));
386  trackParts_Pt->setAxisTitle("p_{T} [GeV]", 1);
387  trackParts_Pt->setAxisTitle("# tracking particles", 2);
388 
389  // 1D: eta
390  edm::ParameterSet psTrackParts_Eta = conf_.getParameter<edm::ParameterSet>("TH1TrackParts_Eta");
391  HistoName = "trackParts_Eta";
392  trackParts_Eta = iBooker.book1D(HistoName,
393  HistoName,
394  psTrackParts_Eta.getParameter<int32_t>("Nbinsx"),
395  psTrackParts_Eta.getParameter<double>("xmin"),
396  psTrackParts_Eta.getParameter<double>("xmax"));
397  trackParts_Eta->setAxisTitle("#eta", 1);
398  trackParts_Eta->setAxisTitle("# tracking particles", 2);
399 
400  // 1D: phi
401  edm::ParameterSet psTrackParts_Phi = conf_.getParameter<edm::ParameterSet>("TH1TrackParts_Phi");
402  HistoName = "trackParts_Phi";
403  trackParts_Phi = iBooker.book1D(HistoName,
404  HistoName,
405  psTrackParts_Phi.getParameter<int32_t>("Nbinsx"),
406  psTrackParts_Phi.getParameter<double>("xmin"),
407  psTrackParts_Phi.getParameter<double>("xmax"));
408  trackParts_Phi->setAxisTitle("#phi", 1);
409  trackParts_Phi->setAxisTitle("# tracking particles", 2);
410 
411  // 1D plots for efficiency
412  iBooker.setCurrentFolder(topFolderName_ + "/Tracks/Efficiency");
413  // pT
414  edm::ParameterSet psEffic_pt = conf_.getParameter<edm::ParameterSet>("TH1Effic_pt");
415  HistoName = "tp_pt";
416  tp_pt = iBooker.book1D(HistoName,
417  HistoName,
418  psEffic_pt.getParameter<int32_t>("Nbinsx"),
419  psEffic_pt.getParameter<double>("xmin"),
420  psEffic_pt.getParameter<double>("xmax"));
421  tp_pt->setAxisTitle("p_{T} [GeV]", 1);
422  tp_pt->setAxisTitle("# tracking particles", 2);
423 
424  // Matched TP's pT
425  HistoName = "match_tp_pt";
426  match_tp_pt = iBooker.book1D(HistoName,
427  HistoName,
428  psEffic_pt.getParameter<int32_t>("Nbinsx"),
429  psEffic_pt.getParameter<double>("xmin"),
430  psEffic_pt.getParameter<double>("xmax"));
431  match_tp_pt->setAxisTitle("p_{T} [GeV]", 1);
432  match_tp_pt->setAxisTitle("# matched tracking particles", 2);
433 
434  // pT zoom (0-10 GeV)
435  edm::ParameterSet psEffic_pt_zoom = conf_.getParameter<edm::ParameterSet>("TH1Effic_pt_zoom");
436  HistoName = "tp_pt_zoom";
437  tp_pt_zoom = iBooker.book1D(HistoName,
438  HistoName,
439  psEffic_pt_zoom.getParameter<int32_t>("Nbinsx"),
440  psEffic_pt_zoom.getParameter<double>("xmin"),
441  psEffic_pt_zoom.getParameter<double>("xmax"));
442  tp_pt_zoom->setAxisTitle("p_{T} [GeV]", 1);
443  tp_pt_zoom->setAxisTitle("# tracking particles", 2);
444 
445  // Matched pT zoom (0-10 GeV)
446  HistoName = "match_tp_pt_zoom";
447  match_tp_pt_zoom = iBooker.book1D(HistoName,
448  HistoName,
449  psEffic_pt_zoom.getParameter<int32_t>("Nbinsx"),
450  psEffic_pt_zoom.getParameter<double>("xmin"),
451  psEffic_pt_zoom.getParameter<double>("xmax"));
452  match_tp_pt_zoom->setAxisTitle("p_{T} [GeV]", 1);
453  match_tp_pt_zoom->setAxisTitle("# matched tracking particles", 2);
454 
455  // eta
456  edm::ParameterSet psEffic_eta = conf_.getParameter<edm::ParameterSet>("TH1Effic_eta");
457  HistoName = "tp_eta";
458  tp_eta = iBooker.book1D(HistoName,
459  HistoName,
460  psEffic_eta.getParameter<int32_t>("Nbinsx"),
461  psEffic_eta.getParameter<double>("xmin"),
462  psEffic_eta.getParameter<double>("xmax"));
463  tp_eta->setAxisTitle("#eta", 1);
464  tp_eta->setAxisTitle("# tracking particles", 2);
465 
466  // Matched eta
467  HistoName = "match_tp_eta";
468  match_tp_eta = iBooker.book1D(HistoName,
469  HistoName,
470  psEffic_eta.getParameter<int32_t>("Nbinsx"),
471  psEffic_eta.getParameter<double>("xmin"),
472  psEffic_eta.getParameter<double>("xmax"));
473  match_tp_eta->setAxisTitle("#eta", 1);
474  match_tp_eta->setAxisTitle("# matched tracking particles", 2);
475 
476  // d0
477  edm::ParameterSet psEffic_d0 = conf_.getParameter<edm::ParameterSet>("TH1Effic_d0");
478  HistoName = "tp_d0";
479  tp_d0 = iBooker.book1D(HistoName,
480  HistoName,
481  psEffic_d0.getParameter<int32_t>("Nbinsx"),
482  psEffic_d0.getParameter<double>("xmin"),
483  psEffic_d0.getParameter<double>("xmax"));
484  tp_d0->setAxisTitle("d_{0} [cm]", 1);
485  tp_d0->setAxisTitle("# tracking particles", 2);
486 
487  // Matched d0
488  HistoName = "match_tp_d0";
489  match_tp_d0 = iBooker.book1D(HistoName,
490  HistoName,
491  psEffic_d0.getParameter<int32_t>("Nbinsx"),
492  psEffic_d0.getParameter<double>("xmin"),
493  psEffic_d0.getParameter<double>("xmax"));
494  match_tp_d0->setAxisTitle("d_{0} [cm]", 1);
495  match_tp_d0->setAxisTitle("# matched tracking particles", 2);
496 
497  // VtxR (also known as vxy)
498  edm::ParameterSet psEffic_VtxR = conf_.getParameter<edm::ParameterSet>("TH1Effic_VtxR");
499  HistoName = "tp_VtxR";
500  tp_VtxR = iBooker.book1D(HistoName,
501  HistoName,
502  psEffic_VtxR.getParameter<int32_t>("Nbinsx"),
503  psEffic_VtxR.getParameter<double>("xmin"),
504  psEffic_VtxR.getParameter<double>("xmax"));
505  tp_VtxR->setAxisTitle("d_{xy} [cm]", 1);
506  tp_VtxR->setAxisTitle("# tracking particles", 2);
507 
508  // Matched VtxR
509  HistoName = "match_tp_VtxR";
510  match_tp_VtxR = iBooker.book1D(HistoName,
511  HistoName,
512  psEffic_VtxR.getParameter<int32_t>("Nbinsx"),
513  psEffic_VtxR.getParameter<double>("xmin"),
514  psEffic_VtxR.getParameter<double>("xmax"));
515  match_tp_VtxR->setAxisTitle("d_{xy} [cm]", 1);
516  match_tp_VtxR->setAxisTitle("# matched tracking particles", 2);
517 
518  // VtxZ
519  edm::ParameterSet psEffic_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1Effic_VtxZ");
520  HistoName = "tp_VtxZ";
521  tp_VtxZ = iBooker.book1D(HistoName,
522  HistoName,
523  psEffic_VtxZ.getParameter<int32_t>("Nbinsx"),
524  psEffic_VtxZ.getParameter<double>("xmin"),
525  psEffic_VtxZ.getParameter<double>("xmax"));
526  tp_VtxZ->setAxisTitle("z_{0} [cm]", 1);
527  tp_VtxZ->setAxisTitle("# tracking particles", 2);
528 
529  // Matched d0
530  HistoName = "match_tp_VtxZ";
531  match_tp_VtxZ = iBooker.book1D(HistoName,
532  HistoName,
533  psEffic_VtxZ.getParameter<int32_t>("Nbinsx"),
534  psEffic_VtxZ.getParameter<double>("xmin"),
535  psEffic_VtxZ.getParameter<double>("xmax"));
536  match_tp_VtxZ->setAxisTitle("z_{0} [cm]", 1);
537  match_tp_VtxZ->setAxisTitle("# matched tracking particles", 2);
538 
539  // 1D plots for resolution
540  iBooker.setCurrentFolder(topFolderName_ + "/Tracks/Resolution");
541  // full pT
542  edm::ParameterSet psRes_pt = conf_.getParameter<edm::ParameterSet>("TH1Res_pt");
543  HistoName = "res_pt";
544  res_pt = iBooker.book1D(HistoName,
545  HistoName,
546  psRes_pt.getParameter<int32_t>("Nbinsx"),
547  psRes_pt.getParameter<double>("xmin"),
548  psRes_pt.getParameter<double>("xmax"));
549  res_pt->setAxisTitle("p_{T} [GeV]", 1);
550  res_pt->setAxisTitle("# tracking particles", 2);
551 
552  // Full eta
553  edm::ParameterSet psRes_eta = conf_.getParameter<edm::ParameterSet>("TH1Res_eta");
554  HistoName = "res_eta";
555  res_eta = iBooker.book1D(HistoName,
556  HistoName,
557  psRes_eta.getParameter<int32_t>("Nbinsx"),
558  psRes_eta.getParameter<double>("xmin"),
559  psRes_eta.getParameter<double>("xmax"));
560  res_eta->setAxisTitle("#eta", 1);
561  res_eta->setAxisTitle("# tracking particles", 2);
562 
563  // Relative pT
564  edm::ParameterSet psRes_ptRel = conf_.getParameter<edm::ParameterSet>("TH1Res_ptRel");
565  HistoName = "res_ptRel";
566  res_ptRel = iBooker.book1D(HistoName,
567  HistoName,
568  psRes_ptRel.getParameter<int32_t>("Nbinsx"),
569  psRes_ptRel.getParameter<double>("xmin"),
570  psRes_ptRel.getParameter<double>("xmax"));
571  res_ptRel->setAxisTitle("Relative p_{T} [GeV]", 1);
572  res_ptRel->setAxisTitle("# tracking particles", 2);
573 
574  // Eta parts (for resolution)
575  // Eta 1 (0 to 0.7)
576  HistoName = "reseta_eta0to0p7";
577  reseta_eta0to0p7 = iBooker.book1D(HistoName,
578  HistoName,
579  psRes_eta.getParameter<int32_t>("Nbinsx"),
580  psRes_eta.getParameter<double>("xmin"),
581  psRes_eta.getParameter<double>("xmax"));
582  reseta_eta0to0p7->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
583  reseta_eta0to0p7->setAxisTitle("# tracking particles", 2);
584 
585  // Eta 2 (0.7 to 1.0)
586  HistoName = "reseta_eta0p7to1";
587  reseta_eta0p7to1 = iBooker.book1D(HistoName,
588  HistoName,
589  psRes_eta.getParameter<int32_t>("Nbinsx"),
590  psRes_eta.getParameter<double>("xmin"),
591  psRes_eta.getParameter<double>("xmax"));
592  reseta_eta0p7to1->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
593  reseta_eta0p7to1->setAxisTitle("# tracking particles", 2);
594 
595  // Eta 3 (1.0 to 1.2)
596  HistoName = "reseta_eta1to1p2";
597  reseta_eta1to1p2 = iBooker.book1D(HistoName,
598  HistoName,
599  psRes_eta.getParameter<int32_t>("Nbinsx"),
600  psRes_eta.getParameter<double>("xmin"),
601  psRes_eta.getParameter<double>("xmax"));
602  reseta_eta1to1p2->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
603  reseta_eta1to1p2->setAxisTitle("# tracking particles", 2);
604 
605  // Eta 4 (1.2 to 1.6)
606  HistoName = "reseta_eta1p2to1p6";
607  reseta_eta1p2to1p6 = iBooker.book1D(HistoName,
608  HistoName,
609  psRes_eta.getParameter<int32_t>("Nbinsx"),
610  psRes_eta.getParameter<double>("xmin"),
611  psRes_eta.getParameter<double>("xmax"));
612  reseta_eta1p2to1p6->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
613  reseta_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
614 
615  // Eta 5 (1.6 to 2.0)
616  HistoName = "reseta_eta1p6to2";
617  reseta_eta1p6to2 = iBooker.book1D(HistoName,
618  HistoName,
619  psRes_eta.getParameter<int32_t>("Nbinsx"),
620  psRes_eta.getParameter<double>("xmin"),
621  psRes_eta.getParameter<double>("xmax"));
622  reseta_eta1p6to2->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
623  reseta_eta1p6to2->setAxisTitle("# tracking particles", 2);
624 
625  // Eta 6 (2.0 to 2.4)
626  HistoName = "reseta_eta2to2p4";
627  reseta_eta2to2p4 = iBooker.book1D(HistoName,
628  HistoName,
629  psRes_eta.getParameter<int32_t>("Nbinsx"),
630  psRes_eta.getParameter<double>("xmin"),
631  psRes_eta.getParameter<double>("xmax"));
632  reseta_eta2to2p4->setAxisTitle("#eta_{trk} - #eta_{tp}", 1);
633  reseta_eta2to2p4->setAxisTitle("# tracking particles", 2);
634 
635  // pT parts for resolution (pT res vs eta)
636  // pT a (2 to 3 GeV)
637  // Eta 1 (0 to 0.7)
638  HistoName = "respt_eta0to0p7_pt2to3";
639  respt_eta0to0p7_pt2to3 = iBooker.book1D(HistoName,
640  HistoName,
641  psRes_pt.getParameter<int32_t>("Nbinsx"),
642  psRes_pt.getParameter<double>("xmin"),
643  psRes_pt.getParameter<double>("xmax"));
644  respt_eta0to0p7_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
645  respt_eta0to0p7_pt2to3->setAxisTitle("# tracking particles", 2);
646 
647  // Eta 2 (0.7 to 1.0)
648  HistoName = "respt_eta0p7to1_pt2to3";
649  respt_eta0p7to1_pt2to3 = iBooker.book1D(HistoName,
650  HistoName,
651  psRes_pt.getParameter<int32_t>("Nbinsx"),
652  psRes_pt.getParameter<double>("xmin"),
653  psRes_pt.getParameter<double>("xmax"));
654  respt_eta0p7to1_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
655  respt_eta0p7to1_pt2to3->setAxisTitle("# tracking particles", 2);
656 
657  // Eta 3 (1.0 to 1.2)
658  HistoName = "respt_eta1to1p2_pt2to3";
659  respt_eta1to1p2_pt2to3 = iBooker.book1D(HistoName,
660  HistoName,
661  psRes_pt.getParameter<int32_t>("Nbinsx"),
662  psRes_pt.getParameter<double>("xmin"),
663  psRes_pt.getParameter<double>("xmax"));
664  respt_eta1to1p2_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
665  respt_eta1to1p2_pt2to3->setAxisTitle("# tracking particles", 2);
666 
667  // Eta 4 (1.2 to 1.6)
668  HistoName = "respt_eta1p2to1p6_pt2to3";
669  respt_eta1p2to1p6_pt2to3 = iBooker.book1D(HistoName,
670  HistoName,
671  psRes_pt.getParameter<int32_t>("Nbinsx"),
672  psRes_pt.getParameter<double>("xmin"),
673  psRes_pt.getParameter<double>("xmax"));
674  respt_eta1p2to1p6_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
675  respt_eta1p2to1p6_pt2to3->setAxisTitle("# tracking particles", 2);
676 
677  // Eta 5 (1.6 to 2.0)
678  HistoName = "respt_eta1p6to2_pt2to3";
679  respt_eta1p6to2_pt2to3 = iBooker.book1D(HistoName,
680  HistoName,
681  psRes_pt.getParameter<int32_t>("Nbinsx"),
682  psRes_pt.getParameter<double>("xmin"),
683  psRes_pt.getParameter<double>("xmax"));
684  respt_eta1p6to2_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
685  respt_eta1p6to2_pt2to3->setAxisTitle("# tracking particles", 2);
686 
687  // Eta 6 (2.0 to 2.4)
688  HistoName = "respt_eta2to2p4_pt2to3";
689  respt_eta2to2p4_pt2to3 = iBooker.book1D(HistoName,
690  HistoName,
691  psRes_pt.getParameter<int32_t>("Nbinsx"),
692  psRes_pt.getParameter<double>("xmin"),
693  psRes_pt.getParameter<double>("xmax"));
694  respt_eta2to2p4_pt2to3->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
695  respt_eta2to2p4_pt2to3->setAxisTitle("# tracking particles", 2);
696 
697  // pT b (3 to 8 GeV)
698  // Eta 1 (0 to 0.7)
699  HistoName = "respt_eta0to0p7_pt3to8";
700  respt_eta0to0p7_pt3to8 = iBooker.book1D(HistoName,
701  HistoName,
702  psRes_pt.getParameter<int32_t>("Nbinsx"),
703  psRes_pt.getParameter<double>("xmin"),
704  psRes_pt.getParameter<double>("xmax"));
705  respt_eta0to0p7_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
706  respt_eta0to0p7_pt3to8->setAxisTitle("# tracking particles", 2);
707 
708  // Eta 2 (0.7 to 1.0)
709  HistoName = "respt_eta0p7to1_pt3to8";
710  respt_eta0p7to1_pt3to8 = iBooker.book1D(HistoName,
711  HistoName,
712  psRes_pt.getParameter<int32_t>("Nbinsx"),
713  psRes_pt.getParameter<double>("xmin"),
714  psRes_pt.getParameter<double>("xmax"));
715  respt_eta0p7to1_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
716  respt_eta0p7to1_pt3to8->setAxisTitle("# tracking particles", 2);
717 
718  // Eta 3 (1.0 to 1.2)
719  HistoName = "respt_eta1to1p2_pt3to8";
720  respt_eta1to1p2_pt3to8 = iBooker.book1D(HistoName,
721  HistoName,
722  psRes_pt.getParameter<int32_t>("Nbinsx"),
723  psRes_pt.getParameter<double>("xmin"),
724  psRes_pt.getParameter<double>("xmax"));
725  respt_eta1to1p2_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
726  respt_eta1to1p2_pt3to8->setAxisTitle("# tracking particles", 2);
727 
728  // Eta 4 (1.2 to 1.6)
729  HistoName = "respt_eta1p2to1p6_pt3to8";
730  respt_eta1p2to1p6_pt3to8 = iBooker.book1D(HistoName,
731  HistoName,
732  psRes_pt.getParameter<int32_t>("Nbinsx"),
733  psRes_pt.getParameter<double>("xmin"),
734  psRes_pt.getParameter<double>("xmax"));
735  respt_eta1p2to1p6_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
736  respt_eta1p2to1p6_pt3to8->setAxisTitle("# tracking particles", 2);
737 
738  // Eta 5 (1.6 to 2.0)
739  HistoName = "respt_eta1p6to2_pt3to8";
740  respt_eta1p6to2_pt3to8 = iBooker.book1D(HistoName,
741  HistoName,
742  psRes_pt.getParameter<int32_t>("Nbinsx"),
743  psRes_pt.getParameter<double>("xmin"),
744  psRes_pt.getParameter<double>("xmax"));
745  respt_eta1p6to2_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
746  respt_eta1p6to2_pt3to8->setAxisTitle("# tracking particles", 2);
747 
748  // Eta 6 (2.0 to 2.4)
749  HistoName = "respt_eta2to2p4_pt3to8";
750  respt_eta2to2p4_pt3to8 = iBooker.book1D(HistoName,
751  HistoName,
752  psRes_pt.getParameter<int32_t>("Nbinsx"),
753  psRes_pt.getParameter<double>("xmin"),
754  psRes_pt.getParameter<double>("xmax"));
755  respt_eta2to2p4_pt3to8->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
756  respt_eta2to2p4_pt3to8->setAxisTitle("# tracking particles", 2);
757 
758  // pT c (>8 GeV)
759  // Eta 1 (0 to 0.7)
760  HistoName = "respt_eta0to0p7_pt8toInf";
761  respt_eta0to0p7_pt8toInf = iBooker.book1D(HistoName,
762  HistoName,
763  psRes_pt.getParameter<int32_t>("Nbinsx"),
764  psRes_pt.getParameter<double>("xmin"),
765  psRes_pt.getParameter<double>("xmax"));
766  respt_eta0to0p7_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
767  respt_eta0to0p7_pt8toInf->setAxisTitle("# tracking particles", 2);
768 
769  // Eta 2 (0.7 to 1.0)
770  HistoName = "respt_eta0p7to1_pt8toInf";
771  respt_eta0p7to1_pt8toInf = iBooker.book1D(HistoName,
772  HistoName,
773  psRes_pt.getParameter<int32_t>("Nbinsx"),
774  psRes_pt.getParameter<double>("xmin"),
775  psRes_pt.getParameter<double>("xmax"));
776  respt_eta0p7to1_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
777  respt_eta0p7to1_pt8toInf->setAxisTitle("# tracking particles", 2);
778 
779  // Eta 3 (1.0 to 1.2)
780  HistoName = "respt_eta1to1p2_pt8toInf";
781  respt_eta1to1p2_pt8toInf = iBooker.book1D(HistoName,
782  HistoName,
783  psRes_pt.getParameter<int32_t>("Nbinsx"),
784  psRes_pt.getParameter<double>("xmin"),
785  psRes_pt.getParameter<double>("xmax"));
786  respt_eta1to1p2_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
787  respt_eta1to1p2_pt8toInf->setAxisTitle("# tracking particles", 2);
788 
789  // Eta 4 (1.2 to 1.6)
790  HistoName = "respt_eta1p2to1p6_pt8toInf";
791  respt_eta1p2to1p6_pt8toInf = iBooker.book1D(HistoName,
792  HistoName,
793  psRes_pt.getParameter<int32_t>("Nbinsx"),
794  psRes_pt.getParameter<double>("xmin"),
795  psRes_pt.getParameter<double>("xmax"));
796  respt_eta1p2to1p6_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
797  respt_eta1p2to1p6_pt8toInf->setAxisTitle("# tracking particles", 2);
798 
799  // Eta 5 (1.6 to 2.0)
800  HistoName = "respt_eta1p6to2_pt8toInf";
801  respt_eta1p6to2_pt8toInf = iBooker.book1D(HistoName,
802  HistoName,
803  psRes_pt.getParameter<int32_t>("Nbinsx"),
804  psRes_pt.getParameter<double>("xmin"),
805  psRes_pt.getParameter<double>("xmax"));
806  respt_eta1p6to2_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
807  respt_eta1p6to2_pt8toInf->setAxisTitle("# tracking particles", 2);
808 
809  // Eta 6 (2.0 to 2.4)
810  HistoName = "respt_eta2to2p4_pt8toInf";
811  respt_eta2to2p4_pt8toInf = iBooker.book1D(HistoName,
812  HistoName,
813  psRes_pt.getParameter<int32_t>("Nbinsx"),
814  psRes_pt.getParameter<double>("xmin"),
815  psRes_pt.getParameter<double>("xmax"));
816  respt_eta2to2p4_pt8toInf->setAxisTitle("(p_{T}(trk) - p_{T}(tp))/p_{T}(tp)", 1);
817  respt_eta2to2p4_pt8toInf->setAxisTitle("# tracking particles", 2);
818 
819  // Phi parts (for resolution)
820  // Eta 1 (0 to 0.7)
821  edm::ParameterSet psRes_phi = conf_.getParameter<edm::ParameterSet>("TH1Res_phi");
822  HistoName = "resphi_eta0to0p7";
823  resphi_eta0to0p7 = iBooker.book1D(HistoName,
824  HistoName,
825  psRes_phi.getParameter<int32_t>("Nbinsx"),
826  psRes_phi.getParameter<double>("xmin"),
827  psRes_phi.getParameter<double>("xmax"));
828  resphi_eta0to0p7->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
829  resphi_eta0to0p7->setAxisTitle("# tracking particles", 2);
830 
831  // Eta 2 (0.7 to 1.0)
832  HistoName = "resphi_eta0p7to1";
833  resphi_eta0p7to1 = iBooker.book1D(HistoName,
834  HistoName,
835  psRes_phi.getParameter<int32_t>("Nbinsx"),
836  psRes_phi.getParameter<double>("xmin"),
837  psRes_phi.getParameter<double>("xmax"));
838  resphi_eta0p7to1->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
839  resphi_eta0p7to1->setAxisTitle("# tracking particles", 2);
840 
841  // Eta 3 (1.0 to 1.2)
842  HistoName = "resphi_eta1to1p2";
843  resphi_eta1to1p2 = iBooker.book1D(HistoName,
844  HistoName,
845  psRes_phi.getParameter<int32_t>("Nbinsx"),
846  psRes_phi.getParameter<double>("xmin"),
847  psRes_phi.getParameter<double>("xmax"));
848  resphi_eta1to1p2->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
849  resphi_eta1to1p2->setAxisTitle("# tracking particles", 2);
850 
851  // Eta 4 (1.2 to 1.6)
852  HistoName = "resphi_eta1p2to1p6";
853  resphi_eta1p2to1p6 = iBooker.book1D(HistoName,
854  HistoName,
855  psRes_phi.getParameter<int32_t>("Nbinsx"),
856  psRes_phi.getParameter<double>("xmin"),
857  psRes_phi.getParameter<double>("xmax"));
858  resphi_eta1p2to1p6->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
859  resphi_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
860 
861  // Eta 5 (1.6 to 2.0)
862  HistoName = "resphi_eta1p6to2";
863  resphi_eta1p6to2 = iBooker.book1D(HistoName,
864  HistoName,
865  psRes_phi.getParameter<int32_t>("Nbinsx"),
866  psRes_phi.getParameter<double>("xmin"),
867  psRes_phi.getParameter<double>("xmax"));
868  resphi_eta1p6to2->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
869  resphi_eta1p6to2->setAxisTitle("# tracking particles", 2);
870 
871  // Eta 6 (2.0 to 2.4)
872  HistoName = "resphi_eta2to2p4";
873  resphi_eta2to2p4 = iBooker.book1D(HistoName,
874  HistoName,
875  psRes_phi.getParameter<int32_t>("Nbinsx"),
876  psRes_phi.getParameter<double>("xmin"),
877  psRes_phi.getParameter<double>("xmax"));
878  resphi_eta2to2p4->setAxisTitle("#phi_{trk} - #phi_{tp}", 1);
879  resphi_eta2to2p4->setAxisTitle("# tracking particles", 2);
880 
881  // VtxZ parts (for resolution)
882  // Eta 1 (0 to 0.7)
883  edm::ParameterSet psRes_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1Res_VtxZ");
884  HistoName = "resVtxZ_eta0to0p7";
885  resVtxZ_eta0to0p7 = iBooker.book1D(HistoName,
886  HistoName,
887  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
888  psRes_VtxZ.getParameter<double>("xmin"),
889  psRes_VtxZ.getParameter<double>("xmax"));
890  resVtxZ_eta0to0p7->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
891  resVtxZ_eta0to0p7->setAxisTitle("# tracking particles", 2);
892 
893  // Eta 2 (0.7 to 1.0)
894  HistoName = "resVtxZ_eta0p7to1";
895  resVtxZ_eta0p7to1 = iBooker.book1D(HistoName,
896  HistoName,
897  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
898  psRes_VtxZ.getParameter<double>("xmin"),
899  psRes_VtxZ.getParameter<double>("xmax"));
900  resVtxZ_eta0p7to1->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
901  resVtxZ_eta0p7to1->setAxisTitle("# tracking particles", 2);
902 
903  // Eta 3 (1.0 to 1.2)
904  HistoName = "resVtxZ_eta1to1p2";
905  resVtxZ_eta1to1p2 = iBooker.book1D(HistoName,
906  HistoName,
907  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
908  psRes_VtxZ.getParameter<double>("xmin"),
909  psRes_VtxZ.getParameter<double>("xmax"));
910  resVtxZ_eta1to1p2->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
911  resVtxZ_eta1to1p2->setAxisTitle("# tracking particles", 2);
912 
913  // Eta 4 (1.2 to 1.6)
914  HistoName = "resVtxZ_eta1p2to1p6";
915  resVtxZ_eta1p2to1p6 = iBooker.book1D(HistoName,
916  HistoName,
917  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
918  psRes_VtxZ.getParameter<double>("xmin"),
919  psRes_VtxZ.getParameter<double>("xmax"));
920  resVtxZ_eta1p2to1p6->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
921  resVtxZ_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
922 
923  // Eta 5 (1.6 to 2.0)
924  HistoName = "resVtxZ_eta1p6to2";
925  resVtxZ_eta1p6to2 = iBooker.book1D(HistoName,
926  HistoName,
927  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
928  psRes_VtxZ.getParameter<double>("xmin"),
929  psRes_VtxZ.getParameter<double>("xmax"));
930  resVtxZ_eta1p6to2->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
931  resVtxZ_eta1p6to2->setAxisTitle("# tracking particles", 2);
932 
933  // Eta 6 (2.0 to 2.4)
934  HistoName = "resVtxZ_eta2to2p4";
935  resVtxZ_eta2to2p4 = iBooker.book1D(HistoName,
936  HistoName,
937  psRes_VtxZ.getParameter<int32_t>("Nbinsx"),
938  psRes_VtxZ.getParameter<double>("xmin"),
939  psRes_VtxZ.getParameter<double>("xmax"));
940  resVtxZ_eta2to2p4->setAxisTitle("VtxZ_{trk} - VtxZ_{tp} [cm]", 1);
941  resVtxZ_eta2to2p4->setAxisTitle("# tracking particles", 2);
942 
943  // d0 parts (for resolution)
944  // Eta 1 (0 to 0.7)
945  edm::ParameterSet psRes_d0 = conf_.getParameter<edm::ParameterSet>("TH1Res_d0");
946  HistoName = "resd0_eta0to0p7";
947  resd0_eta0to0p7 = iBooker.book1D(HistoName,
948  HistoName,
949  psRes_d0.getParameter<int32_t>("Nbinsx"),
950  psRes_d0.getParameter<double>("xmin"),
951  psRes_d0.getParameter<double>("xmax"));
952  resd0_eta0to0p7->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
953  resd0_eta0to0p7->setAxisTitle("# tracking particles", 2);
954 
955  // Eta 2 (0.7 to 1.0)
956  HistoName = "resd0_eta0p7to1";
957  resd0_eta0p7to1 = iBooker.book1D(HistoName,
958  HistoName,
959  psRes_d0.getParameter<int32_t>("Nbinsx"),
960  psRes_d0.getParameter<double>("xmin"),
961  psRes_d0.getParameter<double>("xmax"));
962  resd0_eta0p7to1->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
963  resd0_eta0p7to1->setAxisTitle("# tracking particles", 2);
964 
965  // Eta 3 (1.0 to 1.2)
966  HistoName = "resd0_eta1to1p2";
967  resd0_eta1to1p2 = iBooker.book1D(HistoName,
968  HistoName,
969  psRes_d0.getParameter<int32_t>("Nbinsx"),
970  psRes_d0.getParameter<double>("xmin"),
971  psRes_d0.getParameter<double>("xmax"));
972  resd0_eta1to1p2->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
973  resd0_eta1to1p2->setAxisTitle("# tracking particles", 2);
974 
975  // Eta 4 (1.2 to 1.6)
976  HistoName = "resd0_eta1p2to1p6";
977  resd0_eta1p2to1p6 = iBooker.book1D(HistoName,
978  HistoName,
979  psRes_d0.getParameter<int32_t>("Nbinsx"),
980  psRes_d0.getParameter<double>("xmin"),
981  psRes_d0.getParameter<double>("xmax"));
982  resd0_eta1p2to1p6->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
983  resd0_eta1p2to1p6->setAxisTitle("# tracking particles", 2);
984 
985  // Eta 5 (1.6 to 2.0)
986  HistoName = "resd0_eta1p6to2";
987  resd0_eta1p6to2 = iBooker.book1D(HistoName,
988  HistoName,
989  psRes_d0.getParameter<int32_t>("Nbinsx"),
990  psRes_d0.getParameter<double>("xmin"),
991  psRes_d0.getParameter<double>("xmax"));
992  resd0_eta1p6to2->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
993  resd0_eta1p6to2->setAxisTitle("# tracking particles", 2);
994 
995  // Eta 6 (2.0 to 2.4)
996  HistoName = "resd0_eta2to2p4";
997  resd0_eta2to2p4 = iBooker.book1D(HistoName,
998  HistoName,
999  psRes_d0.getParameter<int32_t>("Nbinsx"),
1000  psRes_d0.getParameter<double>("xmin"),
1001  psRes_d0.getParameter<double>("xmax"));
1002  resd0_eta2to2p4->setAxisTitle("d0_{trk} - d0_{tp} [cm]", 1);
1003  resd0_eta2to2p4->setAxisTitle("# tracking particles", 2);
1004 
1005 } // end of method
1006 
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
double isum
constexpr std::array< uint8_t, layerIndexSize > layer
const Double_t pi
edm::EDGetTokenT< std::vector< TrackingParticle > > trackingParticleToken_
void Fill(long long x)
bool getData(T &iHolder) const
Definition: EventSetup.h:128
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > ttTrackMCTruthToken_
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
edm::EDGetTokenT< TTClusterAssociationMap< Ref_Phase2TrackerDigi_ > > ttClusterMCTruthToken_
static constexpr auto TOB
bool isValid() const
Definition: HandleBase.h:70
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
edm::EDGetTokenT< TTStubAssociationMap< Ref_Phase2TrackerDigi_ > > ttStubMCTruthToken_
Definition: DetId.h:17
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoToken
std::string HistoName
unsigned int layer(const DetId &id) const
void analyze(const edm::Event &, const edm::EventSetup &) override
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
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: Run.h:45
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)