CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTLocalTriggerTask.cc
Go to the documentation of this file.
1 /*
2  * \file DTLocalTriggerTask.cc
3  *
4  * $Date: 2011/11/12 09:18:42 $
5  * $Revision: 1.39 $
6  * \author M. Zanetti - INFN Padova
7  *
8 */
9 
11 
12 // Framework
14 
15 // DT trigger
20 
21 // Geometry
27 
28 //Root
29 #include"TH1.h"
30 #include"TAxis.h"
31 
32 #include <sstream>
33 #include <iostream>
34 #include <fstream>
35 
36 
37 using namespace edm;
38 using namespace std;
39 
41 
42  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: Constructor"<<endl;
43 
44  tpMode = ps.getUntrackedParameter<bool>("testPulseMode", false);
45  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis", false);
46  doDCCTheta = ps.getUntrackedParameter<bool>("enableDCCTheta", false);
47 
48  if (tpMode) {
49  baseFolderDCC = "DT/11-LocalTriggerTP-DCC/";
50  baseFolderDDU = "DT/12-LocalTriggerTP-DDU/";
51  }
52  else {
53  baseFolderDCC = "DT/03-LocalTrigger-DCC/";
54  baseFolderDDU = "DT/04-LocalTrigger-DDU/";
55  }
56 
57  parameters = ps;
58 
60 
61 }
62 
63 
65 
66  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: analyzed " << nevents << " events" << endl;
67  if (trigGeomUtils) { delete trigGeomUtils; }
68 
69 }
70 
71 
73 
74  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: BeginJob" << endl;
75 
76  nevents = 0;
77 
78 }
79 
81 
82  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: BeginRun" << endl;
83 
84  context.get<MuonGeometryRecord>().get(muonGeom);
86 
87  if(parameters.getUntrackedParameter<bool>("staticBooking", true)) { // Static histo booking
88 
89  vector<string> trigSources;
90  if(parameters.getUntrackedParameter<bool>("localrun", true)) {
91  trigSources.push_back("");
92  }
93  else {
94  trigSources.push_back("_DTonly");
95  trigSources.push_back("_NoDT");
96  trigSources.push_back("_DTalso");
97  }
98  vector<string>::const_iterator trigSrcIt = trigSources.begin();
99  vector<string>::const_iterator trigSrcEnd = trigSources.end();
100 
101  if(parameters.getUntrackedParameter<bool>("process_dcc", true)) {
102  bookBarrelHistos("DCC_ErrorsChamberID");
103  }
104 
105  if (tpMode) {
106  for (int stat=1;stat<5;++stat){
107  for (int wh=-2;wh<3;++wh){
108  for (int sect=1;sect<13;++sect){
109  DTChamberId dtChId(wh,stat,sect);
110 
111  if (parameters.getUntrackedParameter<bool>("process_dcc", true)){ // DCC data
112  bookHistos(dtChId,"LocalTriggerPhi","DCC_BXvsQual"+(*trigSrcIt));
113  bookHistos(dtChId,"LocalTriggerPhi","DCC_QualvsPhirad"+(*trigSrcIt));
114  }
115 
116  if (parameters.getUntrackedParameter<bool>("process_ros", true)){ // DDU data
117  bookHistos(dtChId,"LocalTriggerPhi","DDU_BXvsQual"+(*trigSrcIt));
118  }
119 
120  }
121  }
122  } // end of loop
123  }
124  else {
125  for (;trigSrcIt!=trigSrcEnd;++trigSrcIt){
126  for (int wh=-2;wh<3;++wh){
127  if (parameters.getUntrackedParameter<bool>("process_dcc", true) &&
128  parameters.getUntrackedParameter<bool>("process_ros", true)){ // DCC+DDU data
129  bookWheelHistos(wh,"COM_BXDiff"+(*trigSrcIt));
130  }
131  for (int sect=1;sect<13;++sect){
132  for (int stat=1;stat<5;++stat){
133  DTChamberId dtChId(wh,stat,sect);
134  if (parameters.getUntrackedParameter<bool>("process_dcc", true)){ // DCC data
135 
136  bookHistos(dtChId,"LocalTriggerPhi","DCC_BXvsQual"+(*trigSrcIt));
137  if (detailedAnalysis) {
138  bookHistos(dtChId,"LocalTriggerPhi","DCC_QualvsPhirad"+(*trigSrcIt));
139  bookHistos(dtChId,"LocalTriggerPhi","DCC_QualvsPhibend"+(*trigSrcIt));
140  }
141  bookHistos(dtChId,"LocalTriggerPhi","DCC_Flag1stvsQual"+(*trigSrcIt));
142  bookHistos(dtChId,"LocalTriggerPhi","DCC_BestQual"+(*trigSrcIt));
143  if (stat!=4 && doDCCTheta){
144  bookHistos(dtChId,"LocalTriggerTheta","DCC_PositionvsBX"+(*trigSrcIt));
145 // bookHistos(dtChId,"LocalTriggerTheta","DCC_PositionvsQual"+(*trigSrcIt)); // DCC theta quality not available!
146 // bookHistos(dtChId,"LocalTriggerTheta","DCC_ThetaBXvsQual"+(*trigSrcIt));
147 // bookHistos(dtChId,"LocalTriggerTheta","DCC_ThetaBestQual"+(*trigSrcIt));
148  }
149 
150  if (parameters.getUntrackedParameter<bool>("process_seg", true)){ // DCC + Segemnt
151  bookHistos(dtChId,"Segment","DCC_PhitkvsPhitrig"+(*trigSrcIt));
152  bookHistos(dtChId,"Segment","DCC_PhibtkvsPhibtrig"+(*trigSrcIt));
153  bookHistos(dtChId,"Segment","DCC_PhiResidual"+(*trigSrcIt));
154  bookHistos(dtChId,"Segment","DCC_PhiResidualvsLUTPhi"+(*trigSrcIt));
155  bookHistos(dtChId,"Segment","DCC_PhibResidual"+(*trigSrcIt));
156  bookHistos(dtChId,"Segment","DCC_HitstkvsQualtrig"+(*trigSrcIt));
157  bookHistos(dtChId,"Segment","DCC_TrackPosvsAngle"+(*trigSrcIt));
158  bookHistos(dtChId,"Segment","DCC_TrackPosvsAngleandTrig"+(*trigSrcIt));
159  bookHistos(dtChId,"Segment","DCC_TrackPosvsAngleandTrigHHHL"+(*trigSrcIt));
160  if(stat!=4){
161  bookHistos(dtChId,"Segment","DCC_TrackThetaPosvsAngle"+(*trigSrcIt)); // theta view
162  bookHistos(dtChId,"Segment","DCC_TrackThetaPosvsAngleandTrig"+(*trigSrcIt));
163 // bookHistos(dtChId,"Segment","DCC_TrackThetaPosvsAngleandTrigH"+(*trigSrcIt)); // DCC theta quality not available!
164  }
165  }
166 
167  }
168 
169  if (parameters.getUntrackedParameter<bool>("process_ros", true)){ // DDU data
170 
171  bookHistos(dtChId,"LocalTriggerPhi","DDU_BXvsQual"+(*trigSrcIt));
172  bookHistos(dtChId,"LocalTriggerPhi","DDU_Flag1stvsQual"+(*trigSrcIt));
173  bookHistos(dtChId,"LocalTriggerPhi","DDU_BestQual"+(*trigSrcIt));
174  if(stat!=4){ // theta view
175  bookHistos(dtChId,"LocalTriggerTheta","DDU_ThetaBXvsQual"+(*trigSrcIt));
176  bookHistos(dtChId,"LocalTriggerTheta","DDU_ThetaBestQual"+(*trigSrcIt));
177  }
178 
179  if (parameters.getUntrackedParameter<bool>("process_seg", true)){ // DDU + Segment
180  bookHistos(dtChId,"Segment","DDU_HitstkvsQualtrig"+(*trigSrcIt));
181  bookHistos(dtChId,"Segment","DDU_TrackPosvsAngle"+(*trigSrcIt));
182  bookHistos(dtChId,"Segment","DDU_TrackPosvsAngleandTrig"+(*trigSrcIt));
183  bookHistos(dtChId,"Segment","DDU_TrackPosvsAngleandTrigHHHL"+(*trigSrcIt));
184  if(stat!=4){
185  bookHistos(dtChId,"Segment","DDU_TrackThetaPosvsAngle"+(*trigSrcIt)); // theta view
186  bookHistos(dtChId,"Segment","DDU_TrackThetaPosvsAngleandTrig"+(*trigSrcIt));
187  bookHistos(dtChId,"Segment","DDU_TrackThetaPosvsAngleandTrigH"+(*trigSrcIt));
188  }
189  }
190 
191  }
192 
193  if (parameters.getUntrackedParameter<bool>("process_dcc", true) &&
194  parameters.getUntrackedParameter<bool>("process_ros", true)){ // DCC+DDU data
195  bookHistos(dtChId,"LocalTriggerPhi","COM_QualDDUvsQualDCC"+(*trigSrcIt));
196  }
197 
198  }
199  }
200  for (int sect=13;sect<15;++sect){
201  DTChamberId dtChId(wh,4,sect);
202  if (parameters.getUntrackedParameter<bool>("process_dcc", true) &&
203  parameters.getUntrackedParameter<bool>("process_seg", true)){ // DCC+SEG LUTs data
204  bookHistos(dtChId,"Segment","DCC_PhitkvsPhitrig"+(*trigSrcIt));
205  bookHistos(dtChId,"Segment","DCC_PhibtkvsPhibtrig"+(*trigSrcIt));
206  bookHistos(dtChId,"Segment","DCC_PhiResidual"+(*trigSrcIt));
207  bookHistos(dtChId,"Segment","DCC_PhiResidualvsLUTPhi"+(*trigSrcIt));
208  bookHistos(dtChId,"Segment","DCC_PhibResidual"+(*trigSrcIt));
209  }
210  }
211  }
212  }// end of loop
213  }
214 
215  }
216 
217 }
218 
219 
221 
222  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: Begin of LS transition" << endl;
223 
224  if(lumiSeg.id().luminosityBlock()%parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0) {
225  for(map<uint32_t, map<string, MonitorElement*> > ::const_iterator histo = digiHistos.begin();
226  histo != digiHistos.end();
227  histo++) {
228  for(map<string, MonitorElement*> ::const_iterator ht = (*histo).second.begin();
229  ht != (*histo).second.end();
230  ht++) {
231  (*ht).second->Reset();
232  }
233  }
234  }
235 
236 }
237 
238 
240 
241  LogVerbatim("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: analyzed " << nevents << " events" << endl;
242  if (parameters.getUntrackedParameter<bool>("process_dcc", true)) dbe->rmdir(topFolder(0)); //DDU folder
243  if (parameters.getUntrackedParameter<bool>("process_ros", true)) dbe->rmdir(topFolder(1)); //DCC folder
244 
245 }
246 
247 
249 
250  string dcc_label = parameters.getUntrackedParameter<string>("dcc_label", "dttpgprod");
251  string ros_label = parameters.getUntrackedParameter<string>("ros_label", "dtunpacker");
252  string seg_label = parameters.getUntrackedParameter<string>("seg_label", "dt4DSegments");
253 
254  if (!nevents){
255 
257  e.getByLabel(dcc_label, l1DTTPGPh);
259  e.getByLabel(dcc_label, l1DTTPGTh);
260  useDCC = (l1DTTPGPh.isValid() || l1DTTPGTh.isValid()) && parameters.getUntrackedParameter<bool>("process_dcc", true) ;
261 
263  e.getByLabel(ros_label,l1DDUTrigs);
264  useDDU = l1DDUTrigs.isValid() && parameters.getUntrackedParameter<bool>("process_ros", true) ;
265 
266  Handle<DTRecSegment4DCollection> all4DSegments;
267  e.getByLabel(seg_label, all4DSegments);
268  useSEG = all4DSegments.isValid() && parameters.getUntrackedParameter<bool>("process_seg", true) ;
269 
270  }
271 
272  nevents++;
273 
274  triggerSource(e);
275 
276  if ( useDCC ) {
278  e.getByLabel(dcc_label,l1DTTPGPh);
279  vector<L1MuDTChambPhDigi>* l1PhTrig = l1DTTPGPh->getContainer();
280 
282  e.getByLabel(dcc_label,l1DTTPGTh);
283  vector<L1MuDTChambThDigi>* l1ThTrig = l1DTTPGTh->getContainer();
284 
285  runDCCAnalysis(l1PhTrig,l1ThTrig);
286  }
287  if ( useDDU ) {
289  e.getByLabel(ros_label,l1DDUTrigs);
290 
291  runDDUAnalysis(l1DDUTrigs);
292  }
293  if ( !tpMode && useSEG ) {
295  e.getByLabel(seg_label, segments4D);
296 
297  runSegmentAnalysis(segments4D);
298  }
299  if ( !tpMode && useDCC && useDDU ) {
301  }
302 
303 }
304 
305 
307 
308  bool isDCC = histoTag.substr(0,3) == "DCC";
309  dbe->setCurrentFolder(topFolder(isDCC));
310  if (histoTag == "DCC_ErrorsChamberID") {
311  dcc_IDDataErrorPlot = dbe->book1D(histoTag.c_str(),"DCC Data ID Error",5,-2,3);
312  dcc_IDDataErrorPlot->setAxisTitle("wheel",1);
313  }
314 
315  return;
316 
317 }
318 
319 void DTLocalTriggerTask::bookHistos(const DTChamberId& dtCh, string folder, string histoTag) {
320 
321  int wh=dtCh.wheel();
322  int sc=dtCh.sector();
323  stringstream wheel; wheel << wh;
324  stringstream station; station << dtCh.station();
325  stringstream sector; sector << sc;
326 
327  double minBX=0;
328  double maxBX=0;
329  int rangeBX=0;
330 
331  string histoType = histoTag.substr(4,histoTag.find("_",4)-4);
332  bool isDCC = histoTag.substr(0,3) == "DCC";
333 
334  dbe->setCurrentFolder(topFolder(isDCC) + "Wheel" + wheel.str() +
335  "/Sector" + sector.str() +
336  "/Station" + station.str() + "/" + folder);
337 
338  string histoName = histoTag + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
339 
340  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: booking " << topFolder(isDCC) << "Wheel" << wheel.str()
341  << "/Sector" << sector.str()
342  << "/Station"<< station.str() << "/" << folder << "/" << histoName << endl;
343 
344  if (histoType.find("BX") != string::npos){
345  if (histoTag.substr(0,3) == "DCC"){
346  minBX= parameters.getUntrackedParameter<int>("minBXDCC",-2) - 0.5;
347  maxBX= parameters.getUntrackedParameter<int>("maxBXDCC",2) + 0.5;
348  }
349  else {
350  minBX= parameters.getUntrackedParameter<int>("minBXDDU",0) - 0.5;
351  maxBX= parameters.getUntrackedParameter<int>("maxBXDDU",20) + 0.5;
352  }
353  rangeBX = (int)(maxBX-minBX);
354  }
355 
356  if ( folder == "LocalTriggerPhi") {
357 
358  if( histoType == "BXvsQual" ){
359  (digiHistos[dtCh.rawId()])[histoTag] =
360  dbe->book2D(histoName,"BX vs trigger quality",7,-0.5,6.5,rangeBX,minBX,maxBX);
361  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
362  return ;
363  }
364  if( histoType == "BestQual" ){
365  (digiHistos[dtCh.rawId()])[histoTag] =
366  dbe->book1D(histoName,"Trigger quality of best primitives",7,-0.5,6.5);
367  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
368  return ;
369  }
370  if( histoType == "QualvsPhirad" ){
371  (digiHistos[dtCh.rawId()])[histoTag] =
372  dbe->book2D(histoName,"Trigger quality vs local position",100,-500.,500.,7,-0.5,6.5);
373  setQLabels((digiHistos[dtCh.rawId()])[histoTag],2);
374  return ;
375  }
376  if( histoType == "QualvsPhibend" ) {
377  (digiHistos[dtCh.rawId()])[histoTag] =
378  dbe->book2D(histoName,"Trigger quality vs local direction",200,-40.,40.,7,-0.5,6.5);
379  setQLabels((digiHistos[dtCh.rawId()])[histoTag],2);
380  return ;
381  }
382  if( histoType == "Flag1stvsQual" ) {
383  (digiHistos[dtCh.rawId()])[histoTag] =
384  dbe->book2D(histoName,"1st/2nd trig flag vs quality",7,-0.5,6.5,2,-0.5,1.5);
385  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
386  return ;
387  }
388  if( histoType == "QualDDUvsQualDCC" ){
389  (digiHistos[dtCh.rawId()])[histoTag] =
390  dbe->book2D(histoName,"DDU quality vs DCC quality",8,-1.5,6.5,8,-1.5,6.5);
391  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
392  setQLabels((digiHistos[dtCh.rawId()])[histoTag],2);
393  return ;
394  }
395 
396  }
397  else if ( folder == "LocalTriggerTheta") {
398 
399  if( histoType == "PositionvsBX" ) {
400  (digiHistos[dtCh.rawId()])[histoTag] =
401  dbe->book2D(histoName,"Theta trigger position vs BX",rangeBX,minBX,maxBX,7,-0.5,6.5);
402  return ;
403  }
404  if( histoType == "PositionvsQual" ) {
405  (digiHistos[dtCh.rawId()])[histoTag] =
406  dbe->book2D(histoName,"Theta trigger position vs quality",7,-0.5,6.5,7,-0.5,6.5);
407  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
408  return ;
409  }
410  if( histoType == "ThetaBXvsQual" ) {
411  (digiHistos[dtCh.rawId()])[histoTag] =
412  dbe->book2D(histoName,"BX vs trigger quality",7,-0.5,6.5,rangeBX,minBX,maxBX);
413  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
414  }
415  if( histoType == "ThetaBestQual" ){
416  (digiHistos[dtCh.rawId()])[histoTag] =
417  dbe->book1D(histoName,"Trigger quality of best primitives (theta)",7,-0.5,6.5);
418  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
419  return ;
420  }
421 
422  }
423  else if ( folder == "Segment") {
424 
425  if( histoType.find("TrackThetaPosvsAngle" ) == 0 ) {
426 
427  string histoLabel = "Position vs Angle (theta)";
428  if (histoType.find("andTrigH") != string::npos) histoLabel += " for H triggers";
429  else if (histoType.find("andTrig") != string::npos) histoLabel += " for triggers";
430 
431  float min,max;
432  int nbins;
433  trigGeomUtils->thetaRange(dtCh,min,max,nbins);
434  (digiHistos[dtCh.rawId()])[histoTag] =
435  dbe->book2D(histoName,histoLabel,16,-40.,40.,nbins,min,max);
436  return ;
437  }
438  if( histoType.find("TrackPosvsAngle") == 0 ){
439 
440  float min,max;
441  int nbins;
442  trigGeomUtils->phiRange(dtCh,min,max,nbins);
443 
444  string histoLabel = "Position vs Angle (phi)";
445  if (histoType.find("andTrigHHHL") != string::npos) histoLabel += " for HH/HL triggers";
446  else if (histoType.find("andTrig") != string::npos) histoLabel += " for triggers";
447 
448  (digiHistos[dtCh.rawId()])[histoTag] =
449  dbe->book2D(histoName,histoLabel,16,-40.,40.,nbins,min,max);
450  return ;
451  }
452  if( histoType == "PhitkvsPhitrig" ){
453  (digiHistos[dtCh.rawId()])[histoTag] =
454  dbe->book2D(histoName,"Local position: segment vs trigger",100,-500.,500.,100,-500.,500.);
455  return ;
456  }
457  if( histoType == "PhibtkvsPhibtrig" ){
458  (digiHistos[dtCh.rawId()])[histoTag] =
459  dbe->book2D(histoName,"Local direction : segment vs trigger",200,-40.,40.,200,-40.,40.);
460  return ;
461  }
462  if( histoType == "PhiResidual" ){
463  (digiHistos[dtCh.rawId()])[histoTag] =
464  dbe->book1D(histoName,"Trigger local position - Segment local position (correlated triggers)",400,-10.,10.);
465  return ;
466  }
467  if( histoType == "PhibResidual" ){
468  (digiHistos[dtCh.rawId()])[histoTag] =
469  dbe->book1D(histoName,"Trigger local direction - Segment local direction (correlated triggers)",500,-10.,10.);
470  return ;
471  }
472  if( histoType == "HitstkvsQualtrig" ){
473  (digiHistos[dtCh.rawId()])[histoTag] =
474  dbe->book2D(histoName,"Segment hits (phi) vs trigger quality",7,-0.5,6.5,10,0.5,10.5);
475  setQLabels((digiHistos[dtCh.rawId()])[histoTag],1);
476  return ;
477  }
478 
479  }
480 
481 }
482 
483 void DTLocalTriggerTask::bookWheelHistos(int wh, string histoTag) {
484 
485  stringstream wheel; wheel << wh;
486 
487  string histoType = histoTag.substr(4,histoTag.find("_",4)-4);
488  bool isDCC = histoTag.substr(0,3) == "DCC";
489 
490  dbe->setCurrentFolder(topFolder(isDCC) + "Wheel" + wheel.str() + "/");
491 
492  string histoName = histoTag + "_W" + wheel.str();
493 
494  LogTrace("DTDQM|DTMonitorModule|DTLocalTriggerTask") << "[DTLocalTriggerTask]: booking " << topFolder(isDCC)
495  << "Wheel" << wheel.str() << "/" << histoName << endl;
496 
497  if( histoType.find("BXDiff") != string::npos ){
498  MonitorElement *me = dbe->bookProfile2D(histoName,"DDU-DCC BX Difference",12,1,13,4,1,5,0.,20.);
499  me->setAxisTitle("Sector",1);
500  me->setAxisTitle("station",2);
501  (wheelHistos[wh])[histoTag] = me;
502  return ;
503  }
504 
505 }
506 
507 void DTLocalTriggerTask::runDCCAnalysis( std::vector<L1MuDTChambPhDigi>* phTrigs,
508  std::vector<L1MuDTChambThDigi>* thTrigs ){
509 
510  string histoType ;
511  string histoTag ;
512 
513  // define best quality trigger segment (phi and theta)
514  // in any station start from 1 and zero is kept empty
515  for (int i=0;i<5;++i){
516  for (int j=0;j<6;++j){
517  for (int k=0;k<13;++k){
518  phcode_best[j][i][k] = -1;
519  thcode_best[j][i][k] = -1;
520  }
521  }
522  }
523 
524  vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
525  vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
526  for(; iph !=iphe ; ++iph) {
527 
528  int phwheel = iph->whNum();
529  int phsec = iph->scNum() + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
530  int phst = iph->stNum();
531  int phbx = iph->bxNum();
532  int phcode = iph->code();
533  int phi1st = iph->Ts2Tag();
534 
535  // FIXME: workaround for DCC data with station ID
536  if(phst == 0) {
537  dcc_IDDataErrorPlot->Fill(phwheel);
538  continue;
539  }
540 
541  if(phcode>phcode_best[phwheel+3][phst][phsec] && phcode<7) {
542  phcode_best[phwheel+3][phst][phsec]=phcode;
543  iphbest[phwheel+3][phst][phsec] = &(*iph);
544  }
545 
546  DTChamberId dtChId(phwheel,phst,phsec);
547 
548  float x = trigGeomUtils->trigPos(&(*iph));
549  float angle = trigGeomUtils->trigDir(&(*iph));
550  uint32_t indexCh = dtChId.rawId();
551 
552  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
553  if (innerME.find("DCC_BXvsQual"+trigsrc) == innerME.end()){
554  if (tpMode) {
555  bookHistos(dtChId,"LocalTriggerPhi","DCC_BXvsQual"+trigsrc);
556  bookHistos(dtChId,"LocalTriggerPhi","DCC_QualvsPhirad"+trigsrc);
557  }
558  else {
559  bookHistos(dtChId,"LocalTriggerPhi","DCC_BXvsQual"+trigsrc);
560  bookHistos(dtChId,"LocalTriggerPhi","DCC_Flag1stvsQual"+trigsrc);
561  if (detailedAnalysis) {
562  bookHistos(dtChId,"LocalTriggerPhi","DCC_QualvsPhirad"+trigsrc);
563  bookHistos(dtChId,"LocalTriggerPhi","DCC_QualvsPhibend"+trigsrc);
564  }
565  }
566  }
567 
568  if (tpMode) {
569  innerME.find("DCC_BXvsQual"+trigsrc)->second->Fill(phcode,phbx-phi1st); // SM BX vs Qual Phi view (1st tracks)
570  innerME.find("DCC_QualvsPhirad"+trigsrc)->second->Fill(x,phcode); // SM Qual vs radial angle Phi view
571  }
572  else {
573  innerME.find("DCC_BXvsQual"+trigsrc)->second->Fill(phcode,phbx-phi1st); // SM BX vs Qual Phi view (1st tracks)
574  innerME.find("DCC_Flag1stvsQual"+trigsrc)->second->Fill(phcode,phi1st); // SM Qual 1st/2nd track flag Phi view
575  if (detailedAnalysis) {
576  innerME.find("DCC_QualvsPhirad"+trigsrc)->second->Fill(x,phcode); // SM Qual vs radial angle Phi view
577  innerME.find("DCC_QualvsPhibend"+trigsrc)->second->Fill(angle,phcode); // SM Qual vs bending Phi view
578  }
579  }
580 
581  }
582 
583  if (doDCCTheta) {
584  int thcode[7];
585  vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin();
586  vector<L1MuDTChambThDigi>::const_iterator ithe = thTrigs->end();
587  for(; ith != ithe; ++ith) {
588  int thwheel = ith->whNum();
589  int thsec = ith->scNum() + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
590  int thst = ith->stNum();
591  int thbx = ith->bxNum();
592 
593  for (int pos=0; pos<7; pos++) {
594  thcode[pos] = ith->code(pos);
595 
596  if(thcode[pos]>thcode_best[thwheel+3][thst][thsec] ) {
597  thcode_best[thwheel+3][thst][thsec]=thcode[pos];
598  ithbest[thwheel+3][thst][thsec] = &(*ith);
599  }
600  }
601 
602  DTChamberId dtChId(thwheel,thst,thsec);
603  uint32_t indexCh = dtChId.rawId();
604 
605  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
606  if (innerME.find("DCC_PositionvsBX"+trigsrc) == innerME.end()){
607  bookHistos(dtChId,"LocalTriggerTheta","DCC_PositionvsBX"+trigsrc);
608 // if (detailedAnalysis) {
609 // bookHistos(dtChId,"LocalTriggerTheta","DCC_PositionvsBX"+trigsrc);
610 // bookHistos(dtChId,"LocalTriggerTheta","DCC_PositionvsQual"+trigsrc);
611 // }
612  }
613 
614  for (int pos=0; pos<7; pos++) { //SM fill position for non zero position bit in theta view
615  if(thcode[pos]>0){
616  innerME.find("DCC_PositionvsBX"+trigsrc)->second->Fill(thbx,pos); // SM BX vs Position Theta view
617 // if (detailedAnalysis) {
618 // int thqual = (thcode[pos]/2)*2+1;
619 // innerME.find("DCC_ThetaBXvsQual"+trigsrc)->second->Fill(thqual,thbx); // SM BX vs Code Theta view
620 // innerME.find("DCC_PositionvsQual"+trigsrc)->second->Fill(thqual,pos); // SM Code vs Position Theta view
621 // }
622  }
623  }
624  }
625  }
626 
627 
628  // Fill Quality plots with best DCC triggers in phi & theta
629  if (!tpMode) {
630  for (int st=1;st<5;++st){
631  for (int wh=-2;wh<3;++wh){
632  for (int sc=1;sc<13;++sc){
633  if (phcode_best[wh+3][st][sc]>-1 && phcode_best[wh+3][st][sc]<7){
634  DTChamberId id(wh,st,sc);
635  uint32_t indexCh = id.rawId();
636  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
637  if (innerME.find("DCC_BestQual"+trigsrc) == innerME.end())
638  bookHistos(id,"LocalTriggerPhi","DCC_BestQual"+trigsrc);
639  innerME.find("DCC_BestQual"+trigsrc)->second->Fill(phcode_best[wh+3][st][sc]); // Best Qual Trigger Phi view
640  }
641 // if (thcode_best[wh+3][st][sc]>0){
642 // DTChamberId id(wh,st,sc);
643 // uint32_t indexCh = id.rawId();
644 // map<string, MonitorElement*> &innerME = digiHistos[indexCh];
645 // if (innerME.find("DCC_ThetaBestQual"+trigsrc) == innerME.end())
646 // bookHistos(id,"LocalTriggerTheta","DCC_ThetaBestQual"+trigsrc);
647 // innerME.find("DCC_ThetaBestQual"+trigsrc)->second->Fill(thcode_best[wh+3][st][sc]); // Best Qual Trigger Theta view
648 // }
649  }
650  }
651  }
652  }
653 
654 }
655 
657 
659 
660  for (int i=0;i<5;++i){
661  for (int j=0;j<6;++j){
662  for (int k=0;k<13;++k){
663  dduphcode_best[j][i][k] = -1;
664  dduthcode_best[j][i][k] = -1;
665  }
666  }
667  }
668 
669  for (detUnitIt=trigsDDU->begin();
670  detUnitIt!=trigsDDU->end();
671  ++detUnitIt){
672 
673  const DTChamberId& id = (*detUnitIt).first;
674  const DTLocalTriggerCollection::Range& range = (*detUnitIt).second;
675  uint32_t indexCh = id.rawId();
676  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
677 
678  int wh = id.wheel();
679  int sec = id.sector();
680  int st = id.station();
681 
682  for (DTLocalTriggerCollection::const_iterator trigIt = range.first;
683  trigIt!=range.second;
684  ++trigIt){
685 
686  int bx = trigIt->bx();
687  int quality = trigIt->quality();
688  int thqual = trigIt->trTheta();
689  int flag1st = trigIt->secondTrack() ? 1 : 0;
690 
691  // check if SC data exist: fill for any trigger
692  if( quality>-1 && quality<7 ) { // it is a phi trigger
693 
694  if(quality>dduphcode_best[wh+3][st][sec]) {
695  dduphcode_best[wh+3][st][sec]=quality;
696  iphbestddu[wh+3][st][sec] = &(*trigIt);
697  }
698 
699  if (innerME.find("DDU_BXvsQual"+trigsrc) == innerME.end()){
700  bookHistos(id,"LocalTriggerPhi","DDU_BXvsQual"+trigsrc);
701  bookHistos(id,"LocalTriggerPhi","DDU_Flag1stvsQual"+trigsrc);
702  }
703 
704  if(tpMode) {
705  innerME.find("DDU_BXvsQual"+trigsrc)->second->Fill(quality,bx-flag1st); // SM BX vs Qual Phi view
706  }
707  else {
708  innerME.find("DDU_BXvsQual"+trigsrc)->second->Fill(quality,bx-flag1st); // SM BX vs Qual Phi view
709  innerME.find("DDU_Flag1stvsQual"+trigsrc)->second->Fill(quality,flag1st); // SM Quality vs 1st/2nd track flag Phi view
710  }
711  }
712  if( thqual>0 && !tpMode ) { // it is a theta trigger
713 
714  if(thqual>dduthcode_best[wh+3][st][sec] ) {
715  dduthcode_best[wh+3][st][sec]=thqual;
716  }
717  if (innerME.find("DDU_ThetaBXvsQual"+trigsrc) == innerME.end())
718  bookHistos(id,"LocalTriggerTheta","DDU_ThetaBXvsQual"+trigsrc);
719  innerME.find("DDU_ThetaBXvsQual"+trigsrc)->second->Fill(thqual,bx); // SM BX vs Qual Theta view
720 
721  }
722  }
723 
724  // Fill Quality plots with best ddu triggers in phi & theta
725  if (!tpMode) {
726  if (dduphcode_best[wh+3][st][sec]>-1 &&
727  dduphcode_best[wh+3][st][sec]<7){
728  if (innerME.find("DDU_BestQual"+trigsrc) == innerME.end())
729  bookHistos(id,"LocalTriggerPhi","DDU_BestQual"+trigsrc);
730  innerME.find("DDU_BestQual"+trigsrc)->second->Fill(dduphcode_best[wh+3][st][sec]); // Best Qual Trigger Phi view
731  }
732  if (dduthcode_best[wh+3][st][sec]>0){
733  if (innerME.find("DDU_ThetaBestQual"+trigsrc) == innerME.end())
734  bookHistos(id,"LocalTriggerTheta","DDU_ThetaBestQual"+trigsrc);
735  innerME.find("DDU_ThetaBestQual"+trigsrc)->second->Fill(dduthcode_best[wh+3][st][sec]); // Best Qual Trigger Theta view
736  }
737  }
738  }
739 
740 }
741 
742 
744 
746 
747  // Find best tracks & good tracks
748  memset(track_ok,false,450*sizeof(bool));
749 
751  vector<const DTRecSegment4D*> best4DSegments;
752 
753  // Preliminary loop finds best 4D Segment and high quality ones
754  for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
755 
756  DTRecSegment4DCollection::range range = segments4D->get(*chamberId);
757  const DTRecSegment4D* tmpBest=0;
758  int tmpdof = 0;
759  int dof = 0;
760 
761  for ( track = range.first; track != range.second; ++track){
762 
763  if( (*track).hasPhi() ) {
764 
765  dof = (*track).phiSegment()->degreesOfFreedom();
766  if ( dof>tmpdof ){
767  tmpBest = &(*track);
768  tmpdof = dof;
769 
770  int wheel = (*track).chamberId().wheel();
771  int sector = (*track).chamberId().sector();
772  int station = (*track).chamberId().station();
773  if (sector==13){
774  sector=4;
775  }
776  else if (sector==14){
777  sector=10;
778  }
779  track_ok[wheel+3][station][sector] = (!track_ok[wheel+3][station][sector] && dof>=2);
780  }
781 
782  }
783  }
784  if (tmpBest) best4DSegments.push_back(tmpBest);
785  }
786 
787  vector<const DTRecSegment4D*>::const_iterator btrack;
788 
789  for ( btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack ){
790 
791  if( (*btrack)->hasPhi() ) { // Phi component
792 
793  int wheel = (*btrack)->chamberId().wheel();
794  int station = (*btrack)->chamberId().station();
795  int sector = (*btrack)->chamberId().sector();
796  int scsector = 0;
797  float x_track, y_track, x_angle, y_angle;
798  trigGeomUtils->computeSCCoordinates((*btrack),scsector,x_track,x_angle,y_track,y_angle);
799  int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom()+2;
800 
801  DTChamberId dtChId(wheel,station,sector); // get chamber for LUTs histograms (Sectors 1 to 14)
802  uint32_t indexCh = dtChId.rawId();
803  map<string, MonitorElement*> &innerMECh = digiHistos[indexCh];
804 
805  DTChamberId dtChIdSC = DTChamberId(wheel,station,scsector); // get chamber for histograms SC granularity (sectors 1 to 12)
806  indexCh = dtChIdSC.rawId();
807  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
808 
809  if (useDDU &&
810  dduphcode_best[wheel+3][station][scsector] > -1 &&
811  dduphcode_best[wheel+3][station][scsector] < 7 ) {
812 
813  // SM hits of the track vs quality of the trigger
814  if (innerME.find("DDU_HitstkvsQualtrig"+trigsrc) == innerME.end())
815  bookHistos(dtChIdSC,"Segment","DDU_HitstkvsQualtrig"+trigsrc);
816  innerME.find("DDU_HitstkvsQualtrig"+trigsrc)->second->Fill(dduphcode_best[wheel+3][station][scsector],nHitsPhi);
817 
818  }
819 
820  if (useDCC &&
821  phcode_best[wheel+3][station][scsector] > -1 &&
822  phcode_best[wheel+3][station][scsector] < 7 ) {
823 
824  if (innerME.find("DCC_HitstkvsQualtrig"+trigsrc) == innerME.end()){
825  bookHistos(dtChIdSC,"Segment","DCC_HitstkvsQualtrig"+trigsrc);
826  }
827  innerME.find("DCC_HitstkvsQualtrig"+trigsrc)->second->Fill(phcode_best[wheel+3][station][scsector],nHitsPhi);
828 
829  if (phcode_best[wheel+3][station][scsector]>3 && nHitsPhi>=7){
830 
831  float x_trigger = trigGeomUtils->trigPos(iphbest[wheel+3][station][scsector]);
832  float angle_trigger = trigGeomUtils->trigDir(iphbest[wheel+3][station][scsector]);
833  trigGeomUtils->trigToSeg(station,x_trigger,x_angle);
834 
835  if (innerMECh.find("DCC_PhibResidual"+trigsrc) == innerMECh.end()){
836  bookHistos(dtChId,"Segment","DCC_PhiResidual"+trigsrc);
837  bookHistos(dtChId,"Segment","DCC_PhibResidual"+trigsrc);
838  bookHistos(dtChId,"Segment","DCC_PhitkvsPhitrig"+trigsrc);
839  bookHistos(dtChId,"Segment","DCC_PhibtkvsPhibtrig"+trigsrc);
840  bookHistos(dtChId,"Segment","DCC_HitstkvsQualtrig"+trigsrc);
841  }
842 
843  innerMECh.find("DCC_PhitkvsPhitrig"+trigsrc)->second->Fill(x_trigger,x_track);
844  innerMECh.find("DCC_PhibtkvsPhibtrig"+trigsrc)->second->Fill(angle_trigger,x_angle);
845  innerMECh.find("DCC_PhiResidual"+trigsrc)->second->Fill(x_trigger-x_track);
846  innerMECh.find("DCC_PhibResidual"+trigsrc)->second->Fill(angle_trigger-x_angle);
847  }
848 
849 
850 
851  }
852 
853 
854  if (useDCC) {
855 
856  // check for triggers elsewhere in the sector
857  bool trigFlagDCC =false;
858  for (int ist=1; ist<5; ist++){
859  if (ist!=station &&
860  phcode_best[wheel+3][ist][scsector]>=2 &&
861  phcode_best[wheel+3][ist][scsector]<7 &&
862  track_ok[wheel+3][ist][scsector]==true){
863  trigFlagDCC = true;
864  break;
865  }
866  }
867 
868  if (trigFlagDCC && fabs(x_angle)<40. && nHitsPhi>=7){
869 
870  if (innerME.find("DCC_TrackPosvsAngle"+trigsrc) == innerME.end()){
871  bookHistos(dtChIdSC,"Segment","DCC_TrackPosvsAngle"+trigsrc);
872  bookHistos(dtChIdSC,"Segment","DCC_TrackPosvsAngleandTrig"+trigsrc);
873  bookHistos(dtChIdSC,"Segment","DCC_TrackPosvsAngleandTrigHHHL"+trigsrc);
874  }
875 
876  // position vs angle of track for reconstruced tracks (denom. for trigger efficiency)
877  innerME.find("DCC_TrackPosvsAngle"+trigsrc)->second->Fill(x_angle,x_track);
878  if (phcode_best[wheel+3][station][scsector] >= 2 && phcode_best[wheel+3][station][scsector] < 7) {
879  innerME.find("DCC_TrackPosvsAngleandTrig"+trigsrc)->second->Fill(x_angle,x_track);
880  if (phcode_best[wheel+3][station][scsector] > 4){ //HH & HL Triggers
881  innerME.find("DCC_TrackPosvsAngleandTrigHHHL"+trigsrc)->second->Fill(x_angle,x_track);
882  }
883  }
884 
885  }
886 
887  if ((*btrack)->hasZed() && trigFlagDCC && fabs(y_angle)<40. && (*btrack)->zSegment()->degreesOfFreedom()>=1){
888 
889  if (innerME.find("DCC_TrackThetaPosvsAngle"+trigsrc) == innerME.end()){
890  bookHistos(dtChIdSC,"Segment","DCC_TrackThetaPosvsAngle"+trigsrc);
891  bookHistos(dtChIdSC,"Segment","DCC_TrackThetaPosvsAngleandTrig"+trigsrc);
892 // bookHistos(dtChIdSC,"Segment","DCC_TrackThetaPosvsAngleandTrigH"+trigsrc); no DCC theta qual info
893  }
894 
895  // position va angle of track for reconstruced tracks (denom. for trigger efficiency) along theta direction
896  innerME.find("DCC_TrackThetaPosvsAngle"+trigsrc)->second->Fill(y_angle,y_track);
897  if (thcode_best[wheel+3][station][scsector] > 0) {
898  innerME.find("DCC_TrackThetaPosvsAngleandTrig"+trigsrc)->second->Fill(y_angle,y_track);
899 // if (thcode_best[wheel+3][station][scsector] == 3) {
900 // innerME.find("DCC_TrackThetaPosvsAngleH"+trigsrc)->second->Fill(y_angle,y_track);
901 // }
902  }
903 
904  }
905  }
906 
907  if (useDDU) {
908 
909  // check for triggers elsewhere in the sector
910  bool trigFlagDDU =false;
911  for (int ist=1; ist<5; ist++){
912  if (ist!=station &&
913  dduphcode_best[wheel+3][ist][scsector]>=2 &&
914  dduphcode_best[wheel+3][ist][scsector]<7 &&
915  track_ok[wheel+3][ist][scsector]==true){
916  trigFlagDDU = true;
917  break;
918  }
919  }
920 
921  if (trigFlagDDU && fabs(x_angle)<40. && nHitsPhi>=7){
922 
923  if (innerME.find("DDU_TrackPosvsAngle"+trigsrc) == innerME.end()){
924  bookHistos(dtChIdSC,"Segment","DDU_TrackPosvsAngle"+trigsrc);
925  bookHistos(dtChIdSC,"Segment","DDU_TrackPosvsAngleandTrig"+trigsrc);
926  bookHistos(dtChIdSC,"Segment","DDU_TrackPosvsAngleandTrigHHHL"+trigsrc);
927  }
928 
929  // position vs angle of track for reconstruced tracks (denom. for trigger efficiency)
930  innerME.find("DDU_TrackPosvsAngle"+trigsrc)->second->Fill(x_angle,x_track);
931  if (dduphcode_best[wheel+3][station][scsector] >= 2 && dduphcode_best[wheel+3][station][scsector] < 7) {
932  innerME.find("DDU_TrackPosvsAngleandTrig"+trigsrc)->second->Fill(x_angle,x_track);
933  if (dduphcode_best[wheel+3][station][scsector] > 4){ //HH & HL Triggers
934  innerME.find("DDU_TrackPosvsAngleandTrigHHHL"+trigsrc)->second->Fill(x_angle,x_track);
935  }
936  }
937 
938  }
939 
940  if ((*btrack)->hasZed() && trigFlagDDU && fabs(y_angle)<40. && (*btrack)->zSegment()->degreesOfFreedom()>=1){
941 
942  if (innerME.find("DDU_TrackThetaPosvsAngle"+trigsrc) == innerME.end()){
943  bookHistos(dtChIdSC,"Segment","DDU_TrackThetaPosvsAngle"+trigsrc);
944  bookHistos(dtChIdSC,"Segment","DDU_TrackThetaPosvsAngleandTrig"+trigsrc);
945  bookHistos(dtChIdSC,"Segment","DDU_TrackThetaPosvsAngleandTrigH"+trigsrc);
946  }
947 
948  // position va angle of track for reconstruced tracks (denom. for trigger efficiency) along theta direction
949  innerME.find("DDU_TrackThetaPosvsAngle"+trigsrc)->second->Fill(y_angle,y_track);
950  if (dduthcode_best[wheel+3][station][scsector] > 0) {
951  innerME.find("DDU_TrackThetaPosvsAngleandTrig"+trigsrc)->second->Fill(y_angle,y_track);
952  if (dduthcode_best[wheel+3][station][scsector] == 3) {
953  innerME.find("DDU_TrackThetaPosvsAngleandTrigH"+trigsrc)->second->Fill(y_angle,y_track);
954  }
955  }
956 
957  }
958  }
959  }
960  }
961 
962 }
963 
964 
966 
967  string histoType ;
968  string histoTag ;
969 
970  for (int st=1;st<5;++st){
971  for (int wh=-2;wh<3;++wh){
972  for (int sc=1;sc<13;++sc){
973  if ( (phcode_best[wh+3][st][sc]>-1 && phcode_best[wh+3][st][sc]<7) ||
974  (dduphcode_best[wh+3][st][sc]>-1 && dduphcode_best[wh+3][st][sc]<7) ){
975  DTChamberId id(wh,st,sc);
976  uint32_t indexCh = id.rawId();
977  map<string, MonitorElement*> &innerME = digiHistos[indexCh];
978  if (innerME.find("COM_QualDDUvsQualDCC"+trigsrc) == innerME.end())
979  bookHistos(id,"LocalTriggerPhi","COM_QualDDUvsQualDCC"+trigsrc);
980  innerME.find("COM_QualDDUvsQualDCC"+trigsrc)->second->Fill(phcode_best[wh+3][st][sc],dduphcode_best[wh+3][st][sc]);
981  if ( (phcode_best[wh+3][st][sc]>-1 && phcode_best[wh+3][st][sc]<7) &&
982  (dduphcode_best[wh+3][st][sc]>-1 && dduphcode_best[wh+3][st][sc]<7) ){
983  int bxDDU = iphbestddu[wh+3][st][sc]->bx() - iphbestddu[wh+3][st][sc]->secondTrack();
984  int bxDCC = iphbest[wh+3][st][sc]->bxNum() - iphbest[wh+3][st][sc]->Ts2Tag();
985  (wheelHistos[wh]).find("COM_BXDiff"+trigsrc)->second->Fill(sc,st,bxDDU-bxDCC);
986  }
987  }
988  }
989  }
990  }
991 
992 }
993 
995 
996  TH1* histo = me->getTH1();
997  if (!histo) return;
998 
999  TAxis* axis=0;
1000  if (iaxis==1) {
1001  axis=histo->GetXaxis();
1002  }
1003  else if(iaxis==2) {
1004  axis=histo->GetYaxis();
1005  }
1006  if (!axis) return;
1007 
1008  string labels[7] = {"LI","LO","HI","HO","LL","HL","HH"};
1009  int istart = axis->GetXmin()<-1 ? 2 : 1;
1010  for (int i=0;i<7;i++) {
1011  axis->SetBinLabel(i+istart,labels[i].c_str());
1012  }
1013 
1014 }
1015 
1017 
1018 
1019  if ( !parameters.getUntrackedParameter<bool>("localrun", true) ){
1020 
1021  Handle<LTCDigiCollection> ltcdigis;
1022  e.getByType(ltcdigis);
1023 
1024  for (std::vector<LTCDigi>::const_iterator ltc_it = ltcdigis->begin(); ltc_it != ltcdigis->end(); ltc_it++){
1025 
1026  size_t otherTriggerSum=0;
1027  for (size_t i = 1; i < 6; i++) {
1028  otherTriggerSum += size_t((*ltc_it).HasTriggered(i));
1029  }
1030  if ((*ltc_it).HasTriggered(0) && otherTriggerSum == 0)
1031  trigsrc = "_DTonly";
1032  else if (!(*ltc_it).HasTriggered(0))
1033  trigsrc = "_NoDT";
1034  else if ((*ltc_it).HasTriggered(0) && otherTriggerSum > 0)
1035  trigsrc = "_DTalso";
1036 
1037  }
1038  return;
1039  }
1040 
1041  trigsrc = "";
1042  return;
1043 
1044 }
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void bookWheelHistos(int wh, std::string histoTag)
Book the histograms.
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
int phcode_best[6][5][13]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
virtual int degreesOfFreedom() const
return the DOF of the segment
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
int thcode_best[6][5][13]
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
int dduphcode_best[6][5][13]
identifier iterator
Definition: RangeMap.h:138
void bookBarrelHistos(std::string histoTag)
Book the histograms.
void runDDUvsDCCAnalysis(std::string &trigsrc)
Run analysis on ROS data.
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
#define min(a, b)
Definition: mlp_lapack.h:161
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool track_ok[6][5][15]
void runDCCAnalysis(std::vector< L1MuDTChambPhDigi > *phTrigs, std::vector< L1MuDTChambThDigi > *thTrigs)
Run analysis on DCC data.
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
int dduthcode_best[6][5][13]
void runSegmentAnalysis(edm::Handle< DTRecSegment4DCollection > &segments4D)
Run analysis using DT 4D segments.
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
const T & max(const T &a, const T &b)
void bookHistos(const DTChamberId &dtCh, std::string folder, std::string histoTag)
Book the histograms.
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
int j
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
DTLocalTriggerTask(const edm::ParameterSet &ps)
Constructor.
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
#define LogTrace(id)
edm::ESHandle< DTGeometry > muonGeom
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
int k[5][pyjets_maxn]
const DTLocalTrigger * iphbestddu[6][5][13]
const T & get() const
Definition: EventSetup.h:55
const L1MuDTChambThDigi * ithbest[6][5][13]
LuminosityBlockNumber_t luminosityBlock() const
void setQLabels(MonitorElement *me, short int iaxis)
Set Quality labels.
std::vector< DigiType >::const_iterator const_iterator
void endJob(void)
EndJob.
edm::ParameterSet parameters
bool secondTrack() const
std::string & topFolder(bool isDCC)
Get the Top folder (different between Physics and TP and DCC/DDU)
DTTrigGeomUtils * trigGeomUtils
const L1MuDTChambPhDigi * iphbest[6][5][13]
int sector() const
Definition: DTChamberId.h:63
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
To reset the MEs.
virtual ~DTLocalTriggerTask()
Destructor.
void triggerSource(const edm::Event &e)
Get the L1A source.
std::pair< const_iterator, const_iterator > Range
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
int station() const
Return the station number.
Definition: DTChamberId.h:53
x
Definition: VDTMath.h:216
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:845
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
MonitorElement * dcc_IDDataErrorPlot
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::map< uint32_t, std::map< std::string, MonitorElement * > > digiHistos
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.
void beginRun(const edm::Run &, const edm::EventSetup &)
Beginrun.
uint16_t bx() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
Definition: Run.h:33
void runDDUAnalysis(edm::Handle< DTLocalTriggerCollection > &trigsDDU)
Run analysis on ROS data.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1175