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 {
98  trstring_ = dttpgSource_.label()+":"+"DATA"+":"+dttpgSource_.process();
99  trToken_ = consumes<L1MuDTTrackContainer>(trstring_);
100 
101  // verbosity switch
102  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
103 
104  if(verbose_) 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 {
119 }
120 
121 
123  //empty
124 
125 }
126 
127 
129 {
130  nev_ = 0;
131  ibooker.setCurrentFolder("L1T/L1TDTTPG");
132 
133 
134  //hist1[0]
135  dttpgphbx[0] = ibooker.book1D("BxEncoding_PHI",
136  "Bunch encoding DTTF Phi",11,0,11);
137  //hist1[1]
138  dttpgphbx[1] = ibooker.book1D("BxEncoding_OUT",
139  "Bunch encoding DTTF Output",11,0,11);
140 
141  //hist1[2]
142  dttpgphbx[2] = ibooker.book1D("NumberOfSegmentsPHI_BunchNeg1",
143  "Number of segments for bunch -1 Dttf Phi",
144  20,0,20);
145  //hist1[3]
146  dttpgphbx[3] = ibooker.book1D("NumberOfSegmentsPHI_Bunch0",
147  "Number of segments for bunch 0 Dttf Phi",
148  20,0,20);
149  //hist1[4]
150  dttpgphbx[4] = ibooker.book1D("NumberOfSegmentsPHI_Bunch1",
151  "Number of segments for bunch 1 Dttf Phi",
152  20,0,20);
153 
154  //hist1[5]
155  dttpgphbx[5] = ibooker.book1D("NumberOfSegmentsOUT_BunchNeg1",
156  "Number of segments for bunch -1 Dttf Output",
157  20,0,20);
158  //hist1[6]
159  dttpgphbx[6] = ibooker.book1D("NumberOfSegmentsOUT_Bunch0",
160  "Number of segments for bunch 0 Dttf Output",
161  20,0,20);
162  //hist1[7]
163  dttpgphbx[7] = ibooker.book1D("NumberOfSegmentsOUT_Bunch1",
164  "Number of segments for bunch 1 Dttf Output",
165  20,0,20);
166 
167  for(int i=0;i<2;i++){
168  dttpgphbx[i]->setBinLabel(1,"None");
169  dttpgphbx[i]->setBinLabel(3,"Only bx=-1");
170  dttpgphbx[i]->setBinLabel(4,"Only bx= 0");
171  dttpgphbx[i]->setBinLabel(5,"Only bx=+1");
172  dttpgphbx[i]->setBinLabel(7,"Bx=-1,0");
173  dttpgphbx[i]->setBinLabel(8,"Bx=-1,1");
174  dttpgphbx[i]->setBinLabel(9,"Bx= 0,1");
175  dttpgphbx[i]->setBinLabel(11,"All bx");
176  }
177 
178  dttpgphbxcomp = ibooker.book2D("BxEncoding_PHI_OUT",
179  "Bunch encoding: DTTF Phi vs. Output",
180  11,0,11,11,0,11);
181  dttpgphbxcomp->setAxisTitle("DTTF (output)",1);
182  dttpgphbxcomp->setAxisTitle("PHI-TF",2);
183  for(int i=1;i<=2;i++){
184  dttpgphbxcomp->setBinLabel(1,"None",i);
185  dttpgphbxcomp->setBinLabel(3,"Only bx=-1",i);
186  dttpgphbxcomp->setBinLabel(4,"Only bx= 0",i);
187  dttpgphbxcomp->setBinLabel(5,"Only bx=+1",i);
188  dttpgphbxcomp->setBinLabel(7,"Bx=-1,0",i);
189  dttpgphbxcomp->setBinLabel(8,"Bx=-1,1",i);
190  dttpgphbxcomp->setBinLabel(9,"Bx= 0,1",i);
191  dttpgphbxcomp->setBinLabel(11,"All bx",i);
192  }
193 
194  dttpgphntrack = ibooker.book1D("DT_TPG_phi_ntrack",
195  "DT TPG phi ntrack", 20, -0.5, 19.5 ) ;
196  dttpgthntrack = ibooker.book1D("DT_TPG_theta_ntrack",
197  "DT TPG theta ntrack", 20, -0.5, 19.5 ) ;
198 
199  for (int ibx=0 ; ibx<=2; ibx++) {
200 
201  ostringstream bxnum;
202  bxnum << ibx-1;
203  string bxn;
204  if (ibx<2)
205  bxn = bxnum.str();
206  else
207  bxn = "+" + bxnum.str();
208 
209  // Phi
210  dttpgphwheel[ibx] = ibooker.book1D("DT_TPG_phi_wheel_number_"+bxn,
211  "DT TPG phi wheel number "+bxn, 5, -2.5, 2.5 ) ;
212  dttpgphsector[ibx] = ibooker.book1D("DT_TPG_phi_sector_number_"+bxn,
213  "DT TPG phi sector number "+bxn, 12, -0.5, 11.5 );
214  dttpgphstation[ibx] = ibooker.book1D("DT_TPG_phi_station_number_"+bxn,
215  "DT TPG phi station number "+bxn, 5, 0.5, 4.5 ) ;
216 // dttpgphphi[ibx] = dbe->book1D("DT_TPG_phi_"+bxn,
217 // "DT TPG phi "+bxn, 100, -2100., 2100. ) ;
218 // dttpgphphiB[ibx] = dbe->book1D("DT_TPG_phiB_"+bxn,
219 // "DT TPG phiB "+bxn, 100, -550., 550. ) ;
220  dttpgphquality[ibx] = ibooker.book1D("DT_TPG_phi_quality_"+bxn,
221  "DT TPG phi quality "+bxn, 8, -0.5, 7.5 ) ;
222  dttpgphts2tag[ibx] = ibooker.book1D("DT_TPG_phi_Ts2Tag_"+bxn,
223  "DT TPG phi Ts2Tag "+bxn, 2, -0.5, 1.5 ) ;
224 // dttpgphbxcnt[ibx] = dbe->book1D("DT_TPG_phi_BxCnt_"+bxn,
225 // "DT TPG phi BxCnt "+bxn, 10, -0.5, 9.5 ) ;
226  dttpgphmapbx[ibx] = ibooker.book2D("DT_TPG_phi_map_bx"+bxn,
227  "Map of triggers per station (BX="+bxn+")",20,1,21,12,0,12);
229 
230  //Theta
231  dttpgthbx[ibx] = ibooker.book1D("DT_TPG_theta_bx_"+bxn,
232  "DT TPG theta bx "+bxn, 50, -24.5, 24.5 ) ;
233  dttpgthwheel[ibx] = ibooker.book1D("DT_TPG_theta_wheel_number_"+bxn,
234  "DT TPG theta wheel number "+bxn, 5, -2.5, 2.5 ) ;
235  dttpgthsector[ibx] = ibooker.book1D("DT_TPG_theta_sector_number_"+bxn,
236  "DT TPG theta sector number "+bxn, 12, -0.5, 11.5 ) ;
237  dttpgthstation[ibx] = ibooker.book1D("DT_TPG_theta_station_number_"+bxn,
238  "DT TPG theta station number "+bxn, 5, -0.5, 4.5 ) ;
239  dttpgththeta[ibx] = ibooker.book1D("DT_TPG_theta_"+bxn,
240  "DT TPG theta "+bxn, 20, -0.5, 19.5 ) ;
241  dttpgthquality[ibx] = ibooker.book1D("DT_TPG_theta_quality_"+bxn,
242  "DT TPG theta quality "+bxn, 8, -0.5, 7.5 ) ;
243  dttpgthmapbx[ibx] = ibooker.book2D("DT_TPG_theta_map_bx_"+bxn,
244  "Map of triggers per station (BX="+bxn+")",15,1,16,12,0,12);
246 
247  // Phi output
248  dttf_p_phi[ibx] = ibooker.book1D("dttf_p_phi_"+bxn, "dttf phi output #phi "+bxn, 256,
249  -0.5, 255.5);
250  dttf_p_qual[ibx] = ibooker.book1D("dttf_p_qual_"+bxn, "dttf phi output qual "+bxn, 8, -0.5, 7.5);
251  dttf_p_q[ibx] = ibooker.book1D("dttf_p_q_"+bxn, "dttf phi output q "+bxn, 2, -0.5, 1.5);
252  dttf_p_pt[ibx] = ibooker.book1D("dttf_p_pt_"+bxn, "dttf phi output p_{t} "+bxn, 32, -0.5, 31.5);
253 
254  }
255 
256  dttpgphmap = ibooker.book2D("DT_TPG_phi_map",
257  "Map of triggers per station",20,1,21,12,0,12);
258  dttpgphmapcorr = ibooker.book2D("DT_TPG_phi_map_corr",
259  "Map of correlated triggers per station",20,1,21,12,0,12);
260  dttpgphmap2nd = ibooker.book2D("DT_TPG_phi_map_2nd",
261  "Map of second tracks per station",20,1,21,12,0,12);
262  dttpgphbestmap = ibooker.book2D("DT_TPG_phi_best_map",
263  "Map of best triggers per station",20,1,21,12,0,12);
264  dttpgphbestmapcorr = ibooker.book2D("DT_TPG_phi_best_map_corr",
265  "Map of correlated best triggers per station",20,1,21,12,0,12);
271 
272 
273 
274  dttpgthmap = ibooker.book2D("DT_TPG_theta_map",
275  "Map of triggers per station",15,1,16,12,0,12);
276  dttpgthmaph = ibooker.book2D("DT_TPG_theta_map_h",
277  "Map of H quality triggers per station",15,1,16,12,0,12);
278  dttpgthbestmap = ibooker.book2D("DT_TPG_theta_best_map",
279  "Map of besttriggers per station",15,1,16,12,0,12);
280  dttpgthbestmaph = ibooker.book2D("DT_TPG_theta_best_map_h",
281  "Map of H quality best triggers per station",15,1,16,12,0,12);
286 }
287 
288 void L1TDTTPG::analyze(const Event& e, const EventSetup& c)
289 {
290 
291  nev_++;
292  if(verbose_) cout << "L1TDTTPG: analyze...." << endl;
293 
294  edm::Handle<L1MuDTChambPhContainer > myL1MuDTChambPhContainer;
295  e.getByToken(dttpgSourcePhContainer_token_,myL1MuDTChambPhContainer);
296 
297  if (!myL1MuDTChambPhContainer.isValid()) {
298  edm::LogInfo("DataNotFound") << "can't find L1MuDTChambPhContainer with label "
299  << dttpgSource_.label() ;
300  return;
301  }
302  L1MuDTChambPhContainer::Phi_Container const *myPhContainer =
303  myL1MuDTChambPhContainer->getContainer();
304 
305  edm::Handle<L1MuDTChambThContainer > myL1MuDTChambThContainer;
306  e.getByToken(dttpgSourceThContainer_token_,myL1MuDTChambThContainer);
307 
308  if (!myL1MuDTChambThContainer.isValid()) {
309  edm::LogInfo("DataNotFound") << "can't find L1MuDTChambThContainer with label "
310  << dttpgSource_.label() ;
311  edm::LogInfo("DataNotFound") << "if this fails try to add DATA to the process name." ;
312 
313  return;
314  }
315  L1MuDTChambThContainer::The_Container const* myThContainer =
316  myL1MuDTChambThContainer->getContainer();
317 
318  int ndttpgphtrack = 0;
319  int ndttpgthtrack = 0;
320  int NumberOfSegmentsPhi[3]={0,0,0};
321 
322  for( L1MuDTChambPhContainer::Phi_Container::const_iterator
323  DTPhDigiItr = myPhContainer->begin() ;
324  DTPhDigiItr != myPhContainer->end() ;
325  ++DTPhDigiItr )
326  {
327  int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
328  if(bx == -1)
329  NumberOfSegmentsPhi[0]++;
330  if(bx == 0)
331  NumberOfSegmentsPhi[1]++;
332  if(bx == 1)
333  NumberOfSegmentsPhi[2]++;
334  }
335  /*Fill Histos for Segment counter for each bx separately */
336 
337  for(int k=0;k<3;k++){
338  dttpgphbx[k+2]->Fill(NumberOfSegmentsPhi[k]);
339  }
340  int bxCounterDttfPhi=0; // = no. of BX's with non-zero data
341  for (int k=0;k<3;k++){
342  if (NumberOfSegmentsPhi[k]>0)
343  bxCounterDttfPhi++;
344  }
345 
346  /* the BX "code" */
347 
348  int bxCodePhi=0;
349  if(bxCounterDttfPhi==0){
350  bxCodePhi=0;
351  }else if(bxCounterDttfPhi==1){
352  for(int k=0;k<3;k++){
353  if(NumberOfSegmentsPhi[k]>0)
354  bxCodePhi=k+2;
355  }
356  }else if(bxCounterDttfPhi==2){
357  for(int k=0;k<3;k++){
358  if(NumberOfSegmentsPhi[k]==0)
359  bxCodePhi=8-k;
360  }
361  }else if(bxCounterDttfPhi==3){
362  bxCodePhi=10;
363  }
364 
365  //The bx analyzer histo
366  dttpgphbx[0]->Fill(bxCodePhi);
367 
368 
369  const L1MuDTChambPhDigi* bestPhQualMap[5][12][4];
370  memset(bestPhQualMap,0,240*sizeof(L1MuDTChambPhDigi*));
371 
372  for( L1MuDTChambPhContainer::Phi_Container::const_iterator
373  DTPhDigiItr = myPhContainer->begin() ;
374  DTPhDigiItr != myPhContainer->end() ;
375  ++DTPhDigiItr )
376  {
377 
378  ndttpgphtrack++;
379 
380  int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
381 
382  dttpgphwheel[bxindex]->Fill(DTPhDigiItr->whNum());
383  if (verbose_)
384  {
385  cout << "DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
386  }
387  dttpgphstation[bxindex]->Fill(DTPhDigiItr->stNum());
388  if (verbose_)
389  {
390  cout << "DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
391  }
392  dttpgphsector[bxindex]->Fill(DTPhDigiItr->scNum());
393  if (verbose_)
394  {
395  cout << "DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
396  }
397  dttpgphquality[bxindex]->Fill(DTPhDigiItr->code());
398  if (verbose_)
399  {
400  cout << "DTTPG phi quality " << DTPhDigiItr->code() << endl;
401  }
402  dttpgphts2tag[bxindex]->Fill(DTPhDigiItr->Ts2Tag());
403  if (verbose_)
404  {
405  cout << "DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
406  }
407  int ypos = DTPhDigiItr->scNum();
408  int xpos = DTPhDigiItr->stNum()+4*(DTPhDigiItr->whNum()+2);
409  dttpgphmap->Fill(xpos,ypos);
410  if (DTPhDigiItr->Ts2Tag())
411  dttpgphmap2nd->Fill(xpos,ypos);
412  dttpgphmapbx[bxindex]->Fill(xpos,ypos);
413  if (DTPhDigiItr->code()>3)
414  dttpgphmapcorr->Fill(xpos,ypos);
415 
416  if (bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]==nullptr ||
417  bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]->code()<DTPhDigiItr->code())
418  {
419  bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]=&(*DTPhDigiItr);
420  }
421 
422  }
423 
424  for (int iwh=0; iwh<5; iwh++){
425  for (int isec=0; isec<12; isec++){
426  for (int ist=0; ist<4; ist++){
427  if (bestPhQualMap[iwh][isec][ist]){
428  int xpos = iwh*4+ist+1;
429  dttpgphbestmap->Fill(xpos,isec);
430  if(bestPhQualMap[iwh][isec][ist]->code()>3)
431  dttpgphbestmapcorr->Fill(xpos,isec);
432  }
433  }
434  }
435  }
436 
437 
438  int bestThQualMap[5][12][3];
439  memset(bestThQualMap,0,180*sizeof(int));
440  //for( vector<L1MuDTChambThDigi>::const_iterator
441  for( L1MuDTChambThContainer::The_Container::const_iterator
442  DTThDigiItr = myThContainer->begin() ;
443  DTThDigiItr != myThContainer->end() ;
444  ++DTThDigiItr )
445  {
446  ndttpgthtrack++;
447 
448  int bxindex = DTThDigiItr->bxNum() + 1;
449 
450  dttpgthwheel[bxindex]->Fill(DTThDigiItr->whNum());
451  if (verbose_)
452  {
453  cout << "DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
454  }
455  dttpgthstation[bxindex]->Fill(DTThDigiItr->stNum());
456  if (verbose_)
457  {
458  cout << "DTTPG theta station number " << DTThDigiItr->stNum() << endl;
459  }
460  dttpgthsector[bxindex]->Fill(DTThDigiItr->scNum());
461  if (verbose_)
462  {
463  cout << "DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
464  }
465  dttpgthbx[bxindex]->Fill(DTThDigiItr->bxNum());
466  if (verbose_)
467  {
468  cout << "DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
469  }
470  int thcode[7]= {0,0,0,0,0,0,0};
471  for (int j = 0; j < 7; j++)
472  {
473  dttpgththeta[bxindex]->Fill(DTThDigiItr->position(j));
474  if (verbose_)
475  {
476  cout << "DTTPG theta position " << DTThDigiItr->position(j) << endl;
477  }
478  thcode[j]=DTThDigiItr->code(j);
479  dttpgthquality[bxindex]->Fill(thcode[j]);
480  if (verbose_)
481  {
482  cout << "DTTPG theta quality " << DTThDigiItr->code(j) << endl;
483  }
484  }
485 
486  int ypos = DTThDigiItr->scNum();
487  int xpos = DTThDigiItr->stNum()+4*(DTThDigiItr->whNum()+2);
488  int bestqual=0;
489  dttpgthmap->Fill(xpos,ypos);
490  dttpgthmapbx[bxindex]->Fill(xpos,ypos);
491  for (int pos = 0; pos < 7; pos++){
492  if (thcode[pos]>bestqual)
493  bestqual=thcode[pos];
494  if(thcode[pos]==2)
495  dttpgthmaph->Fill(xpos,ypos);
496  }
497 
498  if (bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1] < bestqual)
499  {
500  bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1]=bestqual;
501  }
502  }
503 
504  for (int iwh=0; iwh<5; iwh++){
505  for (int isec=0; isec<12; isec++){
506  for (int ist=0; ist<3; ist++){
507  if (bestThQualMap[iwh][isec][ist]){
508  int xpos = iwh*4+ist+1;
509  dttpgthbestmap->Fill(xpos,isec);
510  if(bestThQualMap[iwh][isec][ist]==2)
511  dttpgthbestmaph->Fill(xpos,isec);
512  }
513  }
514  }
515  }
516 
517 
518  dttpgphntrack->Fill(ndttpgphtrack);
519  if (verbose_)
520  {
521  cout << "DTTPG phi ntrack " << ndttpgphtrack << endl;
522  }
523  dttpgthntrack->Fill(ndttpgthtrack);
524  if (verbose_) {
525  cout << "DTTPG theta ntrack " << ndttpgthtrack << endl;
526  }
527 
528  edm::Handle<L1MuDTTrackContainer > myL1MuDTTrackContainer;
529  e.getByToken(trToken_,myL1MuDTTrackContainer);
530 
531  if (!myL1MuDTTrackContainer.isValid()) {
532  edm::LogInfo("DataNotFound") << "can't find L1MuDTTrackContainer with label "
533  << dttpgSource_.label() ;
534  return;
535  }
536 
537  L1MuDTTrackContainer::TrackContainer const * t = myL1MuDTTrackContainer->getContainer();
538 
539 
540 
541  int NumberOfSegmentsOut[3]={0,0,0};
542  for ( L1MuDTTrackContainer::TrackContainer::const_iterator i
543  = t->begin(); i != t->end(); ++i ) {
544  if(i->bx() ==-1)
545  NumberOfSegmentsOut[0]++;
546  if(i->bx() ==0)
547  NumberOfSegmentsOut[1]++;
548  if(i->bx() ==1)
549  NumberOfSegmentsOut[2]++;
550  }
551 
552 
553  /*Fill Histos for Segment counter*/
554  for(int k=0;k<3;k++){
555  dttpgphbx[k+5]->Fill(NumberOfSegmentsOut[k]);
556  }
557 
558  /*Bunch assigments*/
559 
560  int bxCounterDttfOut=0;
561  for (int k=0;k<3;k++){
562  if (NumberOfSegmentsOut[k]>0)
563  bxCounterDttfOut++;
564  }
565 
566  int bxCodeOut=0;
567  if(bxCounterDttfOut==0){
568  bxCodeOut=0;
569  }else if(bxCounterDttfOut==1){
570  for(int k=0;k<3;k++){
571  if(NumberOfSegmentsOut[k]>0)
572  bxCodeOut=k+2;
573  }
574  }else if(bxCounterDttfOut==2){
575  for(int k=0;k<3;k++){
576  if(NumberOfSegmentsOut[k]==0)
577  bxCodeOut=8-k;
578  }
579  }else if(bxCounterDttfOut==3){
580  bxCodeOut=10;
581  }
582 
583  //The bx analyzer histo
584  dttpgphbx[1]->Fill(bxCodeOut);
585 
586  /*End Dttf Output Bunch analysis*/
587 
588  // the 2-DIM histo with phi.input vs. output
589  dttpgphbxcomp->Fill(bxCodePhi,bxCodeOut);
590 
591 
592  for ( L1MuDTTrackContainer::TrackContainer::const_iterator i
593  = t->begin(); i != t->end(); ++i ) {
594  if ( verbose_ ) {
595  std::cout << "bx = " << i->bx()
596  << std::endl;
597  std::cout << "quality (packed) = " << i->quality_packed()
598  << std::endl;
599  std::cout << "pt (packed) = " << i->pt_packed()
600  << std::endl;
601  std::cout << "phi (packed) = " << i->phi_packed()
602  << std::endl;
603  std::cout << "charge (packed) = " << i->charge_packed()
604  << std::endl;
605  }
606 
607 
608  int bxindex = i->bx() + 1;
609  dttf_p_phi[bxindex]->Fill(i->phi_packed());
610  dttf_p_qual[bxindex]->Fill(i->quality_packed());
611  dttf_p_pt[bxindex]->Fill(i->pt_packed());
612  dttf_p_q[bxindex]->Fill(i->charge_packed());
613  }
614 
615 }
616 
618 {
619 
620  me->setAxisTitle("DTTF Sector",2);
621  for(int i=0;i<5;i++){
622  ostringstream wheel;
623  wheel << i-2;
624  me->setBinLabel(1+i*4,"Wheel "+ wheel.str(),1);
625  }
626 
627 }
628 
630 {
631 
632  me->setAxisTitle("DTTF Sector",2);
633  for(int i=0;i<5;i++){
634  ostringstream wheel;
635  wheel << i-2;
636  me->setBinLabel(1+i*3,"Wheel "+ wheel.str(),1);
637  }
638 
639 }
The_Container const * getContainer() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * dttpgthbestmaph
Definition: L1TDTTPG.h:96
MonitorElement * dttf_p_phi[3]
Definition: L1TDTTPG.h:98
L1TDTTPG(const edm::ParameterSet &ps)
Definition: L1TDTTPG.cc:93
MonitorElement * dttpgphmap
Definition: L1TDTTPG.h:77
MonitorElement * dttpgphbestmapcorr
Definition: L1TDTTPG.h:82
MonitorElement * dttpgphmapcorr
Definition: L1TDTTPG.h:80
void setMapPhLabel(MonitorElement *me)
Definition: L1TDTTPG.cc:617
MonitorElement * dttpgphbx[8]
Definition: L1TDTTPG.h:66
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int nev_
Definition: L1TDTTPG.h:103
edm::EDGetTokenT< L1MuDTChambThContainer > dttpgSourceThContainer_token_
Definition: L1TDTTPG.h:109
MonitorElement * dttpgththeta[3]
Definition: L1TDTTPG.h:89
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TDTTPG.cc:288
MonitorElement * dttpgphwheel[3]
Definition: L1TDTTPG.h:68
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)
MonitorElement * dttpgthbestmap
Definition: L1TDTTPG.h:95
MonitorElement * dttpgphbxcomp
Definition: L1TDTTPG.h:67
edm::EDGetTokenT< L1MuDTTrackContainer > trToken_
Definition: L1TDTTPG.h:113
MonitorElement * dttpgthmaph
Definition: L1TDTTPG.h:94
void Fill(long long x)
MonitorElement * dttpgthsector[3]
Definition: L1TDTTPG.h:87
MonitorElement * dttpgthmapbx[3]
Definition: L1TDTTPG.h:93
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TDTTPG.cc:128
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * dttpgthwheel[3]
Definition: L1TDTTPG.h:86
std::string outputFile_
Definition: L1TDTTPG.h:104
MonitorElement * dttpgthmap
Definition: L1TDTTPG.h:92
std::vector< L1MuDTTrackCand > TrackContainer
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * dttf_p_qual[3]
Definition: L1TDTTPG.h:101
MonitorElement * dttpgthbx[3]
Definition: L1TDTTPG.h:85
MonitorElement * dttpgthquality[3]
Definition: L1TDTTPG.h:90
std::vector< L1MuDTChambPhDigi > Phi_Container
MonitorElement * dttf_p_pt[3]
Definition: L1TDTTPG.h:99
std::vector< L1MuDTChambThDigi > The_Container
bool isValid() const
Definition: HandleBase.h:74
int k[5][pyjets_maxn]
MonitorElement * dttpgphbestmap
Definition: L1TDTTPG.h:81
MonitorElement * dttpgthntrack
Definition: L1TDTTPG.h:91
edm::InputTag dttpgSource_
Definition: L1TDTTPG.h:110
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * dttpgphts2tag[3]
Definition: L1TDTTPG.h:74
MonitorElement * dttpgphntrack
Definition: L1TDTTPG.h:76
Phi_Container const * getContainer() const
edm::EDGetTokenT< L1MuDTChambPhContainer > dttpgSourcePhContainer_token_
Definition: L1TDTTPG.h:108
MonitorElement * dttf_p_q[3]
Definition: L1TDTTPG.h:100
void setMapThLabel(MonitorElement *me)
Definition: L1TDTTPG.cc:629
std::string const & label() const
Definition: InputTag.h:36
std::string const & process() const
Definition: InputTag.h:40
HLT enums.
std::string trstring_
Definition: L1TDTTPG.h:112
MonitorElement * dttpgphmapbx[3]
Definition: L1TDTTPG.h:78
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
Definition: L1TDTTPG.cc:122
bool verbose_
Definition: L1TDTTPG.h:105
MonitorElement * dttpgthstation[3]
Definition: L1TDTTPG.h:88
MonitorElement * dttpgphsector[3]
Definition: L1TDTTPG.h:69
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
~L1TDTTPG() override
Definition: L1TDTTPG.cc:117
TrackContainer const * getContainer() const
MonitorElement * dttpgphquality[3]
Definition: L1TDTTPG.h:73
MonitorElement * dttpgphmap2nd
Definition: L1TDTTPG.h:79
Definition: Run.h:44
MonitorElement * dttpgphstation[3]
Definition: L1TDTTPG.h:70