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  * $Date: 2008/03/20 19:38:25 $
5  * $Revision: 1.20 $
6  * \author J. Berryhill
7  *
8  * $Log: L1TDTTPG.cc,v $
9  * Revision 1.20 2008/03/20 19:38:25 berryhil
10  *
11  *
12  * organized message logger
13  *
14  * Revision 1.19 2008/03/14 20:35:46 berryhil
15  *
16  *
17  * stripped out obsolete parameter settings
18  *
19  * rpc tpg restored with correct dn access and dbe handling
20  *
21  * Revision 1.18 2008/03/12 17:24:24 berryhil
22  *
23  *
24  * eliminated log files, truncated HCALTPGXana histo output
25  *
26  * Revision 1.17 2008/03/10 09:29:52 lorenzo
27  * added MEs
28  *
29  * Revision 1.16 2008/03/01 00:40:00 lat
30  * DQM core migration.
31  *
32  * $Log: L1TDTTPG.cc,v $
33  * Revision 1.20 2008/03/20 19:38:25 berryhil
34  *
35  *
36  * organized message logger
37  *
38  * Revision 1.19 2008/03/14 20:35:46 berryhil
39  *
40  *
41  * stripped out obsolete parameter settings
42  *
43  * rpc tpg restored with correct dn access and dbe handling
44  *
45  * Revision 1.18 2008/03/12 17:24:24 berryhil
46  *
47  *
48  * eliminated log files, truncated HCALTPGXana histo output
49  *
50  * Revision 1.17 2008/03/10 09:29:52 lorenzo
51  * added MEs
52  *
53  * Revision 1.15 2008/01/22 18:56:01 muzaffar
54  * include cleanup. Only for cc/cpp files
55  *
56  * Revision 1.14 2007/12/21 17:41:20 berryhil
57  *
58  *
59  * try/catch removal
60  *
61  * Revision 1.13 2007/11/19 15:08:22 lorenzo
62  * changed top folder name
63  *
64  * Revision 1.12 2007/08/15 18:56:25 berryhil
65  *
66  *
67  * split histograms by bx; add Maiken's bx classifier plots
68  *
69  * Revision 1.11 2007/07/26 09:37:09 berryhil
70  *
71  *
72  * set verbose false for all modules
73  * set verbose fix for DTTPG tracks
74  *
75  * Revision 1.10 2007/07/25 09:03:58 berryhil
76  *
77  *
78  * conform to DTTFFEDReader input tag.... for now
79  *
80  * Revision 1.9 2007/07/12 16:06:18 wittich
81  * add simple phi output track histograms.
82  * note that the label of this class is different than others
83  * from the DTFFReader creates.
84  *
85  */
86 #include <iostream>
87 #include <sstream>
88 #include <fstream>
89 #include <vector>
90 
93 
101 
102 using namespace std;
103 using namespace edm;
104 
106  : dttpgSource_( ps.getParameter< InputTag >("dttpgSource") )
107 {
108 
109  // verbosity switch
110  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
111 
112  if(verbose_) cout << "L1TDTTPG: constructor...." << endl;
113 
114 
115  dbe = NULL;
116  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
117  {
119  dbe->setVerbose(0);
120  }
121 
122  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
123  if ( outputFile_.size() != 0 ) {
124  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
125  }
126 
127  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
128  if(disable){
129  outputFile_="";
130  }
131 
132 
133  if ( dbe !=NULL ) {
134  dbe->setCurrentFolder("L1T/L1TDTTPG");
135  }
136 
137 
138 }
139 
141 {
142 }
143 
145 {
146 
147  nev_ = 0;
148 
149  // get hold of back-end interface
150  DQMStore* dbe = 0;
151  dbe = Service<DQMStore>().operator->();
152  if ( dbe ) {
153  dbe->setCurrentFolder("L1T/L1TDTTPG");
154  dbe->rmdir("L1T/L1TDTTPG");
155  }
156 
157 
158  if ( dbe )
159  {
160  dbe->setCurrentFolder("L1T/L1TDTTPG");
161 
162 
163  //hist1[0]
164  dttpgphbx[0] = dbe->book1D("BxEncoding_PHI",
165  "Bunch encoding DTTF Phi",11,0,11);
166  //hist1[1]
167  dttpgphbx[1] = dbe->book1D("BxEncoding_OUT",
168  "Bunch encoding DTTF Output",11,0,11);
169 
170  //hist1[2]
171  dttpgphbx[2] = dbe->book1D("NumberOfSegmentsPHI_BunchNeg1",
172  "Number of segments for bunch -1 Dttf Phi",
173  20,0,20);
174  //hist1[3]
175  dttpgphbx[3] = dbe->book1D("NumberOfSegmentsPHI_Bunch0",
176  "Number of segments for bunch 0 Dttf Phi",
177  20,0,20);
178  //hist1[4]
179  dttpgphbx[4] = dbe->book1D("NumberOfSegmentsPHI_Bunch1",
180  "Number of segments for bunch 1 Dttf Phi",
181  20,0,20);
182 
183  //hist1[5]
184  dttpgphbx[5] = dbe->book1D("NumberOfSegmentsOUT_BunchNeg1",
185  "Number of segments for bunch -1 Dttf Output",
186  20,0,20);
187  //hist1[6]
188  dttpgphbx[6] = dbe->book1D("NumberOfSegmentsOUT_Bunch0",
189  "Number of segments for bunch 0 Dttf Output",
190  20,0,20);
191  //hist1[7]
192  dttpgphbx[7] = dbe->book1D("NumberOfSegmentsOUT_Bunch1",
193  "Number of segments for bunch 1 Dttf Output",
194  20,0,20);
195 
196  for(int i=0;i<2;i++){
197  dttpgphbx[i]->setBinLabel(1,"None");
198  dttpgphbx[i]->setBinLabel(3,"Only bx=-1");
199  dttpgphbx[i]->setBinLabel(4,"Only bx= 0");
200  dttpgphbx[i]->setBinLabel(5,"Only bx=+1");
201  dttpgphbx[i]->setBinLabel(7,"Bx=-1,0");
202  dttpgphbx[i]->setBinLabel(8,"Bx=-1,1");
203  dttpgphbx[i]->setBinLabel(9,"Bx= 0,1");
204  dttpgphbx[i]->setBinLabel(11,"All bx");
205  }
206 
207  dttpgphbxcomp = dbe->book2D("BxEncoding_PHI_OUT",
208  "Bunch encoding: DTTF Phi vs. Output",
209  11,0,11,11,0,11);
210  dttpgphbxcomp->setAxisTitle("DTTF (output)",1);
211  dttpgphbxcomp->setAxisTitle("PHI-TF",2);
212  for(int i=1;i<=2;i++){
213  dttpgphbxcomp->setBinLabel(1,"None",i);
214  dttpgphbxcomp->setBinLabel(3,"Only bx=-1",i);
215  dttpgphbxcomp->setBinLabel(4,"Only bx= 0",i);
216  dttpgphbxcomp->setBinLabel(5,"Only bx=+1",i);
217  dttpgphbxcomp->setBinLabel(7,"Bx=-1,0",i);
218  dttpgphbxcomp->setBinLabel(8,"Bx=-1,1",i);
219  dttpgphbxcomp->setBinLabel(9,"Bx= 0,1",i);
220  dttpgphbxcomp->setBinLabel(11,"All bx",i);
221  }
222 
223  dttpgphntrack = dbe->book1D("DT_TPG_phi_ntrack",
224  "DT TPG phi ntrack", 20, -0.5, 19.5 ) ;
225  dttpgthntrack = dbe->book1D("DT_TPG_theta_ntrack",
226  "DT TPG theta ntrack", 20, -0.5, 19.5 ) ;
227 
228  for (int ibx=0 ; ibx<=2; ibx++) {
229 
230  ostringstream bxnum;
231  bxnum << ibx-1;
232  string bxn;
233  if (ibx<2)
234  bxn = bxnum.str();
235  else
236  bxn = "+" + bxnum.str();
237 
238  // Phi
239  dttpgphwheel[ibx] = dbe->book1D("DT_TPG_phi_wheel_number_"+bxn,
240  "DT TPG phi wheel number "+bxn, 5, -2.5, 2.5 ) ;
241  dttpgphsector[ibx] = dbe->book1D("DT_TPG_phi_sector_number_"+bxn,
242  "DT TPG phi sector number "+bxn, 12, -0.5, 11.5 );
243  dttpgphstation[ibx] = dbe->book1D("DT_TPG_phi_station_number_"+bxn,
244  "DT TPG phi station number "+bxn, 5, 0.5, 4.5 ) ;
245 // dttpgphphi[ibx] = dbe->book1D("DT_TPG_phi_"+bxn,
246 // "DT TPG phi "+bxn, 100, -2100., 2100. ) ;
247 // dttpgphphiB[ibx] = dbe->book1D("DT_TPG_phiB_"+bxn,
248 // "DT TPG phiB "+bxn, 100, -550., 550. ) ;
249  dttpgphquality[ibx] = dbe->book1D("DT_TPG_phi_quality_"+bxn,
250  "DT TPG phi quality "+bxn, 8, -0.5, 7.5 ) ;
251  dttpgphts2tag[ibx] = dbe->book1D("DT_TPG_phi_Ts2Tag_"+bxn,
252  "DT TPG phi Ts2Tag "+bxn, 2, -0.5, 1.5 ) ;
253 // dttpgphbxcnt[ibx] = dbe->book1D("DT_TPG_phi_BxCnt_"+bxn,
254 // "DT TPG phi BxCnt "+bxn, 10, -0.5, 9.5 ) ;
255  dttpgphmapbx[ibx] = dbe->book2D("DT_TPG_phi_map_bx"+bxn,
256  "Map of triggers per station (BX="+bxn+")",20,1,21,12,0,12);
258 
259  //Theta
260  dttpgthbx[ibx] = dbe->book1D("DT_TPG_theta_bx_"+bxn,
261  "DT TPG theta bx "+bxn, 50, -24.5, 24.5 ) ;
262  dttpgthwheel[ibx] = dbe->book1D("DT_TPG_theta_wheel_number_"+bxn,
263  "DT TPG theta wheel number "+bxn, 5, -2.5, 2.5 ) ;
264  dttpgthsector[ibx] = dbe->book1D("DT_TPG_theta_sector_number_"+bxn,
265  "DT TPG theta sector number "+bxn, 12, -0.5, 11.5 ) ;
266  dttpgthstation[ibx] = dbe->book1D("DT_TPG_theta_station_number_"+bxn,
267  "DT TPG theta station number "+bxn, 5, -0.5, 4.5 ) ;
268  dttpgththeta[ibx] = dbe->book1D("DT_TPG_theta_"+bxn,
269  "DT TPG theta "+bxn, 20, -0.5, 19.5 ) ;
270  dttpgthquality[ibx] = dbe->book1D("DT_TPG_theta_quality_"+bxn,
271  "DT TPG theta quality "+bxn, 8, -0.5, 7.5 ) ;
272  dttpgthmapbx[ibx] = dbe->book2D("DT_TPG_theta_map_bx_"+bxn,
273  "Map of triggers per station (BX="+bxn+")",15,1,16,12,0,12);
275 
276  // Phi output
277  dttf_p_phi[ibx] = dbe->book1D("dttf_p_phi_"+bxn, "dttf phi output #phi "+bxn, 256,
278  -0.5, 255.5);
279  dttf_p_qual[ibx] = dbe->book1D("dttf_p_qual_"+bxn, "dttf phi output qual "+bxn, 8, -0.5, 7.5);
280  dttf_p_q[ibx] = dbe->book1D("dttf_p_q_"+bxn, "dttf phi output q "+bxn, 2, -0.5, 1.5);
281  dttf_p_pt[ibx] = dbe->book1D("dttf_p_pt_"+bxn, "dttf phi output p_{t} "+bxn, 32, -0.5, 31.5);
282 
283  }
284 
285  dttpgphmap = dbe->book2D("DT_TPG_phi_map",
286  "Map of triggers per station",20,1,21,12,0,12);
287  dttpgphmapcorr = dbe->book2D("DT_TPG_phi_map_corr",
288  "Map of correlated triggers per station",20,1,21,12,0,12);
289  dttpgphmap2nd = dbe->book2D("DT_TPG_phi_map_2nd",
290  "Map of second tracks per station",20,1,21,12,0,12);
291  dttpgphbestmap = dbe->book2D("DT_TPG_phi_best_map",
292  "Map of best triggers per station",20,1,21,12,0,12);
293  dttpgphbestmapcorr = dbe->book2D("DT_TPG_phi_best_map_corr",
294  "Map of correlated best triggers per station",20,1,21,12,0,12);
300 
301 
302 
303  dttpgthmap = dbe->book2D("DT_TPG_theta_map",
304  "Map of triggers per station",15,1,16,12,0,12);
305  dttpgthmaph = dbe->book2D("DT_TPG_theta_map_h",
306  "Map of H quality triggers per station",15,1,16,12,0,12);
307  dttpgthbestmap = dbe->book2D("DT_TPG_theta_best_map",
308  "Map of besttriggers per station",15,1,16,12,0,12);
309  dttpgthbestmaph = dbe->book2D("DT_TPG_theta_best_map_h",
310  "Map of H quality best triggers per station",15,1,16,12,0,12);
315 
316 
317  }
318 }
319 
320 
322 {
323  if(verbose_) cout << "L1TDTTPG: end job...." << endl;
324  LogInfo("EndJob") << "analyzed " << nev_ << " events";
325 
326  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
327 
328  return;
329 }
330 
331 void L1TDTTPG::analyze(const Event& e, const EventSetup& c)
332 {
333 
334  nev_++;
335  if(verbose_) cout << "L1TDTTPG: analyze...." << endl;
336 
337  edm::Handle<L1MuDTChambPhContainer > myL1MuDTChambPhContainer;
338  e.getByLabel(dttpgSource_,myL1MuDTChambPhContainer);
339 
340  if (!myL1MuDTChambPhContainer.isValid()) {
341  edm::LogInfo("DataNotFound") << "can't find L1MuDTChambPhContainer with label "
342  << dttpgSource_.label() ;
343  return;
344  }
345  L1MuDTChambPhContainer::Phi_Container *myPhContainer =
346  myL1MuDTChambPhContainer->getContainer();
347 
348  edm::Handle<L1MuDTChambThContainer > myL1MuDTChambThContainer;
349  e.getByLabel(dttpgSource_,myL1MuDTChambThContainer);
350 
351  if (!myL1MuDTChambThContainer.isValid()) {
352  edm::LogInfo("DataNotFound") << "can't find L1MuDTChambThContainer with label "
353  << dttpgSource_.label() ;
354  edm::LogInfo("DataNotFound") << "if this fails try to add DATA to the process name." ;
355 
356  return;
357  }
358  L1MuDTChambThContainer::The_Container* myThContainer =
359  myL1MuDTChambThContainer->getContainer();
360 
361  int ndttpgphtrack = 0;
362  int ndttpgthtrack = 0;
363  int NumberOfSegmentsPhi[3]={0,0,0};
364 
365  for( L1MuDTChambPhContainer::Phi_Container::const_iterator
366  DTPhDigiItr = myPhContainer->begin() ;
367  DTPhDigiItr != myPhContainer->end() ;
368  ++DTPhDigiItr )
369  {
370  int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
371  if(bx == -1)
372  NumberOfSegmentsPhi[0]++;
373  if(bx == 0)
374  NumberOfSegmentsPhi[1]++;
375  if(bx == 1)
376  NumberOfSegmentsPhi[2]++;
377  }
378  /*Fill Histos for Segment counter for each bx separately */
379 
380  for(int k=0;k<3;k++){
381  dttpgphbx[k+2]->Fill(NumberOfSegmentsPhi[k]);
382  }
383  int bxCounterDttfPhi=0; // = no. of BX's with non-zero data
384  for (int k=0;k<3;k++){
385  if (NumberOfSegmentsPhi[k]>0)
386  bxCounterDttfPhi++;
387  }
388 
389  /* the BX "code" */
390 
391  int bxCodePhi=0;
392  if(bxCounterDttfPhi==0){
393  bxCodePhi=0;
394  }else if(bxCounterDttfPhi==1){
395  for(int k=0;k<3;k++){
396  if(NumberOfSegmentsPhi[k]>0)
397  bxCodePhi=k+2;
398  }
399  }else if(bxCounterDttfPhi==2){
400  for(int k=0;k<3;k++){
401  if(NumberOfSegmentsPhi[k]==0)
402  bxCodePhi=8-k;
403  }
404  }else if(bxCounterDttfPhi==3){
405  bxCodePhi=10;
406  }
407 
408  //The bx analyzer histo
409  dttpgphbx[0]->Fill(bxCodePhi);
410 
411 
412  const L1MuDTChambPhDigi* bestPhQualMap[5][12][4];
413  memset(bestPhQualMap,0,240*sizeof(L1MuDTChambPhDigi*));
414 
415  for( L1MuDTChambPhContainer::Phi_Container::const_iterator
416  DTPhDigiItr = myPhContainer->begin() ;
417  DTPhDigiItr != myPhContainer->end() ;
418  ++DTPhDigiItr )
419  {
420 
421  ndttpgphtrack++;
422 
423  int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
424 
425  dttpgphwheel[bxindex]->Fill(DTPhDigiItr->whNum());
426  if (verbose_)
427  {
428  cout << "DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
429  }
430  dttpgphstation[bxindex]->Fill(DTPhDigiItr->stNum());
431  if (verbose_)
432  {
433  cout << "DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
434  }
435  dttpgphsector[bxindex]->Fill(DTPhDigiItr->scNum());
436  if (verbose_)
437  {
438  cout << "DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
439  }
440 // dttpgphphi[bxindex]->Fill(DTPhDigiItr->phi());
441 // if (verbose_)
442 // {
443 // cout << "DTTPG phi phi " << DTPhDigiItr->phi() << endl;
444 // }
445 // dttpgphphiB[bxindex]->Fill(DTPhDigiItr->phiB());
446 // if (verbose_)
447 // {
448 // cout << "DTTPG phi phiB " << DTPhDigiItr->phiB() << endl;
449 // }
450  dttpgphquality[bxindex]->Fill(DTPhDigiItr->code());
451  if (verbose_)
452  {
453  cout << "DTTPG phi quality " << DTPhDigiItr->code() << endl;
454  }
455  dttpgphts2tag[bxindex]->Fill(DTPhDigiItr->Ts2Tag());
456  if (verbose_)
457  {
458  cout << "DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
459  }
460 // dttpgphbxcnt[bxindex]->Fill(DTPhDigiItr->BxCnt());
461 // if (verbose_)
462 // {
463 // cout << "DTTPG phi bxcnt " << DTPhDigiItr->BxCnt() << endl;
464 // }
465 
466  int ypos = DTPhDigiItr->scNum();
467  int xpos = DTPhDigiItr->stNum()+4*(DTPhDigiItr->whNum()+2);
468  dttpgphmap->Fill(xpos,ypos);
469  if (DTPhDigiItr->Ts2Tag())
470  dttpgphmap2nd->Fill(xpos,ypos);
471  dttpgphmapbx[bxindex]->Fill(xpos,ypos);
472  if (DTPhDigiItr->code()>3)
473  dttpgphmapcorr->Fill(xpos,ypos);
474 
475  if (bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]==0 ||
476  bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]->code()<DTPhDigiItr->code())
477  {
478  bestPhQualMap[DTPhDigiItr->whNum()+2][ DTPhDigiItr->scNum()][DTPhDigiItr->stNum()-1]=&(*DTPhDigiItr);
479  }
480 
481  }
482 
483  for (int iwh=0; iwh<5; iwh++){
484  for (int isec=0; isec<12; isec++){
485  for (int ist=0; ist<4; ist++){
486  if (bestPhQualMap[iwh][isec][ist]){
487  int xpos = iwh*4+ist+1;
488  dttpgphbestmap->Fill(xpos,isec);
489  if(bestPhQualMap[iwh][isec][ist]->code()>3)
490  dttpgphbestmapcorr->Fill(xpos,isec);
491  }
492  }
493  }
494  }
495 
496 
497  int bestThQualMap[5][12][3];
498  memset(bestThQualMap,0,180*sizeof(int));
499  //for( vector<L1MuDTChambThDigi>::const_iterator
500  for( L1MuDTChambThContainer::The_Container::const_iterator
501  DTThDigiItr = myThContainer->begin() ;
502  DTThDigiItr != myThContainer->end() ;
503  ++DTThDigiItr )
504  {
505  ndttpgthtrack++;
506 
507  int bxindex = DTThDigiItr->bxNum() + 1;
508 
509  dttpgthwheel[bxindex]->Fill(DTThDigiItr->whNum());
510  if (verbose_)
511  {
512  cout << "DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
513  }
514  dttpgthstation[bxindex]->Fill(DTThDigiItr->stNum());
515  if (verbose_)
516  {
517  cout << "DTTPG theta station number " << DTThDigiItr->stNum() << endl;
518  }
519  dttpgthsector[bxindex]->Fill(DTThDigiItr->scNum());
520  if (verbose_)
521  {
522  cout << "DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
523  }
524  dttpgthbx[bxindex]->Fill(DTThDigiItr->bxNum());
525  if (verbose_)
526  {
527  cout << "DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
528  }
529  int thcode[7]= {0,0,0,0,0,0,0};
530  for (int j = 0; j < 7; j++)
531  {
532  dttpgththeta[bxindex]->Fill(DTThDigiItr->position(j));
533  if (verbose_)
534  {
535  cout << "DTTPG theta position " << DTThDigiItr->position(j) << endl;
536  }
537  thcode[j]=DTThDigiItr->code(j);
538  dttpgthquality[bxindex]->Fill(thcode[j]);
539  if (verbose_)
540  {
541  cout << "DTTPG theta quality " << DTThDigiItr->code(j) << endl;
542  }
543  }
544 
545  int ypos = DTThDigiItr->scNum();
546  int xpos = DTThDigiItr->stNum()+4*(DTThDigiItr->whNum()+2);
547  int bestqual=0;
548  dttpgthmap->Fill(xpos,ypos);
549  dttpgthmapbx[bxindex]->Fill(xpos,ypos);
550  for (int pos = 0; pos < 7; pos++){
551  if (thcode[pos]>bestqual)
552  bestqual=thcode[pos];
553  if(thcode[pos]==2)
554  dttpgthmaph->Fill(xpos,ypos);
555  }
556 
557  if (bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1] < bestqual)
558  {
559  bestThQualMap[DTThDigiItr->whNum()+2][ DTThDigiItr->scNum()][DTThDigiItr->stNum()-1]=bestqual;
560  }
561  }
562 
563  for (int iwh=0; iwh<5; iwh++){
564  for (int isec=0; isec<12; isec++){
565  for (int ist=0; ist<3; ist++){
566  if (bestThQualMap[iwh][isec][ist]){
567  int xpos = iwh*4+ist+1;
568  dttpgthbestmap->Fill(xpos,isec);
569  if(bestThQualMap[iwh][isec][ist]==2)
570  dttpgthbestmaph->Fill(xpos,isec);
571  }
572  }
573  }
574  }
575 
576 
577  dttpgphntrack->Fill(ndttpgphtrack);
578  if (verbose_)
579  {
580  cout << "DTTPG phi ntrack " << ndttpgphtrack << endl;
581  }
582  dttpgthntrack->Fill(ndttpgthtrack);
583  if (verbose_) {
584  cout << "DTTPG theta ntrack " << ndttpgthtrack << endl;
585  }
586 
587  edm::Handle<L1MuDTTrackContainer > myL1MuDTTrackContainer;
588 
589 
590  std::string trstring;
591  trstring = dttpgSource_.label()+":"+"DATA"+":"+dttpgSource_.process();
592  edm::InputTag trInputTag(trstring);
593  e.getByLabel(trInputTag,myL1MuDTTrackContainer);
594 
595  if (!myL1MuDTTrackContainer.isValid()) {
596  edm::LogInfo("DataNotFound") << "can't find L1MuDTTrackContainer with label "
597  << dttpgSource_.label() ;
598  return;
599  }
600 
601  L1MuDTTrackContainer::TrackContainer *t = myL1MuDTTrackContainer->getContainer();
602 
603 
604 
605  int NumberOfSegmentsOut[3]={0,0,0};
606  for ( L1MuDTTrackContainer::TrackContainer::const_iterator i
607  = t->begin(); i != t->end(); ++i ) {
608  if(i->bx() ==-1)
609  NumberOfSegmentsOut[0]++;
610  if(i->bx() ==0)
611  NumberOfSegmentsOut[1]++;
612  if(i->bx() ==1)
613  NumberOfSegmentsOut[2]++;
614  }
615 
616 
617  /*Fill Histos for Segment counter*/
618  for(int k=0;k<3;k++){
619  dttpgphbx[k+5]->Fill(NumberOfSegmentsOut[k]);
620  }
621 
622  /*Bunch assigments*/
623 
624  int bxCounterDttfOut=0;
625  for (int k=0;k<3;k++){
626  if (NumberOfSegmentsOut[k]>0)
627  bxCounterDttfOut++;
628  }
629 
630  int bxCodeOut=0;
631  if(bxCounterDttfOut==0){
632  bxCodeOut=0;
633  }else if(bxCounterDttfOut==1){
634  for(int k=0;k<3;k++){
635  if(NumberOfSegmentsOut[k]>0)
636  bxCodeOut=k+2;
637  }
638  }else if(bxCounterDttfOut==2){
639  for(int k=0;k<3;k++){
640  if(NumberOfSegmentsOut[k]==0)
641  bxCodeOut=8-k;
642  }
643  }else if(bxCounterDttfOut==3){
644  bxCodeOut=10;
645  }
646 
647  //The bx analyzer histo
648  dttpgphbx[1]->Fill(bxCodeOut);
649 
650  /*End Dttf Output Bunch analysis*/
651 
652  // the 2-DIM histo with phi.input vs. output
653  dttpgphbxcomp->Fill(bxCodePhi,bxCodeOut);
654 
655 
656  for ( L1MuDTTrackContainer::TrackContainer::const_iterator i
657  = t->begin(); i != t->end(); ++i ) {
658  if ( verbose_ ) {
659  std::cout << "bx = " << i->bx()
660  << std::endl;
661  std::cout << "quality (packed) = " << i->quality_packed()
662  << std::endl;
663  std::cout << "pt (packed) = " << i->pt_packed()
664  << std::endl;
665  std::cout << "phi (packed) = " << i->phi_packed()
666  << std::endl;
667  std::cout << "charge (packed) = " << i->charge_packed()
668  << std::endl;
669  }
670 
671 
672  int bxindex = i->bx() + 1;
673  dttf_p_phi[bxindex]->Fill(i->phi_packed());
674  dttf_p_qual[bxindex]->Fill(i->quality_packed());
675  dttf_p_pt[bxindex]->Fill(i->pt_packed());
676  dttf_p_q[bxindex]->Fill(i->charge_packed());
677  }
678 
679 }
680 
682 {
683 
684  me->setAxisTitle("DTTF Sector",2);
685  for(int i=0;i<5;i++){
686  ostringstream wheel;
687  wheel << i-2;
688  me->setBinLabel(1+i*4,"Wheel "+ wheel.str(),1);
689  }
690 
691 }
692 
694 {
695 
696  me->setAxisTitle("DTTF Sector",2);
697  for(int i=0;i<5;i++){
698  ostringstream wheel;
699  wheel << i-2;
700  me->setBinLabel(1+i*3,"Wheel "+ wheel.str(),1);
701  }
702 
703 }
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: L1TDTTPG.cc:331
void beginJob(void)
Definition: L1TDTTPG.cc:144
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * dttpgthbestmaph
Definition: L1TDTTPG.h:90
MonitorElement * dttf_p_phi[3]
Definition: L1TDTTPG.h:92
L1TDTTPG(const edm::ParameterSet &ps)
Definition: L1TDTTPG.cc:105
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:681
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2311
MonitorElement * dttpgphbx[8]
Definition: L1TDTTPG.h:60
int nev_
Definition: L1TDTTPG.h:97
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
MonitorElement * dttpgththeta[3]
Definition: L1TDTTPG.h:83
DQMStore * dbe
Definition: L1TDTTPG.h:58
MonitorElement * dttpgphwheel[3]
Definition: L1TDTTPG.h:62
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:140
#define NULL
Definition: scimark2.h:8
MonitorElement * dttpgthbestmap
Definition: L1TDTTPG.h:89
MonitorElement * dttpgphbxcomp
Definition: L1TDTTPG.h:61
MonitorElement * dttpgthmaph
Definition: L1TDTTPG.h:88
void Fill(long long x)
MonitorElement * dttpgthsector[3]
Definition: L1TDTTPG.h:81
MonitorElement * dttpgthmapbx[3]
Definition: L1TDTTPG.h:87
MonitorElement * dttpgthwheel[3]
Definition: L1TDTTPG.h:80
std::string outputFile_
Definition: L1TDTTPG.h:98
MonitorElement * dttpgthmap
Definition: L1TDTTPG.h:86
void endJob(void)
Definition: L1TDTTPG.cc:321
std::vector< L1MuDTTrackCand > TrackContainer
MonitorElement * dttf_p_qual[3]
Definition: L1TDTTPG.h:95
int j
Definition: DBlmapReader.cc:9
MonitorElement * dttpgthbx[3]
Definition: L1TDTTPG.h:79
MonitorElement * dttpgthquality[3]
Definition: L1TDTTPG.h:84
std::vector< L1MuDTChambPhDigi > Phi_Container
void setVerbose(unsigned level)
Definition: DQMStore.cc:196
MonitorElement * dttf_p_pt[3]
Definition: L1TDTTPG.h:93
std::vector< L1MuDTChambThDigi > The_Container
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
int k[5][pyjets_maxn]
MonitorElement * dttpgphbestmap
Definition: L1TDTTPG.h:75
MonitorElement * dttpgthntrack
Definition: L1TDTTPG.h:85
edm::InputTag dttpgSource_
Definition: L1TDTTPG.h:102
MonitorElement * dttpgphts2tag[3]
Definition: L1TDTTPG.h:68
MonitorElement * dttpgphntrack
Definition: L1TDTTPG.h:70
MonitorElement * dttf_p_q[3]
Definition: L1TDTTPG.h:94
void setMapThLabel(MonitorElement *me)
Definition: L1TDTTPG.cc:693
std::string const & label() const
Definition: InputTag.h:25
std::string const & process() const
Definition: InputTag.h:29
MonitorElement * dttpgphmapbx[3]
Definition: L1TDTTPG.h:72
tuple cout
Definition: gather_cfg.py:41
bool verbose_
Definition: L1TDTTPG.h:99
MonitorElement * dttpgthstation[3]
Definition: L1TDTTPG.h:82
MonitorElement * dttpgphsector[3]
Definition: L1TDTTPG.h:63
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * dttpgphquality[3]
Definition: L1TDTTPG.h:67
MonitorElement * dttpgphmap2nd
Definition: L1TDTTPG.h:73
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
MonitorElement * dttpgphstation[3]
Definition: L1TDTTPG.h:64