CMS 3D CMS Logo

L1TDTTPG.cc
Go to the documentation of this file.
1 /*
2  * \file L1TDTTPG.cc
3  *
4  * \author J. Berryhill
5  *
6  *
7  *
8  * organized message logger
9  *
10  * Revision 1.19 2008/03/14 20:35:46 berryhil
11  *
12  *
13  * stripped out obsolete parameter settings
14  *
15  * rpc tpg restored with correct dn access and dbe handling
16  *
17  * Revision 1.18 2008/03/12 17:24:24 berryhil
18  *
19  *
20  * eliminated log files, truncated HCALTPGXana histo output
21  *
22  * Revision 1.17 2008/03/10 09:29:52 lorenzo
23  * added MEs
24  *
25  * Revision 1.16 2008/03/01 00:40:00 lat
26  * DQM core migration.
27  *
28  *
29  *
30  * organized message logger
31  *
32  * Revision 1.19 2008/03/14 20:35:46 berryhil
33  *
34  *
35  * stripped out obsolete parameter settings
36  *
37  * rpc tpg restored with correct dn access and dbe handling
38  *
39  * Revision 1.18 2008/03/12 17:24:24 berryhil
40  *
41  *
42  * eliminated log files, truncated HCALTPGXana histo output
43  *
44  * Revision 1.17 2008/03/10 09:29:52 lorenzo
45  * added MEs
46  *
47  * Revision 1.15 2008/01/22 18:56:01 muzaffar
48  * include cleanup. Only for cc/cpp files
49  *
50  * Revision 1.14 2007/12/21 17:41:20 berryhil
51  *
52  *
53  * try/catch removal
54  *
55  * Revision 1.13 2007/11/19 15:08:22 lorenzo
56  * changed top folder name
57  *
58  * Revision 1.12 2007/08/15 18:56:25 berryhil
59  *
60  *
61  * split histograms by bx; add Maiken's bx classifier plots
62  *
63  * Revision 1.11 2007/07/26 09:37:09 berryhil
64  *
65  *
66  * set verbose false for all modules
67  * set verbose fix for DTTPG tracks
68  *
69  * Revision 1.10 2007/07/25 09:03:58 berryhil
70  *
71  *
72  * conform to DTTFFEDReader input tag.... for now
73  *
74  * Revision 1.9 2007/07/12 16:06:18 wittich
75  * add simple phi output track histograms.
76  * note that the label of this class is different than others
77  * from the DTFFReader creates.
78  *
79  */
80 #include <iostream>
81 #include <sstream>
82 #include <fstream>
83 #include <vector>
84 
87 
89 
90 using namespace std;
91 using namespace edm;
92 
94  : dttpgSourcePhContainer_token_(consumes<L1MuDTChambPhContainer>(ps.getParameter<InputTag>("dttpgSource"))),
95  dttpgSourceThContainer_token_(consumes<L1MuDTChambThContainer>(ps.getParameter<InputTag>("dttpgSource"))),
96  dttpgSource_(ps.getParameter<InputTag>("dttpgSource")) {
97  trstring_ = dttpgSource_.label() + ":" + "DATA" + ":" + dttpgSource_.process();
98  trToken_ = consumes<L1MuDTTrackContainer>(trstring_);
99 
100  // verbosity switch
101  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
102 
103  if (verbose_)
104  cout << "L1TDTTPG: constructor...." << endl;
105 
106  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
107  if (!outputFile_.empty()) {
108  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
109  }
110 
111  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
112  if (disable) {
113  outputFile_ = "";
114  }
115 }
116 
118 
120  //empty
121 }
122 
124  nev_ = 0;
125  ibooker.setCurrentFolder("L1T/L1TDTTPG");
126 
127  //hist1[0]
128  dttpgphbx[0] = ibooker.book1D("BxEncoding_PHI", "Bunch encoding DTTF Phi", 11, 0, 11);
129  //hist1[1]
130  dttpgphbx[1] = ibooker.book1D("BxEncoding_OUT", "Bunch encoding DTTF Output", 11, 0, 11);
131 
132  //hist1[2]
133  dttpgphbx[2] = ibooker.book1D("NumberOfSegmentsPHI_BunchNeg1", "Number of segments for bunch -1 Dttf Phi", 20, 0, 20);
134  //hist1[3]
135  dttpgphbx[3] = ibooker.book1D("NumberOfSegmentsPHI_Bunch0", "Number of segments for bunch 0 Dttf Phi", 20, 0, 20);
136  //hist1[4]
137  dttpgphbx[4] = ibooker.book1D("NumberOfSegmentsPHI_Bunch1", "Number of segments for bunch 1 Dttf Phi", 20, 0, 20);
138 
139  //hist1[5]
140  dttpgphbx[5] =
141  ibooker.book1D("NumberOfSegmentsOUT_BunchNeg1", "Number of segments for bunch -1 Dttf Output", 20, 0, 20);
142  //hist1[6]
143  dttpgphbx[6] = ibooker.book1D("NumberOfSegmentsOUT_Bunch0", "Number of segments for bunch 0 Dttf Output", 20, 0, 20);
144  //hist1[7]
145  dttpgphbx[7] = ibooker.book1D("NumberOfSegmentsOUT_Bunch1", "Number of segments for bunch 1 Dttf Output", 20, 0, 20);
146 
147  for (int i = 0; i < 2; i++) {
148  dttpgphbx[i]->setBinLabel(1, "None");
149  dttpgphbx[i]->setBinLabel(3, "Only bx=-1");
150  dttpgphbx[i]->setBinLabel(4, "Only bx= 0");
151  dttpgphbx[i]->setBinLabel(5, "Only bx=+1");
152  dttpgphbx[i]->setBinLabel(7, "Bx=-1,0");
153  dttpgphbx[i]->setBinLabel(8, "Bx=-1,1");
154  dttpgphbx[i]->setBinLabel(9, "Bx= 0,1");
155  dttpgphbx[i]->setBinLabel(11, "All bx");
156  }
157 
158  dttpgphbxcomp = ibooker.book2D("BxEncoding_PHI_OUT", "Bunch encoding: DTTF Phi vs. Output", 11, 0, 11, 11, 0, 11);
159  dttpgphbxcomp->setAxisTitle("DTTF (output)", 1);
160  dttpgphbxcomp->setAxisTitle("PHI-TF", 2);
161  for (int i = 1; i <= 2; i++) {
162  dttpgphbxcomp->setBinLabel(1, "None", i);
163  dttpgphbxcomp->setBinLabel(3, "Only bx=-1", i);
164  dttpgphbxcomp->setBinLabel(4, "Only bx= 0", i);
165  dttpgphbxcomp->setBinLabel(5, "Only bx=+1", i);
166  dttpgphbxcomp->setBinLabel(7, "Bx=-1,0", i);
167  dttpgphbxcomp->setBinLabel(8, "Bx=-1,1", i);
168  dttpgphbxcomp->setBinLabel(9, "Bx= 0,1", i);
169  dttpgphbxcomp->setBinLabel(11, "All bx", i);
170  }
171 
172  dttpgphntrack = ibooker.book1D("DT_TPG_phi_ntrack", "DT TPG phi ntrack", 20, -0.5, 19.5);
173  dttpgthntrack = ibooker.book1D("DT_TPG_theta_ntrack", "DT TPG theta ntrack", 20, -0.5, 19.5);
174 
175  for (int ibx = 0; ibx <= 2; ibx++) {
176  ostringstream bxnum;
177  bxnum << ibx - 1;
178  string bxn;
179  if (ibx < 2)
180  bxn = bxnum.str();
181  else
182  bxn = "+" + bxnum.str();
183 
184  // Phi
185  dttpgphwheel[ibx] =
186  ibooker.book1D("DT_TPG_phi_wheel_number_" + bxn, "DT TPG phi wheel number " + bxn, 5, -2.5, 2.5);
187  dttpgphsector[ibx] =
188  ibooker.book1D("DT_TPG_phi_sector_number_" + bxn, "DT TPG phi sector number " + bxn, 12, -0.5, 11.5);
189  dttpgphstation[ibx] =
190  ibooker.book1D("DT_TPG_phi_station_number_" + bxn, "DT TPG phi station number " + bxn, 5, 0.5, 4.5);
191  // dttpgphphi[ibx] = dbe->book1D("DT_TPG_phi_"+bxn,
192  // "DT TPG phi "+bxn, 100, -2100., 2100. ) ;
193  // dttpgphphiB[ibx] = dbe->book1D("DT_TPG_phiB_"+bxn,
194  // "DT TPG phiB "+bxn, 100, -550., 550. ) ;
195  dttpgphquality[ibx] = ibooker.book1D("DT_TPG_phi_quality_" + bxn, "DT TPG phi quality " + bxn, 8, -0.5, 7.5);
196  dttpgphts2tag[ibx] = ibooker.book1D("DT_TPG_phi_Ts2Tag_" + bxn, "DT TPG phi Ts2Tag " + bxn, 2, -0.5, 1.5);
197  // dttpgphbxcnt[ibx] = dbe->book1D("DT_TPG_phi_BxCnt_"+bxn,
198  // "DT TPG phi BxCnt "+bxn, 10, -0.5, 9.5 ) ;
199  dttpgphmapbx[ibx] =
200  ibooker.book2D("DT_TPG_phi_map_bx" + bxn, "Map of triggers per station (BX=" + bxn + ")", 20, 1, 21, 12, 0, 12);
202 
203  //Theta
204  dttpgthbx[ibx] = ibooker.book1D("DT_TPG_theta_bx_" + bxn, "DT TPG theta bx " + bxn, 50, -24.5, 24.5);
205  dttpgthwheel[ibx] =
206  ibooker.book1D("DT_TPG_theta_wheel_number_" + bxn, "DT TPG theta wheel number " + bxn, 5, -2.5, 2.5);
207  dttpgthsector[ibx] =
208  ibooker.book1D("DT_TPG_theta_sector_number_" + bxn, "DT TPG theta sector number " + bxn, 12, -0.5, 11.5);
209  dttpgthstation[ibx] =
210  ibooker.book1D("DT_TPG_theta_station_number_" + bxn, "DT TPG theta station number " + bxn, 5, -0.5, 4.5);
211  dttpgththeta[ibx] = ibooker.book1D("DT_TPG_theta_" + bxn, "DT TPG theta " + bxn, 20, -0.5, 19.5);
212  dttpgthquality[ibx] = ibooker.book1D("DT_TPG_theta_quality_" + bxn, "DT TPG theta quality " + bxn, 8, -0.5, 7.5);
213  dttpgthmapbx[ibx] = ibooker.book2D(
214  "DT_TPG_theta_map_bx_" + bxn, "Map of triggers per station (BX=" + bxn + ")", 15, 1, 16, 12, 0, 12);
216 
217  // Phi output
218  dttf_p_phi[ibx] = ibooker.book1D("dttf_p_phi_" + bxn, "dttf phi output #phi " + bxn, 256, -0.5, 255.5);
219  dttf_p_qual[ibx] = ibooker.book1D("dttf_p_qual_" + bxn, "dttf phi output qual " + bxn, 8, -0.5, 7.5);
220  dttf_p_q[ibx] = ibooker.book1D("dttf_p_q_" + bxn, "dttf phi output q " + bxn, 2, -0.5, 1.5);
221  dttf_p_pt[ibx] = ibooker.book1D("dttf_p_pt_" + bxn, "dttf phi output p_{t} " + bxn, 32, -0.5, 31.5);
222  }
223 
224  dttpgphmap = ibooker.book2D("DT_TPG_phi_map", "Map of triggers per station", 20, 1, 21, 12, 0, 12);
226  ibooker.book2D("DT_TPG_phi_map_corr", "Map of correlated triggers per station", 20, 1, 21, 12, 0, 12);
227  dttpgphmap2nd = ibooker.book2D("DT_TPG_phi_map_2nd", "Map of second tracks per station", 20, 1, 21, 12, 0, 12);
228  dttpgphbestmap = ibooker.book2D("DT_TPG_phi_best_map", "Map of best triggers per station", 20, 1, 21, 12, 0, 12);
230  ibooker.book2D("DT_TPG_phi_best_map_corr", "Map of correlated best triggers per station", 20, 1, 21, 12, 0, 12);
236 
237  dttpgthmap = ibooker.book2D("DT_TPG_theta_map", "Map of triggers per station", 15, 1, 16, 12, 0, 12);
238  dttpgthmaph = ibooker.book2D("DT_TPG_theta_map_h", "Map of H quality triggers per station", 15, 1, 16, 12, 0, 12);
239  dttpgthbestmap = ibooker.book2D("DT_TPG_theta_best_map", "Map of besttriggers per station", 15, 1, 16, 12, 0, 12);
241  ibooker.book2D("DT_TPG_theta_best_map_h", "Map of H quality best triggers per station", 15, 1, 16, 12, 0, 12);
246 }
247 
248 void L1TDTTPG::analyze(const Event &e, const EventSetup &c) {
249  nev_++;
250  if (verbose_)
251  cout << "L1TDTTPG: analyze...." << endl;
252 
253  edm::Handle<L1MuDTChambPhContainer> myL1MuDTChambPhContainer;
254  e.getByToken(dttpgSourcePhContainer_token_, myL1MuDTChambPhContainer);
255 
256  if (!myL1MuDTChambPhContainer.isValid()) {
257  edm::LogInfo("DataNotFound") << "can't find L1MuDTChambPhContainer with label " << dttpgSource_.label();
258  return;
259  }
260  L1MuDTChambPhContainer::Phi_Container const *myPhContainer = myL1MuDTChambPhContainer->getContainer();
261 
262  edm::Handle<L1MuDTChambThContainer> myL1MuDTChambThContainer;
263  e.getByToken(dttpgSourceThContainer_token_, myL1MuDTChambThContainer);
264 
265  if (!myL1MuDTChambThContainer.isValid()) {
266  edm::LogInfo("DataNotFound") << "can't find L1MuDTChambThContainer with label " << dttpgSource_.label();
267  edm::LogInfo("DataNotFound") << "if this fails try to add DATA to the process name.";
268 
269  return;
270  }
271  L1MuDTChambThContainer::The_Container const *myThContainer = myL1MuDTChambThContainer->getContainer();
272 
273  int ndttpgphtrack = 0;
274  int ndttpgthtrack = 0;
275  int NumberOfSegmentsPhi[3] = {0, 0, 0};
276 
277  for (L1MuDTChambPhContainer::Phi_Container::const_iterator DTPhDigiItr = myPhContainer->begin();
278  DTPhDigiItr != myPhContainer->end();
279  ++DTPhDigiItr) {
280  int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
281  if (bx == -1)
282  NumberOfSegmentsPhi[0]++;
283  if (bx == 0)
284  NumberOfSegmentsPhi[1]++;
285  if (bx == 1)
286  NumberOfSegmentsPhi[2]++;
287  }
288  /*Fill Histos for Segment counter for each bx separately */
289 
290  for (int k = 0; k < 3; k++) {
291  dttpgphbx[k + 2]->Fill(NumberOfSegmentsPhi[k]);
292  }
293  int bxCounterDttfPhi = 0; // = no. of BX's with non-zero data
294  for (int k = 0; k < 3; k++) {
295  if (NumberOfSegmentsPhi[k] > 0)
296  bxCounterDttfPhi++;
297  }
298 
299  /* the BX "code" */
300 
301  int bxCodePhi = 0;
302  if (bxCounterDttfPhi == 0) {
303  bxCodePhi = 0;
304  } else if (bxCounterDttfPhi == 1) {
305  for (int k = 0; k < 3; k++) {
306  if (NumberOfSegmentsPhi[k] > 0)
307  bxCodePhi = k + 2;
308  }
309  } else if (bxCounterDttfPhi == 2) {
310  for (int k = 0; k < 3; k++) {
311  if (NumberOfSegmentsPhi[k] == 0)
312  bxCodePhi = 8 - k;
313  }
314  } else if (bxCounterDttfPhi == 3) {
315  bxCodePhi = 10;
316  }
317 
318  //The bx analyzer histo
319  dttpgphbx[0]->Fill(bxCodePhi);
320 
321  const L1MuDTChambPhDigi *bestPhQualMap[5][12][4];
322  memset(bestPhQualMap, 0, 240 * sizeof(L1MuDTChambPhDigi *));
323 
324  for (L1MuDTChambPhContainer::Phi_Container::const_iterator DTPhDigiItr = myPhContainer->begin();
325  DTPhDigiItr != myPhContainer->end();
326  ++DTPhDigiItr) {
327  ndttpgphtrack++;
328 
329  int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
330 
331  dttpgphwheel[bxindex]->Fill(DTPhDigiItr->whNum());
332  if (verbose_) {
333  cout << "DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
334  }
335  dttpgphstation[bxindex]->Fill(DTPhDigiItr->stNum());
336  if (verbose_) {
337  cout << "DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
338  }
339  dttpgphsector[bxindex]->Fill(DTPhDigiItr->scNum());
340  if (verbose_) {
341  cout << "DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
342  }
343  dttpgphquality[bxindex]->Fill(DTPhDigiItr->code());
344  if (verbose_) {
345  cout << "DTTPG phi quality " << DTPhDigiItr->code() << endl;
346  }
347  dttpgphts2tag[bxindex]->Fill(DTPhDigiItr->Ts2Tag());
348  if (verbose_) {
349  cout << "DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
350  }
351  int ypos = DTPhDigiItr->scNum();
352  int xpos = DTPhDigiItr->stNum() + 4 * (DTPhDigiItr->whNum() + 2);
353  dttpgphmap->Fill(xpos, ypos);
354  if (DTPhDigiItr->Ts2Tag())
355  dttpgphmap2nd->Fill(xpos, ypos);
356  dttpgphmapbx[bxindex]->Fill(xpos, ypos);
357  if (DTPhDigiItr->code() > 3)
358  dttpgphmapcorr->Fill(xpos, ypos);
359 
360  if (bestPhQualMap[DTPhDigiItr->whNum() + 2][DTPhDigiItr->scNum()][DTPhDigiItr->stNum() - 1] == nullptr ||
361  bestPhQualMap[DTPhDigiItr->whNum() + 2][DTPhDigiItr->scNum()][DTPhDigiItr->stNum() - 1]->code() <
362  DTPhDigiItr->code()) {
363  bestPhQualMap[DTPhDigiItr->whNum() + 2][DTPhDigiItr->scNum()][DTPhDigiItr->stNum() - 1] = &(*DTPhDigiItr);
364  }
365  }
366 
367  for (int iwh = 0; iwh < 5; iwh++) {
368  for (int isec = 0; isec < 12; isec++) {
369  for (int ist = 0; ist < 4; ist++) {
370  if (bestPhQualMap[iwh][isec][ist]) {
371  int xpos = iwh * 4 + ist + 1;
372  dttpgphbestmap->Fill(xpos, isec);
373  if (bestPhQualMap[iwh][isec][ist]->code() > 3)
374  dttpgphbestmapcorr->Fill(xpos, isec);
375  }
376  }
377  }
378  }
379 
380  int bestThQualMap[5][12][3];
381  memset(bestThQualMap, 0, 180 * sizeof(int));
382  //for( vector<L1MuDTChambThDigi>::const_iterator
383  for (L1MuDTChambThContainer::The_Container::const_iterator DTThDigiItr = myThContainer->begin();
384  DTThDigiItr != myThContainer->end();
385  ++DTThDigiItr) {
386  ndttpgthtrack++;
387 
388  int bxindex = DTThDigiItr->bxNum() + 1;
389 
390  dttpgthwheel[bxindex]->Fill(DTThDigiItr->whNum());
391  if (verbose_) {
392  cout << "DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
393  }
394  dttpgthstation[bxindex]->Fill(DTThDigiItr->stNum());
395  if (verbose_) {
396  cout << "DTTPG theta station number " << DTThDigiItr->stNum() << endl;
397  }
398  dttpgthsector[bxindex]->Fill(DTThDigiItr->scNum());
399  if (verbose_) {
400  cout << "DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
401  }
402  dttpgthbx[bxindex]->Fill(DTThDigiItr->bxNum());
403  if (verbose_) {
404  cout << "DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
405  }
406  int thcode[7] = {0, 0, 0, 0, 0, 0, 0};
407  for (int j = 0; j < 7; j++) {
408  dttpgththeta[bxindex]->Fill(DTThDigiItr->position(j));
409  if (verbose_) {
410  cout << "DTTPG theta position " << DTThDigiItr->position(j) << endl;
411  }
412  thcode[j] = DTThDigiItr->code(j);
413  dttpgthquality[bxindex]->Fill(thcode[j]);
414  if (verbose_) {
415  cout << "DTTPG theta quality " << DTThDigiItr->code(j) << endl;
416  }
417  }
418 
419  int ypos = DTThDigiItr->scNum();
420  int xpos = DTThDigiItr->stNum() + 4 * (DTThDigiItr->whNum() + 2);
421  int bestqual = 0;
422  dttpgthmap->Fill(xpos, ypos);
423  dttpgthmapbx[bxindex]->Fill(xpos, ypos);
424  for (int pos = 0; pos < 7; pos++) {
425  if (thcode[pos] > bestqual)
426  bestqual = thcode[pos];
427  if (thcode[pos] == 2)
428  dttpgthmaph->Fill(xpos, ypos);
429  }
430 
431  if (bestThQualMap[DTThDigiItr->whNum() + 2][DTThDigiItr->scNum()][DTThDigiItr->stNum() - 1] < bestqual) {
432  bestThQualMap[DTThDigiItr->whNum() + 2][DTThDigiItr->scNum()][DTThDigiItr->stNum() - 1] = bestqual;
433  }
434  }
435 
436  for (int iwh = 0; iwh < 5; iwh++) {
437  for (int isec = 0; isec < 12; isec++) {
438  for (int ist = 0; ist < 3; ist++) {
439  if (bestThQualMap[iwh][isec][ist]) {
440  int xpos = iwh * 4 + ist + 1;
441  dttpgthbestmap->Fill(xpos, isec);
442  if (bestThQualMap[iwh][isec][ist] == 2)
443  dttpgthbestmaph->Fill(xpos, isec);
444  }
445  }
446  }
447  }
448 
449  dttpgphntrack->Fill(ndttpgphtrack);
450  if (verbose_) {
451  cout << "DTTPG phi ntrack " << ndttpgphtrack << endl;
452  }
453  dttpgthntrack->Fill(ndttpgthtrack);
454  if (verbose_) {
455  cout << "DTTPG theta ntrack " << ndttpgthtrack << endl;
456  }
457 
458  edm::Handle<L1MuDTTrackContainer> myL1MuDTTrackContainer;
459  e.getByToken(trToken_, myL1MuDTTrackContainer);
460 
461  if (!myL1MuDTTrackContainer.isValid()) {
462  edm::LogInfo("DataNotFound") << "can't find L1MuDTTrackContainer with label " << dttpgSource_.label();
463  return;
464  }
465 
466  L1MuDTTrackContainer::TrackContainer const *t = myL1MuDTTrackContainer->getContainer();
467 
468  int NumberOfSegmentsOut[3] = {0, 0, 0};
469  for (L1MuDTTrackContainer::TrackContainer::const_iterator i = t->begin(); i != t->end(); ++i) {
470  if (i->bx() == -1)
471  NumberOfSegmentsOut[0]++;
472  if (i->bx() == 0)
473  NumberOfSegmentsOut[1]++;
474  if (i->bx() == 1)
475  NumberOfSegmentsOut[2]++;
476  }
477 
478  /*Fill Histos for Segment counter*/
479  for (int k = 0; k < 3; k++) {
480  dttpgphbx[k + 5]->Fill(NumberOfSegmentsOut[k]);
481  }
482 
483  /*Bunch assigments*/
484 
485  int bxCounterDttfOut = 0;
486  for (int k = 0; k < 3; k++) {
487  if (NumberOfSegmentsOut[k] > 0)
488  bxCounterDttfOut++;
489  }
490 
491  int bxCodeOut = 0;
492  if (bxCounterDttfOut == 0) {
493  bxCodeOut = 0;
494  } else if (bxCounterDttfOut == 1) {
495  for (int k = 0; k < 3; k++) {
496  if (NumberOfSegmentsOut[k] > 0)
497  bxCodeOut = k + 2;
498  }
499  } else if (bxCounterDttfOut == 2) {
500  for (int k = 0; k < 3; k++) {
501  if (NumberOfSegmentsOut[k] == 0)
502  bxCodeOut = 8 - k;
503  }
504  } else if (bxCounterDttfOut == 3) {
505  bxCodeOut = 10;
506  }
507 
508  //The bx analyzer histo
509  dttpgphbx[1]->Fill(bxCodeOut);
510 
511  /*End Dttf Output Bunch analysis*/
512 
513  // the 2-DIM histo with phi.input vs. output
514  dttpgphbxcomp->Fill(bxCodePhi, bxCodeOut);
515 
516  for (L1MuDTTrackContainer::TrackContainer::const_iterator i = t->begin(); i != t->end(); ++i) {
517  if (verbose_) {
518  std::cout << "bx = " << i->bx() << std::endl;
519  std::cout << "quality (packed) = " << i->quality_packed() << std::endl;
520  std::cout << "pt (packed) = " << i->pt_packed() << std::endl;
521  std::cout << "phi (packed) = " << i->phi_packed() << std::endl;
522  std::cout << "charge (packed) = " << i->charge_packed() << std::endl;
523  }
524 
525  int bxindex = i->bx() + 1;
526  dttf_p_phi[bxindex]->Fill(i->phi_packed());
527  dttf_p_qual[bxindex]->Fill(i->quality_packed());
528  dttf_p_pt[bxindex]->Fill(i->pt_packed());
529  dttf_p_q[bxindex]->Fill(i->charge_packed());
530  }
531 }
532 
534  me->setAxisTitle("DTTF Sector", 2);
535  for (int i = 0; i < 5; i++) {
536  ostringstream wheel;
537  wheel << i - 2;
538  me->setBinLabel(1 + i * 4, "Wheel " + wheel.str(), 1);
539  }
540 }
541 
543  me->setAxisTitle("DTTF Sector", 2);
544  for (int i = 0; i < 5; i++) {
545  ostringstream wheel;
546  wheel << i - 2;
547  me->setBinLabel(1 + i * 3, "Wheel " + wheel.str(), 1);
548  }
549 }
MonitorElement * dttpgthbestmaph
Definition: L1TDTTPG.h:89
MonitorElement * dttf_p_phi[3]
Definition: L1TDTTPG.h:91
L1TDTTPG(const edm::ParameterSet &ps)
Definition: L1TDTTPG.cc:93
MonitorElement * dttpgphmap
Definition: L1TDTTPG.h:71
MonitorElement * dttpgphbestmapcorr
Definition: L1TDTTPG.h:76
MonitorElement * dttpgphmapcorr
Definition: L1TDTTPG.h:74
void setMapPhLabel(MonitorElement *me)
Definition: L1TDTTPG.cc:533
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * dttpgphbx[8]
Definition: L1TDTTPG.h:60
int nev_
Definition: L1TDTTPG.h:96
edm::EDGetTokenT< L1MuDTChambThContainer > dttpgSourceThContainer_token_
Definition: L1TDTTPG.h:102
MonitorElement * dttpgththeta[3]
Definition: L1TDTTPG.h:82
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TDTTPG.cc:248
MonitorElement * dttpgphwheel[3]
Definition: L1TDTTPG.h:62
MonitorElement * dttpgthbestmap
Definition: L1TDTTPG.h:88
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * dttpgphbxcomp
Definition: L1TDTTPG.h:61
edm::EDGetTokenT< L1MuDTTrackContainer > trToken_
Definition: L1TDTTPG.h:106
MonitorElement * dttpgthmaph
Definition: L1TDTTPG.h:87
MonitorElement * dttpgthsector[3]
Definition: L1TDTTPG.h:80
The_Container const * getContainer() const
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
MonitorElement * dttpgthmapbx[3]
Definition: L1TDTTPG.h:86
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TDTTPG.cc:123
MonitorElement * dttpgthwheel[3]
Definition: L1TDTTPG.h:79
std::string outputFile_
Definition: L1TDTTPG.h:97
MonitorElement * dttpgthmap
Definition: L1TDTTPG.h:85
std::vector< L1MuDTTrackCand > TrackContainer
MonitorElement * dttf_p_qual[3]
Definition: L1TDTTPG.h:94
MonitorElement * dttpgthbx[3]
Definition: L1TDTTPG.h:78
MonitorElement * dttpgthquality[3]
Definition: L1TDTTPG.h:83
std::vector< L1MuDTChambPhDigi > Phi_Container
TrackContainer const * getContainer() const
MonitorElement * dttf_p_pt[3]
Definition: L1TDTTPG.h:92
std::vector< L1MuDTChambThDigi > The_Container
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Log< level::Info, false > LogInfo
MonitorElement * dttpgphbestmap
Definition: L1TDTTPG.h:75
Phi_Container const * getContainer() const
MonitorElement * dttpgthntrack
Definition: L1TDTTPG.h:84
edm::InputTag dttpgSource_
Definition: L1TDTTPG.h:103
MonitorElement * dttpgphts2tag[3]
Definition: L1TDTTPG.h:68
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 * dttpgphntrack
Definition: L1TDTTPG.h:70
edm::EDGetTokenT< L1MuDTChambPhContainer > dttpgSourcePhContainer_token_
Definition: L1TDTTPG.h:101
MonitorElement * dttf_p_q[3]
Definition: L1TDTTPG.h:93
bool isValid() const
Definition: HandleBase.h:70
void setMapThLabel(MonitorElement *me)
Definition: L1TDTTPG.cc:542
HLT enums.
std::string trstring_
Definition: L1TDTTPG.h:105
MonitorElement * dttpgphmapbx[3]
Definition: L1TDTTPG.h:72
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TDTTPG.cc:119
bool verbose_
Definition: L1TDTTPG.h:98
MonitorElement * dttpgthstation[3]
Definition: L1TDTTPG.h:81
MonitorElement * dttpgphsector[3]
Definition: L1TDTTPG.h:63
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string const & process() const
Definition: InputTag.h:40
~L1TDTTPG() override
Definition: L1TDTTPG.cc:117
MonitorElement * dttpgphquality[3]
Definition: L1TDTTPG.h:67
MonitorElement * dttpgphmap2nd
Definition: L1TDTTPG.h:73
Definition: Run.h:45
MonitorElement * dttpgphstation[3]
Definition: L1TDTTPG.h:64
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)