CMS 3D CMS Logo

L1TdeRCT.cc
Go to the documentation of this file.
1 /*
2  * \file L1TdeRCT.cc
3  *
4  * version 0.0 A.Savin 2008/04/26
5  * version 1.0 A.Savin 2008/05/05
6  * this version contains single channel histos and 1D efficiencies
7  */
8 
10 
13 
14 #include "TF2.h"
15 
16 #include <iostream>
17 #include <bitset>
18 
21 
22 using namespace edm;
23 using namespace std;
24 
25 namespace {
26  constexpr unsigned int PHIBINS = 18;
27  constexpr float PHIMIN = -0.5;
28  constexpr float PHIMAX = 17.5;
29 
30  constexpr unsigned int ETABINS = 22;
31  constexpr float ETAMIN = -0.5;
32  constexpr float ETAMAX = 21.5;
33 
34  constexpr unsigned int BITETABINS = 44;
35  constexpr float BITETAMIN = 0;
36  constexpr float BITETAMAX = 22;
37 
38  constexpr unsigned int BITPHIBINS = 72;
39  constexpr float BITPHIMIN = 0;
40  constexpr float BITPHIMAX = 18;
41 
42  constexpr unsigned int BITRPHIBINS = 90;
43  constexpr float BITRPHIMIN = 0;
44  constexpr float BITRPHIMAX = 18;
45 
46  constexpr unsigned int TPGPHIBINS = 72;
47  constexpr float TPGPHIMIN = -0.5;
48  constexpr float TPGPHIMAX = 71.5;
49 
50  constexpr unsigned int TPGETABINS = 64;
51  constexpr float TPGETAMIN = -32.;
52  constexpr float TPGETAMAX = 32.;
53 
54  constexpr unsigned int TPGRANK = 256;
55  constexpr float TPGRANKMIN = -.5;
56  constexpr float TPGRANKMAX = 255.5;
57 
58  constexpr unsigned int DEBINS = 127;
59  constexpr float DEMIN = -63.5;
60  constexpr float DEMAX = 63.5;
61 
62  constexpr unsigned int ELBINS = 64;
63  constexpr float ELMIN = -.5;
64  constexpr float ELMAX = 63.5;
65 
66  constexpr unsigned int PhiEtaMax = 396;
67  constexpr unsigned int CHNLBINS = 396;
68  constexpr float CHNLMIN = -0.5;
69  constexpr float CHNLMAX = 395.5;
70 } // namespace
71 
72 const int L1TdeRCT::crateFED[108] = {
73  613, 614, 603, 702, 718, 1118, 611, 612, 602, 700, 718, 1118, 627, 610, 601, 716, 722, 1122,
74  625, 626, 609, 714, 722, 1122, 623, 624, 608, 712, 722, 1122, 621, 622, 607, 710, 720, 1120,
75  619, 620, 606, 708, 720, 1120, 617, 618, 605, 706, 720, 1120, 615, 616, 604, 704, 718, 1118,
76  631, 632, 648, 703, 719, 1118, 629, 630, 647, 701, 719, 1118, 645, 628, 646, 717, 723, 1122,
77  643, 644, 654, 715, 723, 1122, 641, 642, 653, 713, 723, 1122, 639, 640, 652, 711, 721, 1120,
78  637, 638, 651, 709, 721, 1120, 635, 636, 650, 707, 721, 1120, 633, 634, 649, 705, 719, 1118};
79 
81  : rctSourceEmul_rgnEmul_(consumes<L1CaloRegionCollection>(ps.getParameter<InputTag>("rctSourceEmul"))),
82  rctSourceEmul_emEmul_(consumes<L1CaloEmCollection>(ps.getParameter<InputTag>("rctSourceEmul"))),
83  rctSourceData_rgnData_(consumes<L1CaloRegionCollection>(ps.getParameter<InputTag>("rctSourceData"))),
84  rctSourceData_emData_(consumes<L1CaloEmCollection>(ps.getParameter<InputTag>("rctSourceData"))),
85  ecalTPGData_(consumes<EcalTrigPrimDigiCollection>(ps.getParameter<InputTag>("ecalTPGData"))),
86  hcalTPGData_(consumes<HcalTrigPrimDigiCollection>(ps.getParameter<InputTag>("hcalTPGData"))),
87  gtDigisLabel_(consumes<L1GlobalTriggerReadoutRecord>(ps.getParameter<InputTag>("gtDigisLabel"))),
88  runInfoToken_(esConsumes<edm::Transition::BeginRun>()),
89  runInfolumiToken_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
90  gtEGAlgoName_(ps.getParameter<std::string>("gtEGAlgoName")),
91  doubleThreshold_(ps.getParameter<int>("doubleThreshold")),
92  filterTriggerType_(ps.getParameter<int>("filterTriggerType")),
93  selectBX_(ps.getUntrackedParameter<int>("selectBX", 2)),
94  dataInputTagName_(ps.getParameter<InputTag>("rctSourceData").label()) {
95  singlechannelhistos_ = ps.getUntrackedParameter<bool>("singlechannelhistos", false);
96 
97  perLSsaving_ = (ps.getUntrackedParameter<bool>("perLSsaving", false));
98 
100  if (verbose_)
101  std::cout << "L1TdeRCT: single channels histos ON" << std::endl;
102 
103  // verbosity switch
104  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
105 
106  if (verbose_)
107  std::cout << "L1TdeRCT: constructor...." << std::endl;
108 
109  histFolder_ = ps.getUntrackedParameter<std::string>("HistFolder", "L1TEMU/L1TdeRCT");
110 }
111 
113 
114 void L1TdeRCT::analyze(const Event& e, const EventSetup& c) {
115  nev_++;
116  if (verbose_) {
117  std::cout << "L1TdeRCT: analyze...." << std::endl;
118  }
119 
120  // filter according trigger type
121  // enum ExperimentType {
122  // Undefined = 0,
123  // PhysicsTrigger = 1,
124  // CalibrationTrigger = 2,
125  // RandomTrigger = 3,
126  // Reserved = 4,
127  // TracedEvent = 5,
128  // TestTrigger = 6,
129  // ErrorTrigger = 15
130 
131  // fill a histogram with the trigger type, for normalization fill also last bin
132  // ErrorTrigger + 1
133  double triggerType = static_cast<double>(e.experimentType()) + 0.001;
134  double triggerTypeLast = static_cast<double>(edm::EventAuxiliary::ExperimentType::ErrorTrigger) + 0.001;
136  triggerType_->Fill(triggerTypeLast + 1);
137 
138  // filter only if trigger type is greater than 0, negative values disable filtering
139  if (filterTriggerType_ >= 0) {
140  // now filter, for real data only
141  if (e.isRealData()) {
142  if (!(e.experimentType() == filterTriggerType_)) {
143  edm::LogInfo("L1TdeRCT") << "\n Event of TriggerType " << e.experimentType() << " rejected" << std::endl;
144  return;
145  }
146  }
147  }
148 
149  // for GT decision word
151 
152  // get GT decision word
153  e.getByToken(gtDigisLabel_, gtRecord);
154  const DecisionWord dWord =
155  gtRecord->decisionWord(); // this will get the decision word *before* masking disabled bits
156  int effEGThresholdBitNumber = 999;
157  if (gtEGAlgoName_ == "L1_SingleEG1") {
158  effEGThresholdBitNumber = 46;
159  }
160  if (gtEGAlgoName_ == "L1_SingleEG5_0001") {
161  effEGThresholdBitNumber = 47;
162  }
163  if (gtEGAlgoName_ == "L1_SingleEG8_0001") {
164  effEGThresholdBitNumber = 48;
165  }
166  if (gtEGAlgoName_ == "L1_SingleEG10_0001") {
167  effEGThresholdBitNumber = 49;
168  }
169  if (gtEGAlgoName_ == "L1_SingleEG12_0001") {
170  effEGThresholdBitNumber = 50;
171  }
172  if (gtEGAlgoName_ == "L1_SingleEG15_0001") {
173  effEGThresholdBitNumber = 51;
174  }
175  if (gtEGAlgoName_ == "L1_SingleEG20_0001") {
176  effEGThresholdBitNumber = 52;
177  }
178 
179  int algoBitNumber = 0;
180  bool triggered = false;
181  bool independent_triggered = false;
182  DecisionWord::const_iterator algoItr;
183  for (algoItr = dWord.begin(); algoItr != dWord.end(); algoItr++) {
184  if (*algoItr) {
185  triggerAlgoNumbers_->Fill(algoBitNumber);
186  if (algoBitNumber == effEGThresholdBitNumber) {
187  triggered = true; // Fill triggered events (numerator) here!
188  }
189  if (algoBitNumber <= 45 || algoBitNumber >= 53) {
190  independent_triggered = true; // use the muon path only !
191  }
192  }
193  algoBitNumber++;
194  }
195 
196  if (triggered)
197  trigCount++;
198  else
199  notrigCount++;
200 
201  // get TPGs
204 
205  // Get the RCT digis
208 
209  // Get the RCT digis
212 
213  bool doEcal = true;
214  bool doHcal = true;
215 
216  // TPG, first try:
217  e.getByToken(ecalTPGData_, ecalTpData);
218  e.getByToken(hcalTPGData_, hcalTpData);
219 
220  if (!ecalTpData.isValid()) {
221  edm::LogInfo("TPG DataNotFound") << "can't find EcalTrigPrimDigiCollection";
222  if (verbose_)
223  std::cout << "Can not find ecalTpData!" << std::endl;
224 
225  doEcal = false;
226  }
227 
228  if (doEcal) {
229  for (EcalTrigPrimDigiCollection::const_iterator iEcalTp = ecalTpData->begin(); iEcalTp != ecalTpData->end();
230  iEcalTp++) {
231  if (iEcalTp->compressedEt() > 0) {
232  rctInputTPGEcalRank_->Fill(1. * (iEcalTp->compressedEt()));
233 
234  if (iEcalTp->id().ieta() > 0) {
235  rctInputTPGEcalOccNoCut_->Fill(1. * (iEcalTp->id().ieta()) - 0.5, iEcalTp->id().iphi());
236  if (iEcalTp->compressedEt() > 3)
237  rctInputTPGEcalOcc_->Fill(1. * (iEcalTp->id().ieta()) - 0.5, iEcalTp->id().iphi());
238  } else {
239  rctInputTPGEcalOccNoCut_->Fill(1. * (iEcalTp->id().ieta()) + 0.5, iEcalTp->id().iphi());
240  if (iEcalTp->compressedEt() > 3)
241  rctInputTPGEcalOcc_->Fill(1. * (iEcalTp->id().ieta()) + 0.5, iEcalTp->id().iphi());
242  }
243 
244  if (verbose_)
245  std::cout << " ECAL data: Energy: " << iEcalTp->compressedEt() << " eta " << iEcalTp->id().ieta() << " phi "
246  << iEcalTp->id().iphi() << std::endl;
247  }
248  }
249  }
250 
251  if (!hcalTpData.isValid()) {
252  edm::LogInfo("TPG DataNotFound") << "can't find HcalTrigPrimDigiCollection";
253  if (verbose_)
254  std::cout << "Can not find hcalTpData!" << std::endl;
255 
256  doHcal = false;
257  }
258 
259  if (doHcal) {
260  for (HcalTrigPrimDigiCollection::const_iterator iHcalTp = hcalTpData->begin(); iHcalTp != hcalTpData->end();
261  iHcalTp++) {
262  int highSample = 0;
263  int highEt = 0;
264 
265  for (int nSample = 0; nSample < 10; nSample++) {
266  if (iHcalTp->sample(nSample).compressedEt() != 0) {
267  if (verbose_)
268  std::cout << "HCAL data: Et " << iHcalTp->sample(nSample).compressedEt() << " fg "
269  << iHcalTp->sample(nSample).fineGrain() << " ieta " << iHcalTp->id().ieta() << " iphi "
270  << iHcalTp->id().iphi() << " sample " << nSample << std::endl;
271  if (iHcalTp->sample(nSample).compressedEt() > highEt) {
272  highSample = nSample;
273  highEt = iHcalTp->sample(nSample).compressedEt();
274  }
275  }
276  }
277 
278  if (highEt != 0) {
279  if (iHcalTp->id().ieta() > 0)
280  rctInputTPGHcalOcc_->Fill(1. * (iHcalTp->id().ieta()) - 0.5, iHcalTp->id().iphi());
281  else
282  rctInputTPGHcalOcc_->Fill(1. * (iHcalTp->id().ieta()) + 0.5, iHcalTp->id().iphi());
283  rctInputTPGHcalSample_->Fill(highSample, highEt);
285  }
286  }
287  }
288 
289  e.getByToken(rctSourceData_rgnData_, rgnData);
290  e.getByToken(rctSourceEmul_rgnEmul_, rgnEmul);
291 
292  if (!rgnData.isValid()) {
293  edm::LogInfo("DataNotFound") << "can't find L1CaloRegionCollection";
294  if (verbose_)
295  std::cout << "Can not find rgnData!" << std::endl;
296  return;
297  }
298 
299  if (!rgnEmul.isValid()) {
300  edm::LogInfo("DataNotFound") << "can't find L1CaloRegionCollection";
301  if (verbose_)
302  std::cout << "Can not find rgnEmul!" << std::endl;
303  return;
304  }
305 
306  e.getByToken(rctSourceData_emData_, emData);
307  e.getByToken(rctSourceEmul_emEmul_, emEmul);
308 
309  if (!emData.isValid()) {
310  edm::LogInfo("DataNotFound") << "can't find L1CaloEmCollection";
311  if (verbose_)
312  std::cout << "Can not find emData!" << std::endl;
313  return;
314  }
315 
316  if (!emEmul.isValid()) {
317  edm::LogInfo("DataNotFound") << "can't find L1CaloEmCollection";
318  if (verbose_)
319  std::cout << "Can not find emEmul!" << std::endl;
320  return;
321  }
322 
323  // Isolated and non-isolated EM
324 
325  // StepI: Reset
326 
327  int nelectrIsoData = 0;
328  int nelectrNisoData = 0;
329  int nelectrIsoEmul = 0;
330  int nelectrNisoEmul = 0;
331 
332  int electronDataRank[2][PhiEtaMax] = {{0}};
333  int electronDataEta[2][PhiEtaMax] = {{0}};
334  int electronDataPhi[2][PhiEtaMax] = {{0}};
335  int electronEmulRank[2][PhiEtaMax] = {{0}};
336  int electronEmulEta[2][PhiEtaMax] = {{0}};
337  int electronEmulPhi[2][PhiEtaMax] = {{0}};
338 
339  // region/bit arrays
340  int nRegionData = 0;
341  int nRegionEmul = 0;
342 
343  int regionDataRank[PhiEtaMax] = {0};
344  int regionDataEta[PhiEtaMax] = {0};
345  int regionDataPhi[PhiEtaMax] = {0};
346 
347  bool regionDataOverFlow[PhiEtaMax] = {false};
348  bool regionDataTauVeto[PhiEtaMax] = {false};
349  bool regionDataMip[PhiEtaMax] = {false};
350  bool regionDataQuiet[PhiEtaMax] = {false};
351  bool regionDataHfPlusTau[PhiEtaMax] = {false};
352 
353  int regionEmulRank[PhiEtaMax] = {0};
354  int regionEmulEta[PhiEtaMax] = {0};
355  int regionEmulPhi[PhiEtaMax] = {0};
356 
357  bool regionEmulOverFlow[PhiEtaMax] = {false};
358  bool regionEmulTauVeto[PhiEtaMax] = {false};
359  bool regionEmulMip[PhiEtaMax] = {false};
360  bool regionEmulQuiet[PhiEtaMax] = {false};
361  bool regionEmulHfPlusTau[PhiEtaMax] = {false};
362 
363  // StepII: fill variables
364 
365  for (L1CaloEmCollection::const_iterator iem = emEmul->begin(); iem != emEmul->end(); iem++) {
366  if (iem->rank() >= 1) {
367  if (iem->isolated()) {
368  rctIsoEmEmulOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
369 
370  // to show bad channles in the 2D efficiency plots
371  rctIsoEmIneffOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), 0.01);
372  rctIsoEmEff1Occ_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), 0.01);
373 
374  int channel;
375 
376  channel = PHIBINS * iem->regionId().ieta() + iem->regionId().iphi();
377  rctIsoEmEmulOcc1D_->Fill(channel);
378  electronEmulRank[0][nelectrIsoEmul] = iem->rank();
379  electronEmulEta[0][nelectrIsoEmul] = iem->regionId().ieta();
380  electronEmulPhi[0][nelectrIsoEmul] = iem->regionId().iphi();
381  nelectrIsoEmul++;
382  }
383 
384  else {
385  rctNisoEmEmulOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
386 
387  // to show bad channles in the 2D efficiency plots
388  rctNisoEmIneffOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), 0.01);
389  rctNisoEmEff1Occ_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), 0.01);
390 
391  int channel;
392  //
393 
394  channel = PHIBINS * iem->regionId().ieta() + iem->regionId().iphi();
395  rctNisoEmEmulOcc1D_->Fill(channel);
396  electronEmulRank[1][nelectrNisoEmul] = iem->rank();
397  electronEmulEta[1][nelectrNisoEmul] = iem->regionId().ieta();
398  electronEmulPhi[1][nelectrNisoEmul] = iem->regionId().iphi();
399  nelectrNisoEmul++;
400  }
401  }
402  }
403 
404  for (L1CaloEmCollection::const_iterator iem = emData->begin(); iem != emData->end(); iem++) {
405  if (selectBX_ != -1 && selectBX_ != iem->bx())
406  continue;
407 
408  if (iem->rank() >= 1) {
409  if (iem->isolated()) {
410  rctIsoEmDataOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
411 
412  // new stuff to avoid 0's in emulator 2D //
413  // rctIsoEmEmulOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi(),0.01);
414  rctIsoEmOvereffOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), 0.01);
415 
416  int channel;
417 
418  channel = PHIBINS * iem->regionId().ieta() + iem->regionId().iphi();
419  rctIsoEmDataOcc1D_->Fill(channel);
420 
421  // new stuff to avoid 0's
422  // rctIsoEmEmulOcc1D_->Fill(channel);
423 
424  electronDataRank[0][nelectrIsoData] = iem->rank();
425  electronDataEta[0][nelectrIsoData] = iem->regionId().ieta();
426  electronDataPhi[0][nelectrIsoData] = iem->regionId().iphi();
427  nelectrIsoData++;
428  }
429 
430  else {
431  rctNisoEmDataOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi());
432 
433  // new stuff to avoid 0's in emulator 2D //
434  // rctNisoEmEmulOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi(),0.01);
435  rctNisoEmOvereffOcc_->Fill(iem->regionId().ieta(), iem->regionId().iphi(), 0.01);
436 
437  int channel;
438 
439  channel = PHIBINS * iem->regionId().ieta() + iem->regionId().iphi();
440  rctNisoEmDataOcc1D_->Fill(channel);
441 
442  // new stuff to avoid 0's
443  // rctNisoEmEmulOcc1D_->Fill(channel);
444 
445  electronDataRank[1][nelectrNisoData] = iem->rank();
446  electronDataEta[1][nelectrNisoData] = iem->regionId().ieta();
447  electronDataPhi[1][nelectrNisoData] = iem->regionId().iphi();
448  nelectrNisoData++;
449  }
450  }
451  }
452 
453  // fill region/bit arrays for emulator
454  for (L1CaloRegionCollection::const_iterator ireg = rgnEmul->begin(); ireg != rgnEmul->end(); ireg++) {
455  // std::cout << "Emul: " << nRegionEmul << " " << ireg->gctEta() << " " << ireg->gctPhi() << std::endl;
456  if (ireg->overFlow())
457  rctBitEmulOverFlow2D_->Fill(ireg->gctEta(), ireg->gctPhi());
458  if (ireg->tauVeto())
459  rctBitEmulTauVeto2D_->Fill(ireg->gctEta(), ireg->gctPhi());
460  if (ireg->mip())
461  rctBitEmulMip2D_->Fill(ireg->gctEta(), ireg->gctPhi());
462  if (ireg->quiet())
463  rctBitEmulQuiet2D_->Fill(ireg->gctEta(), ireg->gctPhi());
464  if (ireg->fineGrain())
465  rctBitEmulHfPlusTau2D_->Fill(ireg->gctEta(), ireg->gctPhi());
466  if (ireg->et() > 0) {
467  rctRegEmulOcc1D_->Fill(PHIBINS * ireg->gctEta() + ireg->gctPhi());
468  rctRegEmulOcc2D_->Fill(ireg->gctEta(), ireg->gctPhi());
469  }
470 
471  // to show bad channels in 2D efficiency plots:
472  if (ireg->overFlow()) {
473  rctBitUnmatchedEmulOverFlow2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
474  rctBitMatchedOverFlow2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
475  }
476 
477  if (ireg->tauVeto()) {
478  rctBitUnmatchedEmulTauVeto2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
479  rctBitMatchedTauVeto2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
480  }
481 
482  if (ireg->mip()) {
483  rctBitUnmatchedEmulMip2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
484  rctBitMatchedMip2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
485  }
486 
487  if (ireg->quiet()) {
488  rctBitUnmatchedEmulQuiet2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
489  rctBitMatchedQuiet2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
490  }
491 
492  if (ireg->fineGrain()) {
493  rctBitUnmatchedEmulHfPlusTau2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
494  rctBitMatchedHfPlusTau2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
495  }
496 
497  if (ireg->et() > 0) {
498  rctRegUnmatchedEmulOcc2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
499  rctRegMatchedOcc2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
500  /* rctRegDeltaEtOcc2D_->Fill (ireg->gctEta(), ireg->gctPhi(), 0.01); */
501  }
502 
503  nRegionEmul = PHIBINS * ireg->gctEta() + ireg->gctPhi();
504 
505  regionEmulRank[nRegionEmul] = ireg->et();
506  regionEmulEta[nRegionEmul] = ireg->gctEta();
507  regionEmulPhi[nRegionEmul] = ireg->gctPhi();
508  regionEmulOverFlow[nRegionEmul] = ireg->overFlow();
509  regionEmulTauVeto[nRegionEmul] = ireg->tauVeto();
510  regionEmulMip[nRegionEmul] = ireg->mip();
511  regionEmulQuiet[nRegionEmul] = ireg->quiet();
512  regionEmulHfPlusTau[nRegionEmul] = ireg->fineGrain();
513  }
514  // fill region/bit arrays for hardware
515  for (L1CaloRegionCollection::const_iterator ireg = rgnData->begin(); ireg != rgnData->end(); ireg++) {
516  if (selectBX_ != -1 && selectBX_ != ireg->bx())
517  continue;
518 
519  // std::cout << "Data: " << nRegionData << " " << ireg->gctEta() << " " << ireg->gctPhi() << std::endl;
520  if (ireg->overFlow())
521  rctBitDataOverFlow2D_->Fill(ireg->gctEta(), ireg->gctPhi());
522  if (ireg->tauVeto())
523  rctBitDataTauVeto2D_->Fill(ireg->gctEta(), ireg->gctPhi());
524  if (ireg->mip())
525  rctBitDataMip2D_->Fill(ireg->gctEta(), ireg->gctPhi());
526  if (ireg->quiet())
527  rctBitDataQuiet2D_->Fill(ireg->gctEta(), ireg->gctPhi());
528  if (ireg->fineGrain())
529  rctBitDataHfPlusTau2D_->Fill(ireg->gctEta(), ireg->gctPhi());
530  if (ireg->et() > 0) {
531  rctRegDataOcc1D_->Fill(PHIBINS * ireg->gctEta() + ireg->gctPhi());
532  rctRegDataOcc2D_->Fill(ireg->gctEta(), ireg->gctPhi());
533  }
534  // to show bad channels in 2D inefficiency:
535  // if(ireg->overFlow()) rctBitEmulOverFlow2D_ ->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
536  // if(ireg->tauVeto()) rctBitEmulTauVeto2D_ ->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
537  // if(ireg->mip()) rctBitEmulMip2D_ ->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
538  // if(ireg->quiet()) rctBitEmulQuiet2D_ ->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
539  // if(ireg->fineGrain()) rctBitEmulHfPlusTau2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
540  // if(ireg->et() > 0) rctRegEmulOcc2D_ ->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
541  if (ireg->overFlow())
542  rctBitUnmatchedDataOverFlow2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
543  if (ireg->tauVeto())
544  rctBitUnmatchedDataTauVeto2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
545  if (ireg->mip())
546  rctBitUnmatchedDataMip2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
547  if (ireg->quiet())
548  rctBitUnmatchedDataQuiet2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
549  if (ireg->fineGrain())
550  rctBitUnmatchedDataHfPlusTau2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
551  if (ireg->et() > 0)
552  rctRegUnmatchedDataOcc2D_->Fill(ireg->gctEta(), ireg->gctPhi(), 0.01);
553 
554  nRegionData = PHIBINS * ireg->gctEta() + ireg->gctPhi();
555 
556  regionDataRank[nRegionData] = ireg->et();
557  regionDataEta[nRegionData] = ireg->gctEta();
558  regionDataPhi[nRegionData] = ireg->gctPhi();
559  regionDataOverFlow[nRegionData] = ireg->overFlow();
560  regionDataTauVeto[nRegionData] = ireg->tauVeto();
561  regionDataMip[nRegionData] = ireg->mip();
562  regionDataQuiet[nRegionData] = ireg->quiet();
563  regionDataHfPlusTau[nRegionData] = ireg->fineGrain();
564  }
565 
566  if (verbose_) {
567  std::cout << "I found Data! Iso: " << nelectrIsoData << " Niso: " << nelectrNisoData << std::endl;
568  for (int i = 0; i < nelectrIsoData; i++)
569  std::cout << " Iso Energy " << electronDataRank[0][i] << " eta " << electronDataEta[0][i] << " phi "
570  << electronDataPhi[0][i] << std::endl;
571  for (int i = 0; i < nelectrNisoData; i++)
572  std::cout << " Niso Energy " << electronDataRank[1][i] << " eta " << electronDataEta[1][i] << " phi "
573  << electronDataPhi[1][i] << std::endl;
574 
575  std::cout << "I found Emul! Iso: " << nelectrIsoEmul << " Niso: " << nelectrNisoEmul << std::endl;
576  for (int i = 0; i < nelectrIsoEmul; i++)
577  std::cout << " Iso Energy " << electronEmulRank[0][i] << " eta " << electronEmulEta[0][i] << " phi "
578  << electronEmulPhi[0][i] << std::endl;
579  for (int i = 0; i < nelectrNisoEmul; i++)
580  std::cout << " Niso Energy " << electronEmulRank[1][i] << " eta " << electronEmulEta[1][i] << " phi "
581  << electronEmulPhi[1][i] << std::endl;
582 
583  std::cout << "I found Data! Regions: " << PhiEtaMax << std::endl;
584  for (int i = 0; i < (int)PhiEtaMax; i++)
585  if (regionDataRank[i] != 0)
586  std::cout << " Energy " << regionDataRank[i] << " eta " << regionDataEta[i] << " phi " << regionDataPhi[i]
587  << std::endl;
588 
589  std::cout << "I found Emul! Regions: " << PhiEtaMax << std::endl;
590  for (int i = 0; i < (int)PhiEtaMax; i++)
591  if (regionEmulRank[i] != 0)
592  std::cout << " Energy " << regionEmulRank[i] << " eta " << regionEmulEta[i] << " phi " << regionEmulPhi[i]
593  << std::endl;
594  }
595 
596  // StepIII: calculate and fill
597 
598  for (int k = 0; k < 2; k++) {
599  int nelectrE, nelectrD;
600 
601  if (k == 0) {
602  nelectrE = nelectrIsoEmul;
603  nelectrD = nelectrIsoData;
604  }
605 
606  else {
607  nelectrE = nelectrNisoEmul;
608  nelectrD = nelectrNisoData;
609  }
610 
611  for (int i = 0; i < nelectrE; i++) {
612  //bool triggered = l1SingleEG2; //false; //HACK until true trigger implimented
613  double trigThresh = doubleThreshold_; //ditto
614  if (singlechannelhistos_) {
615  int chnl = PHIBINS * electronEmulEta[k][i] + electronEmulPhi[k][i];
616  if (k == 1 && independent_triggered) { //non-iso
617  //std::cout << "eta " << electronEmulEta[k][i] << " phi " << electronEmulPhi[k][i] << " with rank " << electronEmulRank[k][i] << std::endl;
618  trigEffOcc_[chnl]->Fill(electronEmulRank[k][i]);
619  // }
620  if (triggered)
621  trigEffTriggOcc_[chnl]->Fill(electronEmulRank[k][i]);
622  }
623  }
624  //find number of objects with rank above 2x trigger threshold
625  //and number after requiring a trigger too
626  if (electronEmulRank[k][i] >= trigThresh) {
627  if (k == 1 && independent_triggered) { //non-iso
628  trigEffThreshOcc_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i]);
629  trigEffTriggThreshOcc_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.01);
630  // }
631  if (triggered)
632  trigEffTriggThreshOcc_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98001);
633  }
634  }
635 
636  Bool_t found = kFALSE;
637 
638  for (int j = 0; j < nelectrD; j++) {
639  if (electronEmulEta[k][i] == electronDataEta[k][j] && electronEmulPhi[k][i] == electronDataPhi[k][j]) {
640  if (k == 0) {
641  rctIsoEmEff1Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98001);
642  // Weight is for ROOT; when added to initial weight of 0.01, should just exceed 0.99
643 
644  int chnl;
645 
646  chnl = PHIBINS * electronEmulEta[k][i] + electronEmulPhi[k][i];
647  rctIsoEmEff1Occ1D_->Fill(chnl);
648  if (singlechannelhistos_) {
649  int energy_difference;
650 
651  energy_difference = (electronEmulRank[k][i] - electronDataRank[k][j]);
652  rctIsoEffChannel_[chnl]->Fill(energy_difference);
653  }
654 
655  if (electronEmulRank[k][i] == electronDataRank[k][j]) {
656  rctIsoEmEff2Occ1D_->Fill(chnl);
657  rctIsoEmEff2Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98012);
658  // Weight is for ROOT; should just exceed 0.99
659  // NOTE: Weight is different for eff 2 because this isn't filled initially
660  // for current definition of Eff2 and Ineff2 we need to add additional
661  // factor 0.99 since we divide over eff1 which is 0.99001 e.g. we use 0.99001**2 !
662  rctIsoEmIneff2Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.0099);
663  } else {
664  rctIsoEmIneff2Occ1D_->Fill(chnl);
665  rctIsoEmIneff2Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.9801);
666  //Check for the bit that is different and store it
667  bitset<8> bitDifference(electronEmulRank[k][i] ^ electronDataRank[k][j]);
668  for (size_t n = 0; n < bitDifference.size(); n++) {
669  if (n < 4) {
670  rctIsoEmBitDiff_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i] + n * 0.25, bitDifference[n]);
671  }
672  if (n >= 4) {
674  electronEmulEta[k][i] + 0.5, electronEmulPhi[k][i] + (n - 4) * 0.25, bitDifference[n]);
675  }
676  }
677  }
678  }
679 
680  else {
681  rctNisoEmEff1Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98001);
682  // Weight is for ROOT; when added to initial weight of 0.01, should just exceed 0.99
683 
684  int chnl;
685 
686  chnl = PHIBINS * electronEmulEta[k][i] + electronEmulPhi[k][i];
687  rctNisoEmEff1Occ1D_->Fill(chnl);
688  if (singlechannelhistos_) {
689  int energy_difference;
690 
691  energy_difference = (electronEmulRank[k][i] - electronDataRank[k][j]);
692  rctNisoEffChannel_[chnl]->Fill(energy_difference);
693  }
694 
695  if (electronEmulRank[k][i] == electronDataRank[k][j]) {
696  rctNisoEmEff2Occ1D_->Fill(chnl);
697  rctNisoEmEff2Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98012);
698  // Weight is for ROOT; should just exceed 0.99
699  // NOTE: Weight is different for eff 2 because this isn't filled initially
700  // see comments fo Iso
701  rctNisoEmIneff2Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.0099);
702  } else {
704  rctNisoEmIneff2Occ_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.9801);
705  //Check for the bit that is different and store it
706  bitset<8> bitDifference(electronEmulRank[k][i] ^ electronDataRank[k][j]);
707  for (size_t n = 0; n < bitDifference.size(); n++) {
708  if (n < 4) {
709  rctNIsoEmBitDiff_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i] + n * 0.25, bitDifference[n]);
710  }
711  if (n >= 4) {
713  electronEmulEta[k][i] + 0.5, electronEmulPhi[k][i] + (n - 4) * 0.25, bitDifference[n]);
714  }
715  }
716  }
717  }
718 
719  found = kTRUE;
720  }
721  }
722 
723  if (found == kFALSE) {
724  if (k == 0) {
725  rctIsoEmIneffOcc_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98);
726  // Weight is for ROOT; when added to initial weight of 0.01, should equal 0.99
727 
728  int chnl;
729 
730  //Store the bit map for the emulator
731  bitset<8> bit(electronEmulRank[k][i]);
732  for (size_t n = 0; n < bit.size(); n++) {
733  if (n < 4) {
734  rctIsoEmBitOff_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i] + n * 0.25, bit[n]);
735  }
736  if (n >= 4) {
737  rctIsoEmBitOff_->Fill(electronEmulEta[k][i] + 0.5, electronEmulPhi[k][i] + (n - 4) * 0.25, bit[n]);
738  }
739  }
740 
741  chnl = PHIBINS * electronEmulEta[k][i] + electronEmulPhi[k][i];
742  rctIsoEmIneffOcc1D_->Fill(chnl);
743  if (singlechannelhistos_) {
744  rctIsoIneffChannel_[chnl]->Fill(electronEmulRank[k][i]);
745  }
746  }
747 
748  else {
749  rctNisoEmIneffOcc_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i], 0.98);
750  // Weight is for ROOT; when added to initial weight of 0.01, should equal 0.99
751 
752  int chnl;
753 
754  chnl = PHIBINS * electronEmulEta[k][i] + electronEmulPhi[k][i];
755  rctNisoEmIneffOcc1D_->Fill(chnl);
756 
757  //Store the bit map for the emulator
758  bitset<8> bit(electronEmulRank[k][i]);
759  for (size_t n = 0; n < bit.size(); n++) {
760  if (n < 4) {
761  rctNIsoEmBitOff_->Fill(electronEmulEta[k][i], electronEmulPhi[k][i] + n * 0.25, bit[n]);
762  }
763  if (n >= 4) {
764  rctNIsoEmBitOff_->Fill(electronEmulEta[k][i] + 0.5, electronEmulPhi[k][i] + (n - 4) * 0.25, bit[n]);
765  }
766  }
767 
768  if (singlechannelhistos_) {
769  rctNisoIneffChannel_[chnl]->Fill(electronEmulRank[k][i]);
770  }
771  }
772  }
773  }
774 
777  // DivideME1D(rctIsoEmEff2Occ1D_, rctIsoEmEmulOcc1D_, rctIsoEmEff2oneD_);
778  // DivideME2D(rctIsoEmEff2Occ_, rctIsoEmEmulOcc_, rctIsoEmEff2_) ;
781  // DivideME1D(rctIsoEmIneff2Occ1D_, rctIsoEmEmulOcc1D_, rctIsoEmIneff2oneD_);
782  // DivideME2D(rctIsoEmIneff2Occ_, rctIsoEmEmulOcc_, rctIsoEmIneff2_) ;
785 
788  // DivideME1D(rctNisoEmEff2Occ1D_, rctNisoEmEmulOcc1D_, rctNisoEmEff2oneD_);
789  // DivideME2D(rctNisoEmEff2Occ_, rctNisoEmEmulOcc_, rctNisoEmEff2_);
792  // DivideME1D(rctNisoEmIneff2Occ1D_, rctNisoEmEmulOcc1D_, rctNisoEmIneff2oneD_);
793  // DivideME2D(rctNisoEmIneff2Occ_, rctNisoEmEmulOcc_, rctNisoEmIneff2_);
796 
801 
803  if (singlechannelhistos_) {
804  for (int i = 0; i < nelectrE; i++) {
805  int chnl = PHIBINS * electronEmulEta[k][i] + electronEmulPhi[k][i];
806  DivideME1D(trigEffTriggOcc_[chnl], trigEffOcc_[chnl], trigEff_[chnl]);
807  }
808  }
809 
810  for (int i = 0; i < nelectrD; i++) {
811  Bool_t found = kFALSE;
812 
813  for (int j = 0; j < nelectrE; j++) {
814  if (electronEmulEta[k][j] == electronDataEta[k][i] && electronEmulPhi[k][j] == electronDataPhi[k][i]) {
815  found = kTRUE;
816  }
817  }
818 
819  if (found == kFALSE) {
820  if (k == 0) {
821  rctIsoEmOvereffOcc_->Fill(electronDataEta[k][i], electronDataPhi[k][i], 0.98);
822  // Weight is for ROOT; when added to initial weight of 0.01, should equal 0.99
823 
824  int chnl;
825 
826  //Store the bit map for the emulator
827  bitset<8> bit(electronDataRank[k][i]);
828  for (size_t n = 0; n < bit.size(); n++) {
829  if (n < 4) {
830  rctIsoEmBitOn_->Fill(electronDataEta[k][i], electronDataPhi[k][i] + n * 0.25, bit[n]);
831  }
832  if (n >= 4) {
833  rctIsoEmBitOn_->Fill(electronDataEta[k][i] + 0.5, electronDataPhi[k][i] + (n - 4) * 0.25, bit[n]);
834  }
835  }
836 
837  chnl = PHIBINS * electronDataEta[k][i] + electronDataPhi[k][i];
839 
840  if (singlechannelhistos_) {
841  rctIsoOvereffChannel_[chnl]->Fill(electronDataRank[k][i]);
842  }
843  }
844 
845  else {
846  rctNisoEmOvereffOcc_->Fill(electronDataEta[k][i], electronDataPhi[k][i], 0.98);
847  // Weight is for ROOT; when added to initial weight of 0.01, should equal 0.99
848 
849  int chnl;
850 
851  //Store the bit map for the emulator
852  bitset<8> bit(electronDataRank[k][i]);
853  for (size_t n = 0; n < bit.size(); n++) {
854  if (n < 4) {
855  rctNIsoEmBitOn_->Fill(electronDataEta[k][i], electronDataPhi[k][i] + n * 0.25, bit[n]);
856  }
857  if (n >= 4) {
858  rctNIsoEmBitOn_->Fill(electronDataEta[k][i] + 0.5, electronDataPhi[k][i] + (n - 4) * 0.25, bit[n]);
859  }
860  }
861 
862  chnl = PHIBINS * electronDataEta[k][i] + electronDataPhi[k][i];
864 
865  if (singlechannelhistos_) {
866  rctNisoOvereffChannel_[chnl]->Fill(electronDataRank[k][i]);
867  }
868  }
869  }
870  }
871  }
872 
873  // we try new definition of overefficiency:
878 
879  // calculate region/bit information
880  for (unsigned int i = 0; i < (int)PhiEtaMax; i++) {
881  Bool_t regFound = kFALSE;
882  Bool_t overFlowFound = kFALSE;
883  Bool_t tauVetoFound = kFALSE;
884  Bool_t mipFound = kFALSE;
885  Bool_t quietFound = kFALSE;
886  Bool_t hfPlusTauFound = kFALSE;
887 
888  // for(int j = 0; j < nRegionData; j++)
889  // {
890  // if(regionEmulEta[i] == regionDataEta[j] &&
891  // regionEmulPhi[i] == regionDataPhi[j])
892  // {
893  if (regionDataRank[i] >= 1 && regionEmulRank[i] >= 1) {
894  int chnl;
895 
896  chnl = PHIBINS * regionEmulEta[i] + regionEmulPhi[i];
897  rctRegMatchedOcc1D_->Fill(chnl);
898  rctRegMatchedOcc2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98001);
899  // Weight is for ROOT; when added to initial weight of 0.01, should just exceed 0.99
900 
902  rctRegEffChannel_[chnl]->Fill(regionEmulRank[i] - regionDataRank[i]);
903 
904  // see comments for Iso Eff2
905 
906  if (regionEmulRank[i] == regionDataRank[i]) {
907  rctRegSpEffOcc1D_->Fill(chnl);
908  // rctRegSpEffOcc2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.99001);
909  rctRegSpEffOcc2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98012);
910  rctRegSpIneffOcc2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.0099);
911  } else {
912  rctRegSpIneffOcc1D_->Fill(chnl);
913  rctRegSpIneffOcc2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.9801);
914 
915  bitset<10> bitDifference(regionEmulRank[i] ^ regionDataRank[i]);
916  for (size_t n = 0; n < bitDifference.size(); n++) {
917  if (n < 5) {
918  rctRegBitDiff_->Fill(regionEmulEta[i], regionEmulPhi[i] + n * 0.2, bitDifference[n]);
919  }
920  if (n >= 5) {
921  rctRegBitDiff_->Fill(regionEmulEta[i] + 0.5, regionEmulPhi[i] + (n - 5) * 0.2, bitDifference[n]);
922  }
923  }
924  }
925  // Weight is for ROOT; should just exceed 0.99
926  // NOTE: Weight is different for eff 2 because this isn't filled initially
927 
928  regFound = kTRUE;
929  }
930 
931  if (regionEmulOverFlow[i] == true && regionDataOverFlow[i] == true) {
932  rctBitMatchedOverFlow2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98001);
933  overFlowFound = kTRUE;
934  }
935 
936  if (regionEmulTauVeto[i] == true && regionDataTauVeto[i] == true) {
937  rctBitMatchedTauVeto2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98001);
938  tauVetoFound = kTRUE;
939  }
940 
941  if (regionEmulMip[i] == true && regionDataMip[i] == true) {
942  rctBitMatchedMip2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98001);
943  mipFound = kTRUE;
944  }
945 
946  if (regionEmulQuiet[i] == true && regionDataQuiet[i] == true) {
947  rctBitMatchedQuiet2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98001);
948  quietFound = kTRUE;
949  }
950 
951  if (regionEmulHfPlusTau[i] == true && regionDataHfPlusTau[i] == true) {
952  rctBitMatchedHfPlusTau2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98001);
953  hfPlusTauFound = kTRUE;
954  }
955 
956  // }
957  // }
958 
959  if (regFound == kFALSE && regionEmulRank[i] >= 1) {
960  int chnl;
961 
962  bitset<10> bit(regionEmulRank[i]);
963  for (size_t n = 0; n < bit.size(); n++) {
964  if (n < 5) {
965  rctRegBitOff_->Fill(regionEmulEta[i], regionEmulPhi[i] + n * 0.2, bit[n]);
966  }
967  if (n >= 5) {
968  rctRegBitOff_->Fill(regionEmulEta[i] + 0.5, regionEmulPhi[i] + (n - 5) * 0.2, bit[n]);
969  }
970  }
971 
972  chnl = PHIBINS * regionEmulEta[i] + regionEmulPhi[i];
974  rctRegUnmatchedEmulOcc2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98);
975  // Weight is for ROOT; when added to initial weight of 0.01, should equal 0.99
976 
978  rctRegIneffChannel_[chnl]->Fill(regionEmulRank[i]);
979  }
980 
981  if (overFlowFound == kFALSE && regionEmulOverFlow[i] == true) {
982  rctBitUnmatchedEmulOverFlow2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98);
983  }
984 
985  if (tauVetoFound == kFALSE && regionEmulTauVeto[i] == true) {
986  rctBitUnmatchedEmulTauVeto2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98);
987  }
988 
989  if (mipFound == kFALSE && regionEmulMip[i] == true) {
990  rctBitUnmatchedEmulMip2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98);
991  }
992 
993  if (quietFound == kFALSE && regionEmulQuiet[i] == true) {
994  rctBitUnmatchedEmulQuiet2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98);
995  }
996 
997  if (hfPlusTauFound == kFALSE && regionEmulHfPlusTau[i] == true) {
998  rctBitUnmatchedEmulHfPlusTau2D_->Fill(regionEmulEta[i], regionEmulPhi[i], 0.98);
999  }
1000  }
1001 
1004  // DivideME1D(rctRegSpEffOcc1D_, rctRegEmulOcc1D_, rctRegSpEff1D_);
1005  // DivideME2D(rctRegSpEffOcc2D_, rctRegEmulOcc2D_, rctRegSpEff2D_);
1008  // DivideME1D(rctRegSpIneffOcc1D_, rctRegEmulOcc1D_, rctRegSpIneff1D_);
1009  // DivideME2D(rctRegSpIneffOcc2D_, rctRegEmulOcc2D_, rctRegSpIneff2D_);
1015  // QUIETBIT: To add quiet bit information, uncomment following line:
1016  // DivideME2D (rctBitMatchedQuiet2D_, rctBitEmulQuiet2D_, rctBitQuietEff2D_);
1018 
1024  // QUIETBIT: To add quiet bit information, uncomment the following line:
1025  // DivideME2D (rctBitUnmatchedEmulQuiet2D_, rctBitEmulQuiet2D_, rctBitQuietIneff2D_);
1027 
1028  // for(int i = 0; i < nRegionData; i++)
1029  for (int i = 0; i < (int)PhiEtaMax; i++) {
1030  Bool_t regFound = kFALSE;
1031  Bool_t overFlowFound = kFALSE;
1032  Bool_t tauVetoFound = kFALSE;
1033  Bool_t mipFound = kFALSE;
1034  Bool_t quietFound = kFALSE;
1035  Bool_t hfPlusTauFound = kFALSE;
1036 
1037  // for(int j = 0; j < nRegionEmul; j++)
1038  // {
1039  // if(regionEmulEta[j] == regionDataEta[i] &&
1040  // regionEmulPhi[j] == regionDataPhi[i])
1041  // {
1042 
1043  if (regionEmulRank[i] >= 1 && regionDataRank[i] >= 1)
1044  regFound = kTRUE;
1045 
1046  if (regionDataOverFlow[i] == true && regionEmulOverFlow[i] == true)
1047  overFlowFound = kTRUE;
1048 
1049  if (regionDataTauVeto[i] == true && regionEmulTauVeto[i] == true)
1050  tauVetoFound = kTRUE;
1051 
1052  if (regionDataMip[i] == true && regionEmulMip[i] == true)
1053  mipFound = kTRUE;
1054 
1055  if (regionDataQuiet[i] == true && regionEmulQuiet[i] == true)
1056  quietFound = kTRUE;
1057 
1058  if (regionDataHfPlusTau[i] == true && regionEmulHfPlusTau[i] == true)
1059  hfPlusTauFound = kTRUE;
1060  // }
1061  // }
1062 
1063  if (regFound == kFALSE && regionDataRank[i] >= 1) {
1064  int chnl;
1065 
1066  bitset<10> bit(regionDataRank[i]);
1067  for (size_t n = 0; n < bit.size(); n++) {
1068  if (n < 5) {
1069  rctRegBitOn_->Fill(regionDataEta[i], regionDataPhi[i] + n * 0.2, bit[n]);
1070  }
1071  if (n >= 5) {
1072  rctRegBitOn_->Fill(regionDataEta[i] + 0.5, regionDataPhi[i] + (n - 5) * 0.2, bit[n]);
1073  }
1074  }
1075 
1076  chnl = PHIBINS * regionDataEta[i] + regionDataPhi[i];
1078  rctRegUnmatchedDataOcc2D_->Fill(regionDataEta[i], regionDataPhi[i], 0.98);
1079  // Weight is for ROOT; when added to initial weight of 0.01, should equal 0.99
1080 
1081  // we try a new definition of overefficiency:
1082  // DivideME1D(rctRegUnmatchedDataOcc1D_, rctRegDataOcc1D_, rctRegOvereff1D_);
1083  // DivideME2D(rctRegUnmatchedDataOcc2D_, rctRegDataOcc2D_, rctRegOvereff2D_);
1084 
1086  rctRegOvereffChannel_[chnl]->Fill(regionDataRank[i]);
1087  }
1088 
1089  if (overFlowFound == kFALSE && regionDataOverFlow[i] == true) {
1090  rctBitUnmatchedDataOverFlow2D_->Fill(regionDataEta[i], regionDataPhi[i], 0.98);
1091  }
1092 
1093  if (tauVetoFound == kFALSE && regionDataTauVeto[i] == true) {
1094  rctBitUnmatchedDataTauVeto2D_->Fill(regionDataEta[i], regionDataPhi[i], 0.98);
1095  }
1096 
1097  if (mipFound == kFALSE && regionDataMip[i] == true) {
1098  rctBitUnmatchedDataMip2D_->Fill(regionDataEta[i], regionDataPhi[i], 0.98);
1099  }
1100 
1101  if (quietFound == kFALSE && regionDataQuiet[i] == true) {
1102  rctBitUnmatchedDataQuiet2D_->Fill(regionDataEta[i], regionDataPhi[i], 0.98);
1103  }
1104 
1105  if (hfPlusTauFound == kFALSE && regionDataHfPlusTau[i] == true) {
1106  rctBitUnmatchedDataHfPlusTau2D_->Fill(regionDataEta[i], regionDataPhi[i], 0.98);
1107  }
1108  }
1109 
1110  // we try a new definition of overefficiency:
1116  // QUIETBIT: To add quiet bit information, uncomment following 2 lines:
1117  // DivideME2D (rctBitUnmatchedDataQuiet2D_, rctBitDataQuiet2D_,
1118  // rctBitQuietOvereff2D_);
1120 }
1121 
1123  TH2F* num = numerator->getTH2F();
1124  TH2F* den = denominator->getTH2F();
1125  TH2F* res = result->getTH2F();
1126 
1127  res->Divide(num, den, 1, 1, "");
1128 }
1129 
1131  TH1F* num = numerator->getTH1F();
1132  TH1F* den = denominator->getTH1F();
1133  TH1F* res = result->getTH1F();
1134 
1135  res->Divide(num, den, 1, 1, "");
1136 }
1137 
1139  // get hold of back-end interface
1140  nev_ = 0;
1141  //DQMStore *dbe = 0;
1142  //dbe = Service < DQMStore > ().operator->();
1143 
1144  //if (dbe) {
1145  // dbe->setCurrentFolder(histFolder_);
1146  // dbe->rmdir(histFolder_);
1147  //}
1148 
1149  //if (dbe) {
1150 
1151  ibooker.setCurrentFolder(histFolder_);
1152 
1153  triggerType_ = ibooker.book1D("TriggerType", "TriggerType", 17, -0.5, 16.5);
1154 
1155  triggerAlgoNumbers_ = ibooker.book1D("gtTriggerAlgoNumbers", "gtTriggerAlgoNumbers", 128, -0.5, 127.5);
1156 
1157  rctInputTPGEcalOcc_ = ibooker.book2D(
1158  "rctInputTPGEcalOcc", "rctInputTPGEcalOcc", TPGETABINS, TPGETAMIN, TPGETAMAX, TPGPHIBINS, TPGPHIMIN, TPGPHIMAX);
1159 
1160  rctInputTPGEcalOccNoCut_ = ibooker.book2D("rctInputTPGEcalOccNoCut",
1161  "rctInputTPGEcalOccNoCut",
1162  TPGETABINS,
1163  TPGETAMIN,
1164  TPGETAMAX,
1165  TPGPHIBINS,
1166  TPGPHIMIN,
1167  TPGPHIMAX);
1168 
1169  rctInputTPGEcalRank_ = ibooker.book1D("rctInputTPGEcalRank", "rctInputTPGEcalRank", TPGRANK, TPGRANKMIN, TPGRANKMAX);
1170 
1171  rctInputTPGHcalOcc_ = ibooker.book2D(
1172  "rctInputTPGHcalOcc", "rctInputTPGHcalOcc", TPGETABINS, TPGETAMIN, TPGETAMAX, TPGPHIBINS, TPGPHIMIN, TPGPHIMAX);
1173 
1174  rctInputTPGHcalSample_ = ibooker.book1D("rctInputTPGHcalSample", "rctInputTPGHcalSample", 10, -0.5, 9.5);
1175 
1176  rctInputTPGHcalRank_ = ibooker.book1D("rctInputTPGHcalRank", "rctInputTPGHcalRank", TPGRANK, TPGRANKMIN, TPGRANKMAX);
1177 
1178  ibooker.setCurrentFolder(histFolder_ + "/EffCurves/NisoEm/");
1179 
1180  trigEffThresh_ = ibooker.book2D("trigEffThresh",
1181  "Rank occupancy >= 2x trig thresh (source: " + dataInputTagName_ + ")",
1182  ETABINS,
1183  ETAMIN,
1184  ETAMAX,
1185  PHIBINS,
1186  PHIMIN,
1187  PHIMAX);
1188 
1189  ibooker.setCurrentFolder(histFolder_ + "/EffCurves/NisoEm/ServiceData");
1190 
1191  trigEffThreshOcc_ = ibooker.book2D("trigEffThreshOcc",
1192  "Rank occupancy >= 2x trig thresh (source: " + dataInputTagName_ + ")",
1193  ETABINS,
1194  ETAMIN,
1195  ETAMAX,
1196  PHIBINS,
1197  PHIMIN,
1198  PHIMAX);
1200  ibooker.book2D("trigEffTriggThreshOcc",
1201  "Rank occupancy >= 2x trig thresh, triggered (source: " + dataInputTagName_ + ")",
1202  ETABINS,
1203  ETAMIN,
1204  ETAMAX,
1205  PHIBINS,
1206  PHIMIN,
1207  PHIMAX);
1208 
1209  ibooker.setCurrentFolder(histFolder_ + "/IsoEm");
1210 
1211  rctIsoEmEff1_ = ibooker.book2D("rctIsoEmEff1",
1212  "rctIsoEmEff1 (source: " + dataInputTagName_ + ")",
1213  ETABINS,
1214  ETAMIN,
1215  ETAMAX,
1216  PHIBINS,
1217  PHIMIN,
1218  PHIMAX);
1219 
1220  rctIsoEmEff1oneD_ = ibooker.book1D("rctIsoEmEff1oneD", "rctIsoEmEff1oneD", CHNLBINS, CHNLMIN, CHNLMAX);
1221 
1222  rctIsoEmEff2_ = ibooker.book2D("rctIsoEmEff2",
1223  "rctIsoEmEff2, energy matching required (source: " + dataInputTagName_ + ")",
1224  ETABINS,
1225  ETAMIN,
1226  ETAMAX,
1227  PHIBINS,
1228  PHIMIN,
1229  PHIMAX);
1230 
1232  ibooker.book1D("rctIsoEmEff2oneD", "rctIsoEmEff2oneD, energy matching required", CHNLBINS, CHNLMIN, CHNLMAX);
1233 
1234  rctIsoEmIneff2_ = ibooker.book2D("rctIsoEmIneff2",
1235  "rctIsoEmIneff2, energy matching required (source: " + dataInputTagName_ + ")",
1236  ETABINS,
1237  ETAMIN,
1238  ETAMAX,
1239  PHIBINS,
1240  PHIMIN,
1241  PHIMAX);
1242 
1244  ibooker.book1D("rctIsoEmIneff2oneD", "rctIsoEmIneff2oneD, energy matching required", CHNLBINS, CHNLMIN, CHNLMAX);
1245 
1246  rctIsoEmIneff_ = ibooker.book2D("rctIsoEmIneff",
1247  "rctIsoEmIneff (source: " + dataInputTagName_ + ")",
1248  ETABINS,
1249  ETAMIN,
1250  ETAMAX,
1251  PHIBINS,
1252  PHIMIN,
1253  PHIMAX);
1254 
1255  rctIsoEmIneff1D_ = ibooker.book1D("rctIsoEmIneff1D", "rctIsoEmIneff1D", CHNLBINS, CHNLMIN, CHNLMAX);
1256 
1257  rctIsoEmOvereff_ = ibooker.book2D("rctIsoEmOvereff",
1258  "rctIsoEmOvereff (source: " + dataInputTagName_ + ")",
1259  ETABINS,
1260  ETAMIN,
1261  ETAMAX,
1262  PHIBINS,
1263  PHIMIN,
1264  PHIMAX);
1265 
1266  rctIsoEmOvereff1D_ = ibooker.book1D("rctIsoEmOvereff1D", "rctIsoEmOvereff1D", CHNLBINS, CHNLMIN, CHNLMAX);
1267 
1268  ibooker.setCurrentFolder(histFolder_ + "/IsoEm/ServiceData");
1269 
1270  rctIsoEmDataOcc_ = ibooker.book2D("rctIsoEmDataOcc",
1271  "rctIsoEmDataOcc (source: " + dataInputTagName_ + ")",
1272  ETABINS,
1273  ETAMIN,
1274  ETAMAX,
1275  PHIBINS,
1276  PHIMIN,
1277  PHIMAX);
1278 
1279  rctIsoEmDataOcc1D_ = ibooker.book1D("rctIsoEmDataOcc1D", "rctIsoEmDataOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1280 
1281  rctIsoEmEmulOcc_ = ibooker.book2D("rctIsoEmEmulOcc",
1282  "rctIsoEmEmulOcc (source: " + dataInputTagName_ + ")",
1283  ETABINS,
1284  ETAMIN,
1285  ETAMAX,
1286  PHIBINS,
1287  PHIMIN,
1288  PHIMAX);
1289 
1290  rctIsoEmEmulOcc1D_ = ibooker.book1D("rctIsoEmEmulOcc1D", "rctIsoEmEmulOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1291 
1292  rctIsoEmEff1Occ_ = ibooker.book2D("rctIsoEmEff1Occ",
1293  "rctIsoEmEff1Occ (source: " + dataInputTagName_ + ")",
1294  ETABINS,
1295  ETAMIN,
1296  ETAMAX,
1297  PHIBINS,
1298  PHIMIN,
1299  PHIMAX);
1300 
1301  rctIsoEmEff1Occ1D_ = ibooker.book1D("rctIsoEmEff1Occ1D", "rctIsoEmEff1Occ1D", CHNLBINS, CHNLMIN, CHNLMAX);
1302 
1303  rctIsoEmEff2Occ_ = ibooker.book2D("rctIsoEmEff2Occ",
1304  "rctIsoEmEff2Occ (source: " + dataInputTagName_ + ")",
1305  ETABINS,
1306  ETAMIN,
1307  ETAMAX,
1308  PHIBINS,
1309  PHIMIN,
1310  PHIMAX);
1311 
1312  rctIsoEmEff2Occ1D_ = ibooker.book1D("rctIsoEmEff2Occ1D", "rctIsoEmEff2Occ1D", CHNLBINS, CHNLMIN, CHNLMAX);
1313 
1314  rctIsoEmIneff2Occ_ = ibooker.book2D("rctIsoEmIneff2Occ",
1315  "rctIsoEmIneff2Occ (source: " + dataInputTagName_ + ")",
1316  ETABINS,
1317  ETAMIN,
1318  ETAMAX,
1319  PHIBINS,
1320  PHIMIN,
1321  PHIMAX);
1322 
1323  rctIsoEmIneff2Occ1D_ = ibooker.book1D("rctIsoEmIneff2Occ1D", "rctIsoEmIneff2Occ1D", CHNLBINS, CHNLMIN, CHNLMAX);
1324 
1325  rctIsoEmIneffOcc_ = ibooker.book2D("rctIsoEmIneffOcc",
1326  "rctIsoEmIneffOcc (source: " + dataInputTagName_ + ")",
1327  ETABINS,
1328  ETAMIN,
1329  ETAMAX,
1330  PHIBINS,
1331  PHIMIN,
1332  PHIMAX);
1333 
1334  rctIsoEmIneffOcc1D_ = ibooker.book1D("rctIsoEmIneffOcc1D", "rctIsoEmIneffOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1335 
1336  rctIsoEmOvereffOcc_ = ibooker.book2D("rctIsoEmOvereffOcc",
1337  "rctIsoEmOvereffOcc (source: " + dataInputTagName_ + ")",
1338  ETABINS,
1339  ETAMIN,
1340  ETAMAX,
1341  PHIBINS,
1342  PHIMIN,
1343  PHIMAX);
1344 
1345  rctIsoEmOvereffOcc1D_ = ibooker.book1D("rctIsoEmOvereffOcc1D", "rctIsoEmOvereffOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1346 
1347  ibooker.setCurrentFolder(histFolder_ + "/NisoEm");
1348  rctNisoEmEff1_ = ibooker.book2D("rctNisoEmEff1",
1349  "rctNisoEmEff1 (source: " + dataInputTagName_ + ")",
1350  ETABINS,
1351  ETAMIN,
1352  ETAMAX,
1353  PHIBINS,
1354  PHIMIN,
1355  PHIMAX);
1356 
1357  rctNisoEmEff1oneD_ = ibooker.book1D("rctNisoEmEff1oneD", "rctNisoEmEff1oneD", CHNLBINS, CHNLMIN, CHNLMAX);
1358 
1359  rctNisoEmEff2_ = ibooker.book2D("rctNisoEmEff2",
1360  "rctNisoEmEff2, energy matching required (source: " + dataInputTagName_ + ")",
1361  ETABINS,
1362  ETAMIN,
1363  ETAMAX,
1364  PHIBINS,
1365  PHIMIN,
1366  PHIMAX);
1367 
1369  ibooker.book1D("rctNisoEmEff2oneD", "rctNisoEmEff2oneD, energy matching required", CHNLBINS, CHNLMIN, CHNLMAX);
1370 
1371  rctNisoEmIneff2_ = ibooker.book2D("rctNisoEmIneff2",
1372  "rctNisoEmIneff2, energy matching required (source: " + dataInputTagName_ + ")",
1373  ETABINS,
1374  ETAMIN,
1375  ETAMAX,
1376  PHIBINS,
1377  PHIMIN,
1378  PHIMAX);
1379 
1380  rctNisoEmIneff2oneD_ = ibooker.book1D(
1381  "rctNisoEmIneff2oneD", "rctNisoEmIneff2oneD, energy matching required", CHNLBINS, CHNLMIN, CHNLMAX);
1382 
1383  rctNisoEmIneff_ = ibooker.book2D("rctNisoEmIneff",
1384  "rctNisoEmIneff (source: " + dataInputTagName_ + ")",
1385  ETABINS,
1386  ETAMIN,
1387  ETAMAX,
1388  PHIBINS,
1389  PHIMIN,
1390  PHIMAX);
1391 
1392  rctNisoEmIneff1D_ = ibooker.book1D("rctNisoEmIneff1D", "rctNisoEmIneff1D", CHNLBINS, CHNLMIN, CHNLMAX);
1393 
1394  rctNisoEmOvereff_ = ibooker.book2D("rctNisoEmOvereff",
1395  "rctNisoEmOvereff (source: " + dataInputTagName_ + ")",
1396  ETABINS,
1397  ETAMIN,
1398  ETAMAX,
1399  PHIBINS,
1400  PHIMIN,
1401  PHIMAX);
1402 
1403  rctNisoEmOvereff1D_ = ibooker.book1D("rctNisoEmOvereff1D", "rctNisoEmOvereff1D", CHNLBINS, CHNLMIN, CHNLMAX);
1404 
1405  ibooker.setCurrentFolder(histFolder_ + "/NisoEm/ServiceData");
1406 
1407  rctNisoEmDataOcc_ = ibooker.book2D("rctNisoEmDataOcc",
1408  "rctNisoEmDataOcc (source: " + dataInputTagName_ + ")",
1409  ETABINS,
1410  ETAMIN,
1411  ETAMAX,
1412  PHIBINS,
1413  PHIMIN,
1414  PHIMAX);
1415 
1416  rctNisoEmDataOcc1D_ = ibooker.book1D("rctNisoEmDataOcc1D", "rctNisoEmDataOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1417 
1418  rctNisoEmEmulOcc_ = ibooker.book2D("rctNisoEmEmulOcc",
1419  "rctNisoEmEmulOcc (source: " + dataInputTagName_ + ")",
1420  ETABINS,
1421  ETAMIN,
1422  ETAMAX,
1423  PHIBINS,
1424  PHIMIN,
1425  PHIMAX);
1426 
1427  rctNisoEmEmulOcc1D_ = ibooker.book1D("rctNisoEmEmulOcc1D", "rctNisoEmEmulOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1428 
1429  rctNisoEmEff1Occ_ = ibooker.book2D("rctNisoEmEff1Occ",
1430  "rctNisoEmEff1Occ (source: " + dataInputTagName_ + ")",
1431  ETABINS,
1432  ETAMIN,
1433  ETAMAX,
1434  PHIBINS,
1435  PHIMIN,
1436  PHIMAX);
1437 
1438  rctNisoEmEff1Occ1D_ = ibooker.book1D("rctNisoEmEff1Occ1D", "rctNisoEmEff1Occ1D", CHNLBINS, CHNLMIN, CHNLMAX);
1439 
1440  rctNisoEmEff2Occ_ = ibooker.book2D("rctNisoEmEff2Occ",
1441  "rctNisoEmEff2Occ (source: " + dataInputTagName_ + ")",
1442  ETABINS,
1443  ETAMIN,
1444  ETAMAX,
1445  PHIBINS,
1446  PHIMIN,
1447  PHIMAX);
1448 
1449  rctNisoEmEff2Occ1D_ = ibooker.book1D("rctNisoEmEff2Occ1D", "rctNisoEmEff2Occ1D", CHNLBINS, CHNLMIN, CHNLMAX);
1450 
1451  rctNisoEmIneff2Occ_ = ibooker.book2D("rctNisoEmIneff2Occ",
1452  "rctNisoEmIneff2Occ (source: " + dataInputTagName_ + ")",
1453  ETABINS,
1454  ETAMIN,
1455  ETAMAX,
1456  PHIBINS,
1457  PHIMIN,
1458  PHIMAX);
1459 
1460  rctNisoEmIneff2Occ1D_ = ibooker.book1D("rctNisoEmIneff2Occ1D", "rctNisoEmIneff2Occ1D", CHNLBINS, CHNLMIN, CHNLMAX);
1461 
1462  rctNisoEmIneffOcc_ = ibooker.book2D("rctNisoEmIneffOcc",
1463  "rctNisoEmIneffOcc (source: " + dataInputTagName_ + ")",
1464  ETABINS,
1465  ETAMIN,
1466  ETAMAX,
1467  PHIBINS,
1468  PHIMIN,
1469  PHIMAX);
1470 
1471  rctNisoEmIneffOcc1D_ = ibooker.book1D("rctNisoEmIneffOcc1D", "rctNisoEmIneffOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1472 
1473  rctNisoEmOvereffOcc_ = ibooker.book2D("rctNisoEmOvereffOcc",
1474  "rctNisoEmOvereffOcc (source: " + dataInputTagName_ + ")",
1475  ETABINS,
1476  ETAMIN,
1477  ETAMAX,
1478  PHIBINS,
1479  PHIMIN,
1480  PHIMAX);
1481 
1482  rctNisoEmOvereffOcc1D_ = ibooker.book1D("rctNisoEmOvereffOcc1D", "rctNisoEmOvereffOcc1D", CHNLBINS, CHNLMIN, CHNLMAX);
1483 
1484  // region information
1485  ibooker.setCurrentFolder(histFolder_ + "/RegionData");
1486 
1487  rctRegEff1D_ = ibooker.book1D("rctRegEff1D", "1D region efficiency", CHNLBINS, CHNLMIN, CHNLMAX);
1488 
1489  rctRegIneff1D_ = ibooker.book1D("rctRegIneff1D", "1D region inefficiency", CHNLBINS, CHNLMIN, CHNLMAX);
1490 
1491  rctRegOvereff1D_ = ibooker.book1D("rctRegOvereff1D", "1D region overefficiency", CHNLBINS, CHNLMIN, CHNLMAX);
1492 
1493  rctRegSpEff1D_ =
1494  ibooker.book1D("rctRegSpEff1D", "1D region efficiency, energy matching required", CHNLBINS, CHNLMIN, CHNLMAX);
1495 
1497  ibooker.book1D("rctRegSpIneff1D", "1D region inefficiency, energy matching required", CHNLBINS, CHNLMIN, CHNLMAX);
1498 
1499  rctRegEff2D_ = ibooker.book2D("rctRegEff2D",
1500  "2D region efficiency (source: " + dataInputTagName_ + ")",
1501  ETABINS,
1502  ETAMIN,
1503  ETAMAX,
1504  PHIBINS,
1505  PHIMIN,
1506  PHIMAX);
1507 
1508  rctRegIneff2D_ = ibooker.book2D("rctRegIneff2D",
1509  "2D region inefficiency (source: " + dataInputTagName_ + ")",
1510  ETABINS,
1511  ETAMIN,
1512  ETAMAX,
1513  PHIBINS,
1514  PHIMIN,
1515  PHIMAX);
1516 
1517  rctRegOvereff2D_ = ibooker.book2D("rctRegOvereff2D",
1518  "2D region overefficiency (source: " + dataInputTagName_ + ")",
1519  ETABINS,
1520  ETAMIN,
1521  ETAMAX,
1522  PHIBINS,
1523  PHIMIN,
1524  PHIMAX);
1525 
1526  rctRegSpEff2D_ = ibooker.book2D("rctRegSpEff2D",
1527  "2D region efficiency, energy matching required (source: " + dataInputTagName_ + ")",
1528  ETABINS,
1529  ETAMIN,
1530  ETAMAX,
1531  PHIBINS,
1532  PHIMIN,
1533  PHIMAX);
1534 
1536  ibooker.book2D("rctRegSpIneff2D",
1537  "2D region inefficiency, energy matching required (source: " + dataInputTagName_ + ")",
1538  ETABINS,
1539  ETAMIN,
1540  ETAMAX,
1541  PHIBINS,
1542  PHIMIN,
1543  PHIMAX);
1544 
1545  ibooker.setCurrentFolder(histFolder_ + "/RegionData/ServiceData");
1546 
1547  rctRegDataOcc1D_ = ibooker.book1D("rctRegDataOcc1D", "1D region occupancy from data", CHNLBINS, CHNLMIN, CHNLMAX);
1548 
1549  rctRegEmulOcc1D_ = ibooker.book1D("rctRegEmulOcc1D", "1D region occupancy from emulator", CHNLBINS, CHNLMIN, CHNLMAX);
1550 
1552  ibooker.book1D("rctRegMatchedOcc1D", "1D region occupancy for matched hits", CHNLBINS, CHNLMIN, CHNLMAX);
1553 
1555  "rctRegUnmatchedDataOcc1D", "1D region occupancy for unmatched hardware hits", CHNLBINS, CHNLMIN, CHNLMAX);
1556 
1558  "rctRegUnmatchedEmulOcc1D", "1D region occupancy for unmatched emulator hits", CHNLBINS, CHNLMIN, CHNLMAX);
1559 
1560  rctRegSpEffOcc1D_ = ibooker.book1D(
1561  "rctRegSpEffOcc1D", "1D region occupancy for \\Delta E_{T} efficiency", CHNLBINS, CHNLMIN, CHNLMAX);
1562 
1563  rctRegSpIneffOcc1D_ = ibooker.book1D(
1564  "rctRegSpIneffOcc1D", "1D region occupancy for \\Delta E_{T} efficiency ", CHNLBINS, CHNLMIN, CHNLMAX);
1565 
1566  rctRegDataOcc2D_ = ibooker.book2D("rctRegDataOcc2D",
1567  "2D region occupancy from hardware (source: " + dataInputTagName_ + ")",
1568  ETABINS,
1569  ETAMIN,
1570  ETAMAX,
1571  PHIBINS,
1572  PHIMIN,
1573  PHIMAX);
1574 
1575  rctRegEmulOcc2D_ = ibooker.book2D(
1576  "rctRegEmulOcc2D", "2D region occupancy from emulator", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1577 
1578  rctRegMatchedOcc2D_ = ibooker.book2D(
1579  "rctRegMatchedOcc2D", "2D region occupancy for matched hits", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1580 
1581  rctRegUnmatchedDataOcc2D_ = ibooker.book2D("rctRegUnmatchedDataOcc2D",
1582  "2D region occupancy for unmatched hardware hits",
1583  ETABINS,
1584  ETAMIN,
1585  ETAMAX,
1586  PHIBINS,
1587  PHIMIN,
1588  PHIMAX);
1589 
1590  rctRegUnmatchedEmulOcc2D_ = ibooker.book2D("rctRegUnmatchedEmulOcc2D",
1591  "2D region occupancy for unmatched emulator hits",
1592  ETABINS,
1593  ETAMIN,
1594  ETAMAX,
1595  PHIBINS,
1596  PHIMIN,
1597  PHIMAX);
1598 
1599  // rctRegDeltaEt2D_ =
1600  // dbe->book2D("rctRegDeltaEt2D", " \\Delta E_{T} for each channel",
1601  // CHNLBINS, CHNLMIN, CHNLMAX, 100, -50., 50.);
1602 
1603  rctRegSpEffOcc2D_ = ibooker.book2D("rctRegSpEffOcc2D",
1604  "2D region occupancy for \\Delta E_{T} efficiency",
1605  ETABINS,
1606  ETAMIN,
1607  ETAMAX,
1608  PHIBINS,
1609  PHIMIN,
1610  PHIMAX);
1611 
1612  rctRegSpIneffOcc2D_ = ibooker.book2D("rctRegSpIneffOcc2D",
1613  "2D region occupancy for \\Delta E_{T} inefficiency",
1614  ETABINS,
1615  ETAMIN,
1616  ETAMAX,
1617  PHIBINS,
1618  PHIMIN,
1619  PHIMAX);
1620 
1621  // bit information
1622  ibooker.setCurrentFolder(histFolder_ + "/BitData");
1623 
1624  rctBitOverFlowEff2D_ = ibooker.book2D("rctBitOverFlowEff2D",
1625  "2D overflow bit efficiency (source: " + dataInputTagName_ + ")",
1626  ETABINS,
1627  ETAMIN,
1628  ETAMAX,
1629  PHIBINS,
1630  PHIMIN,
1631  PHIMAX);
1632 
1633  rctBitOverFlowIneff2D_ = ibooker.book2D("rctBitOverFlowIneff2D",
1634  "2D overflow bit inefficiency (source: " + dataInputTagName_ + ")",
1635  ETABINS,
1636  ETAMIN,
1637  ETAMAX,
1638  PHIBINS,
1639  PHIMIN,
1640  PHIMAX);
1641 
1642  rctBitOverFlowOvereff2D_ = ibooker.book2D("rctBitOverFlowOvereff2D",
1643  "2D overflow bit overefficiency (source: " + dataInputTagName_ + ")",
1644  ETABINS,
1645  ETAMIN,
1646  ETAMAX,
1647  PHIBINS,
1648  PHIMIN,
1649  PHIMAX);
1650 
1651  rctBitTauVetoEff2D_ = ibooker.book2D("rctBitTauVetoEff2D",
1652  "2D tau veto bit efficiency (source: " + dataInputTagName_ + ")",
1653  ETABINS,
1654  ETAMIN,
1655  ETAMAX,
1656  PHIBINS,
1657  PHIMIN,
1658  PHIMAX);
1659 
1660  rctBitTauVetoIneff2D_ = ibooker.book2D("rctBitTauVetoIneff2D",
1661  "2D tau veto bit inefficiency (source: " + dataInputTagName_ + ")",
1662  ETABINS,
1663  ETAMIN,
1664  ETAMAX,
1665  PHIBINS,
1666  PHIMIN,
1667  PHIMAX);
1668 
1669  rctBitTauVetoOvereff2D_ = ibooker.book2D("rctBitTauVetoOvereff2D",
1670  "2D tau veto bit overefficiency (source: " + dataInputTagName_ + ")",
1671  ETABINS,
1672  ETAMIN,
1673  ETAMAX,
1674  PHIBINS,
1675  PHIMIN,
1676  PHIMAX);
1677 
1678  rctBitMipEff2D_ =
1679  ibooker.book2D("rctBitMipEff2D", "2D mip bit efficiency", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1680 
1682  ibooker.book2D("rctBitMipIneff2D", "2D mip bit inefficiency", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1683 
1684  rctBitMipOvereff2D_ = ibooker.book2D(
1685  "rctBitMipOvereff2D", "2D mip bit overefficiency", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1686 
1687  // QUIETBIT: To add quiet bit information, uncomment following 11 lines:
1688  // rctBitQuietEff2D_ =
1689  // dbe->book2D("rctBitQuietEff2D", "2D quiet bit efficiency",
1690  // ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1691 
1692  // rctBitQuietIneff2D_ =
1693  // dbe->book2D("rctBitQuietIneff2D", "2D quiet bit inefficiency",
1694  // ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1695 
1696  // rctBitQuietOvereff2D_ =
1697  // dbe->book2D("rctBitQuietOvereff2D", "2D quiet bit overefficiency",
1698  // ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1699 
1700  rctBitHfPlusTauEff2D_ = ibooker.book2D("rctBitHfPlusTauEff2D",
1701  "2D HfPlusTau bit efficiency (source: " + dataInputTagName_ + ")",
1702  ETABINS,
1703  ETAMIN,
1704  ETAMAX,
1705  PHIBINS,
1706  PHIMIN,
1707  PHIMAX);
1708 
1709  rctBitHfPlusTauIneff2D_ = ibooker.book2D("rctBitHfPlusTauIneff2D",
1710  "2D HfPlusTau bit inefficiency (source: " + dataInputTagName_ + ")",
1711  ETABINS,
1712  ETAMIN,
1713  ETAMAX,
1714  PHIBINS,
1715  PHIMIN,
1716  PHIMAX);
1717 
1718  rctBitHfPlusTauOvereff2D_ = ibooker.book2D("rctBitHfPlusTauOvereff2D",
1719  "2D HfPlusTau bit overefficiency (source: " + dataInputTagName_ + ")",
1720  ETABINS,
1721  ETAMIN,
1722  ETAMAX,
1723  PHIBINS,
1724  PHIMIN,
1725  PHIMAX);
1726 
1727  ibooker.setCurrentFolder(histFolder_ + "/BitData/ServiceData");
1728 
1729  rctBitEmulOverFlow2D_ = ibooker.book2D(
1730  "rctBitEmulOverFlow2D", "2D overflow bit from emulator", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1731 
1732  rctBitDataOverFlow2D_ = ibooker.book2D("rctBitDataOverFlow2D",
1733  "2D overflow bit from hardware (source: " + dataInputTagName_ + ")",
1734  ETABINS,
1735  ETAMIN,
1736  ETAMAX,
1737  PHIBINS,
1738  PHIMIN,
1739  PHIMAX);
1740 
1741  rctBitMatchedOverFlow2D_ = ibooker.book2D(
1742  "rctBitMatchedOverFlow2D", "2D overflow bit for matched hits", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1743 
1744  rctBitUnmatchedEmulOverFlow2D_ = ibooker.book2D("rctBitUnmatchedEmulOverFlow2D",
1745  "2D overflow bit for unmatched emulator hits",
1746  ETABINS,
1747  ETAMIN,
1748  ETAMAX,
1749  PHIBINS,
1750  PHIMIN,
1751  PHIMAX);
1752 
1753  rctBitUnmatchedDataOverFlow2D_ = ibooker.book2D("rctBitUnmatchedDataOverFlow2D",
1754  "2D overflow bit for unmatched hardware hits",
1755  ETABINS,
1756  ETAMIN,
1757  ETAMAX,
1758  PHIBINS,
1759  PHIMIN,
1760  PHIMAX);
1761 
1762  rctBitEmulTauVeto2D_ = ibooker.book2D(
1763  "rctBitEmulTauVeto2D", "2D tau veto bit from emulator", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1764 
1765  rctBitDataTauVeto2D_ = ibooker.book2D("rctBitDataTauVeto2D",
1766  "2D tau veto bit from hardware (source: " + dataInputTagName_ + ")",
1767  ETABINS,
1768  ETAMIN,
1769  ETAMAX,
1770  PHIBINS,
1771  PHIMIN,
1772  PHIMAX);
1773 
1774  rctBitMatchedTauVeto2D_ = ibooker.book2D(
1775  "rctBitMatchedTauVeto2D", "2D tau veto bit for matched hits", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1776 
1777  rctBitUnmatchedEmulTauVeto2D_ = ibooker.book2D("rctBitUnmatchedEmulTauVeto2D",
1778  "2D tau veto bit for unmatched emulator hits",
1779  ETABINS,
1780  ETAMIN,
1781  ETAMAX,
1782  PHIBINS,
1783  PHIMIN,
1784  PHIMAX);
1785 
1786  rctBitUnmatchedDataTauVeto2D_ = ibooker.book2D("rctBitUnmatchedDataTauVeto2D",
1787  "2D tau veto bit for unmatched hardware hits",
1788  ETABINS,
1789  ETAMIN,
1790  ETAMAX,
1791  PHIBINS,
1792  PHIMIN,
1793  PHIMAX);
1794 
1796  ibooker.book2D("rctBitEmulMip2D", "2D mip bit from emulator", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1797 
1799  ibooker.book2D("rctBitDataMip2D", "2D mip bit from hardware", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1800 
1801  rctBitMatchedMip2D_ = ibooker.book2D(
1802  "rctBitMatchedMip2D", "2D mip bit for matched hits", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1803 
1804  rctBitUnmatchedEmulMip2D_ = ibooker.book2D("rctBitUnmatchedEmulMip2D",
1805  "2D mip bit for unmatched emulator hits",
1806  ETABINS,
1807  ETAMIN,
1808  ETAMAX,
1809  PHIBINS,
1810  PHIMIN,
1811  PHIMAX);
1812 
1813  rctBitUnmatchedDataMip2D_ = ibooker.book2D("rctBitUnmatchedDataMip2D",
1814  "2D mip bit for unmatched hardware hits",
1815  ETABINS,
1816  ETAMIN,
1817  ETAMAX,
1818  PHIBINS,
1819  PHIMIN,
1820  PHIMAX);
1821 
1822  rctBitEmulQuiet2D_ = ibooker.book2D(
1823  "rctBitEmulQuiet2D", "2D quiet bit from emulator", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1824 
1825  rctBitDataQuiet2D_ = ibooker.book2D(
1826  "rctBitDataQuiet2D", "2D quiet bit from hardware", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1827 
1828  rctBitMatchedQuiet2D_ = ibooker.book2D(
1829  "rctBitMatchedQuiet2D", "2D quiet bit for matched hits", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1830 
1831  rctBitUnmatchedEmulQuiet2D_ = ibooker.book2D("rctBitUnmatchedEmulQuiet2D",
1832  "2D quiet bit for unmatched emulator hits",
1833  ETABINS,
1834  ETAMIN,
1835  ETAMAX,
1836  PHIBINS,
1837  PHIMIN,
1838  PHIMAX);
1839 
1840  rctBitUnmatchedDataQuiet2D_ = ibooker.book2D("rctBitUnmatchedDataQuiet2D",
1841  "2D quiet bit for unmatched hardware hits",
1842  ETABINS,
1843  ETAMIN,
1844  ETAMAX,
1845  PHIBINS,
1846  PHIMIN,
1847  PHIMAX);
1848 
1849  rctBitEmulHfPlusTau2D_ = ibooker.book2D(
1850  "rctBitEmulHfPlusTau2D", "2D HfPlusTau bit from emulator", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1851 
1852  rctBitDataHfPlusTau2D_ = ibooker.book2D("rctBitDataHfPlusTau2D",
1853  "2D HfPlusTau bit from hardware (source: " + dataInputTagName_ + ")",
1854  ETABINS,
1855  ETAMIN,
1856  ETAMAX,
1857  PHIBINS,
1858  PHIMIN,
1859  PHIMAX);
1860 
1862  "rctBitMatchedHfPlusTau2D", "2D HfPlusTau bit for matched hits", ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
1863 
1864  rctBitUnmatchedEmulHfPlusTau2D_ = ibooker.book2D("rctBitUnmatchedEmulHfPlusTau2D",
1865  "2D HfPlusTau bit for unmatched emulator hits",
1866  ETABINS,
1867  ETAMIN,
1868  ETAMAX,
1869  PHIBINS,
1870  PHIMIN,
1871  PHIMAX);
1872 
1873  rctBitUnmatchedDataHfPlusTau2D_ = ibooker.book2D("rctBitUnmatchedDataHfPlusTau2D",
1874  "2D HfPlusTau bit for unmatched hardware hits",
1875  ETABINS,
1876  ETAMIN,
1877  ETAMAX,
1878  PHIBINS,
1879  PHIMIN,
1880  PHIMAX);
1881 
1882  ibooker.setCurrentFolder(histFolder_ + "/BitMon");
1883  rctRegBitOn_ = ibooker.book2D("rctRegBitOn",
1884  "Monitoring for Bits Stuck On",
1885  BITETABINS,
1886  BITETAMIN,
1887  BITETAMAX,
1888  BITRPHIBINS,
1889  BITRPHIMIN,
1890  BITRPHIMAX);
1891 
1892  rctRegBitOff_ = ibooker.book2D("rctRegBitOff",
1893  "Monitoring for Bits Stuck Off",
1894  BITETABINS,
1895  BITETAMIN,
1896  BITETAMAX,
1897  BITRPHIBINS,
1898  BITRPHIMIN,
1899  BITRPHIMAX);
1900 
1901  rctRegBitDiff_ = ibooker.book2D("rctRegBitDiff",
1902  "Monitoring for Bits Difference",
1903  BITETABINS,
1904  BITETAMIN,
1905  BITETAMAX,
1906  BITRPHIBINS,
1907  BITRPHIMIN,
1908  BITRPHIMAX);
1909 
1910  rctIsoEmBitOn_ = ibooker.book2D("rctIsoEmBitOn",
1911  "Monitoring for Bits Stuck On",
1912  BITETABINS,
1913  BITETAMIN,
1914  BITETAMAX,
1915  BITPHIBINS,
1916  BITPHIMIN,
1917  BITPHIMAX);
1918 
1919  rctIsoEmBitOff_ = ibooker.book2D("rctIsoEmBitOff",
1920  "Monitoring for Bits Stuck Off",
1921  BITETABINS,
1922  BITETAMIN,
1923  BITETAMAX,
1924  BITPHIBINS,
1925  BITPHIMIN,
1926  BITPHIMAX);
1927 
1928  rctIsoEmBitDiff_ = ibooker.book2D("rctIsoEmBitDiff",
1929  "Monitoring for Bits Difference",
1930  BITETABINS,
1931  BITETAMIN,
1932  BITETAMAX,
1933  BITPHIBINS,
1934  BITPHIMIN,
1935  BITPHIMAX);
1936 
1937  rctNIsoEmBitOn_ = ibooker.book2D("rctNIsoEmBitOn",
1938  "Monitoring for Bits Stuck On",
1939  BITETABINS,
1940  BITETAMIN,
1941  BITETAMAX,
1942  BITPHIBINS,
1943  BITPHIMIN,
1944  BITPHIMAX);
1945 
1946  rctNIsoEmBitOff_ = ibooker.book2D("rctNIsoEmBitOff",
1947  "Monitoring for Bits Stuck Off",
1948  BITETABINS,
1949  BITETAMIN,
1950  BITETAMAX,
1951  BITPHIBINS,
1952  BITPHIMIN,
1953  BITPHIMAX);
1954 
1955  rctNIsoEmBitDiff_ = ibooker.book2D("rctNIsoEmBitDiff",
1956  "Monitoring for Bits Difference",
1957  BITETABINS,
1958  BITETAMIN,
1959  BITETAMAX,
1960  BITPHIBINS,
1961  BITPHIMIN,
1962  BITPHIMAX);
1963 
1964  ibooker.setCurrentFolder(histFolder_ + "/DBData");
1965  fedVectorMonitorRUN_ = ibooker.book2D("rctFedVectorMonitorRUN", "FED Vector Monitor Per Run", 108, 0, 108, 2, 0, 2);
1966  if (!perLSsaving_)
1967  fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS", 108, 0, 108, 2, 0, 2);
1968 
1969  std::map<unsigned int, unsigned int> repeats;
1970  for (unsigned int i = 0; i < 108; ++i) {
1971  repeats[crateFED[i]] = 0;
1972  }
1973  for (unsigned int i = 0; i < 108; ++i) {
1974  char fed[10];
1975  if (0 == repeats[crateFED[i]]++) {
1976  sprintf(fed, "%d", crateFED[i]);
1977  } else {
1978  sprintf(fed, "%d_%d", crateFED[i], repeats[crateFED[i]]);
1979  }
1980  fedVectorMonitorRUN_->setBinLabel(i + 1, fed);
1981  if (!perLSsaving_)
1982  fedVectorMonitorLS_->setBinLabel(i + 1, fed);
1983  }
1984  fedVectorMonitorRUN_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT");
1985  fedVectorMonitorRUN_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN");
1986  if (!perLSsaving_) {
1987  fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(1, "OUT");
1988  fedVectorMonitorLS_->getTH2F()->GetYaxis()->SetBinLabel(2, "IN");
1989  }
1990 
1991  // for single channels
1992 
1993  if (singlechannelhistos_) {
1994  for (int m = 0; m < 12; m++) {
1995  if (m == 0)
1996  ibooker.setCurrentFolder(histFolder_ + "/IsoEm/ServiceData/Eff1SnglChnls");
1997  if (m == 1)
1998  ibooker.setCurrentFolder(histFolder_ + "/NisoEm/ServiceData/Eff1SnglChnls");
1999  if (m == 2)
2000  ibooker.setCurrentFolder(histFolder_ + "/RegionData/ServiceData/EffSnglChnls");
2001  if (m == 3)
2002  ibooker.setCurrentFolder(histFolder_ + "/IsoEm/ServiceData/IneffSnglChnls");
2003  if (m == 4)
2004  ibooker.setCurrentFolder(histFolder_ + "/NisoEm/ServiceData/IneffSnglChnls");
2005  if (m == 5)
2006  ibooker.setCurrentFolder(histFolder_ + "/RegionData/ServiceData/IneffSnglChnls");
2007  if (m == 6)
2008  ibooker.setCurrentFolder(histFolder_ + "/IsoEm/ServiceData/OvereffSnglChnls");
2009  if (m == 7)
2010  ibooker.setCurrentFolder(histFolder_ + "/NisoEm/ServiceData/OvereffSnglChnls");
2011  if (m == 8)
2012  ibooker.setCurrentFolder(histFolder_ + "/RegionData/ServiceData/OvereffSnglChnls");
2013  if (m == 9)
2014  ibooker.setCurrentFolder(histFolder_ + "/EffCurves/NisoEm/ServiceData/SingleChannels");
2015  if (m == 10)
2016  ibooker.setCurrentFolder(histFolder_ + "/EffCurves/NisoEm/ServiceData/SingleChannels");
2017  if (m == 11)
2018  ibooker.setCurrentFolder(histFolder_ + "/EffCurves/NisoEm/ServiceData/SingleChannels");
2019 
2020  for (int i = 0; i < ETAMAX; i++) {
2021  for (int j = 0; j < PHIMAX; j++) {
2022  char name[80], channel[80] = {""};
2023 
2024  if (m == 0)
2025  strcpy(name, "(Eemul-Edata)Chnl");
2026  if (m == 1)
2027  strcpy(name, "(Eemul-Edata)Chnl");
2028  if (m == 2)
2029  strcpy(name, "(Eemul-Edata)Chnl");
2030  if (m == 3)
2031  strcpy(name, "EemulChnl");
2032  if (m == 4)
2033  strcpy(name, "EemulChnl");
2034  if (m == 5)
2035  strcpy(name, "EemulChnl");
2036  if (m == 6)
2037  strcpy(name, "EdataChnl");
2038  if (m == 7)
2039  strcpy(name, "EdataChnl");
2040  if (m == 8)
2041  strcpy(name, "EdataChnl");
2042  if (m == 9)
2043  strcpy(name, "EemulChnlEff");
2044  if (m == 10)
2045  strcpy(name, "EemulChnlTrig");
2046  if (m == 11)
2047  strcpy(name, "EemulChnl");
2048 
2049  if (i < 10 && j < 10)
2050  sprintf(channel, "_0%d0%d", i, j);
2051  else if (i < 10)
2052  sprintf(channel, "_0%d%d", i, j);
2053  else if (j < 10)
2054  sprintf(channel, "_%d0%d", i, j);
2055  else
2056  sprintf(channel, "_%d%d", i, j);
2057  strcat(name, channel);
2058 
2059  int chnl = PHIBINS * i + j;
2060 
2061  if (m == 0)
2062  rctIsoEffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2063  if (m == 1)
2064  rctNisoEffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2065  if (m == 2)
2066  rctRegEffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2067  if (m == 3)
2068  rctIsoIneffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2069  if (m == 4)
2070  rctNisoIneffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2071  if (m == 5)
2072  rctRegIneffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2073  if (m == 6)
2074  rctIsoOvereffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2075  if (m == 7)
2076  rctNisoOvereffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2077  if (m == 8)
2078  rctRegOvereffChannel_[chnl] = ibooker.book1D(name, name, DEBINS, DEMIN, DEMAX);
2079  if (m == 9)
2080  trigEff_[chnl] = ibooker.book1D(name, name, ELBINS, ELMIN, ELMAX);
2081  if (m == 10)
2082  trigEffOcc_[chnl] = ibooker.book1D(name, name, ELBINS, ELMIN, ELMAX);
2083  if (m == 11)
2084  trigEffTriggOcc_[chnl] = ibooker.book1D(name, name, ELBINS, ELMIN, ELMAX);
2085  }
2086  }
2087  }
2088  }
2089 
2090  //end of single channels
2091 
2092  notrigCount = 0;
2093  trigCount = 0;
2094 
2095  readFEDVector(fedVectorMonitorRUN_, es, false);
2096 }
2097 
2098 std::shared_ptr<l1tderct::Empty> L1TdeRCT::globalBeginLuminosityBlock(const edm::LuminosityBlock& ls,
2099  const edm::EventSetup& es) const {
2100  if (!perLSsaving_)
2102  return std::shared_ptr<l1tderct::Empty>();
2103 }
2104 
2105 void L1TdeRCT::readFEDVector(MonitorElement* histogram, const edm::EventSetup& es, const bool isLumitransition) const {
2106  // adding fed mask into channel mask
2107  //edm::ESHandle<RunInfo> sum;
2108  //es.get<RunInfoRcd>().get(sum);
2109  const auto& sum = isLumitransition ? es.getHandle(runInfolumiToken_) : es.getHandle(runInfoToken_);
2110  const RunInfo* summary = sum.product();
2111 
2112  std::vector<int> caloFeds; // pare down the feds to the intresting ones
2113 
2114  const std::vector<int> Feds = summary->m_fed_in;
2115  for (std::vector<int>::const_iterator cf = Feds.begin(); cf != Feds.end(); ++cf) {
2116  int fedNum = *cf;
2117  if ((fedNum > 600 && fedNum < 724) || fedNum == 1118 || fedNum == 1120 || fedNum == 1122)
2118  caloFeds.push_back(fedNum);
2119  }
2120 
2121  for (unsigned int i = 0; i < 108; ++i) {
2122  std::vector<int>::iterator fv = std::find(caloFeds.begin(), caloFeds.end(), crateFED[i]);
2123  if (fv != caloFeds.end()) {
2124  histogram->setBinContent(i + 1, 2, 1);
2125  histogram->setBinContent(i + 1, 1, 0);
2126  } else {
2127  histogram->setBinContent(i + 1, 2, 0);
2128  histogram->setBinContent(i + 1, 1, 1);
2129  }
2130  }
2131 }
MonitorElement * rctBitUnmatchedDataTauVeto2D_
Definition: L1TdeRCT.h:127
void DivideME2D(MonitorElement *numerator, MonitorElement *denominator, MonitorElement *result)
Definition: L1TdeRCT.cc:1122
void readFEDVector(MonitorElement *, const edm::EventSetup &, const bool isLumitransition=true) const
Definition: L1TdeRCT.cc:2105
MonitorElement * rctRegUnmatchedDataOcc1D_
Definition: L1TdeRCT.h:82
MonitorElement * rctIsoEmBitDiff_
Definition: L1TdeRCT.h:194
MonitorElement * rctRegMatchedOcc1D_
Definition: L1TdeRCT.h:81
MonitorElement * rctNisoEmEmulOcc1D_
Definition: L1TdeRCT.h:210
MonitorElement * rctNisoEmIneff2oneD_
Definition: L1TdeRCT.h:218
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::vector< L1CaloEmCand > L1CaloEmCollection
MonitorElement * rctNisoEmIneff1D_
Definition: L1TdeRCT.h:219
static const int crateFED[108]
Definition: L1TdeRCT.h:250
MonitorElement * rctNisoEmEff2Occ1D_
Definition: L1TdeRCT.h:212
MonitorElement * rctInputTPGHcalOcc_
Definition: L1TdeRCT.h:162
MonitorElement * rctNisoEmEff2oneD_
Definition: L1TdeRCT.h:217
MonitorElement * rctNisoEmIneff2Occ1D_
Definition: L1TdeRCT.h:213
const float ETAMAX
Definition: L1TCompare.cc:79
int selectBX_
Definition: L1TdeRCT.h:277
const unsigned int ETABINS
Definition: L1TCompare.cc:77
MonitorElement * rctBitMatchedTauVeto2D_
Definition: L1TdeRCT.h:125
MonitorElement * rctBitDataMip2D_
Definition: L1TdeRCT.h:132
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * rctBitUnmatchedDataHfPlusTau2D_
Definition: L1TdeRCT.h:152
int nev_
Definition: L1TdeRCT.h:255
const float ETAMIN
Definition: L1TCompare.cc:78
MonitorElement * rctBitEmulTauVeto2D_
Definition: L1TdeRCT.h:123
MonitorElement * rctIsoEmIneff2Occ_
Definition: L1TdeRCT.h:170
edm::ESGetToken< RunInfo, RunInfoRcd > runInfolumiToken_
Definition: L1TdeRCT.h:271
MonitorElement * trigEffThresh_
Definition: L1TdeRCT.h:240
MonitorElement * rctBitHfPlusTauIneff2D_
Definition: L1TdeRCT.h:154
bool verbose_
Definition: L1TdeRCT.h:257
MonitorElement * rctIsoEmIneff2Occ1D_
Definition: L1TdeRCT.h:183
MonitorElement * rctIsoEmEmulOcc1D_
Definition: L1TdeRCT.h:180
MonitorElement * rctBitUnmatchedEmulTauVeto2D_
Definition: L1TdeRCT.h:126
edm::EDGetTokenT< L1CaloEmCollection > rctSourceData_emData_
Definition: L1TdeRCT.h:264
MonitorElement * rctBitUnmatchedEmulQuiet2D_
Definition: L1TdeRCT.h:142
MonitorElement * trigEffThreshOcc_
Definition: L1TdeRCT.h:241
MonitorElement * rctNisoEffChannel_[396]
Definition: L1TdeRCT.h:230
MonitorElement * rctRegOvereff1D_
Definition: L1TdeRCT.h:89
std::vector< T >::const_iterator const_iterator
int doubleThreshold_
Definition: L1TdeRCT.h:273
MonitorElement * rctIsoEmEff2_
Definition: L1TdeRCT.h:174
MonitorElement * rctNisoEmOvereffOcc1D_
Definition: L1TdeRCT.h:215
MonitorElement * trigEffOcc_[396]
Definition: L1TdeRCT.h:244
const DecisionWord & decisionWord(int bxInEventValue) const
MonitorElement * rctRegOvereff2D_
Definition: L1TdeRCT.h:104
MonitorElement * rctIsoEmOvereffOcc1D_
Definition: L1TdeRCT.h:185
MonitorElement * triggerType_
Definition: L1TdeRCT.h:76
MonitorElement * rctBitTauVetoEff2D_
Definition: L1TdeRCT.h:128
MonitorElement * rctBitMatchedQuiet2D_
Definition: L1TdeRCT.h:141
const float PHIMAX
Definition: L1TCompare.cc:68
MonitorElement * rctBitTauVetoOvereff2D_
Definition: L1TdeRCT.h:130
MonitorElement * rctRegDataOcc1D_
Definition: L1TdeRCT.h:79
MonitorElement * rctIsoEmIneffOcc_
Definition: L1TdeRCT.h:171
MonitorElement * rctBitDataQuiet2D_
Definition: L1TdeRCT.h:140
MonitorElement * rctBitMatchedHfPlusTau2D_
Definition: L1TdeRCT.h:150
MonitorElement * rctIsoEmEff2Occ_
Definition: L1TdeRCT.h:169
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
MonitorElement * rctRegEmulOcc2D_
Definition: L1TdeRCT.h:94
MonitorElement * rctRegUnmatchedEmulOcc2D_
Definition: L1TdeRCT.h:97
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigisLabel_
Definition: L1TdeRCT.h:269
MonitorElement * rctRegSpEff2D_
Definition: L1TdeRCT.h:105
std::string histFolder_
Definition: L1TdeRCT.h:256
MonitorElement * rctBitUnmatchedEmulOverFlow2D_
Definition: L1TdeRCT.h:118
MonitorElement * rctIsoEmBitOn_
Definition: L1TdeRCT.h:192
Definition: Electron.h:6
MonitorElement * rctRegIneff2D_
Definition: L1TdeRCT.h:103
MonitorElement * rctIsoEmEff2Occ1D_
Definition: L1TdeRCT.h:182
const unsigned int PHIBINS
Definition: L1TCompare.cc:66
bool singlechannelhistos_
Definition: L1TdeRCT.h:258
MonitorElement * rctBitMipIneff2D_
Definition: L1TdeRCT.h:137
MonitorElement * rctBitOverFlowOvereff2D_
Definition: L1TdeRCT.h:122
MonitorElement * rctInputTPGHcalSample_
Definition: L1TdeRCT.h:164
MonitorElement * rctIsoEmOvereff_
Definition: L1TdeRCT.h:177
MonitorElement * rctBitDataOverFlow2D_
Definition: L1TdeRCT.h:116
MonitorElement * rctIsoEmDataOcc_
Definition: L1TdeRCT.h:166
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * fedVectorMonitorLS_
Definition: L1TdeRCT.h:252
void Fill(long long x)
MonitorElement * rctNisoEmEff1oneD_
Definition: L1TdeRCT.h:216
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalTPGData_
Definition: L1TdeRCT.h:268
MonitorElement * rctNisoEmIneff2Occ_
Definition: L1TdeRCT.h:200
MonitorElement * rctNisoEmOvereffOcc_
Definition: L1TdeRCT.h:202
char const * label
MonitorElement * rctRegBitOn_
Definition: L1TdeRCT.h:108
MonitorElement * rctRegBitDiff_
Definition: L1TdeRCT.h:110
MonitorElement * rctNisoEmDataOcc_
Definition: L1TdeRCT.h:196
MonitorElement * rctNisoEmIneff2_
Definition: L1TdeRCT.h:205
MonitorElement * rctBitDataHfPlusTau2D_
Definition: L1TdeRCT.h:149
std::string gtEGAlgoName_
Definition: L1TdeRCT.h:272
void DivideME1D(MonitorElement *numerator, MonitorElement *denominator, MonitorElement *result)
Definition: L1TdeRCT.cc:1130
MonitorElement * rctRegIneffChannel_[396]
Definition: L1TdeRCT.h:236
MonitorElement * rctInputTPGEcalOcc_
Definition: L1TdeRCT.h:159
MonitorElement * rctRegDataOcc2D_
Definition: L1TdeRCT.h:93
MonitorElement * rctInputTPGEcalRank_
Definition: L1TdeRCT.h:161
MonitorElement * rctIsoEmIneff1D_
Definition: L1TdeRCT.h:189
std::vector< bool > DecisionWord
typedefs
MonitorElement * rctBitMipOvereff2D_
Definition: L1TdeRCT.h:138
MonitorElement * trigEff_[396]
Definition: L1TdeRCT.h:243
MonitorElement * rctBitMatchedOverFlow2D_
Definition: L1TdeRCT.h:117
MonitorElement * rctBitEmulOverFlow2D_
Definition: L1TdeRCT.h:115
MonitorElement * rctRegEmulOcc1D_
Definition: L1TdeRCT.h:80
const float PHIMIN
Definition: L1TCompare.cc:67
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalTPGData_
Definition: L1TdeRCT.h:267
MonitorElement * rctIsoEmBitOff_
Definition: L1TdeRCT.h:193
MonitorElement * fedVectorMonitorRUN_
Definition: L1TdeRCT.h:251
MonitorElement * rctBitEmulMip2D_
Definition: L1TdeRCT.h:131
MonitorElement * rctIsoEmIneff2_
Definition: L1TdeRCT.h:175
MonitorElement * rctBitEmulQuiet2D_
Definition: L1TdeRCT.h:139
MonitorElement * rctNisoEmEmulOcc_
Definition: L1TdeRCT.h:197
Transition
Definition: Transition.h:12
MonitorElement * rctBitEmulHfPlusTau2D_
Definition: L1TdeRCT.h:148
MonitorElement * triggerAlgoNumbers_
Definition: L1TdeRCT.h:73
const_iterator begin() const
MonitorElement * rctNisoIneffChannel_[396]
Definition: L1TdeRCT.h:231
MonitorElement * rctRegSpIneff2D_
Definition: L1TdeRCT.h:106
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * rctIsoEmEmulOcc_
Definition: L1TdeRCT.h:167
MonitorElement * rctIsoEmEff1Occ_
Definition: L1TdeRCT.h:168
std::string dataInputTagName_
Definition: L1TdeRCT.h:279
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
MonitorElement * rctNisoEmOvereff1D_
Definition: L1TdeRCT.h:220
MonitorElement * rctNisoEmEff2Occ_
Definition: L1TdeRCT.h:199
MonitorElement * rctBitUnmatchedEmulHfPlusTau2D_
Definition: L1TdeRCT.h:151
MonitorElement * rctRegEff1D_
Definition: L1TdeRCT.h:87
MonitorElement * rctBitMatchedMip2D_
Definition: L1TdeRCT.h:133
MonitorElement * rctNisoEmEff2_
Definition: L1TdeRCT.h:204
std::shared_ptr< l1tderct::Empty > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const override
Definition: L1TdeRCT.cc:2098
MonitorElement * rctRegSpEff1D_
Definition: L1TdeRCT.h:90
const_iterator end() const
MonitorElement * rctIsoEmEff1Occ1D_
Definition: L1TdeRCT.h:181
MonitorElement * rctIsoEmEff1oneD_
Definition: L1TdeRCT.h:186
Log< level::Info, false > LogInfo
int notrigCount
Definition: L1TdeRCT.h:281
MonitorElement * rctNisoEmIneff_
Definition: L1TdeRCT.h:206
def ls(path, rec=False)
Definition: eostools.py:349
MonitorElement * rctRegSpEffOcc1D_
Definition: L1TdeRCT.h:84
MonitorElement * rctRegMatchedOcc2D_
Definition: L1TdeRCT.h:95
MonitorElement * rctNIsoEmBitDiff_
Definition: L1TdeRCT.h:224
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * rctBitHfPlusTauOvereff2D_
Definition: L1TdeRCT.h:155
MonitorElement * rctNisoEmEff1Occ_
Definition: L1TdeRCT.h:198
~L1TdeRCT() override
Definition: L1TdeRCT.cc:112
MonitorElement * rctIsoEmOvereff1D_
Definition: L1TdeRCT.h:190
MonitorElement * rctIsoEmEff1_
Definition: L1TdeRCT.h:173
MonitorElement * rctBitTauVetoIneff2D_
Definition: L1TdeRCT.h:129
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * rctInputTPGHcalRank_
Definition: L1TdeRCT.h:163
MonitorElement * trigEffTriggThreshOcc_
Definition: L1TdeRCT.h:242
MonitorElement * rctIsoEmIneffOcc1D_
Definition: L1TdeRCT.h:184
MonitorElement * rctRegEffChannel_[396]
Definition: L1TdeRCT.h:235
MonitorElement * rctBitHfPlusTauEff2D_
Definition: L1TdeRCT.h:153
MonitorElement * rctNisoEmIneffOcc1D_
Definition: L1TdeRCT.h:214
MonitorElement * rctRegOvereffChannel_[396]
Definition: L1TdeRCT.h:237
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * rctBitOverFlowIneff2D_
Definition: L1TdeRCT.h:121
MonitorElement * rctRegSpIneffOcc1D_
Definition: L1TdeRCT.h:85
MonitorElement * rctBitUnmatchedDataMip2D_
Definition: L1TdeRCT.h:135
L1TdeRCT(const edm::ParameterSet &ps)
Definition: L1TdeRCT.cc:80
MonitorElement * trigEffTriggOcc_[396]
Definition: L1TdeRCT.h:245
MonitorElement * rctBitMipEff2D_
Definition: L1TdeRCT.h:136
MonitorElement * rctIsoEmIneff2oneD_
Definition: L1TdeRCT.h:188
HLT enums.
MonitorElement * rctRegUnmatchedDataOcc2D_
Definition: L1TdeRCT.h:96
MonitorElement * rctBitUnmatchedEmulMip2D_
Definition: L1TdeRCT.h:134
MonitorElement * rctBitOverFlowEff2D_
Definition: L1TdeRCT.h:120
MonitorElement * rctNIsoEmBitOff_
Definition: L1TdeRCT.h:223
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceEmul_rgnEmul_
Definition: L1TdeRCT.h:261
MonitorElement * rctIsoIneffChannel_[396]
Definition: L1TdeRCT.h:227
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
Definition: L1TdeRCT.cc:1138
MonitorElement * rctRegSpEffOcc2D_
Definition: L1TdeRCT.h:99
MonitorElement * rctIsoEmOvereffOcc_
Definition: L1TdeRCT.h:172
MonitorElement * rctNisoEmDataOcc1D_
Definition: L1TdeRCT.h:209
edm::EDGetTokenT< L1CaloRegionCollection > rctSourceData_rgnData_
Definition: L1TdeRCT.h:263
MonitorElement * rctNIsoEmBitOn_
Definition: L1TdeRCT.h:222
MonitorElement * rctRegIneff1D_
Definition: L1TdeRCT.h:88
MonitorElement * rctNisoEmEff1Occ1D_
Definition: L1TdeRCT.h:211
MonitorElement * rctIsoEmDataOcc1D_
Definition: L1TdeRCT.h:179
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
Definition: L1TdeRCT.h:270
std::vector< L1CaloRegion > L1CaloRegionCollection
MonitorElement * rctBitDataTauVeto2D_
Definition: L1TdeRCT.h:124
MonitorElement * rctIsoEffChannel_[396]
Definition: L1TdeRCT.h:226
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TdeRCT.cc:114
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * rctNisoEmOvereff_
Definition: L1TdeRCT.h:207
MonitorElement * rctRegEff2D_
Definition: L1TdeRCT.h:102
int filterTriggerType_
filter TriggerType
Definition: L1TdeRCT.h:276
MonitorElement * rctInputTPGEcalOccNoCut_
Definition: L1TdeRCT.h:160
MonitorElement * rctNisoOvereffChannel_[396]
Definition: L1TdeRCT.h:232
MonitorElement * rctNisoEmIneffOcc_
Definition: L1TdeRCT.h:201
MonitorElement * rctIsoEmEff2oneD_
Definition: L1TdeRCT.h:187
edm::EDGetTokenT< L1CaloEmCollection > rctSourceEmul_emEmul_
Definition: L1TdeRCT.h:262
MonitorElement * rctBitUnmatchedDataQuiet2D_
Definition: L1TdeRCT.h:143
Definition: Run.h:45
int trigCount
Definition: L1TdeRCT.h:281
MonitorElement * rctRegSpIneff1D_
Definition: L1TdeRCT.h:91
MonitorElement * rctRegSpIneffOcc2D_
Definition: L1TdeRCT.h:100
MonitorElement * rctRegBitOff_
Definition: L1TdeRCT.h:109
MonitorElement * rctIsoEmIneff_
Definition: L1TdeRCT.h:176
bool perLSsaving_
Definition: L1TdeRCT.h:259
MonitorElement * rctRegUnmatchedEmulOcc1D_
Definition: L1TdeRCT.h:83
MonitorElement * rctBitUnmatchedDataOverFlow2D_
Definition: L1TdeRCT.h:119
MonitorElement * rctIsoOvereffChannel_[396]
Definition: L1TdeRCT.h:228
MonitorElement * rctNisoEmEff1_
Definition: L1TdeRCT.h:203