CMS 3D CMS Logo

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