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