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