CMS 3D CMS Logo

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