CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EETriggerTowerTask.cc
Go to the documentation of this file.
1 /*
2  * \file EETriggerTowerTask.cc
3  *
4  * \author G. Della Ricca
5  * \author E. Di Marco
6  *
7 */
8 
9 #include <vector>
10 
13 
17 
19 
22 
23 #include <iostream>
24 
25 const int EETriggerTowerTask::nTTEta = 20;
26 const int EETriggerTowerTask::nTTPhi = 20;
27 const int EETriggerTowerTask::nSM = 18;
28 
30 
31  init_ = false;
32 
34 
35  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
36 
37  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
38 
39  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
40 
41  meEtSpectrumReal_[0] = 0;
42  meEtSpectrumReal_[1] = 0;
43  meEtSpectrumEmul_[0] = 0;
44  meEtSpectrumEmul_[1] = 0;
45  meEtSpectrumEmulMax_[0] = 0;
46  meEtSpectrumEmulMax_[1] = 0;
47  meEtBxReal_[0] = 0;
48  meEtBxReal_[1] = 0;
49  meOccupancyBxReal_[0] = 0;
50  meOccupancyBxReal_[1] = 0;
51  meTCCTimingCalo_[0] = 0;
52  meTCCTimingCalo_[1] = 0;
53  meTCCTimingMuon_[0] = 0;
54  meTCCTimingMuon_[1] = 0;
55  meEmulMatchIndex1D_[0] = 0;
56  meEmulMatchIndex1D_[1] = 0;
59 
67 
68  realCollection_ = consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollectionReal"));
69  emulCollection_ = consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("EcalTrigPrimDigiCollectionEmul"));
70  EEDigiCollection_ = consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEDigiCollection"));
71  HLTResultsCollection_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("HLTResultsCollection"));
72 
73  HLTCaloHLTBit_ = ps.getUntrackedParameter<std::string>("HLTCaloHLTBit", "");
74  HLTMuonHLTBit_ = ps.getUntrackedParameter<std::string>("HLTMuonHLTBit", "");
75 
76  outputFile_ = ps.getUntrackedParameter<std::string>("OutputRootFile", "");
77 
78  LogDebug("EETriggerTowerTask") << "REAL digis: " << realCollection_;
79  LogDebug("EETriggerTowerTask") << "EMULATED digis: " << emulCollection_;
80 
81 }
82 
84 
85 }
86 
88 
89  array.reserve( nSM );
90  array.resize( nSM, static_cast<MonitorElement*>(0) );
91 
92 }
93 
95 
96  ievt_ = 0;
97 
98  if ( dqmStore_ ) {
99  dqmStore_->setCurrentFolder(prefixME_ + "/EETriggerTowerTask");
100  dqmStore_->rmdir(prefixME_ + "/EETriggerTowerTask");
101  }
102 
103 }
104 
106 
107  Numbers::initGeometry(c, false);
108 
109  if ( ! mergeRuns_ ) this->reset();
110 
111 }
112 
114 
115 }
116 
118 
119  for (int iside = 0; iside < 2; iside++) {
120  if ( meEtSpectrumReal_[iside] ) meEtSpectrumReal_[iside]->Reset();
121  if ( meEtSpectrumEmul_[iside] ) meEtSpectrumEmul_[iside]->Reset();
122  if ( meEtSpectrumEmulMax_[iside] ) meEtSpectrumEmulMax_[iside]->Reset();
123  if ( meEtBxReal_[iside] ) meEtBxReal_[iside]->Reset();
124  if ( meOccupancyBxReal_[iside] ) meOccupancyBxReal_[iside]->Reset();
125  if ( meTCCTimingCalo_[iside] ) meTCCTimingCalo_[iside]->Reset();
126  if ( meTCCTimingMuon_[iside] ) meTCCTimingMuon_[iside]->Reset();
127  if ( meEmulMatchIndex1D_[iside] ) meEmulMatchIndex1D_[iside]->Reset();
128  if ( meEmulMatchMaxIndex1D_[iside] ) meEmulMatchMaxIndex1D_[iside]->Reset();
129  }
130 
131  for (int i = 0; i < 18; i++) {
132 
133  if ( meEtMapReal_[i] ) meEtMapReal_[i]->Reset();
134  if ( meVetoReal_[i] ) meVetoReal_[i]->Reset();
135  if ( meEtMapEmul_[i] ) meEtMapEmul_[i]->Reset();
136  if ( meVetoEmul_[i] ) meVetoEmul_[i]->Reset();
137  if ( meEmulError_[i] ) meEmulError_[i]->Reset();
138  if ( meEmulMatch_[i] ) meEmulMatch_[i]->Reset();
139  if ( meVetoEmulError_[i] ) meVetoEmulError_[i]->Reset();
140 
141  }
142 
143 }
144 
146 
147  init_ = true;
148 
149  if ( dqmStore_ ) {
150  setup( "Real Digis",
151  (prefixME_ + "/EETriggerTowerTask").c_str(), false );
152 
153  setup( "Emulated Digis",
154  (prefixME_ + "/EETriggerTowerTask/Emulated").c_str(), true);
155  }
156  else {
157  edm::LogError("EETriggerTowerTask") << "Bad DQMStore, cannot book MonitorElements.";
158  }
159 }
160 
162  std::string const &folder,
163  bool emulated ) {
164 
165  array1* meEtMap = &meEtMapReal_;
166 
167  if ( emulated ) {
168  meEtMap = &meEtMapEmul_;
169  }
170 
171  dqmStore_->setCurrentFolder(folder);
172 
174 
175  if (!emulated) {
176  name = "EETTT Et spectrum " + nameext + " EE -";
177  meEtSpectrumReal_[0] = dqmStore_->book1D(name, name, 256, 0., 256.);
178  meEtSpectrumReal_[0]->setAxisTitle("energy (ADC)", 1);
179 
180  name = "EETTT Et spectrum " + nameext + " EE +";
181  meEtSpectrumReal_[1] = dqmStore_->book1D(name, name, 256, 0., 256.);
182  meEtSpectrumReal_[1]->setAxisTitle("energy (ADC)", 1);
183 
184  name = "EETTT TP matching index EE -";
185  meEmulMatchIndex1D_[0] = dqmStore_->book1D(name, name, 7, -1., 6.);
186  meEmulMatchIndex1D_[0]->setAxisTitle("TP data matching emulator", 1);
187 
188  name = "EETTT TP matching index EE +";
189  meEmulMatchIndex1D_[1] = dqmStore_->book1D(name, name, 7, -1., 6.);
190  meEmulMatchIndex1D_[1]->setAxisTitle("TP data matching emulator", 1);
191 
192  name = "EETTT max TP matching index EE -";
193  meEmulMatchMaxIndex1D_[0] = dqmStore_->book1D(name, name, 7, -1., 6.);
194  meEmulMatchMaxIndex1D_[0]->setAxisTitle("Max TP data matching emulator", 1);
195 
196  name = "EETTT max TP matching index EE +";
197  meEmulMatchMaxIndex1D_[1] = dqmStore_->book1D(name, name, 7, -1., 6.);
198  meEmulMatchMaxIndex1D_[1]->setAxisTitle("Max TP data matching emulator", 1);
199 
200  double xbins[51];
201  for ( int i=0; i<=11; i++ ) xbins[i] = i-1; // begin of orbit
202  // abort gap in presence of calibration: [3381-3500]
203  // abort gap in absence of calibration: [3444-3500]
204  // using the wider abort gap always, start finer binning at bx=3371
205  for ( int i=12; i<=22; i++) xbins[i] = 3371+i-12;
206  // use 29 bins for the abort gap
207  for ( int i=23; i<=50; i++) xbins[i] = 3382+(i-23)*6;
208 
209  name = "EETTT Et vs bx " + nameext + " EE -";
210  meEtBxReal_[0] = dqmStore_->bookProfile(name, name, 50, xbins, 256, 0, 256);
211  meEtBxReal_[0]->setAxisTitle("bunch crossing", 1);
212  meEtBxReal_[0]->setAxisTitle("energy (ADC)", 2);
213 
214  name = "EETTT Et vs bx " + nameext + " EE +";
215  meEtBxReal_[1] = dqmStore_->bookProfile(name, name, 50, xbins, 256, 0, 256);
216  meEtBxReal_[1]->setAxisTitle("bunch crossing", 1);
217  meEtBxReal_[1]->setAxisTitle("energy (ADC)", 2);
218 
219  name = "EETTT TP occupancy vs bx " + nameext + " EE -";
220  meOccupancyBxReal_[0] = dqmStore_->bookProfile(name, name, 50, xbins, 2448, 0, 2448);
221  meOccupancyBxReal_[0]->setAxisTitle("bunch crossing", 1);
222  meOccupancyBxReal_[0]->setAxisTitle("TP number", 2);
223 
224  name = "EETTT TP occupancy vs bx " + nameext + " EE +";
225  meOccupancyBxReal_[1] = dqmStore_->bookProfile(name, name, 50, xbins, 2448, 0, 2448);
226  meOccupancyBxReal_[1]->setAxisTitle("bunch crossing", 1);
227  meOccupancyBxReal_[1]->setAxisTitle("TP number", 2);
228 
229  if ( HLTCaloHLTBit_ != "" ) {
230  name = "EETTT TCC timing calo triggers " + nameext + " EE -";
231  meTCCTimingCalo_[0] = dqmStore_->book2D(name, name, 36, 1, 37, 7, -1., 6.);
232  meTCCTimingCalo_[0]->setAxisTitle("nTCC", 1);
233  meTCCTimingCalo_[0]->setAxisTitle("TP data matching emulator", 2);
234 
235  name = "EETTT TCC timing calo triggers " + nameext + " EE +";
236  meTCCTimingCalo_[1] = dqmStore_->book2D(name, name, 36, 73, 109, 7, -1., 6.);
237  meTCCTimingCalo_[1]->setAxisTitle("nTCC", 1);
238  meTCCTimingCalo_[1]->setAxisTitle("TP data matching emulator", 2);
239  }
240 
241  if ( HLTMuonHLTBit_ != "" ) {
242  name = "EETTT TCC timing muon triggers " + nameext + " EE -";
243  meTCCTimingMuon_[0] = dqmStore_->book2D(name, name, 36, 1, 37, 7, -1., 6.);
244  meTCCTimingMuon_[0]->setAxisTitle("nTCC", 1);
245  meTCCTimingMuon_[0]->setAxisTitle("TP data matching emulator", 2);
246 
247  name = "EETTT TCC timing muon triggers " + nameext + " EE +";
248  meTCCTimingMuon_[1] = dqmStore_->book2D(name, name, 36, 73, 109, 7, -1., 6.);
249  meTCCTimingMuon_[1]->setAxisTitle("nTCC", 1);
250  meTCCTimingMuon_[1]->setAxisTitle("TP data matching emulator", 2);
251  }
252 
253  } else {
254  name = "EETTT Et spectrum " + nameext + " EE -";
255  meEtSpectrumEmul_[0] = dqmStore_->book1D(name, name, 256, 0., 256.);
256  meEtSpectrumEmul_[0]->setAxisTitle("energy (ADC)", 1);
257 
258  name = "EETTT Et spectrum " + nameext + " EE +";
259  meEtSpectrumEmul_[1] = dqmStore_->book1D(name, name, 256, 0., 256.);
260  meEtSpectrumEmul_[1]->setAxisTitle("energy (ADC)", 1);
261 
262  name = "EETTT Et spectrum " + nameext + " max EE -";
263  meEtSpectrumEmulMax_[0] = dqmStore_->book1D(name, name, 256, 0., 256.);
264  meEtSpectrumEmulMax_[0]->setAxisTitle("energy (ADC)", 1);
265 
266  name = "EETTT Et spectrum " + nameext + " max EE +";
267  meEtSpectrumEmulMax_[1] = dqmStore_->book1D(name, name, 256, 0., 256.);
268  meEtSpectrumEmulMax_[1]->setAxisTitle("energy (ADC)", 1);
269  }
270 
271  for (int i = 0; i < 18; i++) {
272 
273  name = "EETTT Et map " + nameext + " " + Numbers::sEE(i+1);
274  (*meEtMap)[i] = dqmStore_->bookProfile2D(name, name,
275  50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50.,
276  50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.,
277  256, 0, 256.);
278  (*meEtMap)[i]->setAxisTitle("ix", 1);
279  if ( i+1 >= 1 && i+1 <= 9 ) (*meEtMap)[i]->setAxisTitle("101-ix", 1);
280  (*meEtMap)[i]->setAxisTitle("iy", 2);
281  dqmStore_->tag((*meEtMap)[i], i+1);
282 
283  if (!emulated) {
284 
285  name = "EETTT EmulError " + Numbers::sEE(i+1);
286  meEmulError_[i] = dqmStore_->book2D(name, name,
287  50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50.,
288  50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50. );
289  meEmulError_[i]->setAxisTitle("ix", 1);
290  if ( i+1 >= 1 && i+1 <= 9 ) meEmulError_[i]->setAxisTitle("101-ix", 1);
291  meEmulError_[i]->setAxisTitle("iy", 2);
292  dqmStore_->tag(meEmulError_[i], i+1);
293 
294  name = "EETTT EmulMatch " + Numbers::sEE(i+1);
295  meEmulMatch_[i] = dqmStore_->book3D(name, name,
296  50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50.,
297  50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.,
298  6, 0., 6.);
299  meEmulMatch_[i]->setAxisTitle("ix", 1);
300  if ( i+1 >= 1 && i+1 <= 9 ) meEmulMatch_[i]->setAxisTitle("101-ix", 1);
301  meEmulMatch_[i]->setAxisTitle("iy", 2);
302  dqmStore_->tag(meEmulMatch_[i], i+1);
303 
304  name = "EETTT EmulFineGrainVetoError " + Numbers::sEE(i+1);
305  meVetoEmulError_[i] = dqmStore_->book2D(name, name,
306  50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50.,
307  50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50.);
308  meVetoEmulError_[i]->setAxisTitle("ix", 1);
309  if ( i+1 >= 1 && i+1 <= 9 ) meVetoEmulError_[i]->setAxisTitle("101-ix", 1);
310  meVetoEmulError_[i]->setAxisTitle("iy", 2);
311  dqmStore_->tag(meVetoEmulError_[i], i+1);
312 
313  }
314  }
315 
316 }
317 
319 
320  if ( ! init_ ) return;
321 
322  if ( dqmStore_ ) {
323 
324  if ( !outputFile_.empty() ) dqmStore_->save( outputFile_.c_str() );
325 
326  dqmStore_->rmdir( prefixME_ + "/EETriggerTowerTask" );
327 
328  }
329 
330  init_ = false;
331 
332 }
333 
335 
336  edm::LogInfo("EETriggerTowerTask") << "analyzed " << ievt_ << " events";
337 
338  if ( enableCleanup_ ) this->cleanup();
339 
340 }
341 
343 
344  if ( ! init_ ) this->setup();
345 
346  ievt_++;
347 
349 
350  if ( e.getByToken(realCollection_, realDigis) ) {
351 
352  int neetpd = realDigis->size();
353  LogDebug("EETriggerTowerTask") << "event " << ievt_ << " trigger primitive digi collection size: " << neetpd;
354 
355  processDigis( e,
356  realDigis,
357  meEtMapReal_,
358  meVetoReal_);
359 
360  } else {
361  edm::LogWarning("EETriggerTowerTask") << "realCollection not available";
362  }
363 
365 
366  if ( e.getByToken(emulCollection_, emulDigis) ) {
367 
369 
370  if ( e.getByToken(HLTResultsCollection_, hltResults) ) {
371 
372  processDigis( e,
373  emulDigis,
374  meEtMapEmul_,
375  meVetoEmul_,
376  realDigis,
377  hltResults);
378 
379  } else {
380  edm::LogWarning("EETriggerTowerTask") << "HLTResultsCollection not available";
381  }
382 
383  } else {
384  edm::LogInfo("EETriggerTowerTask") << "emulCollection not available";
385  }
386 
387 }
388 
389 void
391  array1& meEtMap,
392  array1& meVeto,
395 
396  int bx = e.bunchCrossing();
397  int nTP[2];
398  nTP[0] = nTP[1] = 0;
399 
400  // indexes are: readoutCrystalsInTower[TCCId][iTT]
401  int readoutCrystalsInTower[108][41];
402  for (int itcc = 0; itcc < 108; itcc++) {
403  for (int itt = 0; itt < 41; itt++) readoutCrystalsInTower[itcc][itt] = 0;
404  }
405 
406  if ( compDigis.isValid() ) {
407 
408  edm::Handle<EEDigiCollection> crystalDigis;
409 
410  if ( e.getByToken(EEDigiCollection_, crystalDigis) ) {
411 
412  for ( EEDigiCollection::const_iterator cDigiItr = crystalDigis->begin(); cDigiItr != crystalDigis->end(); ++cDigiItr ) {
413 
414  EEDetId id = cDigiItr->id();
415 
416  int ix = id.ix();
417  int iy = id.iy();
418  int ism = Numbers::iSM( id );
419  int itcc = Numbers::iTCC( ism, EcalEndcap, ix, iy );
420  int itt = Numbers::iTT( ism, EcalEndcap, ix, iy );
421 
422  readoutCrystalsInTower[itcc-1][itt-1]++;
423 
424  }
425 
426  } else {
427  edm::LogWarning("EETriggerTowerTask") << "EEDigiCollection not available";
428  }
429 
430  }
431 
432  bool caloTrg = false;
433  bool muonTrg = false;
434 
435  if ( hltResults.isValid() ) {
436 
437  int ntrigs = hltResults->size();
438  if ( ntrigs!=0 ) {
439 
440  const edm::TriggerNames & triggerNames = e.triggerNames(*hltResults);
441 
442  for ( int itrig = 0; itrig != ntrigs; ++itrig ) {
443  std::string trigName = triggerNames.triggerName(itrig);
444  bool accept = hltResults->accept(itrig);
445 
446  if ( trigName == HLTCaloHLTBit_ ) caloTrg = accept;
447 
448  if ( trigName == HLTMuonHLTBit_ ) muonTrg = accept;
449 
450  }
451 
452  } else {
453  edm::LogWarning("EBTriggerTowerTask") << " zero size trigger names in input TriggerResults";
454  }
455 
456  }
457 
458  for ( EcalTrigPrimDigiCollection::const_iterator tpdigiItr = digis->begin(); tpdigiItr != digis->end(); ++tpdigiItr ) {
459 
460  if ( Numbers::subDet( tpdigiItr->id() ) != EcalEndcap ) continue;
461 
462  int ismt = Numbers::iSM( tpdigiItr->id() );
463  int itt = Numbers::iTT( tpdigiItr->id() );
464  int itcc = Numbers::iTCC( tpdigiItr->id() );
465 
466  std::vector<DetId>* crystals = Numbers::crystals( tpdigiItr->id() );
467 
468  float xvalEt = tpdigiItr->compressedEt();
469  float xvalVeto = 0.5 + tpdigiItr->fineGrain();
470 
471  bool good = true;
472  bool goodVeto = true;
473 
474  int compDigiInterest = -1;
475 
476  bool matchSample[6];
477  for (int j=0; j<6; j++) matchSample[j]=false;
478 
479  if ( compDigis.isValid() ) {
480 
481  if ( ismt >= 1 && ismt <= 9 ) {
482  if ( meEtSpectrumEmul_[0] ) meEtSpectrumEmul_[0]->Fill( xvalEt );
483  } else {
484  if ( meEtSpectrumEmul_[1] ) meEtSpectrumEmul_[1]->Fill( xvalEt );
485  }
486 
487  float maxEt = 0;
488  int maxTPIndex = -1;
489  for (int j=0; j<5; j++) {
490  float EtTP = (*tpdigiItr)[j].compressedEt();
491  if ( EtTP > maxEt ) {
492  maxEt = EtTP;
493  maxTPIndex = j+1;
494  }
495  }
496 
497  if ( ismt >= 1 && ismt <= 9 ) {
498  if ( meEtSpectrumEmulMax_[0] ) meEtSpectrumEmulMax_[0]->Fill( maxEt );
499  if ( meEmulMatchMaxIndex1D_[0] && maxEt > 0 ) meEmulMatchMaxIndex1D_[0]->Fill( maxTPIndex );
500  } else {
501  if ( meEtSpectrumEmulMax_[1] ) meEtSpectrumEmulMax_[1]->Fill( maxEt );
502  if ( meEmulMatchMaxIndex1D_[1] && maxEt > 0 ) meEmulMatchMaxIndex1D_[1]->Fill( maxTPIndex );
503  }
504 
505  EcalTrigPrimDigiCollection::const_iterator compDigiItr = compDigis->find( tpdigiItr->id().rawId() );
506  if ( compDigiItr != compDigis->end() ) {
507  int compDigiEt = compDigiItr->compressedEt();
508  compDigiInterest = (compDigiItr->ttFlag() & 0x3);
509 
510  if ( ismt >= 1 && ismt <= 9 ) {
511  if ( compDigiEt > 0 ) nTP[0]++;
512  if ( meEtSpectrumReal_[0] ) meEtSpectrumReal_[0]->Fill( compDigiEt );
513  if ( meEtBxReal_[0] && compDigiEt > 0 ) meEtBxReal_[0]->Fill( bx, compDigiEt );
514  } else {
515  if ( compDigiEt > 0 ) nTP[1]++;
516  if ( meEtSpectrumReal_[1] ) meEtSpectrumReal_[1]->Fill( compDigiEt );
517  if ( meEtBxReal_[1] && compDigiEt > 0 ) meEtBxReal_[1]->Fill( bx, compDigiEt );
518  }
519 
520  // compare the 5 TPs with different time-windows
521  // sample 0 means no match, 1-5: sample of the TP that matches
522  matchSample[0]=false;
523  bool matchedAny=false;
524 
525  for (int j=0; j<5; j++) {
526  if ((*tpdigiItr)[j].compressedEt() == compDigiEt ) {
527  matchSample[j+1]=true;
528  matchedAny=true;
529  } else {
530  matchSample[j+1]=false;
531  }
532  }
533 
534  if (!matchedAny) matchSample[0]=true;
535 
536  // check if the tower has been readout completely and if it is medium or high interest
537  if (readoutCrystalsInTower[itcc-1][itt-1] == int(crystals->size()) &&
538  (compDigiInterest == 1 || compDigiInterest == 3) && compDigiEt > 0) {
539 
540  if ( tpdigiItr->compressedEt() != compDigiEt ) {
541  good = false;
542  }
543  if ( tpdigiItr->fineGrain() != compDigiItr->fineGrain() ) {
544  goodVeto = false;
545  }
546 
547  for (int j=0; j<6; j++) {
548  if (matchSample[j]) {
549 
550  int index = ( j==0 ) ? -1 : j;
551 
552  if ( ismt >= 1 && ismt <= 9 ) {
553  meEmulMatchIndex1D_[0]->Fill(index+0.5);
554  } else {
555  meEmulMatchIndex1D_[1]->Fill(index+0.5);
556  }
557 
558  for ( unsigned int i=0; i<crystals->size(); i++ ) {
559 
560  EEDetId id = (*crystals)[i];
561 
562  int ix = id.ix();
563  int iy = id.iy();
564 
565  if ( ismt >= 1 && ismt <= 9 ) ix = 101 - ix;
566 
567  float xix = ix-0.5;
568  float xiy = iy-0.5;
569 
570  meEmulMatch_[ismt-1]->Fill(xix, xiy, j+0.5);
571  if ( ismt >= 1 && ismt <= 9 ) {
572  if ( meTCCTimingCalo_[0] && caloTrg ) meTCCTimingCalo_[0]->Fill( itcc, index+0.5 );
573  if ( meTCCTimingMuon_[0] && muonTrg ) meTCCTimingMuon_[0]->Fill( itcc, index+0.5 );
574  } else {
575  if ( meTCCTimingCalo_[1] && caloTrg ) meTCCTimingCalo_[1]->Fill( itcc, index+0.5 );
576  if ( meTCCTimingMuon_[1] && muonTrg ) meTCCTimingMuon_[1]->Fill( itcc, index+0.5 );
577  }
578 
579  } // loop on crystals
580 
581  }
582  }
583 
584  } // check readout
585 
586  } else {
587  good = false;
588  goodVeto = false;
589  }
590 
591  for ( unsigned int i=0; i<crystals->size(); i++ ) {
592 
593  EEDetId id = (*crystals)[i];
594 
595  int ix = id.ix();
596  int iy = id.iy();
597 
598  if ( ismt >= 1 && ismt <= 9 ) ix = 101 - ix;
599 
600  float xix = ix-0.5;
601  float xiy = iy-0.5;
602 
603  if (!good ) {
604  if ( meEmulError_[ismt-1] ) meEmulError_[ismt-1]->Fill(xix, xiy);
605  }
606  if (!goodVeto) {
607  if ( meVetoEmulError_[ismt-1] ) meVetoEmulError_[ismt-1]->Fill(xix, xiy);
608  }
609 
610  } // loop on crystals
611 
612  } // compDigis.isValid
613 
614  for ( unsigned int i=0; i<crystals->size(); i++ ) {
615 
616  EEDetId id = (*crystals)[i];
617 
618  int ix = id.ix();
619  int iy = id.iy();
620 
621  if ( ismt >= 1 && ismt <= 9 ) ix = 101 - ix;
622 
623  float xix = ix-0.5;
624  float xiy = iy-0.5;
625 
626  if ( meEtMap[ismt-1] ) meEtMap[ismt-1]->Fill(xix, xiy, xvalEt);
627  if ( meVeto[ismt-1] ) meVeto[ismt-1]->Fill(xix, xiy, xvalVeto);
628 
629  } // loop on crystals
630 
631  } // loop on TP
632 
633  if ( meOccupancyBxReal_[0] ) meOccupancyBxReal_[0]->Fill( bx, nTP[0] );
634  if ( meOccupancyBxReal_[1] ) meOccupancyBxReal_[1]->Fill( bx, nTP[1] );
635 
636 }
637 
#define LogDebug(id)
bool enableCleanup_
remove MEs
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
to find the input collection of crystal digis
void endJob(void)
EndJob.
T getUntrackedParameter(std::string const &, T const &) const
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:204
virtual ~EETriggerTowerTask()
Destructor.
int ix() const
Definition: EEDetId.h:76
array1 meVetoEmul_
Emulated fine grain veto vs ix vs iy, for each SM.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const double xbins[]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * meEtBxReal_[2]
number and ET average of TP vs bx for the whole EE+/-
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2730
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:1134
Some &quot;id&quot; conversions.
std::string outputFile_
debug output root file. if empty, no output file created.
static const int nSM
number of supermodules
void setup(void)
Setup.
static const int nTTPhi
number of trigger towers in phi
MonitorElement * meOccupancyBxReal_[2]
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:62
void reserveArray(array1 &array)
reserve an array to hold one histogram per supermodule
MonitorElement * meEtSpectrumEmul_[2]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
void beginJob(void)
BeginJob.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1509
static std::vector< DetId > * crystals(const EcalTrigTowerDetId &id)
Definition: Numbers.cc:582
std::vector< MonitorElement * > array1
1D array
void processDigis(const edm::Event &e, const edm::Handle< EcalTrigPrimDigiCollection > &digis, array1 &meEtMap, array1 &meVeto, const edm::Handle< EcalTrigPrimDigiCollection > &compDigis=edm::Handle< EcalTrigPrimDigiCollection >(), const edm::Handle< edm::TriggerResults > &hltResults=edm::Handle< edm::TriggerResults >())
process a collection of digis, either real or emulated
static const int nTTEta
number of trigger towers in eta
static unsigned iTCC(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
Definition: Numbers.cc:531
DQMStore * dqmStore_
DQM back-end interface.
MonitorElement * meEmulMatchMaxIndex1D_[2]
array1 meEtMapEmul_
Emulated Et vs ix vs iy, for each SM.
edm::EDGetTokenT< edm::TriggerResults > HLTResultsCollection_
to find the input collection of HLT bits
array1 meVetoReal_
fine grain veto vs ix vs iy, for each SM
int j
Definition: DBlmapReader.cc:9
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2296
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
bool isValid() const
Definition: HandleBase.h:76
array1 meEtMapReal_
Et vs ix vs iy, for each SM.
std::string prefixME_
path to MEs
EETriggerTowerTask(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meEtSpectrumEmulMax_[2]
bool mergeRuns_
merge MEs across runs
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:47
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
edm::EDGetTokenT< EcalTrigPrimDigiCollection > emulCollection_
to find the input collection of emulated digis
void reset(void)
Reset.
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
MonitorElement * meEtSpectrumReal_[2]
ET spectrums for the whole EE+/-.
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:142
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:1000
MonitorElement * meTCCTimingCalo_[2]
TCC timing.
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * meEmulMatchIndex1D_[2]
1D emulator match 1D
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void cleanup(void)
Cleanup.
static unsigned iTT(const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
Definition: Numbers.cc:482
Definition: Run.h:41
edm::EDGetTokenT< EcalTrigPrimDigiCollection > realCollection_
to find the input collection of real digis
MonitorElement * meTCCTimingMuon_[2]
int ievt_
local event counter
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:1330