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