CMS 3D CMS Logo

Phase2OTMonitorTTTrack.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:
42  explicit Phase2OTMonitorTTTrack(const edm::ParameterSet &);
43  ~Phase2OTMonitorTTTrack() override;
44  void analyze(const edm::Event &, const edm::EventSetup &) override;
45  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
46  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
48  MonitorElement *Track_All_N = nullptr; // Number of tracks per event
49  MonitorElement *Track_All_NStubs = nullptr; // Number of stubs per track
50  MonitorElement *Track_All_NLayersMissed = nullptr; // Number of layers missed per track
51  MonitorElement *Track_All_Eta_NStubs = nullptr; // Number of stubs per track vs eta
52  MonitorElement *Track_All_Pt = nullptr; // pT distrubtion for tracks
53  MonitorElement *Track_All_Eta = nullptr; // eta distrubtion for tracks
54  MonitorElement *Track_All_Phi = nullptr; // phi distrubtion for tracks
55  MonitorElement *Track_All_D0 = nullptr; // d0 distrubtion for tracks
56  MonitorElement *Track_All_VtxZ = nullptr; // z0 distrubtion for tracks
57  MonitorElement *Track_All_BendChi2 = nullptr; // Bendchi2 distrubtion for tracks
58  MonitorElement *Track_All_Chi2 = nullptr; // chi2 distrubtion for tracks
59  MonitorElement *Track_All_Chi2Red = nullptr; // chi2/dof distrubtion for tracks
60  MonitorElement *Track_All_Chi2RZ = nullptr; // chi2 r-phi distrubtion for tracks
61  MonitorElement *Track_All_Chi2RPhi = nullptr; // chi2 r-z distrubtion for tracks
62  MonitorElement *Track_All_Chi2Red_NStubs = nullptr; // chi2/dof vs number of stubs
63  MonitorElement *Track_All_Chi2Red_Eta = nullptr; // chi2/dof vs eta of track
64  MonitorElement *Track_All_Eta_BarrelStubs = nullptr; // eta vs number of stubs in barrel
65  MonitorElement *Track_All_Eta_ECStubs = nullptr; // eta vs number of stubs in end caps
66  MonitorElement *Track_All_Chi2_Probability = nullptr; // chi2 probability
67  MonitorElement *Track_All_MVA1 = nullptr; // MVA1 (prompt quality) distribution
68 
70  // Quality cuts: chi2/dof<10, bendchi2<2.2 (Prompt), default in config
71  // Quality cuts: chi2/dof<40, bendchi2<2.4 (Extended/Displaced tracks)
72  MonitorElement *Track_HQ_N = nullptr; // Number of tracks per event
73  MonitorElement *Track_HQ_NStubs = nullptr; // Number of stubs per track
74  MonitorElement *Track_HQ_NLayersMissed = nullptr; // Number of layers missed per track
75  MonitorElement *Track_HQ_Eta_NStubs = nullptr; // Number of stubs per track vs eta
76  MonitorElement *Track_HQ_Pt = nullptr; // pT distrubtion for tracks
77  MonitorElement *Track_HQ_Eta = nullptr; // eta distrubtion for tracks
78  MonitorElement *Track_HQ_Phi = nullptr; // phi distrubtion for tracks
79  MonitorElement *Track_HQ_D0 = nullptr; // d0 distrubtion for tracks
80  MonitorElement *Track_HQ_VtxZ = nullptr; // z0 distrubtion for tracks
81  MonitorElement *Track_HQ_BendChi2 = nullptr; // Bendchi2 distrubtion for tracks
82  MonitorElement *Track_HQ_Chi2 = nullptr; // chi2 distrubtion for tracks
83  MonitorElement *Track_HQ_Chi2Red = nullptr; // chi2/dof distrubtion for tracks
84  MonitorElement *Track_HQ_Chi2RZ = nullptr; // chi2 r-z distrubtion for tracks
85  MonitorElement *Track_HQ_Chi2RPhi = nullptr; // chi2 r-phi distrubtion for tracks
86  MonitorElement *Track_HQ_Chi2Red_NStubs = nullptr; // chi2/dof vs number of stubs
87  MonitorElement *Track_HQ_Chi2Red_Eta = nullptr; // chi2/dof vs eta of track
88  MonitorElement *Track_HQ_Eta_BarrelStubs = nullptr; // eta vs number of stubs in barrel
89  MonitorElement *Track_HQ_Eta_ECStubs = nullptr; // eta vs number of stubs in end caps
90  MonitorElement *Track_HQ_Chi2_Probability = nullptr; // chi2 probability
91  MonitorElement *Track_HQ_MVA1 = nullptr; // MVA1 (prompt quality) distribution
92 
93 private:
96 
97  unsigned int HQNStubs_;
98  double HQChi2dof_;
99  double HQBendChi2_;
101 };
102 
103 // constructors and destructor
105  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
106  ttTrackToken_ =
107  consumes<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>>(conf_.getParameter<edm::InputTag>("TTTracksTag"));
108  HQNStubs_ = conf_.getParameter<int>("HQNStubs");
109  HQChi2dof_ = conf_.getParameter<double>("HQChi2dof");
110  HQBendChi2_ = conf_.getParameter<double>("HQBendChi2");
111 }
112 
114  // do anything here that needs to be done at desctruction time
115  // (e.g. close files, deallocate resources etc.)
116 }
117 
118 // ------------ method called for each event ------------
120  // L1 Primaries
122  iEvent.getByToken(ttTrackToken_, TTTrackHandle);
123 
125  unsigned int numAllTracks = 0;
126  unsigned int numHQTracks = 0;
127 
128  // Adding protection
129  if (!TTTrackHandle.isValid())
130  return;
131 
133  unsigned int tkCnt = 0;
134  for (const auto &iterTTTrack : *TTTrackHandle) {
135  edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>> tempTrackPtr(TTTrackHandle, tkCnt++);
136 
137  unsigned int nStubs = tempTrackPtr->getStubRefs().size();
138  int nBarrelStubs = 0;
139  int nECStubs = 0;
140 
141  float track_eta = tempTrackPtr->momentum().eta();
142  float track_d0 = tempTrackPtr->d0();
143  float track_bendchi2 = tempTrackPtr->stubPtConsistency();
144  float track_chi2 = tempTrackPtr->chi2();
145  float track_chi2dof = tempTrackPtr->chi2Red();
146  float track_chi2rz = tempTrackPtr->chi2Z();
147  float track_chi2rphi = tempTrackPtr->chi2XY();
148  float track_MVA1 = tempTrackPtr->trkMVA1();
149  int nLayersMissed = 0;
150  unsigned int hitPattern_ = (unsigned int)tempTrackPtr->hitPattern();
151 
152  int nbits = floor(log2(hitPattern_)) + 1;
153  int lay_i = 0;
154  bool seq = false;
155  for (int i = 0; i < nbits; i++) {
156  lay_i = ((1 << i) & hitPattern_) >> i; //0 or 1 in ith bit (right to left)
157  if (lay_i && !seq)
158  seq = true; //sequence starts when first 1 found
159  if (!lay_i && seq)
160  nLayersMissed++;
161  }
162 
163  std::vector<edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>>
164  theStubs = iterTTTrack.getStubRefs();
165  for (const auto &istub : theStubs) {
166  bool inBarrel = false;
167  bool inEC = false;
168 
169  if (istub->getDetId().subdetId() == StripSubdetector::TOB)
170  inBarrel = true;
171  else if (istub->getDetId().subdetId() == StripSubdetector::TID)
172  inEC = true;
173  if (inBarrel)
174  nBarrelStubs++;
175  else if (inEC)
176  nECStubs++;
177  } // end loop over stubs
178 
179  // HQ tracks: bendchi2<2.2 and chi2/dof<10
180  if (nStubs >= HQNStubs_ && track_chi2dof <= HQChi2dof_ && track_bendchi2 <= HQBendChi2_) {
181  numHQTracks++;
182 
183  Track_HQ_NStubs->Fill(nStubs);
184  Track_HQ_NLayersMissed->Fill(nLayersMissed);
185  Track_HQ_Eta_NStubs->Fill(track_eta, nStubs);
186  Track_HQ_Pt->Fill(tempTrackPtr->momentum().perp());
187  Track_HQ_Eta->Fill(track_eta);
188  Track_HQ_Phi->Fill(tempTrackPtr->momentum().phi());
189  Track_HQ_D0->Fill(track_d0);
190  Track_HQ_VtxZ->Fill(tempTrackPtr->z0());
191  Track_HQ_BendChi2->Fill(track_bendchi2);
192  Track_HQ_Chi2->Fill(track_chi2);
193  Track_HQ_Chi2RZ->Fill(track_chi2rz);
194  Track_HQ_Chi2RPhi->Fill(track_chi2rphi);
195  Track_HQ_Chi2Red->Fill(track_chi2dof);
196  Track_HQ_Chi2Red_NStubs->Fill(nStubs, track_chi2dof);
197  Track_HQ_Chi2Red_Eta->Fill(track_eta, track_chi2dof);
198  Track_HQ_Eta_BarrelStubs->Fill(track_eta, nBarrelStubs);
199  Track_HQ_Eta_ECStubs->Fill(track_eta, nECStubs);
201  Track_HQ_MVA1->Fill(track_MVA1);
202  }
203 
204  // All tracks (including HQ tracks)
205  numAllTracks++;
206  Track_All_NStubs->Fill(nStubs);
207  Track_All_NLayersMissed->Fill(nLayersMissed);
208  Track_All_Eta_NStubs->Fill(track_eta, nStubs);
209  Track_All_Pt->Fill(tempTrackPtr->momentum().perp());
210  Track_All_Eta->Fill(track_eta);
211  Track_All_Phi->Fill(tempTrackPtr->momentum().phi());
212  Track_All_D0->Fill(track_d0);
213  Track_All_VtxZ->Fill(tempTrackPtr->z0());
214  Track_All_BendChi2->Fill(track_bendchi2);
215  Track_All_Chi2->Fill(track_chi2);
216  Track_All_Chi2RZ->Fill(track_chi2rz);
217  Track_All_Chi2RPhi->Fill(track_chi2rphi);
218  Track_All_Chi2Red->Fill(track_chi2dof);
219  Track_All_Chi2Red_NStubs->Fill(nStubs, track_chi2dof);
220  Track_All_Chi2Red_Eta->Fill(track_eta, track_chi2dof);
221  Track_All_Eta_BarrelStubs->Fill(track_eta, nBarrelStubs);
222  Track_All_Eta_ECStubs->Fill(track_eta, nECStubs);
224  Track_All_MVA1->Fill(track_MVA1);
225  } // End of loop over TTTracks
226 
227  Track_HQ_N->Fill(numHQTracks);
228  Track_All_N->Fill(numAllTracks);
229 } // end of method
230 
231 // ------------ method called once each job just before starting event loop
232 // ------------
233 // Creating all histograms for DQM file output
235  edm::Run const &run,
236  edm::EventSetup const &es) {
238 
240  iBooker.setCurrentFolder(topFolderName_ + "/Tracks/All");
241  // Nb of L1Tracks
242  HistoName = "Track_All_N";
243  edm::ParameterSet psTrack_N = conf_.getParameter<edm::ParameterSet>("TH1_NTracks");
244  Track_All_N = iBooker.book1D(HistoName,
245  HistoName,
246  psTrack_N.getParameter<int32_t>("Nbinsx"),
247  psTrack_N.getParameter<double>("xmin"),
248  psTrack_N.getParameter<double>("xmax"));
249  Track_All_N->setAxisTitle("# L1 Tracks", 1);
250  Track_All_N->setAxisTitle("# Events", 2);
251 
252  // Number of stubs
253  edm::ParameterSet psTrack_NStubs = conf_.getParameter<edm::ParameterSet>("TH1_NStubs");
254  HistoName = "Track_All_NStubs";
256  HistoName,
257  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
258  psTrack_NStubs.getParameter<double>("xmin"),
259  psTrack_NStubs.getParameter<double>("xmax"));
260  Track_All_NStubs->setAxisTitle("# L1 Stubs per L1 Track", 1);
261  Track_All_NStubs->setAxisTitle("# L1 Tracks", 2);
262 
263  // Number of layers missed
264  HistoName = "Track_All_NLayersMissed";
266  HistoName,
267  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
268  psTrack_NStubs.getParameter<double>("xmin"),
269  psTrack_NStubs.getParameter<double>("xmax"));
270  Track_All_NLayersMissed->setAxisTitle("# Layers missed", 1);
271  Track_All_NLayersMissed->setAxisTitle("# L1 Tracks", 2);
272 
273  edm::ParameterSet psTrack_Eta_NStubs = conf_.getParameter<edm::ParameterSet>("TH2_Track_Eta_NStubs");
274  HistoName = "Track_All_Eta_NStubs";
276  HistoName,
277  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
278  psTrack_Eta_NStubs.getParameter<double>("xmin"),
279  psTrack_Eta_NStubs.getParameter<double>("xmax"),
280  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
281  psTrack_Eta_NStubs.getParameter<double>("ymin"),
282  psTrack_Eta_NStubs.getParameter<double>("ymax"));
284  Track_All_Eta_NStubs->setAxisTitle("# L1 Stubs", 2);
285 
286  // Pt of the tracks
287  edm::ParameterSet psTrack_Pt = conf_.getParameter<edm::ParameterSet>("TH1_Track_Pt");
288  HistoName = "Track_All_Pt";
289  Track_All_Pt = iBooker.book1D(HistoName,
290  HistoName,
291  psTrack_Pt.getParameter<int32_t>("Nbinsx"),
292  psTrack_Pt.getParameter<double>("xmin"),
293  psTrack_Pt.getParameter<double>("xmax"));
294  Track_All_Pt->setAxisTitle("p_{T} [GeV]", 1);
295  Track_All_Pt->setAxisTitle("# L1 Tracks", 2);
296 
297  // Phi
298  edm::ParameterSet psTrack_Phi = conf_.getParameter<edm::ParameterSet>("TH1_Track_Phi");
299  HistoName = "Track_All_Phi";
300  Track_All_Phi = iBooker.book1D(HistoName,
301  HistoName,
302  psTrack_Phi.getParameter<int32_t>("Nbinsx"),
303  psTrack_Phi.getParameter<double>("xmin"),
304  psTrack_Phi.getParameter<double>("xmax"));
305  Track_All_Phi->setAxisTitle("#phi", 1);
306  Track_All_Phi->setAxisTitle("# L1 Tracks", 2);
307 
308  // D0
309  edm::ParameterSet psTrack_D0 = conf_.getParameter<edm::ParameterSet>("TH1_Track_D0");
310  HistoName = "Track_All_D0";
311  Track_All_D0 = iBooker.book1D(HistoName,
312  HistoName,
313  psTrack_D0.getParameter<int32_t>("Nbinsx"),
314  psTrack_D0.getParameter<double>("xmin"),
315  psTrack_D0.getParameter<double>("xmax"));
316  Track_All_D0->setAxisTitle("Track D0", 1);
317  Track_All_D0->setAxisTitle("# L1 Tracks", 2);
318 
319  // Eta
320  edm::ParameterSet psTrack_Eta = conf_.getParameter<edm::ParameterSet>("TH1_Track_Eta");
321  HistoName = "Track_All_Eta";
322  Track_All_Eta = iBooker.book1D(HistoName,
323  HistoName,
324  psTrack_Eta.getParameter<int32_t>("Nbinsx"),
325  psTrack_Eta.getParameter<double>("xmin"),
326  psTrack_Eta.getParameter<double>("xmax"));
327  Track_All_Eta->setAxisTitle("#eta", 1);
328  Track_All_Eta->setAxisTitle("# L1 Tracks", 2);
329 
330  // VtxZ
331  edm::ParameterSet psTrack_VtxZ = conf_.getParameter<edm::ParameterSet>("TH1_Track_VtxZ");
332  HistoName = "Track_All_VtxZ";
333  Track_All_VtxZ = iBooker.book1D(HistoName,
334  HistoName,
335  psTrack_VtxZ.getParameter<int32_t>("Nbinsx"),
336  psTrack_VtxZ.getParameter<double>("xmin"),
337  psTrack_VtxZ.getParameter<double>("xmax"));
338  Track_All_VtxZ->setAxisTitle("L1 Track vertex position z [cm]", 1);
339  Track_All_VtxZ->setAxisTitle("# L1 Tracks", 2);
340 
341  // chi2
342  edm::ParameterSet psTrack_Chi2 = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2");
343  HistoName = "Track_All_Chi2";
344  Track_All_Chi2 = iBooker.book1D(HistoName,
345  HistoName,
346  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
347  psTrack_Chi2.getParameter<double>("xmin"),
348  psTrack_Chi2.getParameter<double>("xmax"));
349  Track_All_Chi2->setAxisTitle("L1 Track #chi^{2}", 1);
350  Track_All_Chi2->setAxisTitle("# L1 Tracks", 2);
351 
352  // chi2 r-z
353  HistoName = "Track_All_Chi2RZ";
355  HistoName,
356  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
357  psTrack_Chi2.getParameter<double>("xmin"),
358  psTrack_Chi2.getParameter<double>("xmax"));
359  Track_All_Chi2RZ->setAxisTitle("L1 Track #chi^{2} r-z", 1);
360  Track_All_Chi2RZ->setAxisTitle("# L1 Tracks", 2);
361 
362  // chi2 r-phi
363  HistoName = "Track_All_Chi2RPhi";
365  HistoName,
366  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
367  psTrack_Chi2.getParameter<double>("xmin"),
368  psTrack_Chi2.getParameter<double>("xmax"));
369  Track_All_Chi2RPhi->setAxisTitle("L1 Track #chi^{2}", 1);
370  Track_All_Chi2RPhi->setAxisTitle("# L1 Tracks", 2);
371 
372  // Bendchi2
373  edm::ParameterSet psTrack_Chi2R = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2R");
374  HistoName = "Track_All_BendChi2";
376  HistoName,
377  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
378  psTrack_Chi2R.getParameter<double>("xmin"),
379  psTrack_Chi2R.getParameter<double>("xmax"));
380  Track_All_BendChi2->setAxisTitle("L1 Track Bend #chi^{2}", 1);
381  Track_All_BendChi2->setAxisTitle("# L1 Tracks", 2);
382 
383  // chi2Red
384  edm::ParameterSet psTrack_Chi2Red = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2R");
385  HistoName = "Track_All_Chi2Red";
387  HistoName,
388  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
389  psTrack_Chi2R.getParameter<double>("xmin"),
390  psTrack_Chi2R.getParameter<double>("xmax"));
391  Track_All_Chi2Red->setAxisTitle("L1 Track #chi^{2}/ndf", 1);
392  Track_All_Chi2Red->setAxisTitle("# L1 Tracks", 2);
393 
394  // Chi2 prob
395  edm::ParameterSet psTrack_Chi2_Probability = conf_.getParameter<edm::ParameterSet>("TH1_Track_Chi2_Probability");
396  HistoName = "Track_All_Chi2_Probability";
398  HistoName,
399  psTrack_Chi2_Probability.getParameter<int32_t>("Nbinsx"),
400  psTrack_Chi2_Probability.getParameter<double>("xmin"),
401  psTrack_Chi2_Probability.getParameter<double>("xmax"));
402  Track_All_Chi2_Probability->setAxisTitle("#chi^{2} probability", 1);
403  Track_All_Chi2_Probability->setAxisTitle("# L1 Tracks", 2);
404 
405  // MVA1 (prompt quality)
406  edm::ParameterSet psTrack_MVA1 = conf_.getParameter<edm::ParameterSet>("TH1_Track_MVA1");
407  HistoName = "Track_All_MVA1";
408  Track_All_MVA1 = iBooker.book1D(HistoName,
409  HistoName,
410  psTrack_MVA1.getParameter<int32_t>("Nbinsx"),
411  psTrack_MVA1.getParameter<double>("xmin"),
412  psTrack_MVA1.getParameter<double>("xmax"));
413  Track_All_MVA1->setAxisTitle("MVA1", 1);
414  Track_All_MVA1->setAxisTitle("# L1 Tracks", 2);
415 
416  // Reduced chi2 vs #stubs
417  edm::ParameterSet psTrack_Chi2R_NStubs = conf_.getParameter<edm::ParameterSet>("TH2_Track_Chi2R_NStubs");
418  HistoName = "Track_All_Chi2Red_NStubs";
420  HistoName,
421  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsx"),
422  psTrack_Chi2R_NStubs.getParameter<double>("xmin"),
423  psTrack_Chi2R_NStubs.getParameter<double>("xmax"),
424  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsy"),
425  psTrack_Chi2R_NStubs.getParameter<double>("ymin"),
426  psTrack_Chi2R_NStubs.getParameter<double>("ymax"));
427  Track_All_Chi2Red_NStubs->setAxisTitle("# L1 Stubs", 1);
428  Track_All_Chi2Red_NStubs->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
429 
430  // chi2/dof vs eta
431  edm::ParameterSet psTrack_Chi2R_Eta = conf_.getParameter<edm::ParameterSet>("TH2_Track_Chi2R_Eta");
432  HistoName = "Track_All_Chi2Red_Eta";
434  HistoName,
435  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsx"),
436  psTrack_Chi2R_Eta.getParameter<double>("xmin"),
437  psTrack_Chi2R_Eta.getParameter<double>("xmax"),
438  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsy"),
439  psTrack_Chi2R_Eta.getParameter<double>("ymin"),
440  psTrack_Chi2R_Eta.getParameter<double>("ymax"));
442  Track_All_Chi2Red_Eta->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
443 
444  // Eta vs #stubs in barrel
445  HistoName = "Track_All_Eta_BarrelStubs";
447  HistoName,
448  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
449  psTrack_Eta_NStubs.getParameter<double>("xmin"),
450  psTrack_Eta_NStubs.getParameter<double>("xmax"),
451  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
452  psTrack_Eta_NStubs.getParameter<double>("ymin"),
453  psTrack_Eta_NStubs.getParameter<double>("ymax"));
455  Track_All_Eta_BarrelStubs->setAxisTitle("# L1 Barrel Stubs", 2);
456 
457  // Eta vs #stubs in EC
458  HistoName = "Track_LQ_Eta_ECStubs";
460  HistoName,
461  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
462  psTrack_Eta_NStubs.getParameter<double>("xmin"),
463  psTrack_Eta_NStubs.getParameter<double>("xmax"),
464  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
465  psTrack_Eta_NStubs.getParameter<double>("ymin"),
466  psTrack_Eta_NStubs.getParameter<double>("ymax"));
468  Track_All_Eta_ECStubs->setAxisTitle("# L1 EC Stubs", 2);
469 
471  iBooker.setCurrentFolder(topFolderName_ + "/Tracks/HQ");
472  // Nb of L1Tracks
473  HistoName = "Track_HQ_N";
474  Track_HQ_N = iBooker.book1D(HistoName,
475  HistoName,
476  psTrack_N.getParameter<int32_t>("Nbinsx"),
477  psTrack_N.getParameter<double>("xmin"),
478  psTrack_N.getParameter<double>("xmax"));
479  Track_HQ_N->setAxisTitle("# L1 Tracks", 1);
480  Track_HQ_N->setAxisTitle("# Events", 2);
481 
482  // Number of stubs
483  HistoName = "Track_HQ_NStubs";
484  Track_HQ_NStubs = iBooker.book1D(HistoName,
485  HistoName,
486  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
487  psTrack_NStubs.getParameter<double>("xmin"),
488  psTrack_NStubs.getParameter<double>("xmax"));
489  Track_HQ_NStubs->setAxisTitle("# L1 Stubs per L1 Track", 1);
490  Track_HQ_NStubs->setAxisTitle("# L1 Tracks", 2);
491 
492  // Number of layers missed
493  HistoName = "Track_HQ_NLayersMissed";
495  HistoName,
496  psTrack_NStubs.getParameter<int32_t>("Nbinsx"),
497  psTrack_NStubs.getParameter<double>("xmin"),
498  psTrack_NStubs.getParameter<double>("xmax"));
499  Track_HQ_NLayersMissed->setAxisTitle("# Layers missed", 1);
500  Track_HQ_NLayersMissed->setAxisTitle("# L1 Tracks", 2);
501 
502  // Track eta vs #stubs
503  HistoName = "Track_HQ_Eta_NStubs";
505  HistoName,
506  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
507  psTrack_Eta_NStubs.getParameter<double>("xmin"),
508  psTrack_Eta_NStubs.getParameter<double>("xmax"),
509  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
510  psTrack_Eta_NStubs.getParameter<double>("ymin"),
511  psTrack_Eta_NStubs.getParameter<double>("ymax"));
512  Track_HQ_Eta_NStubs->setAxisTitle("#eta", 1);
513  Track_HQ_Eta_NStubs->setAxisTitle("# L1 Stubs", 2);
514 
515  // Pt of the tracks
516  HistoName = "Track_HQ_Pt";
517  Track_HQ_Pt = iBooker.book1D(HistoName,
518  HistoName,
519  psTrack_Pt.getParameter<int32_t>("Nbinsx"),
520  psTrack_Pt.getParameter<double>("xmin"),
521  psTrack_Pt.getParameter<double>("xmax"));
522  Track_HQ_Pt->setAxisTitle("p_{T} [GeV]", 1);
523  Track_HQ_Pt->setAxisTitle("# L1 Tracks", 2);
524 
525  // Phi
526  HistoName = "Track_HQ_Phi";
527  Track_HQ_Phi = iBooker.book1D(HistoName,
528  HistoName,
529  psTrack_Phi.getParameter<int32_t>("Nbinsx"),
530  psTrack_Phi.getParameter<double>("xmin"),
531  psTrack_Phi.getParameter<double>("xmax"));
532  Track_HQ_Phi->setAxisTitle("#phi", 1);
533  Track_HQ_Phi->setAxisTitle("# L1 Tracks", 2);
534 
535  // D0
536  HistoName = "Track_HQ_D0";
537  Track_HQ_D0 = iBooker.book1D(HistoName,
538  HistoName,
539  psTrack_D0.getParameter<int32_t>("Nbinsx"),
540  psTrack_D0.getParameter<double>("xmin"),
541  psTrack_D0.getParameter<double>("xmax"));
542  Track_HQ_D0->setAxisTitle("Track D0", 1);
543  Track_HQ_D0->setAxisTitle("# L1 Tracks", 2);
544 
545  // Eta
546  HistoName = "Track_HQ_Eta";
547  Track_HQ_Eta = iBooker.book1D(HistoName,
548  HistoName,
549  psTrack_Eta.getParameter<int32_t>("Nbinsx"),
550  psTrack_Eta.getParameter<double>("xmin"),
551  psTrack_Eta.getParameter<double>("xmax"));
552  Track_HQ_Eta->setAxisTitle("#eta", 1);
553  Track_HQ_Eta->setAxisTitle("# L1 Tracks", 2);
554 
555  // VtxZ
556  HistoName = "Track_HQ_VtxZ";
557  Track_HQ_VtxZ = iBooker.book1D(HistoName,
558  HistoName,
559  psTrack_VtxZ.getParameter<int32_t>("Nbinsx"),
560  psTrack_VtxZ.getParameter<double>("xmin"),
561  psTrack_VtxZ.getParameter<double>("xmax"));
562  Track_HQ_VtxZ->setAxisTitle("L1 Track vertex position z [cm]", 1);
563  Track_HQ_VtxZ->setAxisTitle("# L1 Tracks", 2);
564 
565  // chi2
566  HistoName = "Track_HQ_Chi2";
567  Track_HQ_Chi2 = iBooker.book1D(HistoName,
568  HistoName,
569  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
570  psTrack_Chi2.getParameter<double>("xmin"),
571  psTrack_Chi2.getParameter<double>("xmax"));
572  Track_HQ_Chi2->setAxisTitle("L1 Track #chi^{2}", 1);
573  Track_HQ_Chi2->setAxisTitle("# L1 Tracks", 2);
574 
575  // Bendchi2
576  HistoName = "Track_HQ_BendChi2";
578  HistoName,
579  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
580  psTrack_Chi2R.getParameter<double>("xmin"),
581  psTrack_Chi2R.getParameter<double>("xmax"));
582  Track_HQ_BendChi2->setAxisTitle("L1 Track Bend #chi^{2}", 1);
583  Track_HQ_BendChi2->setAxisTitle("# L1 Tracks", 2);
584 
585  // chi2 r-z
586  HistoName = "Track_HQ_Chi2RZ";
587  Track_HQ_Chi2RZ = iBooker.book1D(HistoName,
588  HistoName,
589  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
590  psTrack_Chi2.getParameter<double>("xmin"),
591  psTrack_Chi2.getParameter<double>("xmax"));
592  Track_HQ_Chi2RZ->setAxisTitle("L1 Track #chi^{2} r-z", 1);
593  Track_HQ_Chi2RZ->setAxisTitle("# L1 Tracks", 2);
594 
595  HistoName = "Track_HQ_Chi2RPhi";
597  HistoName,
598  psTrack_Chi2.getParameter<int32_t>("Nbinsx"),
599  psTrack_Chi2.getParameter<double>("xmin"),
600  psTrack_Chi2.getParameter<double>("xmax"));
601  Track_HQ_Chi2RPhi->setAxisTitle("L1 Track #chi^{2} r-phi", 1);
602  Track_HQ_Chi2RPhi->setAxisTitle("# L1 Tracks", 2);
603 
604  // chi2Red
605  HistoName = "Track_HQ_Chi2Red";
607  HistoName,
608  psTrack_Chi2R.getParameter<int32_t>("Nbinsx"),
609  psTrack_Chi2R.getParameter<double>("xmin"),
610  psTrack_Chi2R.getParameter<double>("xmax"));
611  Track_HQ_Chi2Red->setAxisTitle("L1 Track #chi^{2}/ndf", 1);
612  Track_HQ_Chi2Red->setAxisTitle("# L1 Tracks", 2);
613 
614  // Chi2 prob
615  HistoName = "Track_HQ_Chi2_Probability";
617  HistoName,
618  psTrack_Chi2_Probability.getParameter<int32_t>("Nbinsx"),
619  psTrack_Chi2_Probability.getParameter<double>("xmin"),
620  psTrack_Chi2_Probability.getParameter<double>("xmax"));
621  Track_HQ_Chi2_Probability->setAxisTitle("#chi^{2} probability", 1);
622  Track_HQ_Chi2_Probability->setAxisTitle("# L1 Tracks", 2);
623 
624  // MVA1 (prompt quality)
625  HistoName = "Track_HQ_MVA1";
626  Track_HQ_MVA1 = iBooker.book1D(HistoName,
627  HistoName,
628  psTrack_MVA1.getParameter<int32_t>("Nbinsx"),
629  psTrack_MVA1.getParameter<double>("xmin"),
630  psTrack_MVA1.getParameter<double>("xmax"));
631  Track_HQ_MVA1->setAxisTitle("MVA1", 1);
632  Track_HQ_MVA1->setAxisTitle("# L1 Tracks", 2);
633 
634  // Reduced chi2 vs #stubs
635  HistoName = "Track_HQ_Chi2Red_NStubs";
637  HistoName,
638  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsx"),
639  psTrack_Chi2R_NStubs.getParameter<double>("xmin"),
640  psTrack_Chi2R_NStubs.getParameter<double>("xmax"),
641  psTrack_Chi2R_NStubs.getParameter<int32_t>("Nbinsy"),
642  psTrack_Chi2R_NStubs.getParameter<double>("ymin"),
643  psTrack_Chi2R_NStubs.getParameter<double>("ymax"));
644  Track_HQ_Chi2Red_NStubs->setAxisTitle("# L1 Stubs", 1);
645  Track_HQ_Chi2Red_NStubs->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
646 
647  // chi2/dof vs eta
648  HistoName = "Track_HQ_Chi2Red_Eta";
650  HistoName,
651  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsx"),
652  psTrack_Chi2R_Eta.getParameter<double>("xmin"),
653  psTrack_Chi2R_Eta.getParameter<double>("xmax"),
654  psTrack_Chi2R_Eta.getParameter<int32_t>("Nbinsy"),
655  psTrack_Chi2R_Eta.getParameter<double>("ymin"),
656  psTrack_Chi2R_Eta.getParameter<double>("ymax"));
658  Track_HQ_Chi2Red_Eta->setAxisTitle("L1 Track #chi^{2}/ndf", 2);
659 
660  // eta vs #stubs in barrel
661  HistoName = "Track_HQ_Eta_BarrelStubs";
663  HistoName,
664  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
665  psTrack_Eta_NStubs.getParameter<double>("xmin"),
666  psTrack_Eta_NStubs.getParameter<double>("xmax"),
667  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
668  psTrack_Eta_NStubs.getParameter<double>("ymin"),
669  psTrack_Eta_NStubs.getParameter<double>("ymax"));
671  Track_HQ_Eta_BarrelStubs->setAxisTitle("# L1 Barrel Stubs", 2);
672 
673  // eta vs #stubs in EC
674  HistoName = "Track_HQ_Eta_ECStubs";
676  HistoName,
677  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsx"),
678  psTrack_Eta_NStubs.getParameter<double>("xmin"),
679  psTrack_Eta_NStubs.getParameter<double>("xmax"),
680  psTrack_Eta_NStubs.getParameter<int32_t>("Nbinsy"),
681  psTrack_Eta_NStubs.getParameter<double>("ymin"),
682  psTrack_Eta_NStubs.getParameter<double>("ymax"));
684  Track_HQ_Eta_ECStubs->setAxisTitle("# L1 EC Stubs", 2);
685 
686 } // end of method
687 
689  // Phase2OTMonitorTTTrack
691  {
693  psd0.add<int>("Nbinsx", 8);
694  psd0.add<double>("xmax", 8);
695  psd0.add<double>("xmin", 0);
696  desc.add<edm::ParameterSetDescription>("TH1_NStubs", psd0);
697  }
698  {
700  psd0.add<int>("Nbinsx", 100);
701  psd0.add<double>("xmax", 399);
702  psd0.add<double>("xmin", 0);
703  desc.add<edm::ParameterSetDescription>("TH1_NTracks", psd0);
704  }
705  {
707  psd0.add<int>("Nbinsx", 50);
708  psd0.add<double>("xmax", 100);
709  psd0.add<double>("xmin", 0);
710  desc.add<edm::ParameterSetDescription>("TH1_Track_Pt", psd0);
711  }
712  {
714  psd0.add<int>("Nbinsx", 60);
715  psd0.add<double>("xmax", 3.5);
716  psd0.add<double>("xmin", -3.5);
717  desc.add<edm::ParameterSetDescription>("TH1_Track_Phi", psd0);
718  }
719  {
721  psd0.add<int>("Nbinsx", 50);
722  psd0.add<double>("xmax", 5.0);
723  psd0.add<double>("xmin", -5.0);
724  desc.add<edm::ParameterSetDescription>("TH1_Track_D0", psd0);
725  }
726  {
728  psd0.add<int>("Nbinsx", 45);
729  psd0.add<double>("xmax", 3.0);
730  psd0.add<double>("xmin", -3.0);
731  desc.add<edm::ParameterSetDescription>("TH1_Track_Eta", psd0);
732  }
733  {
735  psd0.add<int>("Nbinsx", 41);
736  psd0.add<double>("xmax", 20);
737  psd0.add<double>("xmin", -20);
738  desc.add<edm::ParameterSetDescription>("TH1_Track_VtxZ", psd0);
739  }
740  {
742  psd0.add<int>("Nbinsx", 100);
743  psd0.add<double>("xmax", 50);
744  psd0.add<double>("xmin", 0);
745  desc.add<edm::ParameterSetDescription>("TH1_Track_Chi2", psd0);
746  }
747  {
749  psd0.add<int>("Nbinsx", 100);
750  psd0.add<double>("xmax", 10);
751  psd0.add<double>("xmin", 0);
752  desc.add<edm::ParameterSetDescription>("TH1_Track_Chi2R", psd0);
753  }
754  {
756  psd0.add<int>("Nbinsx", 100);
757  psd0.add<double>("xmax", 1);
758  psd0.add<double>("xmin", 0);
759  desc.add<edm::ParameterSetDescription>("TH1_Track_Chi2_Probability", psd0);
760  }
761  {
763  psd0.add<int>("Nbinsx", 100);
764  psd0.add<double>("xmax", 1);
765  psd0.add<double>("xmin", 0);
766  desc.add<edm::ParameterSetDescription>("TH1_Track_MVA1", psd0);
767  }
768  {
770  psd0.add<int>("Nbinsx", 5);
771  psd0.add<double>("xmax", 8);
772  psd0.add<double>("xmin", 3);
773  psd0.add<int>("Nbinsy", 15);
774  psd0.add<double>("ymax", 10);
775  psd0.add<double>("ymin", 0);
776  desc.add<edm::ParameterSetDescription>("TH2_Track_Chi2R_NStubs", psd0);
777  }
778  {
780  psd0.add<int>("Nbinsx", 15);
781  psd0.add<double>("xmax", 3.0);
782  psd0.add<double>("xmin", -3.0);
783  psd0.add<int>("Nbinsy", 15);
784  psd0.add<double>("ymax", 10);
785  psd0.add<double>("ymin", 0);
786  desc.add<edm::ParameterSetDescription>("TH2_Track_Chi2R_Eta", psd0);
787  }
788  {
790  psd0.add<int>("Nbinsx", 15);
791  psd0.add<double>("xmax", 3.0);
792  psd0.add<double>("xmin", -3.0);
793  psd0.add<int>("Nbinsy", 5);
794  psd0.add<double>("ymax", 8);
795  psd0.add<double>("ymin", 3);
796  desc.add<edm::ParameterSetDescription>("TH2_Track_Eta_NStubs", psd0);
797  }
798  desc.add<std::string>("TopFolderName", "TrackerPhase2OTL1Track");
799  desc.add<edm::InputTag>("TTTracksTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"));
800  desc.add<int>("HQNStubs", 4);
801  desc.add<double>("HQChi2dof", 10.0);
802  desc.add<double>("HQBendChi2", 2.2);
803  descriptions.add("Phase2OTMonitorTTTrack", desc);
804  // or use the following to generate the label from the module's C++ type
805  //descriptions.addWithDefaultLabel(desc);
806 }
MonitorElement * Track_All_NLayersMissed
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * Track_HQ_Chi2Red_Eta
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * Track_HQ_Chi2Red_NStubs
Phase2OTMonitorTTTrack(const edm::ParameterSet &)
MonitorElement * Track_All_Chi2_Probability
MonitorElement * Track_HQ_N
High-quality TTTracks; different depending on prompt vs displaced tracks.
MonitorElement * Track_HQ_Chi2RPhi
MonitorElement * Track_HQ_NLayersMissed
MonitorElement * Track_HQ_Eta_ECStubs
MonitorElement * Track_All_Eta_ECStubs
MonitorElement * Track_HQ_Chi2_Probability
MonitorElement * Track_HQ_BendChi2
void Fill(long long x)
MonitorElement * Track_All_BendChi2
int iEvent
Definition: GenABIO.cc:224
MonitorElement * Track_HQ_Eta_BarrelStubs
MonitorElement * Track_All_Chi2Red_NStubs
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
float ChiSquaredProbability(double chiSquared, double nrDOF)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static constexpr auto TOB
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
MonitorElement * Track_All_N
Low-quality TTTracks (All tracks)
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:221
MonitorElement * Track_All_Eta_BarrelStubs
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::string HistoName
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > ttTrackToken_
MonitorElement * Track_All_Chi2Red
MonitorElement * Track_HQ_Eta_NStubs
MonitorElement * Track_All_Chi2RPhi
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * Track_All_Chi2Red_Eta
MonitorElement * Track_All_Eta_NStubs
static constexpr auto TID
Definition: Run.h:45
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)