CMS 3D CMS Logo

OuterTrackerMonitorTTTrack.cc
Go to the documentation of this file.
1 // Package: SiOuterTracker
2 // Class: SiOuterTracker
3 //
4 // Original Author: Isis Marina Van Parijs
5 // Modified by: Emily MacDonald (emily.kaelyn.macdonald@cern.ch)
6 
7 // system include files
8 #include <memory>
9 #include <numeric>
10 #include <string>
11 #include <vector>
12 #include <bitset>
13 
14 // user include files
23 
36 
39 
41 public:
43  ~OuterTrackerMonitorTTTrack() override;
44  void analyze(const edm::Event &, const edm::EventSetup &) override;
45  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
47  MonitorElement *Track_All_N = nullptr; // Number of tracks per event
48  MonitorElement *Track_All_NStubs = nullptr; // Number of stubs per track
49  MonitorElement *Track_All_NLayersMissed = nullptr; // Number of layers missed per track
50  MonitorElement *Track_All_Eta_NStubs = nullptr; // Number of stubs per track vs eta
51  MonitorElement *Track_All_Pt = nullptr; // pT distrubtion for tracks
52  MonitorElement *Track_All_Eta = nullptr; // eta distrubtion for tracks
53  MonitorElement *Track_All_Phi = nullptr; // phi distrubtion for tracks
54  MonitorElement *Track_All_D0 = nullptr; // d0 distrubtion for tracks
55  MonitorElement *Track_All_VtxZ = nullptr; // z0 distrubtion for tracks
56  MonitorElement *Track_All_BendChi2 = nullptr; // Bendchi2 distrubtion for tracks
57  MonitorElement *Track_All_Chi2 = nullptr; // chi2 distrubtion for tracks
58  MonitorElement *Track_All_Chi2Red = nullptr; // chi2/dof distrubtion for tracks
59  MonitorElement *Track_All_Chi2RZ = nullptr; // chi2 r-phi distrubtion for tracks
60  MonitorElement *Track_All_Chi2RPhi = nullptr; // chi2 r-z distrubtion for tracks
61  MonitorElement *Track_All_Chi2Red_NStubs = nullptr; // chi2/dof vs number of stubs
62  MonitorElement *Track_All_Chi2Red_Eta = nullptr; // chi2/dof vs eta of track
63  MonitorElement *Track_All_Eta_BarrelStubs = nullptr; // eta vs number of stubs in barrel
64  MonitorElement *Track_All_Eta_ECStubs = nullptr; // eta vs number of stubs in end caps
65  MonitorElement *Track_All_Chi2_Probability = nullptr; // chi2 probability
66  MonitorElement *Track_All_MVA1 = nullptr; // MVA1 (prompt quality) distribution
67 
69  // Quality cuts: chi2/dof<10, bendchi2<2.2 (Prompt), default in config
70  // Quality cuts: chi2/dof<40, bendchi2<2.4 (Extended/Displaced tracks)
71  MonitorElement *Track_HQ_N = nullptr; // Number of tracks per event
72  MonitorElement *Track_HQ_NStubs = nullptr; // Number of stubs per track
73  MonitorElement *Track_HQ_NLayersMissed = nullptr; // Number of layers missed per track
74  MonitorElement *Track_HQ_Eta_NStubs = nullptr; // Number of stubs per track vs eta
75  MonitorElement *Track_HQ_Pt = nullptr; // pT distrubtion for tracks
76  MonitorElement *Track_HQ_Eta = nullptr; // eta distrubtion for tracks
77  MonitorElement *Track_HQ_Phi = nullptr; // phi distrubtion for tracks
78  MonitorElement *Track_HQ_D0 = nullptr; // d0 distrubtion for tracks
79  MonitorElement *Track_HQ_VtxZ = nullptr; // z0 distrubtion for tracks
80  MonitorElement *Track_HQ_BendChi2 = nullptr; // Bendchi2 distrubtion for tracks
81  MonitorElement *Track_HQ_Chi2 = nullptr; // chi2 distrubtion for tracks
82  MonitorElement *Track_HQ_Chi2Red = nullptr; // chi2/dof distrubtion for tracks
83  MonitorElement *Track_HQ_Chi2RZ = nullptr; // chi2 r-z distrubtion for tracks
84  MonitorElement *Track_HQ_Chi2RPhi = nullptr; // chi2 r-phi distrubtion for tracks
85  MonitorElement *Track_HQ_Chi2Red_NStubs = nullptr; // chi2/dof vs number of stubs
86  MonitorElement *Track_HQ_Chi2Red_Eta = nullptr; // chi2/dof vs eta of track
87  MonitorElement *Track_HQ_Eta_BarrelStubs = nullptr; // eta vs number of stubs in barrel
88  MonitorElement *Track_HQ_Eta_ECStubs = nullptr; // eta vs number of stubs in end caps
89  MonitorElement *Track_HQ_Chi2_Probability = nullptr; // chi2 probability
90  MonitorElement *Track_HQ_MVA1 = nullptr; // MVA1 (prompt quality) distribution
91 
92 private:
95 
96  unsigned int HQNStubs_;
97  double HQChi2dof_;
98  double HQBendChi2_;
100 };
101 
102 // constructors and destructor
104  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
105  ttTrackToken_ =
106  consumes<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>>(conf_.getParameter<edm::InputTag>("TTTracksTag"));
107  HQNStubs_ = conf_.getParameter<int>("HQNStubs");
108  HQChi2dof_ = conf_.getParameter<double>("HQChi2dof");
109  HQBendChi2_ = conf_.getParameter<double>("HQBendChi2");
110 }
111 
113  // do anything here that needs to be done at desctruction time
114  // (e.g. close files, deallocate resources etc.)
115 }
116 
117 // ------------ method called for each event ------------
119  // L1 Primaries
121  iEvent.getByToken(ttTrackToken_, TTTrackHandle);
122 
124  unsigned int numAllTracks = 0;
125  unsigned int numHQTracks = 0;
126 
127  // Adding protection
128  if (!TTTrackHandle.isValid())
129  return;
130 
132  unsigned int tkCnt = 0;
133  for (const auto &iterTTTrack : *TTTrackHandle) {
134  edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>> tempTrackPtr(TTTrackHandle, tkCnt++);
135 
136  unsigned int nStubs = tempTrackPtr->getStubRefs().size();
137  int nBarrelStubs = 0;
138  int nECStubs = 0;
139 
140  float track_eta = tempTrackPtr->momentum().eta();
141  float track_d0 = tempTrackPtr->d0();
142  float track_bendchi2 = tempTrackPtr->stubPtConsistency();
143  float track_chi2 = tempTrackPtr->chi2();
144  float track_chi2dof = tempTrackPtr->chi2Red();
145  float track_chi2rz = tempTrackPtr->chi2Z();
146  float track_chi2rphi = tempTrackPtr->chi2XY();
147  float track_MVA1 = tempTrackPtr->trkMVA1();
148  int nLayersMissed = 0;
149  unsigned int hitPattern_ = (unsigned int)tempTrackPtr->hitPattern();
150 
151  int nbits = floor(log2(hitPattern_)) + 1;
152  int lay_i = 0;
153  bool seq = false;
154  for (int i = 0; i < nbits; i++) {
155  lay_i = ((1 << i) & hitPattern_) >> i; //0 or 1 in ith bit (right to left)
156  if (lay_i && !seq)
157  seq = true; //sequence starts when first 1 found
158  if (!lay_i && seq)
159  nLayersMissed++;
160  }
161 
162  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
163  theStubs = iterTTTrack.getStubRefs();
164  for (const auto &istub : theStubs) {
165  bool inBarrel = false;
166  bool inEC = false;
167 
168  if (istub->getDetId().subdetId() == StripSubdetector::TOB)
169  inBarrel = true;
170  else if (istub->getDetId().subdetId() == StripSubdetector::TID)
171  inEC = true;
172  if (inBarrel)
173  nBarrelStubs++;
174  else if (inEC)
175  nECStubs++;
176  } // end loop over stubs
177 
178  // HQ tracks: bendchi2<2.2 and chi2/dof<10
179  if (nStubs >= HQNStubs_ && track_chi2dof <= HQChi2dof_ && track_bendchi2 <= HQBendChi2_) {
180  numHQTracks++;
181 
182  Track_HQ_NStubs->Fill(nStubs);
183  Track_HQ_NLayersMissed->Fill(nLayersMissed);
184  Track_HQ_Eta_NStubs->Fill(track_eta, nStubs);
185  Track_HQ_Pt->Fill(tempTrackPtr->momentum().perp());
186  Track_HQ_Eta->Fill(track_eta);
187  Track_HQ_Phi->Fill(tempTrackPtr->momentum().phi());
188  Track_HQ_D0->Fill(track_d0);
189  Track_HQ_VtxZ->Fill(tempTrackPtr->z0());
190  Track_HQ_BendChi2->Fill(track_bendchi2);
191  Track_HQ_Chi2->Fill(track_chi2);
192  Track_HQ_Chi2RZ->Fill(track_chi2rz);
193  Track_HQ_Chi2RPhi->Fill(track_chi2rphi);
194  Track_HQ_Chi2Red->Fill(track_chi2dof);
195  Track_HQ_Chi2Red_NStubs->Fill(nStubs, track_chi2dof);
196  Track_HQ_Chi2Red_Eta->Fill(track_eta, track_chi2dof);
197  Track_HQ_Eta_BarrelStubs->Fill(track_eta, nBarrelStubs);
198  Track_HQ_Eta_ECStubs->Fill(track_eta, nECStubs);
200  Track_HQ_MVA1->Fill(track_MVA1);
201  }
202 
203  // All tracks (including HQ tracks)
204  numAllTracks++;
205  Track_All_NStubs->Fill(nStubs);
206  Track_All_NLayersMissed->Fill(nLayersMissed);
207  Track_All_Eta_NStubs->Fill(track_eta, nStubs);
208  Track_All_Pt->Fill(tempTrackPtr->momentum().perp());
209  Track_All_Eta->Fill(track_eta);
210  Track_All_Phi->Fill(tempTrackPtr->momentum().phi());
211  Track_All_D0->Fill(track_d0);
212  Track_All_VtxZ->Fill(tempTrackPtr->z0());
213  Track_All_BendChi2->Fill(track_bendchi2);
214  Track_All_Chi2->Fill(track_chi2);
215  Track_All_Chi2RZ->Fill(track_chi2rz);
216  Track_All_Chi2RPhi->Fill(track_chi2rphi);
217  Track_All_Chi2Red->Fill(track_chi2dof);
218  Track_All_Chi2Red_NStubs->Fill(nStubs, track_chi2dof);
219  Track_All_Chi2Red_Eta->Fill(track_eta, track_chi2dof);
220  Track_All_Eta_BarrelStubs->Fill(track_eta, nBarrelStubs);
221  Track_All_Eta_ECStubs->Fill(track_eta, nECStubs);
223  Track_All_MVA1->Fill(track_MVA1);
224  } // End of loop over TTTracks
225 
226  Track_HQ_N->Fill(numHQTracks);
227  Track_All_N->Fill(numAllTracks);
228 } // end of method
229 
230 // ------------ method called once each job just before starting event loop
231 // ------------
232 // Creating all histograms for DQM file output
234  edm::Run const &run,
235  edm::EventSetup const &es) {
237 
239  iBooker.setCurrentFolder(topFolderName_ + "/Tracks/All");
240  // Nb of L1Tracks
241  HistoName = "Track_All_N";
242  edm::ParameterSet psTrack_N = conf_.getParameter<edm::ParameterSet>("TH1_NTracks");
243  Track_All_N = iBooker.book1D(HistoName,
244  HistoName,
245  psTrack_N.getParameter<int32_t>("Nbinsx"),
246  psTrack_N.getParameter<double>("xmin"),
247  psTrack_N.getParameter<double>("xmax"));
248  Track_All_N->setAxisTitle("# L1 Tracks", 1);
249  Track_All_N->setAxisTitle("# Events", 2);
250 
251  // Number of stubs
252  edm::ParameterSet psTrack_NStubs = conf_.getParameter<edm::ParameterSet>("TH1_NStubs");
253  HistoName = "Track_All_NStubs";
255  HistoName,
256  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
257  psTrack_NStubs.getParameter<double>("xmin"),
258  psTrack_NStubs.getParameter<double>("xmax"));
259  Track_All_NStubs->setAxisTitle("# L1 Stubs per L1 Track", 1);
260  Track_All_NStubs->setAxisTitle("# L1 Tracks", 2);
261 
262  // Number of layers missed
263  HistoName = "Track_All_NLayersMissed";
265  HistoName,
266  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
267  psTrack_NStubs.getParameter<double>("xmin"),
268  psTrack_NStubs.getParameter<double>("xmax"));
269  Track_All_NLayersMissed->setAxisTitle("# Layers missed", 1);
270  Track_All_NLayersMissed->setAxisTitle("# L1 Tracks", 2);
271 
272  edm::ParameterSet psTrack_Eta_NStubs = conf_.getParameter<edm::ParameterSet>("TH2_Track_Eta_NStubs");
273  HistoName = "Track_All_Eta_NStubs";
275  HistoName,
276  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
277  psTrack_Eta_NStubs.getParameter<double>("xmin"),
278  psTrack_Eta_NStubs.getParameter<double>("xmax"),
279  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
280  psTrack_Eta_NStubs.getParameter<double>("ymin"),
281  psTrack_Eta_NStubs.getParameter<double>("ymax"));
283  Track_All_Eta_NStubs->setAxisTitle("# L1 Stubs", 2);
284 
285  // Pt of the tracks
286  edm::ParameterSet psTrack_Pt = conf_.getParameter<edm::ParameterSet>("TH1_Track_Pt");
287  HistoName = "Track_All_Pt";
288  Track_All_Pt = iBooker.book1D(HistoName,
289  HistoName,
290  psTrack_Pt.getParameter<int32_t>("Nbinsx"),
291  psTrack_Pt.getParameter<double>("xmin"),
292  psTrack_Pt.getParameter<double>("xmax"));
293  Track_All_Pt->setAxisTitle("p_{T} [GeV]", 1);
294  Track_All_Pt->setAxisTitle("# L1 Tracks", 2);
295 
296  // Phi
297  edm::ParameterSet psTrack_Phi = conf_.getParameter<edm::ParameterSet>("TH1_Track_Phi");
298  HistoName = "Track_All_Phi";
299  Track_All_Phi = iBooker.book1D(HistoName,
300  HistoName,
301  psTrack_Phi.getParameter<int32_t>("Nbinsx"),
302  psTrack_Phi.getParameter<double>("xmin"),
303  psTrack_Phi.getParameter<double>("xmax"));
304  Track_All_Phi->setAxisTitle("#phi", 1);
305  Track_All_Phi->setAxisTitle("# L1 Tracks", 2);
306 
307  // D0
308  edm::ParameterSet psTrack_D0 = conf_.getParameter<edm::ParameterSet>("TH1_Track_D0");
309  HistoName = "Track_All_D0";
310  Track_All_D0 = iBooker.book1D(HistoName,
311  HistoName,
312  psTrack_D0.getParameter<int32_t>("Nbinsx"),
313  psTrack_D0.getParameter<double>("xmin"),
314  psTrack_D0.getParameter<double>("xmax"));
315  Track_All_D0->setAxisTitle("Track D0", 1);
316  Track_All_D0->setAxisTitle("# L1 Tracks", 2);
317 
318  // Eta
319  edm::ParameterSet psTrack_Eta = conf_.getParameter<edm::ParameterSet>("TH1_Track_Eta");
320  HistoName = "Track_All_Eta";
321  Track_All_Eta = iBooker.book1D(HistoName,
322  HistoName,
323  psTrack_Eta.getParameter<int32_t>("Nbinsx"),
324  psTrack_Eta.getParameter<double>("xmin"),
325  psTrack_Eta.getParameter<double>("xmax"));
326  Track_All_Eta->setAxisTitle("#eta", 1);
327  Track_All_Eta->setAxisTitle("# L1 Tracks", 2);
328 
329  // VtxZ
330  edm::ParameterSet psTrack_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1_Track_VtxZ");
331  HistoName = "Track_All_VtxZ";
332  Track_All_VtxZ = iBooker.book1D(HistoName,
333  HistoName,
334  psTrack_VtxZ.getParameter<int32_t>("Nbinsx"),
335  psTrack_VtxZ.getParameter<double>("xmin"),
336  psTrack_VtxZ.getParameter<double>("xmax"));
337  Track_All_VtxZ->setAxisTitle("L1 Track vertex position z [cm]", 1);
338  Track_All_VtxZ->setAxisTitle("# L1 Tracks", 2);
339 
340  // chi2
341  edm::ParameterSet psTrack_Chi2 = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2");
342  HistoName = "Track_All_Chi2";
343  Track_All_Chi2 = iBooker.book1D(HistoName,
344  HistoName,
345  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
346  psTrack_Chi2.getParameter<double>("xmin"),
347  psTrack_Chi2.getParameter<double>("xmax"));
348  Track_All_Chi2->setAxisTitle("L1 Track #chi^{2}", 1);
349  Track_All_Chi2->setAxisTitle("# L1 Tracks", 2);
350 
351  // chi2 r-z
352  HistoName = "Track_All_Chi2RZ";
354  HistoName,
355  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
356  psTrack_Chi2.getParameter<double>("xmin"),
357  psTrack_Chi2.getParameter<double>("xmax"));
358  Track_All_Chi2RZ->setAxisTitle("L1 Track #chi^{2} r-z", 1);
359  Track_All_Chi2RZ->setAxisTitle("# L1 Tracks", 2);
360 
361  // chi2 r-phi
362  HistoName = "Track_All_Chi2RPhi";
364  HistoName,
365  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
366  psTrack_Chi2.getParameter<double>("xmin"),
367  psTrack_Chi2.getParameter<double>("xmax"));
368  Track_All_Chi2RPhi->setAxisTitle("L1 Track #chi^{2}", 1);
369  Track_All_Chi2RPhi->setAxisTitle("# L1 Tracks", 2);
370 
371  // Bendchi2
372  edm::ParameterSet psTrack_Chi2R = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2R");
373  HistoName = "Track_All_BendChi2";
375  HistoName,
376  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
377  psTrack_Chi2R.getParameter<double>("xmin"),
378  psTrack_Chi2R.getParameter<double>("xmax"));
379  Track_All_BendChi2->setAxisTitle("L1 Track Bend #chi^{2}", 1);
380  Track_All_BendChi2->setAxisTitle("# L1 Tracks", 2);
381 
382  // chi2Red
383  edm::ParameterSet psTrack_Chi2Red = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2R");
384  HistoName = "Track_All_Chi2Red";
386  HistoName,
387  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
388  psTrack_Chi2R.getParameter<double>("xmin"),
389  psTrack_Chi2R.getParameter<double>("xmax"));
390  Track_All_Chi2Red->setAxisTitle("L1 Track #chi^{2}/ndf", 1);
391  Track_All_Chi2Red->setAxisTitle("# L1 Tracks", 2);
392 
393  // Chi2 prob
394  edm::ParameterSet psTrack_Chi2_Probability = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2_Probability");
395  HistoName = "Track_All_Chi2_Probability";
397  HistoName,
398  psTrack_Chi2_Probability.getParameter<int32_t>("Nbinsx"),
399  psTrack_Chi2_Probability.getParameter<double>("xmin"),
400  psTrack_Chi2_Probability.getParameter<double>("xmax"));
401  Track_All_Chi2_Probability->setAxisTitle("#chi^{2} probability", 1);
402  Track_All_Chi2_Probability->setAxisTitle("# L1 Tracks", 2);
403 
404  // MVA1 (prompt quality)
405  edm::ParameterSet psTrack_MVA1 = conf_.getParameter<edm::ParameterSet>("TH1_Track_MVA1");
406  HistoName = "Track_All_MVA1";
407  Track_All_MVA1 = iBooker.book1D(HistoName,
408  HistoName,
409  psTrack_MVA1.getParameter<int32_t>("Nbinsx"),
410  psTrack_MVA1.getParameter<double>("xmin"),
411  psTrack_MVA1.getParameter<double>("xmax"));
412  Track_All_MVA1->setAxisTitle("MVA1", 1);
413  Track_All_MVA1->setAxisTitle("# L1 Tracks", 2);
414 
415  // Reduced chi2 vs #stubs
416  edm::ParameterSet psTrack_Chi2R_NStubs = conf_.getParameter<edm::ParameterSet>("TH2_Track_Chi2R_NStubs");
417  HistoName = "Track_All_Chi2Red_NStubs";
419  HistoName,
420  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsx"),
421  psTrack_Chi2R_NStubs.getParameter<double>("xmin"),
422  psTrack_Chi2R_NStubs.getParameter<double>("xmax"),
423  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsy"),
424  psTrack_Chi2R_NStubs.getParameter<double>("ymin"),
425  psTrack_Chi2R_NStubs.getParameter<double>("ymax"));
426  Track_All_Chi2Red_NStubs->setAxisTitle("# L1 Stubs", 1);
427  Track_All_Chi2Red_NStubs->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
428 
429  // chi2/dof vs eta
430  edm::ParameterSet psTrack_Chi2R_Eta = conf_.getParameter<edm::ParameterSet>("TH2_Track_Chi2R_Eta");
431  HistoName = "Track_All_Chi2Red_Eta";
433  HistoName,
434  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsx"),
435  psTrack_Chi2R_Eta.getParameter<double>("xmin"),
436  psTrack_Chi2R_Eta.getParameter<double>("xmax"),
437  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsy"),
438  psTrack_Chi2R_Eta.getParameter<double>("ymin"),
439  psTrack_Chi2R_Eta.getParameter<double>("ymax"));
441  Track_All_Chi2Red_Eta->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
442 
443  // Eta vs #stubs in barrel
444  HistoName = "Track_All_Eta_BarrelStubs";
446  HistoName,
447  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
448  psTrack_Eta_NStubs.getParameter<double>("xmin"),
449  psTrack_Eta_NStubs.getParameter<double>("xmax"),
450  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
451  psTrack_Eta_NStubs.getParameter<double>("ymin"),
452  psTrack_Eta_NStubs.getParameter<double>("ymax"));
454  Track_All_Eta_BarrelStubs->setAxisTitle("# L1 Barrel Stubs", 2);
455 
456  // Eta vs #stubs in EC
457  HistoName = "Track_LQ_Eta_ECStubs";
459  HistoName,
460  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
461  psTrack_Eta_NStubs.getParameter<double>("xmin"),
462  psTrack_Eta_NStubs.getParameter<double>("xmax"),
463  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
464  psTrack_Eta_NStubs.getParameter<double>("ymin"),
465  psTrack_Eta_NStubs.getParameter<double>("ymax"));
467  Track_All_Eta_ECStubs->setAxisTitle("# L1 EC Stubs", 2);
468 
470  iBooker.setCurrentFolder(topFolderName_ + "/Tracks/HQ");
471  // Nb of L1Tracks
472  HistoName = "Track_HQ_N";
473  Track_HQ_N = iBooker.book1D(HistoName,
474  HistoName,
475  psTrack_N.getParameter<int32_t>("Nbinsx"),
476  psTrack_N.getParameter<double>("xmin"),
477  psTrack_N.getParameter<double>("xmax"));
478  Track_HQ_N->setAxisTitle("# L1 Tracks", 1);
479  Track_HQ_N->setAxisTitle("# Events", 2);
480 
481  // Number of stubs
482  HistoName = "Track_HQ_NStubs";
483  Track_HQ_NStubs = iBooker.book1D(HistoName,
484  HistoName,
485  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
486  psTrack_NStubs.getParameter<double>("xmin"),
487  psTrack_NStubs.getParameter<double>("xmax"));
488  Track_HQ_NStubs->setAxisTitle("# L1 Stubs per L1 Track", 1);
489  Track_HQ_NStubs->setAxisTitle("# L1 Tracks", 2);
490 
491  // Number of layers missed
492  HistoName = "Track_HQ_NLayersMissed";
494  HistoName,
495  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
496  psTrack_NStubs.getParameter<double>("xmin"),
497  psTrack_NStubs.getParameter<double>("xmax"));
498  Track_HQ_NLayersMissed->setAxisTitle("# Layers missed", 1);
499  Track_HQ_NLayersMissed->setAxisTitle("# L1 Tracks", 2);
500 
501  // Track eta vs #stubs
502  HistoName = "Track_HQ_Eta_NStubs";
504  HistoName,
505  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
506  psTrack_Eta_NStubs.getParameter<double>("xmin"),
507  psTrack_Eta_NStubs.getParameter<double>("xmax"),
508  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
509  psTrack_Eta_NStubs.getParameter<double>("ymin"),
510  psTrack_Eta_NStubs.getParameter<double>("ymax"));
511  Track_HQ_Eta_NStubs->setAxisTitle("#eta", 1);
512  Track_HQ_Eta_NStubs->setAxisTitle("# L1 Stubs", 2);
513 
514  // Pt of the tracks
515  HistoName = "Track_HQ_Pt";
516  Track_HQ_Pt = iBooker.book1D(HistoName,
517  HistoName,
518  psTrack_Pt.getParameter<int32_t>("Nbinsx"),
519  psTrack_Pt.getParameter<double>("xmin"),
520  psTrack_Pt.getParameter<double>("xmax"));
521  Track_HQ_Pt->setAxisTitle("p_{T} [GeV]", 1);
522  Track_HQ_Pt->setAxisTitle("# L1 Tracks", 2);
523 
524  // Phi
525  HistoName = "Track_HQ_Phi";
526  Track_HQ_Phi = iBooker.book1D(HistoName,
527  HistoName,
528  psTrack_Phi.getParameter<int32_t>("Nbinsx"),
529  psTrack_Phi.getParameter<double>("xmin"),
530  psTrack_Phi.getParameter<double>("xmax"));
531  Track_HQ_Phi->setAxisTitle("#phi", 1);
532  Track_HQ_Phi->setAxisTitle("# L1 Tracks", 2);
533 
534  // D0
535  HistoName = "Track_HQ_D0";
536  Track_HQ_D0 = iBooker.book1D(HistoName,
537  HistoName,
538  psTrack_D0.getParameter<int32_t>("Nbinsx"),
539  psTrack_D0.getParameter<double>("xmin"),
540  psTrack_D0.getParameter<double>("xmax"));
541  Track_HQ_D0->setAxisTitle("Track D0", 1);
542  Track_HQ_D0->setAxisTitle("# L1 Tracks", 2);
543 
544  // Eta
545  HistoName = "Track_HQ_Eta";
546  Track_HQ_Eta = iBooker.book1D(HistoName,
547  HistoName,
548  psTrack_Eta.getParameter<int32_t>("Nbinsx"),
549  psTrack_Eta.getParameter<double>("xmin"),
550  psTrack_Eta.getParameter<double>("xmax"));
551  Track_HQ_Eta->setAxisTitle("#eta", 1);
552  Track_HQ_Eta->setAxisTitle("# L1 Tracks", 2);
553 
554  // VtxZ
555  HistoName = "Track_HQ_VtxZ";
556  Track_HQ_VtxZ = iBooker.book1D(HistoName,
557  HistoName,
558  psTrack_VtxZ.getParameter<int32_t>("Nbinsx"),
559  psTrack_VtxZ.getParameter<double>("xmin"),
560  psTrack_VtxZ.getParameter<double>("xmax"));
561  Track_HQ_VtxZ->setAxisTitle("L1 Track vertex position z [cm]", 1);
562  Track_HQ_VtxZ->setAxisTitle("# L1 Tracks", 2);
563 
564  // chi2
565  HistoName = "Track_HQ_Chi2";
566  Track_HQ_Chi2 = iBooker.book1D(HistoName,
567  HistoName,
568  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
569  psTrack_Chi2.getParameter<double>("xmin"),
570  psTrack_Chi2.getParameter<double>("xmax"));
571  Track_HQ_Chi2->setAxisTitle("L1 Track #chi^{2}", 1);
572  Track_HQ_Chi2->setAxisTitle("# L1 Tracks", 2);
573 
574  // Bendchi2
575  HistoName = "Track_HQ_BendChi2";
577  HistoName,
578  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
579  psTrack_Chi2R.getParameter<double>("xmin"),
580  psTrack_Chi2R.getParameter<double>("xmax"));
581  Track_HQ_BendChi2->setAxisTitle("L1 Track Bend #chi^{2}", 1);
582  Track_HQ_BendChi2->setAxisTitle("# L1 Tracks", 2);
583 
584  // chi2 r-z
585  HistoName = "Track_HQ_Chi2RZ";
586  Track_HQ_Chi2RZ = iBooker.book1D(HistoName,
587  HistoName,
588  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
589  psTrack_Chi2.getParameter<double>("xmin"),
590  psTrack_Chi2.getParameter<double>("xmax"));
591  Track_HQ_Chi2RZ->setAxisTitle("L1 Track #chi^{2} r-z", 1);
592  Track_HQ_Chi2RZ->setAxisTitle("# L1 Tracks", 2);
593 
594  HistoName = "Track_HQ_Chi2RPhi";
596  HistoName,
597  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
598  psTrack_Chi2.getParameter<double>("xmin"),
599  psTrack_Chi2.getParameter<double>("xmax"));
600  Track_HQ_Chi2RPhi->setAxisTitle("L1 Track #chi^{2} r-phi", 1);
601  Track_HQ_Chi2RPhi->setAxisTitle("# L1 Tracks", 2);
602 
603  // chi2Red
604  HistoName = "Track_HQ_Chi2Red";
606  HistoName,
607  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
608  psTrack_Chi2R.getParameter<double>("xmin"),
609  psTrack_Chi2R.getParameter<double>("xmax"));
610  Track_HQ_Chi2Red->setAxisTitle("L1 Track #chi^{2}/ndf", 1);
611  Track_HQ_Chi2Red->setAxisTitle("# L1 Tracks", 2);
612 
613  // Chi2 prob
614  HistoName = "Track_HQ_Chi2_Probability";
616  HistoName,
617  psTrack_Chi2_Probability.getParameter<int32_t>("Nbinsx"),
618  psTrack_Chi2_Probability.getParameter<double>("xmin"),
619  psTrack_Chi2_Probability.getParameter<double>("xmax"));
620  Track_HQ_Chi2_Probability->setAxisTitle("#chi^{2} probability", 1);
621  Track_HQ_Chi2_Probability->setAxisTitle("# L1 Tracks", 2);
622 
623  // MVA1 (prompt quality)
624  HistoName = "Track_HQ_MVA1";
625  Track_HQ_MVA1 = iBooker.book1D(HistoName,
626  HistoName,
627  psTrack_MVA1.getParameter<int32_t>("Nbinsx"),
628  psTrack_MVA1.getParameter<double>("xmin"),
629  psTrack_MVA1.getParameter<double>("xmax"));
630  Track_HQ_MVA1->setAxisTitle("MVA1", 1);
631  Track_HQ_MVA1->setAxisTitle("# L1 Tracks", 2);
632 
633  // Reduced chi2 vs #stubs
634  HistoName = "Track_HQ_Chi2Red_NStubs";
636  HistoName,
637  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsx"),
638  psTrack_Chi2R_NStubs.getParameter<double>("xmin"),
639  psTrack_Chi2R_NStubs.getParameter<double>("xmax"),
640  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsy"),
641  psTrack_Chi2R_NStubs.getParameter<double>("ymin"),
642  psTrack_Chi2R_NStubs.getParameter<double>("ymax"));
643  Track_HQ_Chi2Red_NStubs->setAxisTitle("# L1 Stubs", 1);
644  Track_HQ_Chi2Red_NStubs->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
645 
646  // chi2/dof vs eta
647  HistoName = "Track_HQ_Chi2Red_Eta";
649  HistoName,
650  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsx"),
651  psTrack_Chi2R_Eta.getParameter<double>("xmin"),
652  psTrack_Chi2R_Eta.getParameter<double>("xmax"),
653  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsy"),
654  psTrack_Chi2R_Eta.getParameter<double>("ymin"),
655  psTrack_Chi2R_Eta.getParameter<double>("ymax"));
657  Track_HQ_Chi2Red_Eta->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
658 
659  // eta vs #stubs in barrel
660  HistoName = "Track_HQ_Eta_BarrelStubs";
662  HistoName,
663  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
664  psTrack_Eta_NStubs.getParameter<double>("xmin"),
665  psTrack_Eta_NStubs.getParameter<double>("xmax"),
666  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
667  psTrack_Eta_NStubs.getParameter<double>("ymin"),
668  psTrack_Eta_NStubs.getParameter<double>("ymax"));
670  Track_HQ_Eta_BarrelStubs->setAxisTitle("# L1 Barrel Stubs", 2);
671 
672  // eta vs #stubs in EC
673  HistoName = "Track_HQ_Eta_ECStubs";
675  HistoName,
676  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
677  psTrack_Eta_NStubs.getParameter<double>("xmin"),
678  psTrack_Eta_NStubs.getParameter<double>("xmax"),
679  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
680  psTrack_Eta_NStubs.getParameter<double>("ymin"),
681  psTrack_Eta_NStubs.getParameter<double>("ymax"));
683  Track_HQ_Eta_ECStubs->setAxisTitle("# L1 EC Stubs", 2);
684 
685 } // end of method
686 
MonitorElement * Track_All_N
Low-quality TTTracks (All tracks)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void Fill(long long x)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > ttTrackToken_
MonitorElement * Track_HQ_N
High-quality TTTracks; different depending on prompt vs displaced tracks.
float ChiSquaredProbability(double chiSquared, double nrDOF)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
OuterTrackerMonitorTTTrack(const edm::ParameterSet &)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
std::string HistoName
bool isValid() const
Definition: HandleBase.h:70
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
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)