ATLAS Offline Software
TrigT1CaloLWHistogramToolV1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <cmath>
6 #include <iomanip>
7 #include <set>
8 #include <sstream>
9 
10 #include "TH1.h"
11 #include "TH1F.h"
12 #include "TH2F.h"
13 #include "LWHists/LWHist.h"
14 #include "LWHists/LWHist1D.h"
15 #include "LWHists/LWHist2D.h"
16 #include "LWHists/TH1F_LW.h"
17 #include "LWHists/TH2F_LW.h"
18 #include "LWHists/TH2I_LW.h"
19 #include "LWHists/TProfile_LW.h"
20 #include "LWHists/TProfile2D_LW.h"
21 
22 #include "GaudiKernel/IInterface.h"
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/StatusCode.h"
25 
28 #include "TrigConfL1Data/Menu.h"
30 //#include "TrigConfigSvc/ILVL1ConfigSvc.h"
34 
36 // ============================================================================
37 namespace LVL1 {
38 // ============================================================================
39 // Constructor
40 
42  : AsgTool(name),
43  m_configSvc("TrigConf::TrigConfigSvc/TrigConfigSvc", name),
44  m_monGroup(0), m_phiScaleTT(32./M_PI), m_phiScaleJE(16./M_PI)
45 {
46  declareInterface<TrigT1CaloLWHistogramToolV1>(this);
47  declareProperty( "LVL1ConfigSvc", m_configSvc, "LVL1 Config Service");
48 
49  declareProperty("EventSamples", m_eventSamples = 10,
50  "Number of Error Event Number Samples");
51  declareProperty("ShrinkEtaBins", m_shrinkEtaBins = true,
52  "Make all eta bins the same size in eta/phi plots");
53 }
54 
55 // Destructor
56 
58 {
59 }
60 
61 // Initialize
62 
64 {
65  msg(MSG::INFO) << "Initializing " << name() << endmsg;
66 
67  // Connect to the TrigConfigSvc for the trigger configuration:
68 
69  if (m_configSvc.typeAndName() != "") {
70  StatusCode sc = m_configSvc.retrieve();
71  if ( sc.isFailure() ) {
72  msg(MSG::ERROR) << "Couldn't connect to " << m_configSvc.typeAndName()
73  << endmsg;
74  return sc;
75  } else msg(MSG::INFO) << "Connected to " << m_configSvc.typeAndName()
76  << endmsg;
77  }
78 
79  return StatusCode::SUCCESS;
80 }
81 
82 // Finalize
83 
85 {
86  return StatusCode::SUCCESS;
87 }
88 
89 //===========================================================================
90 // Labelling Utilities - General
91 //===========================================================================
92 
93 // Return int/double pair as a string
94 
96  int precision)
97 {
98  std::ostringstream cnum;
99  cnum << num << "/"
100  << std::setiosflags(std::ios::fixed | std::ios::showpoint)
101  << std::setprecision(precision) << val;
102  return cnum.str();
103 }
104 
105 // Label bins with number pairs
106 
108  int firstMax, int secondMin, int secondMax,
109  int step, int offset, bool xAxis)
110 {
111  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
112  const int numSecond = secondMax - secondMin + 1;
113  for (int first = firstMin; first <= firstMax; ++first) {
114  int bin = 1 + offset + (first-firstMin)*numSecond;
115  for (int second = secondMin; second <= secondMax; second += step) {
116  std::ostringstream cnum;
117  cnum << first << "/" << second;
118  axis->SetBinLabel(bin, cnum.str().c_str());
119  bin += step;
120  }
121  }
122 }
123 
124 // Label bins with number pairs without skipping bins when stepping
125 
127  int firstMin, int firstMax,
128  int secondMin, int secondMax, int step, int offset, bool xAxis)
129 {
130  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
131  int bin = 1 + offset;
132  for (int first = firstMin; first <= firstMax; ++first) {
133  for (int second = secondMin; second <= secondMax; second += step) {
134  std::ostringstream cnum;
135  cnum << first << "/" << second;
136  axis->SetBinLabel(bin, cnum.str().c_str());
137  bin++;
138  }
139  }
140 }
141 
142 // Label bins with numbers
143 
145  int step, int offset, bool xAxis)
146 {
147  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
148  int bin = 1 + offset;
149  for (int num = min; num <= max; num += step) {
150  std::ostringstream cnum;
151  cnum << num;
152  axis->SetBinLabel(bin, cnum.str().c_str());
153  bin += step;
154  }
155 }
156 
157 // Split long names for Y axis
158 
159 std::string TrigT1CaloLWHistogramToolV1::splitLine(const std::string& word,
160  bool xAxis)
161 {
162  std::string newWord(word);
163  if (!xAxis && word.length() > 6) {
164  // split at last capital
165  std::string::size_type idx =
166  word.find_last_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
167  if (idx != std::string::npos && idx != 0 && idx != word.length()-1) {
168  newWord = "#splitline{" + word.substr(0, idx) + "}{"
169  + word.substr(idx) + "}";
170  }
171  }
172  return newWord;
173 }
174 
175 // Label bins with sub-status error bit names
176 
178 {
179  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
180  const LVL1::DataError err(0);
181  for (int bit = 0; bit < 8; ++bit) {
182  std::string label(splitLine(err.bitName(bit +
184  axis->SetBinLabel(bit + 1 + offset, label.c_str());
185  }
186 }
187 
188 // Get list of threshold names for given type
189 // NB. Treats EM/TAU as one
190 
192  std::vector<std::string>& names)
193 {
194  bool found = false;
195  names.clear();
197 // int nthresh = 0;
198 // if (type == def.emType() || type == def.tauType())
199 // nthresh = def.max_EM_Threshold_Number();
200 // else if (type == def.jetType()) nthresh = def.max_J_Threshold_Number();
201 // else if (type == def.jfType()) nthresh = def.max_JF_Threshold_Number();
202 // else if (type == def.jbType()) nthresh = def.max_JB_Threshold_Number();
203 // else if (type == def.xeType()) nthresh = def.max_XE_Threshold_Number();
204 // else if (type == def.jeType()) nthresh = def.max_JE_Threshold_Number();
205 // else if (type == def.teType()) nthresh = def.max_TE_Threshold_Number();
206 // else if (type == def.xsType()) nthresh = def.max_XS_Threshold_Number();
207 // else return found;
208 
210  if(tt == TrigConf::L1DataDef::UNDEF) return found;
211 
213  int nthresh = ttc.max;
214 
215  for (int thr = 0; thr < nthresh; ++thr) {
216  std::ostringstream cnum;
217  cnum << type << " " << thr;
218  names.push_back(cnum.str());
219  }
220 
221  if (m_configSvc) {
222  const TrigConf::CTPConfig* ctpConf = m_configSvc->ctpConfig();
223  if (ctpConf) {
224  const std::vector<TrigConf::TriggerThreshold*>& thresholds = ctpConf->menu().thresholdVector();
225 
226  std::vector<TrigConf::TriggerThreshold*>::const_iterator it;
227  for (it = thresholds.begin(); it != thresholds.end(); ++it) {
228  const std::string thrType((*it)->type());
229  if (type == def.emType() || type == def.tauType()) {
230  if (thrType != def.emType() && thrType != def.tauType()) continue;
231  } else if (thrType != type) continue;
232  const int threshNum = (*it)->thresholdNumber();
233  if (threshNum >= 0 && threshNum < nthresh) {
234  names[threshNum] = (*it)->name();
235  found = true;
236  }
237  }
238 
239  }
240  }
241  return found;
242 }
243 
244 // Label bins with threshold names
245 
247  const std::string& type, int offset, bool xAxis)
248 {
249  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
250  std::vector<std::string> names;
251  //const bool found = thresholdNames(type, names);
253  std::vector<std::string>::const_iterator it = names.begin();
254  for (int bin = 1; it != names.end(); ++it, ++bin) {
255  axis->SetBinLabel(bin+offset, (*it).c_str());
256  }
257  //if (!found) axis->SetTitle("Threshold Number");
258 }
259 
260 // Put threshold hit values into a string suitable for printing
261 
263  int nBits)
264 {
265  std::ostringstream cval;
266  const int mask = (1 << nBits) - 1;
267  for (int thr = 0; thr < nThresh; ++thr) {
268  const int hit = (val >> (nBits*thr)) & mask;
269  cval << hit;
270  if (thr != nThresh-1) cval << " ";
271  }
272  return cval.str();
273 }
274 
275 // Flag which threshold hit values are non-zero and the same
276 
278  int nThresh, int nBits)
279 {
280  int result = 0;
281  const int mask = (1 << nBits) - 1;
282  for (int thr = 0; thr < nThresh; ++thr) {
283  const int hit1 = (val1 >> (nBits*thr)) & mask;
284  const int hit2 = (val2 >> (nBits*thr)) & mask;
285  if (hit1 && (hit1 == hit2)) result |= (1 << thr);
286  }
287  return result;
288 }
289 
290 // Flag which threshold hit values are different
291 
293  int nThresh, int nBits)
294 {
295  int result = 0;
296  const int mask = (1 << nBits) - 1;
297  for (int thr = 0; thr < nThresh; ++thr) {
298  const int hit1 = (val1 >> (nBits*thr)) & mask;
299  const int hit2 = (val2 >> (nBits*thr)) & mask;
300  if (hit1 != hit2) result |= (1 << thr);
301  }
302  return result;
303 }
304 
305 // Get threshold bit mask for given type
306 // NB. Treats EM and TAU separately
307 
308 unsigned int TrigT1CaloLWHistogramToolV1::thresholdMask(const std::string& type)
309 {
310  unsigned int mask = 0;
311  //TrigConf::L1DataDef def;
312  // int nthresh = 0;
313  // if (type == def.emType() || type == def.tauType())
314  // nthresh = def.max_EM_Threshold_Number();
315  // else if (type == def.jetType()) nthresh = def.max_J_Threshold_Number();
316  // else if (type == def.jfType()) nthresh = def.max_JF_Threshold_Number();
317  // else if (type == def.jbType()) nthresh = def.max_JB_Threshold_Number();
318  // else if (type == def.xeType()) nthresh = def.max_XE_Threshold_Number();
319  // else if (type == def.jeType()) nthresh = def.max_JE_Threshold_Number();
320  // else if (type == def.teType()) nthresh = def.max_TE_Threshold_Number();
321  // else if (type == def.xsType()) nthresh = def.max_XS_Threshold_Number();
322 
325  int nthresh = ttc.max;
326 
327 
328 
329  if (m_configSvc) {
330  const TrigConf::CTPConfig* ctpConf = m_configSvc->ctpConfig();
331  if (ctpConf) {
332  const std::vector<TrigConf::TriggerThreshold*>& thresholds = ctpConf->menu().thresholdVector();
333  std::vector<TrigConf::TriggerThreshold*>::const_iterator it;
334  for (it = thresholds.begin(); it != thresholds.end(); ++it) {
335  const std::string thrType((*it)->type());
336  if (thrType != type) continue;
337  const int threshNum = (*it)->thresholdNumber();
338  if (threshNum >= 0 && threshNum < nthresh) {
339  mask |= (1<<threshNum);
340  }
341  }
342  }
343  }
344  return mask;
345 }
346 
347 // Get threshold bit mask for EM
348 
350 {
351  return thresholdMask(TrigConf::L1DataDef::emType());
352 }
353 
354 // Get threshold bit mask for Tau
355 
357 {
358  return thresholdMask(TrigConf::L1DataDef::tauType());
359 }
360 
361 //===========================================================================
362 // Labelling Utilities - CPM
363 //===========================================================================
364 
365 // Label bins with CPM chip/local coordinate
366 
368  bool xAxis)
369 {
370  const int nChips = 8;
371  const int nLoc = 8;
372  numberPairs(hist, 0, nChips-1, 0, nLoc-1, 4, offset, xAxis);
373  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
374  axis->SetTitle("Chip/Local Coord");
375 }
376 
377 // Label bins with CPM/CMM crate/module
378 
380  bool xAxis)
381 {
382  cpmCrateModule(hist, offset, xAxis);
383  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
384  axis->SetBinLabel(1+offset, "CPM");
385  axis->SetBinLabel(57+offset, "CMM");
386  axis->SetBinLabel(59+offset, "1/0");
387  axis->SetBinLabel(61+offset, "2/0");
388  axis->SetBinLabel(63+offset, "3/0");
389 }
390 
391 // Label bins with CPM crate/CMM
392 
394  bool xAxis)
395 {
396  const int nCrates = 4;
397  const int nCMMs = 2;
398  numberPairs(hist, 0, nCrates-1, 0, nCMMs-1, 1, offset, xAxis);
399  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
400  axis->SetTitle("Crate/CMM");
401 }
402 
403 // Label bins with CPM crate/module
404 
406  bool xAxis)
407 {
408  const int nCrates = 4;
409  const int nCPMs = 14;
410  numberPairs(hist, 0, nCrates-1, 1, nCPMs, nCPMs/2, offset, xAxis);
411  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
412  axis->SetTitle("Crate/Module");
413 }
414 
415 // Label bins with CPM RoI threshold names
416 
418  bool xAxis)
419 {
420  thresholds(hist, TrigConf::L1DataDef::emType(), offset, xAxis);
421 }
422 
423 //===========================================================================
424 // Labelling Utilities - JEM
425 //===========================================================================
426 
427 // Label bins with JEM crate/module
428 
430  bool xAxis)
431 {
432  const int nCrates = 2;
433  const int nJEMs = 16;
434  numberPairs(hist, 0, nCrates-1, 0, nJEMs-1, 2, offset, xAxis);
435  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
436  axis->SetTitle("Crate/Module");
437 }
438 
439 // Label bins with JEM/CMM crate/module
440 
442  bool xAxis)
443 {
444  jemCrateModule(hist, offset, xAxis);
445  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
446  axis->SetBinLabel(1+offset, "JEM");
447  axis->SetBinLabel(33+offset, "CMM");
448  axis->SetBinLabel(35+offset, "1/0");
449 }
450 
451 // Label bins with JEM crate/CMM
452 
454  bool xAxis)
455 {
456  const int nCrates = 2;
457  const int nCMMs = 2;
458  numberPairs(hist, 0, nCrates-1, 0, nCMMs-1, 1, offset, xAxis);
459  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
460  axis->SetTitle("Crate/CMM");
461 }
462 
463 // Label bins with JEM frame/local coord
464 
466  bool xAxis)
467 {
468  const int nFrame = 8;
469  const int nLoc = 4;
470  numberPairs(hist, 0, nFrame-1, 0, nLoc-1, 2, offset, xAxis);
471  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
472  axis->SetTitle("Frame/Local Coord");
473 }
474 
475 // Label bins with JEM RoI threshold names
476 
478  bool xAxis)
479 {
480  int newOffset = offset;
481  thresholds(hist, TrigConf::L1DataDef::jetType(), newOffset, xAxis);
482  newOffset += TrigConf::L1DataDef::max_JET_Threshold_Number();
483  thresholds(hist, TrigConf::L1DataDef::jbType(), newOffset, xAxis);
484  newOffset += TrigConf::L1DataDef::max_JB_Threshold_Number();
485  thresholds(hist, TrigConf::L1DataDef::jfType(), newOffset, xAxis);
486 }
487 
488 // Label bins with Main Jet threshold names
489 
491  bool xAxis)
492 {
494 }
495 
496 // Label bins with Backward Jet threshold names
497 
499  bool xAxis)
500 {
501  thresholds(hist, TrigConf::L1DataDef::jbType(), offset, xAxis);
502 }
503 
504 // Label bins with Forward Jet threshold names
505 
507  bool xAxis)
508 {
509  thresholds(hist, TrigConf::L1DataDef::jfType(), offset, xAxis);
510 }
511 
512 // Label bins with JetEt threshold names
513 
515  bool xAxis)
516 {
517  thresholds(hist, TrigConf::L1DataDef::jeType(), offset, xAxis);
518 }
519 
520 // Label bins with MissingEt threshold names
521 
523  bool xAxis)
524 {
525  thresholds(hist, TrigConf::L1DataDef::xeType(), offset, xAxis);
526 }
527 
528 // Label bins with SumEt threshold names
529 
531  bool xAxis)
532 {
533  thresholds(hist, TrigConf::L1DataDef::teType(), offset, xAxis);
534 }
535 
536 // Label bins with MissingEtSig threshold names
537 
539  bool xAxis)
540 {
541  //thresholds(hist, TrigConf::L1DataDef::xsType(), offset, xAxis);
542  thresholds(hist, "XS", offset, xAxis);
543 }
544 
545 //===========================================================================
546 // Labelling Utilities - PPM
547 //===========================================================================
548 
549 // Label bins with PPM crate/module
550 
552  int lastCrate, int offset, bool xAxis)
553 {
554  int step = 2;
555  if (lastCrate-firstCrate > 1) step = 4;
556  numberPairs(hist, firstCrate, lastCrate, 0, 15, step, offset, xAxis);
557  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
558  axis->SetTitle("Crate/Module");
559 }
560 
561 // Label bins with PPM error bit names
562 
564 {
565  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
566  const LVL1::DataError err(0);
567  for (int bit = 0; bit < 8; ++bit) {
568  std::string label(splitLine(err.bitName(bit +
570  axis->SetBinLabel(bit + 1 + offset, label.c_str());
571  }
572 }
573 
574 // Label bins with PPM submodule/channel
575 
577  bool xAxis)
578 {
579  numberPairs(hist, 0, 15, 0, 3, 4, offset, xAxis);
580  LWHist::LWHistAxis* axis = (xAxis) ? hist->GetXaxis() : hist->GetYaxis();
581  axis->SetTitle("Submodule/Channel");
582 }
583 
584 //===========================================================================
585 // Booking Utilities - General
586 //===========================================================================
587 
588 // Book and register a 1D histogram
589 
591  const std::string& title,
592  int nx, double xmin, double xmax)
593 {
594  TH1F_LW *hist = TH1F_LW::create(name.c_str(), title.c_str(), nx, xmin, xmax);
596  return hist;
597 }
598 
599 // Book and register a 1D histogram with variable width bins
600 
602  const std::string& title,
603  int nx, const double* xbins)
604 {
605  TH1F_LW *hist = TH1F_LW::create(name.c_str(), title.c_str(), nx, xbins);
607  return hist;
608 }
609 
610 // Book and register a 1D profile histogram
611 
613  const std::string& title, int nx, double xmin, double xmax)
614 {
615  TProfile_LW *hist = TProfile_LW::create(name.c_str(), title.c_str(),
616  nx, xmin, xmax);
618  return hist;
619 }
620 
621 // Book and register a 1D profile histogram with variable width bins
622 
624  const std::string& title, int nx, const double* xbins)
625 {
626  TProfile_LW *hist = TProfile_LW::create(name.c_str(), title.c_str(),
627  nx, xbins);
629  return hist;
630 }
631 
632 // Book and register a 2D histogram
633 
635  const std::string& title,
636  int nx, double xmin, double xmax,
637  int ny, double ymin, double ymax)
638 {
639  TH2F_LW *hist = TH2F_LW::create(name.c_str(), title.c_str(), nx, xmin, xmax,
640  ny, ymin, ymax);
642  hist->SetOption("colz");
643  return hist;
644 }
645 
646 // Book and register a 2D histogram with variable width bins
647 
649  const std::string& title,
650  int nx, const double* xbins,
651  int ny, double ymin, double ymax)
652 {
653  TH2F_LW *hist = TH2F_LW::create(name.c_str(), title.c_str(), nx, xbins,
654  ny, ymin, ymax);
656  hist->SetOption("colz");
657  return hist;
658 }
659 
660 // Book and register a 2D histogram with variable width bins both axes
661 
663  const std::string& title,
664  int nx, const double* xbins,
665  int ny, const double* ybins)
666 {
667  TH2F_LW *hist = TH2F_LW::create(name.c_str(), title.c_str(), nx, xbins,
668  ny, ybins);
670  hist->SetOption("colz");
671  return hist;
672 }
673 
674 // Book and register a 2D profile histogram
675 
677  const std::string& name, const std::string& title,
678  int nx, double xmin, double xmax, int ny, double ymin, double ymax)
679 {
680  TProfile2D_LW *hist = TProfile2D_LW::create(name.c_str(), title.c_str(),
681  nx, xmin, xmax, ny, ymin, ymax);
683  hist->SetOption("colz");
684  return hist;
685 }
686 
687 // Book and register a 2D profile histogram with variable width bins
688 
690  const std::string& name, const std::string& title,
691  int nx, const double* xbins, int ny, double ymin, double ymax)
692 {
693  TProfile2D_LW *hist = TProfile2D_LW::create(name.c_str(), title.c_str(),
694  nx, xbins, ny, ymin, ymax);
696  hist->SetOption("colz");
697  return hist;
698 }
699 
700 // Book and register a 2D profile histogram with variable width bins both axes
701 
703  const std::string& name, const std::string& title,
704  int nx, const double* xbins, int ny, const double* ybins)
705 {
706  TProfile2D_LW *hist = TProfile2D_LW::create(name.c_str(), title.c_str(),
707  nx, xbins, ny, ybins);
709  hist->SetOption("colz");
710  return hist;
711 }
712 
713 // Book and register a 2D histogram of integers displayed as text
714 
716  const std::string& title,
717  int nx, double xmin, double xmax,
718  int ny, double ymin, double ymax)
719 {
720  TH2I_LW *hist = TH2I_LW::create(name.c_str(), title.c_str(), nx, xmin, xmax,
721  ny, ymin, ymax);
723  hist->SetOption("text");
724  return hist;
725 }
726 
727 // Book and register a 2D histogram containing event numbers as bin contents
728 
730  const std::string& name, const std::string& title,
731  int ny, double ymin, double ymax)
732 {
734  ny, ymin, ymax);
735  if (m_eventSamples <= 10) numbers(hist, 1, m_eventSamples);
736  hist->GetXaxis()->SetTitle("Events with Error/Mismatch");
737  return hist;
738 }
739 
740 // Register a histogram
741 
743 {
744  if (m_monGroup && m_monGroup->regHist(hist) != StatusCode::SUCCESS) {
745  msg(MSG::WARNING) << "Could not register histogram : "
746  << hist->GetName() << endmsg;
747  }
748 }
749 
750 // ROOT versions
751 
752 // Book and register a 1D histogram
753 
755  const std::string& title,
756  int nx, double xmin, double xmax)
757 {
758  TH1F* hist = new TH1F(name.c_str(), title.c_str(), nx, xmin, xmax);
760  return hist;
761 }
762 
763 // Book and register a 2D histogram
764 
766  const std::string& title,
767  int nx, double xmin, double xmax,
768  int ny, double ymin, double ymax)
769 {
770  TH2F* hist = new TH2F(name.c_str(), title.c_str(), nx, xmin, xmax,
771  ny, ymin, ymax);
773  hist->SetOption("colz");
774  return hist;
775 }
776 
777 // Register a histogram
778 
780 {
781  if (m_monGroup && m_monGroup->regHist(hist) != StatusCode::SUCCESS) {
782  msg(MSG::WARNING) << "Could not register histogram : "
783  << hist->GetName() << endmsg;
784  }
785  if (!m_monGroup) hist->SetDirectory(0);
786 }
787 
788 //===========================================================================
789 // Booking Utilities - CPM
790 //===========================================================================
791 
792 // Book CPM crate/module vs chip/local coordinate
793 
795  const std::string& name, const std::string& title)
796 {
797  TH2F_LW *hist = book2F(name, title, 56, 0., 56., 64, 0., 64.);
799  cpmChipLocalCoord(hist, 0, false);
800  return hist;
801 }
802 
803 // Book CPM crate/module vs FPGA
804 
806  const std::string& name, const std::string& title)
807 {
808  TH2F_LW *hist = book2F(name, title, 56, 0., 56., 20, 0., 20.);
810  numbers(hist, 2, 17, 1, 2, false);
811  // colour overlap fpga bins
812  LWHist::LWHistAxis* axis = hist->GetYaxis();
813  axis->SetBinLabel(1, "#color[4]{0}");
814  axis->SetBinLabel(2, "#color[4]{1}");
815  axis->SetBinLabel(19, "#color[4]{18}");
816  axis->SetBinLabel(20, "#color[4]{19}");
817  axis->SetTitle("Serialiser FPGA");
818  return hist;
819 }
820 
821 // Book CPM crate/module vs thresholds
822 
824  const std::string& name, const std::string& title)
825 {
826  TH2F_LW *hist = book2F(name, title, 56, 0., 56., 16, 0., 16.);
828  cpmThresholds(hist, 0, false);
829  return hist;
830 }
831 
832 // Book CPM eta vs phi
833 
835  const std::string& title)
836 {
837  TH2F_LW* hist = 0;
839  if (m_shrinkEtaBins) {
841  axis = hist->GetXaxis();
842  for (int bin = 1; bin <= 8; ++bin) {
843  axis->SetBinLabel(bin, "+");
844  axis->SetBinLabel(bin+58, "+");
845  }
846  } else {
847  hist = book2F(name, title, 50, -2.5, 2.5, 64, 0., 64.);
848  hist->SetXTitle("eta");
849  const double phiBin = M_PI/32.;
850  const double halfPhiBin = M_PI/64.;
851  axis = hist->GetYaxis();
852  for (int chan = 0; chan < 64; chan += 4 ) {
853  const double rad = chan*phiBin + halfPhiBin;
854  axis->SetBinLabel(chan+1, intDoubleString(chan, rad).c_str());
855  }
856  axis->SetBinLabel(64, "phi");
857  }
858  return hist;
859 }
860 
861 // Book CPM RoI eta vs phi
862 
864  const std::string& title)
865 {
866  TH2F_LW* hist = 0;
868  if (m_shrinkEtaBins) {
869  hist = book2F(name, title, 66, -3.3, 3.3, 64, 0., 64.);
870  axis = hist->GetXaxis();
871  for (int chan = -24; chan < 26; chan+=4) {
872  const double eta = (chan/10.);
873  axis->SetBinLabel(chan+33, intDoubleString(chan, eta).c_str());
874  }
875  for (int bin = 1; bin <= 8; ++bin) {
876  axis->SetBinLabel(bin, "+");
877  axis->SetBinLabel(bin+58, "+");
878  }
879  } else {
880  hist = book2F(name, title, 50, -2.45, 2.55, 64, 0., 64.);
881  hist->SetXTitle("eta");
882  }
883  const double phiBin = M_PI/32.;
884  axis = hist->GetYaxis();
885  for (int chan = 0; chan < 64; chan += 4 ) {
886  const double rad = (chan + 1)*phiBin;
887  axis->SetBinLabel(chan+1, intDoubleString(chan, rad).c_str());
888  }
889  if (m_shrinkEtaBins) axis->SetBinLabel(64, "etaVphi");
890  else axis->SetBinLabel(64, "phi");
891  return hist;
892 }
893 
894 // Book CPM events with error/mismatch vs crate/module
895 
897  const std::string& name, const std::string& title)
898 {
899  TH2I_LW* hist = bookEventNumbers(name, title, 56, 0., 56.);
900  cpmCrateModule(hist, 0, false);
901  return hist;
902 }
903 
904 // Book CPM module vs crate
905 
907  const std::string& name, const std::string& title)
908 {
909  TH2F_LW *hist = book2F(name, title, 14, 1., 15., 4, 0., 4.);
910  numbers(hist, 1, 14);
911  numbers(hist, 0, 3, 1, 0, false);
912  hist->GetXaxis()->SetTitle("Module");
913  hist->GetYaxis()->SetTitle("Crate");
914  return hist;
915 }
916 
917 // Book CPM module vs crate/CMM
918 
920  const std::string& name, const std::string& title)
921 {
922  TH2F_LW *hist = book2F(name, title, 14, 1., 15., 8, 0., 8.);
923  numbers(hist, 1, 14);
924  hist->GetXaxis()->SetTitle("Module");
925  cpmCrateCMM(hist, 0, false);
926  return hist;
927 }
928 
929 // Book CPM sub-status errors vs crate/module
930 
932  const std::string& name, const std::string& title)
933 {
934  TH2F_LW* hist = book2F(name, title, 8, 0., 8., 56, 0., 56.);
935  subStatus(hist);
936  cpmCrateModule(hist, 0, false);
937  return hist;
938 }
939 
940 // Book CPM Sum/CMM
941 
943  const std::string& title)
944 {
945  TH1F_LW* hist = book1F(name, title, 16, 0., 16.);
946  LWHist::LWHistAxis* axis = hist->GetXaxis();
947  axis->SetBinLabel(1, "L0/0");
948  axis->SetBinLabel(2, "L0/1");
949  axis->SetBinLabel(3, "L1/0");
950  axis->SetBinLabel(4, "L1/1");
951  axis->SetBinLabel(5, "L2/0");
952  axis->SetBinLabel(6, "L2/1");
953  axis->SetBinLabel(7, "L3/0");
954  axis->SetBinLabel(8, "L3/1");
955  axis->SetBinLabel(9, "R0/0");
956  axis->SetBinLabel(10, "R0/1");
957  axis->SetBinLabel(11, "R1/0");
958  axis->SetBinLabel(12, "R1/1");
959  axis->SetBinLabel(13, "R2/0");
960  axis->SetBinLabel(14, "R2/1");
961  axis->SetBinLabel(15, "T/0");
962  axis->SetBinLabel(16, "T/1");
963  axis->SetTitle("Sum/CMM");
964  return hist;
965 }
966 
967 // Book CPM Sum vs Threshold
968 
970  const std::string& name, const std::string& title)
971 {
972  TH2F_LW* hist = book2F(name, title, 8, 0., 8., 16, 0., 16.);
973  LWHist::LWHistAxis* axis = hist->GetXaxis();
974  axis->SetBinLabel(1, "L0");
975  axis->SetBinLabel(2, "L1");
976  axis->SetBinLabel(3, "L2");
977  axis->SetBinLabel(4, "L3");
978  axis->SetBinLabel(5, "R0");
979  axis->SetBinLabel(6, "R1");
980  axis->SetBinLabel(7, "R2");
981  axis->SetBinLabel(8, "T");
982  axis->SetTitle("Sum (Local/Remote/Total)");
983  cpmThresholds(hist, 0, false);
984  return hist;
985 }
986 
987 //===========================================================================
988 // Booking Utilities - JEM
989 //===========================================================================
990 
991 // Book JEM crate/module vs EX,Ey,Et
992 
994  const std::string& name, const std::string& title)
995 {
996  TH2F_LW* hist = book2F(name, title, 32, 0., 32., 3, 0., 3.);
998  LWHist::LWHistAxis* axis = hist->GetYaxis();
999  axis->SetBinLabel(1, "Ex");
1000  axis->SetBinLabel(2, "Ey");
1001  axis->SetBinLabel(3, "Et");
1002  return hist;
1003 }
1004 
1005 // Book JEM crate/module vs frame/local coord
1006 
1008  const std::string& name, const std::string& title)
1009 {
1010  TH2F_LW* hist = book2F(name, title, 32, 0., 32., 32, 0., 32.);
1012  jemFrameLoc(hist, 0, false);
1013  return hist;
1014 }
1015 
1016 // Book JEM crate/module vs thresholds
1017 
1019  const std::string& name, const std::string& title)
1020 {
1021  TH2F_LW* hist = book2F(name, title, 32, 0., 32., 16, 0., 16.);
1023  jemThresholds(hist, 0, false);
1024  return hist;
1025 }
1026 
1027 // Book JEM events with error/mismatch vs crate/module
1028 
1030  const std::string& name, const std::string& title)
1031 {
1032  TH2I_LW* hist = bookEventNumbers(name, title, 32, 0., 32.);
1033  jemCrateModule(hist, 0, false);
1034  return hist;
1035 }
1036 
1037 // Book JEM module Vs crate
1038 
1040  const std::string& name, const std::string& title)
1041 {
1042  TH2F_LW* hist = book2F(name, title, 16, 0., 16., 2, 0., 2.);
1043  numbers(hist, 0, 15);
1044  numbers(hist, 0, 1, 1, 0, false);
1045  hist->SetXTitle("Module");
1046  hist->SetYTitle("Crate");
1047  return hist;
1048 }
1049 
1050 // Book JEM eta
1051 
1053  const std::string& title)
1054 {
1055  const int nxbins = 32;
1056  const double xbins[nxbins+1] = {-4.9,-3.2,-2.9,-2.7,-2.4,-2.2,-2.0,-1.8,-1.6,
1057  -1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0.0,0.2,
1058  0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,
1059  2.7,2.9,3.2,4.9};
1060  TH1F_LW* hist = book1F(name, title, nxbins, xbins);
1061  hist->SetXTitle("eta");
1062  return hist;
1063 }
1064 
1065 // Book JEM eta vs phi
1066 
1068  const std::string& title)
1069 {
1070  TH2F_LW* hist = 0;
1071  LWHist::LWHistAxis* axis = 0;
1072  if (m_shrinkEtaBins) {
1073  hist = book2F(name, title, 32, -3.2, 3.2, 32, 0., 32.);
1074  axis = hist->GetXaxis();
1075  for (int ch = -11; ch < 12; ch+=2) {
1076  int chan = ch;
1077  if (chan >= -1) ++chan;
1078  const double eta = chan/5. + 0.1;
1079  axis->SetBinLabel(chan+17, intDoubleString(chan, eta).c_str());
1080  }
1081  axis->SetBinLabel(2, "-15/-3.05");
1082  axis->SetBinLabel(4, "-13/-2.55");
1083  axis->SetBinLabel(29, "12/2.55");
1084  axis->SetBinLabel(31, "14/3.05");
1085  } else {
1086  const int nxbins = 32;
1087  const double xbins[nxbins+1] = {-4.9,-3.2,-2.9,-2.7,-2.4,-2.2,-2.0,-1.8,
1088  -1.6,-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,
1089  0.0,0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,
1090  2.0,2.2,2.4,2.7,2.9,3.2,4.9};
1091  hist = book2F(name, title, nxbins, xbins, 32, 0., 32.);
1092  hist->SetXTitle("eta");
1093  }
1094  axis = hist->GetYaxis();
1095  const double phiBin = M_PI/16.;
1096  const double halfPhiBin = M_PI/32.;
1097  for (int chan = 0; chan < 32; chan += 2 ) {
1098  const double rad = chan*phiBin + halfPhiBin;
1099  axis->SetBinLabel(chan+1, intDoubleString(chan, rad).c_str());
1100  }
1101  if (m_shrinkEtaBins) axis->SetBinLabel(32, "etaVphi");
1102  else axis->SetBinLabel(32, "phi");
1103  return hist;
1104 }
1105 
1106 // Book JEM RoI eta vs phi
1107 
1109  const std::string& title)
1110 {
1111  TH2F_LW* hist = 0;
1112  LWHist::LWHistAxis* axis = 0;
1113  if (m_shrinkEtaBins) {
1114  hist = book2F(name, title, 32, -3.2, 3.2, 32, 0., 32.);
1115  axis = hist->GetXaxis();
1116  for (int chan = -10; chan < 12; chan+=2) {
1117  const double eta = chan/5.;
1118  axis->SetBinLabel(chan+16, intDoubleString(chan, eta).c_str());
1119  }
1120  axis->SetBinLabel(2, "-14/-2.95");
1121  axis->SetBinLabel(4, "-12/-2.45");
1122  axis->SetBinLabel(28, "12/2.45");
1123  axis->SetBinLabel(30, "14/2.95");
1124  axis->SetBinLabel(32, "16/4.05");
1125  } else {
1126  const int nxbins = 32;
1127  const double xbins[nxbins+1] = {-4.0,-3.05,-2.8,-2.55,-2.3,-2.1,-1.9,-1.7,
1128  -1.5,-1.3,-1.1,-0.9,-0.7,-0.5,-0.3,-0.1,
1129  0.1,0.3,0.5,0.7,0.9,1.1,1.3,1.5,1.7,1.9,
1130  2.1,2.3,2.55,2.8,3.05,4.0,4.95};
1131  hist = book2F(name, title, nxbins, xbins, 32, 0., 32.);
1132  hist->SetXTitle("eta");
1133  }
1134  axis = hist->GetYaxis();
1135  const double phiBin = M_PI/16.;
1136  for (int chan = 0; chan < 32; chan += 2 ) {
1137  const double rad = (chan + 1)*phiBin;
1138  axis->SetBinLabel(chan+1, intDoubleString(chan, rad).c_str());
1139  }
1140  if (m_shrinkEtaBins) axis->SetBinLabel(32, "etaVphi");
1141  else axis->SetBinLabel(32, "phi");
1142  return hist;
1143 }
1144 
1145 // Book JEM energy with bins matching QuadLinear encoding
1146 
1148  const std::string& title,
1149  int scale)
1150 {
1151  if (scale < 1) scale = 1;
1152  const int eRange = 256; //range of encoded value
1153  const int dRange = 4096*scale; //range of decoded value
1154  std::set<int> sorted;
1155  for (int i = 0; i < eRange; ++i) {
1156  const int val = LVL1::QuadLinear::Expand(i);
1157  if (val != 0) sorted.insert(val);
1158  }
1159  double binedges[eRange+2];
1160  int nbins = (scale > 1) ? 1 : 0;
1161  std::set<int>::const_iterator iter = sorted.begin();
1162  std::set<int>::const_iterator iterE = sorted.end();
1163  for (; iter != iterE; ++iter) {
1164  binedges[nbins] = (*iter)*scale;
1165  ++nbins;
1166  }
1167  binedges[0] = 1;
1168  //if (scale > 1) binedges[1] = scale;
1169  binedges[nbins] = dRange;
1170  TH1F_LW* hist = book1F(name, title, nbins, binedges);
1171  return hist;
1172 }
1173 
1174 // Book JEM main jet thresholds
1175 
1177  const std::string& name, const std::string& title)
1178 {
1179  const int nbins = TrigConf::L1DataDef::max_JET_Threshold_Number();
1180  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1182  return hist;
1183 }
1184 
1185 // Book JEM backward jet thresholds
1186 
1188  const std::string& name, const std::string& title)
1189 {
1190  const int nbins = TrigConf::L1DataDef::max_JB_Threshold_Number();
1191  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1193  return hist;
1194 }
1195 
1196 // Book JEM forward jet thresholds
1197 
1199  const std::string& name, const std::string& title)
1200 {
1201  const int nbins = TrigConf::L1DataDef::max_JF_Threshold_Number();
1202  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1204  return hist;
1205 }
1206 
1207 // Book JEM JetEt thresholds
1208 
1210  const std::string& name, const std::string& title)
1211 {
1212  const int nbins = TrigConf::L1DataDef::max_JE_Threshold_Number();
1213  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1215  return hist;
1216 }
1217 
1218 // Book JEM MissingEt thresholds
1219 
1221  const std::string& name, const std::string& title)
1222 {
1223  const int nbins = TrigConf::L1DataDef::max_XE_Threshold_Number();
1224  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1226  return hist;
1227 }
1228 
1229 // Book JEM SumEt thresholds
1230 
1232  const std::string& name, const std::string& title)
1233 {
1234  //const int nbins = TrigConf::L1DataDef::max_TE_Threshold_Number();
1235  const int nbins = 8;
1236  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1238  return hist;
1239 }
1240 
1241 // Book JEM MissingEtSig thresholds
1242 
1244  const std::string& name, const std::string& title)
1245 {
1246  //const int nbins = TrigConf::L1DataDef::max_XS_Threshold_Number();
1247  const int nbins = 8;
1248  TH1F_LW* hist = book1F(name, title, nbins, 0, nbins);
1250  return hist;
1251 }
1252 
1253 // Book JEM sub-status errors vs crate/module
1254 
1256  const std::string& name, const std::string& title)
1257 {
1258  TH2F_LW* hist = book2F(name, title, 8, 0., 8., 32, 0., 32.);
1259  subStatus(hist);
1260  jemCrateModule(hist, 0, false);
1261  return hist;
1262 }
1263 
1264 // Book JEM sub-status errors vs crate
1265 
1267  const std::string& name, const std::string& title)
1268 {
1269  TH2F_LW* hist = book2F(name, title, 8, 0., 8., 2, 0., 2.);
1270  subStatus(hist);
1271  numbers(hist, 0, 1, 1, 0, false);
1272  hist->SetYTitle("Crate");
1273  return hist;
1274 }
1275 
1276 //===========================================================================
1277 // Booking Utilities - PPM
1278 //===========================================================================
1279 
1280 // Book PPM Em eta
1281 
1283  const std::string& title)
1284 {
1285  const int nxbins = 66;
1286  const double xbins[nxbins+1] = {-4.9,-4.475,-4.050,-3.625,-3.2,-3.1,-2.9,
1287  -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
1288  -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
1289  -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
1290  -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
1291  0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
1292  1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
1293  3.1,3.2,3.625,4.050,4.475,4.9};
1294  TH1F_LW* hist = book1F(name, title, nxbins, xbins);
1295  hist->SetXTitle("eta");
1296  return hist;
1297 }
1298 
1299 // Book PPM Had eta
1300 
1302  const std::string& title)
1303 {
1304  const int nxbins = 62;
1305  const double xbins[nxbins+1] = {-4.9,-4.050,-3.2,-3.1,-2.9,
1306  -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
1307  -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
1308  -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
1309  -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
1310  0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
1311  1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
1312  3.1,3.2,4.050,4.9};
1313  TH1F_LW* hist = book1F(name, title, nxbins, xbins);
1314  hist->SetXTitle("eta");
1315  return hist;
1316 }
1317 
1318 // Book PPM Em eta vs phi
1319 
1321  const std::string& title)
1322 {
1323  TH2F_LW* hist = 0;
1324  LWHist::LWHistAxis* axis = 0;
1325  if (m_shrinkEtaBins) {
1326  hist = book2F(name, title, 66, -3.3, 3.3, 64, 0., 64.);
1327  axis = hist->GetXaxis();
1328  for (int ch = -25; ch < 25; ch+=4) {
1329  int chan = ch;
1330  if (chan >= -1) ++chan;
1331  const double eta = (chan/10.)+0.05;
1332  axis->SetBinLabel(chan+34, intDoubleString(chan, eta).c_str());
1333  }
1334  axis->SetBinLabel(1, "-49/-4.41");
1335  axis->SetBinLabel(5, "-32/-3.15");
1336  axis->SetBinLabel(62, "31/3.15");
1337  axis->SetBinLabel(66, "44/4.41");
1338  } else {
1339  const int nxbins = 66;
1340  const double xbins[nxbins+1] = {-4.9,-4.475,-4.050,-3.625,-3.2,-3.1,-2.9,
1341  -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
1342  -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
1343  -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
1344  -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
1345  0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
1346  1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
1347  3.1,3.2,3.625,4.050,4.475,4.9};
1348  hist = book2F(name, title, nxbins, xbins, 64, 0., 64.);
1349  hist->SetXTitle("eta");
1350  }
1351 
1352  axis = hist->GetYaxis();
1353  const double phiBin = M_PI/32.;
1354  const double halfPhiBin = M_PI/64.;
1355  for (int chan = 0; chan < 64; chan += 4 ) {
1356  const double rad = chan*phiBin + halfPhiBin;
1357  axis->SetBinLabel(chan+1, intDoubleString(chan, rad).c_str());
1358  }
1359  if (m_shrinkEtaBins) axis->SetBinLabel(64, "etaVphi");
1360  else axis->SetBinLabel(64, "phi");
1361  return hist;
1362 
1363 }
1364 
1365 // Book PPM Had eta vs phi
1366 
1368  const std::string& title)
1369 {
1371  if (m_shrinkEtaBins) {
1372  LWHist::LWHistAxis* axis = hist->GetXaxis();
1373  axis->SetBinLabel(1, "-49/-4.17");
1374  axis->SetBinLabel(66, "44/4.19");
1375  }
1376  return hist;
1377 
1378 }
1379 
1380 // Book PPM Em eta vs phi profile
1381 
1383  const std::string& name, const std::string& title)
1384 {
1385  // todo - remove duplication with above
1386  TProfile2D_LW* hist = 0;
1387  LWHist::LWHistAxis* axis = 0;
1388  if (m_shrinkEtaBins) {
1389  hist = bookProfile2D(name, title, 66, -3.3, 3.3, 64, 0., 64.);
1390  axis = hist->GetXaxis();
1391  for (int ch = -25; ch < 25; ch+=4) {
1392  int chan = ch;
1393  if (chan >= -1) ++chan;
1394  const double eta = (chan/10.)+0.05;
1395  axis->SetBinLabel(chan+34, intDoubleString(chan, eta).c_str());
1396  }
1397  axis->SetBinLabel(1, "-49/-4.41");
1398  axis->SetBinLabel(5, "-32/-3.15");
1399  axis->SetBinLabel(62, "31/3.15");
1400  axis->SetBinLabel(66, "44/4.41");
1401  } else {
1402  const int nxbins = 66;
1403  const double xbins[nxbins+1] = {-4.9,-4.475,-4.050,-3.625,-3.2,-3.1,-2.9,
1404  -2.7,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,
1405  -1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,
1406  -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,
1407  -0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,
1408  0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,
1409  1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.7,2.9,
1410  3.1,3.2,3.625,4.050,4.475,4.9};
1411  hist = bookProfile2D(name, title, nxbins, xbins, 64, 0., 64.);
1412  hist->SetXTitle("eta");
1413  }
1414 
1415  axis = hist->GetYaxis();
1416  const double phiBin = M_PI/32.;
1417  const double halfPhiBin = M_PI/64.;
1418  for (int chan = 0; chan < 64; chan += 4 ) {
1419  const double rad = chan*phiBin + halfPhiBin;
1420  axis->SetBinLabel(chan+1, intDoubleString(chan, rad).c_str());
1421  }
1422  if (m_shrinkEtaBins) axis->SetBinLabel(64, "etaVphi");
1423  else axis->SetBinLabel(64, "phi");
1424  return hist;
1425 
1426 }
1427 
1428 // Book PPM Had eta vs phi profile
1429 
1431  const std::string& name, const std::string& title)
1432 {
1434  if (m_shrinkEtaBins) {
1435  LWHist::LWHistAxis* axis = hist->GetXaxis();
1436  axis->SetBinLabel(1, "-49/-4.17");
1437  axis->SetBinLabel(66, "44/4.19");
1438  }
1439  return hist;
1440 
1441 }
1442 
1443 // Book PPM events with error/mismatch vs crate/module
1444 
1446  const std::string& name, const std::string& title,
1447  int firstCrate, int lastCrate)
1448 {
1449  const int nbins = (lastCrate-firstCrate+1)*16;
1451  ppmCrateModule(hist, firstCrate, lastCrate, 0, false);
1452  return hist;
1453 }
1454 
1455 // Book PPM Crate/Module vs Submodule/Channel
1456 
1458  const std::string& name, const std::string& title,
1459  int firstCrate, int lastCrate)
1460 {
1461  const int nbins = (lastCrate-firstCrate+1)*16;
1462  TH2F_LW* hist = book2F(name, title, nbins, 0., nbins, 64, 0., 64.);
1463  ppmCrateModule(hist, firstCrate, lastCrate);
1464  ppmSubmoduleChannel(hist, 0, false);
1465  return hist;
1466 }
1467 
1468 // Book PPM Crate/Module vs Submodule/Channel profile
1469 
1472  const std::string& name, const std::string& title,
1473  int firstCrate, int lastCrate)
1474 {
1475  const int nbins = (lastCrate-firstCrate+1)*16;
1477  64, 0., 64.);
1478  ppmCrateModule(hist, firstCrate, lastCrate);
1479  ppmSubmoduleChannel(hist, 0, false);
1480  return hist;
1481 }
1482 
1483 // Book PPM SubStatus vs crate/module
1484 
1486  const std::string& name, const std::string& title,
1487  int firstCrate, int lastCrate)
1488 {
1489  const int nbins = (lastCrate-firstCrate+1)*16;
1490  TH2F_LW* hist = book2F(name, title, 8, 0., 8., nbins, 0., nbins);
1491  subStatus(hist);
1492  ppmCrateModule(hist, firstCrate, lastCrate, 0, false);
1493  return hist;
1494 }
1495 
1496 // Book PPM ASIC errors vs crate/module
1497 
1499  const std::string& name, const std::string& title,
1500  int firstCrate, int lastCrate)
1501 {
1502  const int nbins = (lastCrate-firstCrate+1)*16;
1503  TH2F_LW* hist = book2F(name, title, 8, 0., 8., nbins, 0., nbins);
1504  ppmErrors(hist);
1505  ppmCrateModule(hist, firstCrate, lastCrate, 0, false);
1506  return hist;
1507 }
1508 
1509 //===========================================================================
1510 // Filling Utilities - General
1511 //===========================================================================
1512 
1513 // Get Minimum and Maximun bins and contents of 2D histogram
1514 
1516  int& minBinx, int& minBiny, int& maxBinx, int& maxBiny,
1517  double& minValue, double& maxValue)
1518 {
1519  //NB. this ignores bins with content & error = 0
1520  minBinx = 1;
1521  minBiny = 1;
1522  maxBinx = 1;
1523  maxBiny = 1;
1524  minValue = 0.;
1525  maxValue = 0.;
1526  bool found = false;
1527  unsigned int ix = 0;
1528  unsigned int iy = 0;
1529  double content = 0.;
1530  double error = 0.;
1531  hist->resetActiveBinLoop();
1532  while(hist->getNextActiveBin(ix, iy, content, error)) {
1533  if (!found) {
1534  minBinx = ix;
1535  minBiny = iy;
1536  maxBinx = ix;
1537  maxBiny = iy;
1538  minValue = content;
1539  maxValue = content;
1540  found = true;
1541  } else {
1542  if (content < minValue) {
1543  minValue = content;
1544  minBinx = ix;
1545  minBiny = iy;
1546  } else if (content > maxValue) {
1547  maxValue = content;
1548  maxBinx = ix;
1549  maxBiny = iy;
1550  }
1551  }
1552  }
1553  // return false if no active bins found
1554  return found;
1555 }
1556 
1557 // Get Minimum and Maximun bins and contents of 2D Profile histogram
1558 
1560  int& minBinx, int& minBiny, int& maxBinx, int& maxBiny,
1561  double& minValue, double& maxValue)
1562 {
1563  //NB. this ignores bins with no entries
1564  minBinx = 1;
1565  minBiny = 1;
1566  maxBinx = 1;
1567  maxBiny = 1;
1568  minValue = 0.;
1569  maxValue = 0.;
1570  bool found = false;
1571  const int xbins = hist->GetNbinsX();
1572  const int ybins = hist->GetNbinsY();
1573  for (int ix = 1; ix <= xbins; ++ix) {
1574  for (int iy = 1; iy <= ybins; ++iy) {
1575  double entries = 0.;
1576  double content = 0.;
1577  double error = 0.;
1578  hist->GetBinInfo(ix, iy, entries, content, error);
1579  if (entries > 0.) {
1580  if (!found) {
1581  minBinx = ix;
1582  minBiny = iy;
1583  maxBinx = ix;
1584  maxBiny = iy;
1585  minValue = content;
1586  maxValue = content;
1587  found = true;
1588  } else {
1589  if (content < minValue) {
1590  minValue = content;
1591  minBinx = ix;
1592  minBiny = iy;
1593  } else if (content > maxValue) {
1594  maxValue = content;
1595  maxBinx = ix;
1596  maxBiny = iy;
1597  }
1598  }
1599  }
1600  }
1601  }
1602  // return false if no entries found
1603  return found;
1604 }
1605 
1606 // Fill Error/Mismatch event number
1607 
1609 {
1610  const EventContext& ctx = Gaudi::Hive::currentContext();
1611  int eventNumber = ctx.eventID().event_number();
1612  if (eventNumber <= 0) return;
1613  const int biny = hist->GetYaxis()->FindBin(y);
1614  const int nbins = hist->GetNbinsX();
1615  double entries = hist->GetEntries();
1616  for (int binx = 1; binx <= nbins; ++binx) {
1617  const int val = hist->GetBinContent(binx, biny);
1618  if (val == eventNumber) break;
1619  else if (val == 0) {
1620  hist->SetBinContent(binx, biny, eventNumber);
1621  entries++;
1622  break;
1623  } else if (eventNumber < val) {
1624  for (int b = nbins; b > binx; --b) {
1625  const int v1 = hist->GetBinContent(b-1, biny);
1626  if (v1 == 0) continue;
1627  const int v2 = hist->GetBinContent(b, biny);
1628  if (v2 == 0) entries++;
1629  hist->SetBinContent(b, biny, v1);
1630  }
1631  hist->SetBinContent(binx, biny, eventNumber);
1632  break;
1633  }
1634  }
1635  hist->SetEntries(entries);
1636 }
1637 
1638 // Fill weighted thresholds 1D
1639 
1641  int nThresh, int nBits, int offset)
1642 {
1643  if (val) {
1644  const int mask = (1 << nBits) - 1;
1645  for (int thr = 0; thr < nThresh; ++thr) {
1646  const int hit = (val >> (nBits*thr)) & mask;
1647  if (hit) hist->Fill(thr + offset, hit);
1648  }
1649  }
1650 }
1651 
1652 // Fill weighted thresholds 2D, X axis
1653 
1655  int y, int nThresh, int nBits, int offset)
1656 {
1657  if (val) {
1658  const int mask = (1 << nBits) - 1;
1659  for (int thr = 0; thr < nThresh; ++thr) {
1660  const int hit = (val >> (nBits*thr)) & mask;
1661  if (hit) hist->Fill(thr + offset, y, hit);
1662  }
1663  }
1664 }
1665 
1666 // Fill weighted thresholds 2D, Y axis
1667 
1669  int val, int nThresh, int nBits, int offset)
1670 {
1671  if (val) {
1672  const int mask = (1 << nBits) - 1;
1673  for (int thr = 0; thr < nThresh; ++thr) {
1674  const int hit = (val >> (nBits*thr)) & mask;
1675  if (hit) hist->Fill(x, thr + offset, hit);
1676  }
1677  }
1678 }
1679 
1680 // Replace the contents of one 2D histogram with those of another
1681 
1683  LWHist2D* histFrom)
1684 {
1685  histTo->Reset();
1686  unsigned int ix = 0;
1687  unsigned int iy = 0;
1688  double content = 0.;
1689  double error = 0.;
1690  histFrom->resetActiveBinLoop();
1691  while (histFrom->getNextActiveBin(ix, iy, content, error)) {
1692  histTo->SetBinContentAndError(ix, iy, content, error);
1693  }
1694  double sumW = 0.;
1695  double sumW2 = 0.;
1696  double sumWX = 0.;
1697  double sumWX2 = 0.;
1698  double sumWY = 0.;
1699  double sumWY2 = 0.;
1700  double sumWXY = 0.;
1701  histFrom->getSums(sumW, sumW2, sumWX, sumWX2, sumWY, sumWY2, sumWXY);
1702  histTo->setSums(sumW, sumW2, sumWX, sumWX2, sumWY, sumWY2, sumWXY);
1703  histTo->SetEntries(histFrom->GetEntries());
1704 }
1705 
1706 // Replace the contents of one 2D Profile histogram with those of another
1707 
1709  TProfile2D_LW* histFrom)
1710 {
1711  histTo->Reset();
1712  const int xbins = histFrom->GetNbinsX();
1713  const int ybins = histFrom->GetNbinsY();
1714  for (int ix = 1; ix <= xbins; ++ix) {
1715  for (int iy = 1; iy <= ybins; ++iy) {
1716  double entries = 0.;
1717  double contentOut = 0.;
1718  double errorOut = 0.;
1719  histFrom->GetBinInfo(ix, iy, entries, contentOut, errorOut);
1720  if (entries > 0.) {
1721  const double contentIn = contentOut*entries;
1722  const double errorIn = sqrt(errorOut*errorOut*entries*entries
1723  + contentOut*contentOut*entries);
1724  histTo->SetBinInfo(ix, iy, entries, contentIn, errorIn);
1725  }
1726  }
1727  }
1728  double sumW = 0.;
1729  double sumW2 = 0.;
1730  double sumWX = 0.;
1731  double sumWX2 = 0.;
1732  double sumWY = 0.;
1733  double sumWY2 = 0.;
1734  double sumWXY = 0.;
1735  double sumWZ = 0.;
1736  double sumWZ2 = 0.;
1737  histFrom->getSums(sumW, sumW2, sumWX, sumWX2, sumWY, sumWY2, sumWXY,
1738  sumWZ, sumWZ2);
1739  histTo->setSums(sumW, sumW2, sumWX, sumWX2, sumWY, sumWY2, sumWXY,
1740  sumWZ, sumWZ2);
1741  histTo->SetEntries(histFrom->GetEntries());
1742 }
1743 
1744 //===========================================================================
1745 // Filling Utilities - CPM
1746 //===========================================================================
1747 
1748 // Fill CPM eta vs phi
1749 
1751  double phi, double weight)
1752 {
1753  const double phiMod = phi * m_phiScaleTT;
1754  hist->Fill(eta, phiMod, weight);
1755 }
1756 
1757 // Fill CPM RoI eta vs phi
1758 
1760  double phi, double weight)
1761 {
1762  const double phiMod = phi * m_phiScaleTT - 0.5;
1763  double etaMod = eta;
1764  if (m_shrinkEtaBins) etaMod -= 0.05;
1765  hist->Fill(etaMod, phiMod, weight);
1766 }
1767 
1768 //===========================================================================
1769 // Filling Utilities - JEM
1770 //===========================================================================
1771 
1772 // Fill JEM eta vs phi
1773 
1775  double phi, double weight)
1776 {
1777  double phiMod = phi * m_phiScaleJE;
1778  double etaMod = eta;
1779  const double absEta = fabs(eta);
1780  if (m_shrinkEtaBins && absEta > 2.4) {
1781  int offset = 1;
1782  if (absEta > 3.2) offset = 4;
1783  else if (absEta > 2.9) offset = 3;
1784  else if (absEta > 2.7) offset = 2;
1785  etaMod = 2.3 + 0.2*offset;
1786  if (eta < 0.) etaMod = -etaMod;
1787  }
1788  if (eta < -3.2 || eta > 3.2) {
1789  // Fill two bins for FCAL
1790  phiMod = floor(phiMod/2)*2. + 1.;
1791  hist->Fill(etaMod, phiMod + 0.5, weight);
1792  hist->Fill(etaMod, phiMod - 0.5, weight);
1793  } else hist->Fill(etaMod, phiMod, weight);
1794 }
1795 
1796 // Fill JEM RoI eta vs phi
1797 
1799  double phi, double weight)
1800 {
1801  const double phiMod = phi * m_phiScaleJE - 0.5;
1802  double etaMod = eta;
1803  const double absEta = fabs(eta);
1804  if (m_shrinkEtaBins && absEta > 2.3) {
1805  int offset = 1;
1806  if (absEta > 4.0) offset = 5;
1807  else if (absEta > 3.05) offset = 4;
1808  else if (absEta > 2.8) offset = 3;
1809  else if (absEta > 2.55) offset = 2;
1810  etaMod = 2.2 + 0.2*offset;
1811  if (eta < 0.) etaMod = -etaMod;
1812  }
1813  const double etaShift = (m_shrinkEtaBins) ? 0.1 : 0.;
1814  // JEPRoIDecoder returns eta=3.9 for both of the two forwardmost bins
1815  if (eta > 3.8 && eta < 4.0) {
1816  const double eta2 = (m_shrinkEtaBins) ? 3.2 : 4.05;
1817  hist->Fill(eta2 - etaShift, phiMod, weight);
1818  }
1819  hist->Fill(etaMod - etaShift, phiMod, weight);
1820 }
1821 
1822 // Fill JEM phi allowing for granularity varying with eta
1823 
1825  double eta, double phi, double weight)
1826 {
1827  const double halfBin = 1./(2.*m_phiScaleJE);
1828  if (eta < -3.2 || eta > 3.2) {
1829  // Fill two bins for FCAL
1830  hist->Fill(phi + halfBin, weight);
1831  hist->Fill(phi - halfBin, weight);
1832  } else hist->Fill(phi, weight);
1833 }
1834 
1835 //===========================================================================
1836 // Filling Utilities - PPM
1837 //===========================================================================
1838 
1839 // Fill PPM Em eta vs phi
1840 
1842  double phi, double weight)
1843 {
1844  double phiMod = phi * m_phiScaleTT;
1845  double etaMod = eta;
1846  const double absEta = fabs(eta);
1847  if (absEta > 3.2) {
1848  if (m_shrinkEtaBins) {
1849  etaMod = 2.9 + 0.1*(absEta-3.2)/0.425;
1850  if (eta < 0.) etaMod = -etaMod;
1851  }
1852  // Fill four bins in phi
1853  phiMod = floor(phiMod/4)*4. + 2.;
1854  hist->Fill(etaMod, phiMod + 1.5, weight);
1855  hist->Fill(etaMod, phiMod + 0.5, weight);
1856  hist->Fill(etaMod, phiMod - 0.5, weight);
1857  hist->Fill(etaMod, phiMod - 1.5, weight);
1858  } else if (absEta > 2.5) {
1859  if (m_shrinkEtaBins) {
1860  etaMod = (absEta > 3.1) ? 2.85 : 2.5 + (absEta-2.5)/2.;
1861  if (eta < 0.) etaMod = -etaMod;
1862  }
1863  // Fill two bins in phi
1864  phiMod = floor(phiMod/2)*2. + 1.;
1865  hist->Fill(etaMod, phiMod + 0.5, weight);
1866  hist->Fill(etaMod, phiMod - 0.5, weight);
1867  } else hist->Fill(eta, phiMod, weight);
1868 }
1869 
1870 // Fill PPM Had eta vs phi
1871 
1873  double phi, double weight)
1874 {
1875  // Use EM mapping - puts FCAL2 in left half of bin and FCAL3 in right half
1877 }
1878 
1879 // Fill PPM Em eta vs phi profile
1880 
1882  double eta, double phi, double z, double weight)
1883 {
1884  double phiMod = phi * m_phiScaleTT;
1885  double etaMod = eta;
1886  const double absEta = fabs(eta);
1887  if (absEta > 3.2) {
1888  if (m_shrinkEtaBins) {
1889  etaMod = 2.9 + 0.1*(absEta-3.2)/0.425;
1890  if (eta < 0.) etaMod = -etaMod;
1891  }
1892  // Fill four bins in phi
1893  phiMod = floor(phiMod/4)*4. + 2.;
1894  hist->Fill(etaMod, phiMod + 1.5, z, weight);
1895  hist->Fill(etaMod, phiMod + 0.5, z, weight);
1896  hist->Fill(etaMod, phiMod - 0.5, z, weight);
1897  hist->Fill(etaMod, phiMod - 1.5, z, weight);
1898  } else if (absEta > 2.5) {
1899  if (m_shrinkEtaBins) {
1900  etaMod = (absEta > 3.1) ? 2.85 : 2.5 + (absEta-2.5)/2.;
1901  if (eta < 0.) etaMod = -etaMod;
1902  }
1903  // Fill two bins in phi
1904  phiMod = floor(phiMod/2)*2. + 1.;
1905  hist->Fill(etaMod, phiMod + 0.5, z, weight);
1906  hist->Fill(etaMod, phiMod - 0.5, z, weight);
1907  } else hist->Fill(eta, phiMod, z, weight);
1908 }
1909 
1910 // Fill PPM Had eta vs phi profile
1911 
1913  double eta, double phi, double z, double weight)
1914 {
1915  // Use EM mapping - puts FCAL2 in left half of bin and FCAL3 in right half
1917 }
1918 
1919 // Fill PPM phi allowing for granularity varying with eta
1920 
1922  double eta, double phi, double weight)
1923 {
1924  const double halfBin = 1./(2.*m_phiScaleTT);
1925  const double absEta = fabs(eta);
1926  if (absEta > 3.2) {
1927  // Fill four bins in phi
1928  hist->Fill(phi + 3.*halfBin, weight);
1929  hist->Fill(phi + halfBin, weight);
1930  hist->Fill(phi - halfBin, weight);
1931  hist->Fill(phi - 3.*halfBin, weight);
1932  } else if (absEta > 2.5) {
1933  // Fill two bins in phi
1934  hist->Fill(phi + halfBin, weight);
1935  hist->Fill(phi - halfBin, weight);
1936  } else hist->Fill(phi, weight);
1937 }
1938 
1939 // Fill PPM phi profile allowing for granularity varying with eta
1940 
1942  double eta, double phi, double z, double weight)
1943 {
1944  const double halfBin = 1./(2.*m_phiScaleTT);
1945  const double absEta = fabs(eta);
1946  if (absEta > 3.2) {
1947  // Fill four bins in phi
1948  hist->Fill(phi + 3.*halfBin, z, weight);
1949  hist->Fill(phi + halfBin, z, weight);
1950  hist->Fill(phi - halfBin, z, weight);
1951  hist->Fill(phi - 3.*halfBin, z, weight);
1952  } else if (absEta > 2.5) {
1953  // Fill two bins in phi
1954  hist->Fill(phi + halfBin, z, weight);
1955  hist->Fill(phi - halfBin, z, weight);
1956  } else hist->Fill(phi, z, weight);
1957 }
1958 
1959 // Find bin in Em eta vs phi
1960 
1962  double eta, double phi, int& binx, int& biny)
1963 {
1964  double phiMod = phi * m_phiScaleTT;
1965  if (eta < -2.5 || eta > 2.5) phiMod += 0.5;
1966  double etaMod = eta;
1967  if (m_shrinkEtaBins) {
1968  const double absEta = fabs(eta);
1969  if (absEta > 3.2) {
1970  etaMod = 2.9 + 0.1*(absEta-3.2)/0.425;
1971  if (eta < 0.) etaMod = -etaMod;
1972  } else if (absEta > 2.5) {
1973  etaMod = (absEta > 3.1) ? 2.85 : 2.5 + (absEta-2.5)/2.;
1974  if (eta < 0.) etaMod = -etaMod;
1975  }
1976  }
1977  binx = hist->GetXaxis()->FindBin(etaMod);
1978  biny = hist->GetYaxis()->FindBin(phiMod);
1979 }
1980 
1981 // Find bin in Had eta vs phi
1982 
1984  double eta, double phi, int& binx, int& biny)
1985 {
1986  findBinPPMEmEtaVsPhi(hist, eta, phi, binx, biny);
1987 }
1988 
1989 // Set bin content and optionally error in Em eta vs phi
1990 
1992  int binx, int biny, double content, double error)
1993 {
1994  int nbin = 1;
1995  if (binx <= 4 || binx >= 63) nbin = 4; // |eta|>3.2
1996  else if (binx <= 8 || binx >= 59) nbin = 2; // 2.5<|eta|<3.2
1997  const int binyBase = ((biny-1)/nbin)*nbin+1;
1998  for (int i = 0; i < nbin; ++i) {
1999  if (error >= 0.) {
2000  hist->SetBinContentAndError(binx, binyBase+i, content, error);
2001  } else hist->SetBinContent(binx, binyBase+i, content);
2002  }
2003 }
2004 
2005 // Set bin content and optionally error in Had eta vs phi
2006 
2008  int binx, int biny, double content, double error)
2009 {
2010  setBinPPMEmEtaVsPhi(hist, binx, biny, content, error);
2011 }
2012 
2013 //===========================================================================
2014 // Merge Utilities
2015 //===========================================================================
2016 
2017 // Scale histogram quantities by number of events for weightedAverage merge
2018 // Used for eg. DB status plots which are just filled on the first event
2019 // Call from procHistograms.
2020 
2021 // Obsolete - superceded by lowerLB merge method.
2022 
2024 {
2025  unsigned int entries = hist->GetEntries();
2026  if (entries > 0 && nevents > 0) {
2027  unsigned int ix = 0;
2028  unsigned int iy = 0;
2029  double content = 0.;
2030  double error = 0.;
2031  hist->resetActiveBinLoop();
2032  while (hist->getNextActiveBin(ix, iy, content, error)) {
2033  hist->SetBinError(ix, iy, 1./sqrt(nevents));
2034  }
2035  } else hist->SetBinError(1, 1, 0.); // merge always creates sumw2 array
2036  hist->setSums(0., 0., 0., 0., 0., 0., 0.); // to force recomputation
2037  hist->SetEntries(nevents*entries);
2038 }
2039 
2040 // Compute efficiencies and errors for perBinEffPerCent merge method
2041 // Call from procHistograms.
2042 
2044  LWHist* lw3) {
2045  TH1* hist1 = lw1->getROOTHistBase(); // denominator
2046  TH1* hist2 = lw2->getROOTHistBase(); // numerator
2047  TH1* hist3 = lw3->getROOTHistBase(); // % efficiency
2048  hist3->Sumw2();
2049  const double OneSigOneSided = 0.159;
2050  int nbins = hist3->GetNbinsX() + 2;
2051  if (hist3->GetDimension() == 2) nbins *= (hist3->GetNbinsY() + 2);
2052  for (int bin = 0; bin < nbins; ++bin) {
2053  double denom = hist1->GetBinContent(bin);
2054  if (denom == 0.) continue;
2055  float eff = hist2->GetBinContent(bin)/denom;
2056  float err = 0.;
2057  if (eff == 0. || eff > 0.99) {
2058  err = 1. - std::pow(OneSigOneSided, 1. / denom);
2059  } else {
2060  err = std::sqrt(eff * (1. - eff) / denom);
2061  }
2062  hist3->SetBinContent(bin, eff*100.);
2063  hist3->SetBinError(bin, err*100.);
2064  }
2065  hist3->SetEntries(hist1->GetEntries());
2066  if (hist3->GetDimension() == 1) {
2067  hist3->SetMinimum(0.);
2068  hist3->SetMaximum(110.);
2069  }
2070 }
2071 // ============================================================================
2072 } // end namespace
2073 // ============================================================================
LVL1::TrigT1CaloLWHistogramToolV1::fillThresholds
void fillThresholds(LWHist1D *hist, int val, int nThresh, int nBits, int offset=0)
Fill weighted thresholds 1D.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1640
LWHist
Definition: LWHist.h:26
LVL1::TrigT1CaloLWHistogramToolV1::ppmErrors
void ppmErrors(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with PPM error bit names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:563
LVL1::TrigT1CaloLWHistogramToolV1::bookJetEtThresholds
TH1F_LW * bookJetEtThresholds(const std::string &name, const std::string &title)
Book JEM JetEt thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1209
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
CTPConfig.h
TrigConf::L1DataDef::typeConfig
static TriggerTypeConfig & typeConfig(TriggerType tt)
Definition: L1DataDef.cxx:145
TH1F_LW.h
ymin
double ymin
Definition: listroot.cxx:63
TProfile2D_LW::GetEntries
virtual unsigned GetEntries() const override
Definition: TProfile2D_LW.cxx:272
TH2F_LW.h
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
LVL1::TrigT1CaloLWHistogramToolV1::splitLine
std::string splitLine(const std::string &word, bool xAxis=true)
Split long names for Y axis.
Definition: TrigT1CaloLWHistogramToolV1.cxx:159
LVL1::TrigT1CaloLWHistogramToolV1::fillCPMEtaVsPhi
void fillCPMEtaVsPhi(LWHist2D *hist, double eta, double phi, double weight=1.)
Fill CPM eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1750
LWHist::SetEntries
virtual void SetEntries(unsigned)=0
LVL1::DataError
Error data.
Definition: DataError.h:27
get_generator_info.result
result
Definition: get_generator_info.py:21
maxValue
#define maxValue(current, test)
Definition: CompoundLayerMaterialCreator.h:22
max
#define max(a, b)
Definition: cfImp.cxx:41
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
LVL1::TrigT1CaloLWHistogramToolV1::TrigT1CaloLWHistogramToolV1
TrigT1CaloLWHistogramToolV1(const std::string &name)
Definition: TrigT1CaloLWHistogramToolV1.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMSubStatusVsCrateModule
TH2F_LW * bookPPMSubStatusVsCrateModule(const std::string &name, const std::string &title, int firstCrate, int lastCrate)
Book PPM SubStatus vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1485
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMCrateModuleVsThresholds
TH2F_LW * bookJEMCrateModuleVsThresholds(const std::string &name, const std::string &title)
Book JEM crate/module vs thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1018
LVL1::TrigT1CaloLWHistogramToolV1::sumEtThresholds
void sumEtThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with SumEt threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:530
LVL1::TrigT1CaloLWHistogramToolV1::jemThresholds
void jemThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with JEM RoI threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:477
LVL1::TrigT1CaloLWHistogramToolV1::bookEventNumbers
TH2I_LW * bookEventNumbers(const std::string &name, const std::string &title, int ny, double ymin, double ymax)
Book and register a 2D histogram containing event numbers as bin contents.
Definition: TrigT1CaloLWHistogramToolV1.cxx:729
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMSubStatusVsCrateModule
TH2F_LW * bookCPMSubStatusVsCrateModule(const std::string &name, const std::string &title)
Book CPM sub-status errors vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:931
LVL1::TrigT1CaloLWHistogramToolV1::fillJEMPhi
void fillJEMPhi(LWHist1D *hist, double eta, double phi, double weight=1.)
Fill JEM phi allowing for granularity varying with eta.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1824
LVL1::TrigT1CaloLWHistogramToolV1::bookProfilePPMCrateModuleVsSubmoduleChannel
TProfile2D_LW * bookProfilePPMCrateModuleVsSubmoduleChannel(const std::string &name, const std::string &title, int firstCrate, int lastCrate)
Book PPM Crate/Module vs Submodule/Channel profile.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1471
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMSumCMM
TH1F_LW * bookCPMSumCMM(const std::string &name, const std::string &title)
Book CPM Sum/CMM.
Definition: TrigT1CaloLWHistogramToolV1.cxx:942
LVL1::TrigT1CaloLWHistogramToolV1::cpmChipLocalCoord
void cpmChipLocalCoord(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with CPM chip/local coordinate.
Definition: TrigT1CaloLWHistogramToolV1.cxx:367
LVL1::TrigT1CaloLWHistogramToolV1::thresholdMaskEm
unsigned int thresholdMaskEm()
Definition: TrigT1CaloLWHistogramToolV1.cxx:349
TH1F_LW::create
static TH1F_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup)
Definition: TH1F_LW.cxx:33
TrigT1CaloLWHistogramToolV1.h
TH2F
Definition: rootspy.cxx:420
TProfile2D_LW::SetBinInfo
void SetBinInfo(unsigned binx, unsigned biny, const double &entries, const double &content, const double &error)
Definition: TProfile2D_LW.cxx:341
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMSumVsThreshold
TH2F_LW * bookCPMSumVsThreshold(const std::string &name, const std::string &title)
Book CPM Sum vs Threshold.
Definition: TrigT1CaloLWHistogramToolV1.cxx:969
LVL1::TrigT1CaloLWHistogramToolV1::jemCrateCMM
void jemCrateCMM(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with JEM crate/CMM.
Definition: TrigT1CaloLWHistogramToolV1.cxx:453
plotmaker.hist
hist
Definition: plotmaker.py:148
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
LVL1::TrigT1CaloLWHistogramToolV1::fillPPMPhi
void fillPPMPhi(LWHist1D *hist, double eta, double phi, double weight=1.)
Fill PPM phi allowing for granularity varying with eta.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1921
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
skel.it
it
Definition: skel.GENtoEVGEN.py:423
LVL1::TrigT1CaloLWHistogramToolV1::findBinPPMHadEtaVsPhi
void findBinPPMHadEtaVsPhi(LWHist *hist, double eta, double phi, int &binx, int &biny)
Find bin in Had eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1983
PixelAthClusterMonAlgCfg.ybins
ybins
Definition: PixelAthClusterMonAlgCfg.py:163
M_PI
#define M_PI
Definition: ActiveFraction.h:11
bin
Definition: BinsDiffFromStripMedian.h:43
LVL1::TrigT1CaloLWHistogramToolV1::book2F
TH2F_LW * book2F(const std::string &name, const std::string &title, int nx, double xmin, double xmax, int ny, double ymin, double ymax)
Book and register a 2D histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:634
LVL1::QuadLinear::Expand
static unsigned int Expand(int Code)
Uncompress data.
Definition: QuadLinear.cxx:37
LWHist1D.h
LVL1::TrigT1CaloLWHistogramToolV1::m_configSvc
ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc
Trigger configuration service for threshold names.
Definition: TrigT1CaloLWHistogramToolV1.h:484
LWHist2D::getNextActiveBin
virtual bool getNextActiveBin(unsigned &binx, unsigned &biny, double &content, double &error)=0
LVL1::TrigT1CaloLWHistogramToolV1::fillJEMRoIEtaVsPhi
void fillJEMRoIEtaVsPhi(LWHist2D *hist, double eta, double phi, double weight=1.)
Fill JEM RoI eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1798
Menu.h
TProfile_LW.h
LWHist1D
Definition: LWHist1D.h:23
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMCrateModuleVsSubmoduleChannel
TH2F_LW * bookPPMCrateModuleVsSubmoduleChannel(const std::string &name, const std::string &title, int firstCrate, int lastCrate)
Book PPM Crate/Module vs Submodule/Channel.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1457
LVL1::DataError::GLinkParity
@ GLinkParity
Definition: DataError.h:40
TrigConf::Menu::thresholdVector
const std::vector< TriggerThreshold * > & thresholdVector() const
Definition: Menu.cxx:123
TProfile2D_LW::create
static TProfile2D_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, unsigned nbinsy, const double &ylow, const double &yup, const char *option=" ")
Definition: TProfile2D_LW.cxx:32
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
TProfile2D_LW::SetEntries
virtual void SetEntries(unsigned) override
Definition: TProfile2D_LW.cxx:279
TProfile_LW
Definition: TProfile_LW.h:24
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
LVL1::TrigT1CaloLWHistogramToolV1::replaceContents
void replaceContents(LWHist2D *histTo, LWHist2D *histFrom)
Replace the contents of one 2D histogram with those of another.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1682
LVL1::TrigT1CaloLWHistogramToolV1::jemCMMCrateModule
void jemCMMCrateModule(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with JEM/CMM crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:441
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
x
#define x
LVL1::TrigT1CaloLWHistogramToolV1::subStatus
void subStatus(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with sub-status error bit names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:177
LVL1::TrigT1CaloLWHistogramToolV1::thresholdMaskTau
unsigned int thresholdMaskTau()
Definition: TrigT1CaloLWHistogramToolV1.cxx:356
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMEventVsCrateModule
TH2I_LW * bookPPMEventVsCrateModule(const std::string &name, const std::string &title, int firstCrate, int lastCrate)
Book PPM events with error/mismatch vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1445
LVL1::TrigT1CaloLWHistogramToolV1::fillCPMRoIEtaVsPhi
void fillCPMRoIEtaVsPhi(LWHist2D *hist, double eta, double phi, double weight=1.)
Fill CPM RoI eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1759
LVL1::TrigT1CaloLWHistogramToolV1::cpmThresholds
void cpmThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with CPM RoI threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:417
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
LVL1::TrigT1CaloLWHistogramToolV1::ppmSubmoduleChannel
void ppmSubmoduleChannel(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with PPM submodule/channel.
Definition: TrigT1CaloLWHistogramToolV1.cxx:576
TProfile2D_LW::Reset
virtual void Reset() override
Definition: TProfile2D_LW.cxx:204
LVL1::TrigT1CaloLWHistogramToolV1::setBinPPMHadEtaVsPhi
void setBinPPMHadEtaVsPhi(LWHist2D *hist, int binx, int biny, double content, double error=-1.)
Set bin content and optionally error in Had eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:2007
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
grepfile.content
string content
Definition: grepfile.py:56
TrigConf::L1DataDef::stringAsType
static TriggerType stringAsType(const std::string &type)
Definition: L1DataDef.h:62
ILVL1ConfigSvc.h
LVL1::TrigT1CaloLWHistogramToolV1::~TrigT1CaloLWHistogramToolV1
virtual ~TrigT1CaloLWHistogramToolV1()
Definition: TrigT1CaloLWHistogramToolV1.cxx:57
TrigConf::L1DataDef
Definition: L1DataDef.h:27
LVL1::TrigT1CaloLWHistogramToolV1::bookTH2F
TH2F * bookTH2F(const std::string &name, const std::string &title, int nx, double xmin, double xmax, int ny, double ymin, double ymax)
Book and register a 2D histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:765
TH1F_LW
Definition: TH1F_LW.h:23
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMModuleVsCrateCMM
TH2F_LW * bookCPMModuleVsCrateCMM(const std::string &name, const std::string &title)
Book CPM module vs crate/CMM.
Definition: TrigT1CaloLWHistogramToolV1.cxx:919
LVL1::TrigT1CaloLWHistogramToolV1::book1F
TH1F_LW * book1F(const std::string &name, const std::string &title, int nx, double xmin, double xmax)
Book and register a 1D histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:590
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMModuleVsCrate
TH2F_LW * bookCPMModuleVsCrate(const std::string &name, const std::string &title)
Book CPM module vs crate.
Definition: TrigT1CaloLWHistogramToolV1.cxx:906
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
TH1::SetBinContent
void SetBinContent(int, double)
Definition: rootspy.cxx:301
LVL1::TrigT1CaloLWHistogramToolV1::m_phiScaleTT
double m_phiScaleTT
Phi scale for trigger tower eta/phi plots.
Definition: TrigT1CaloLWHistogramToolV1.h:488
TProfile_LW::create
static TProfile_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xlow, const double &xup, const char *option=" ")
Definition: TProfile_LW.cxx:32
LVL1::TrigT1CaloLWHistogramToolV1::m_phiScaleJE
double m_phiScaleJE
Phi scale for jet element eta/phi plots.
Definition: TrigT1CaloLWHistogramToolV1.h:490
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMQuadLinear
TH1F_LW * bookJEMQuadLinear(const std::string &name, const std::string &title, int scale=1)
Book JEM energy with bins matching QuadLinear encoding.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1147
lumiFormat.i
int i
Definition: lumiFormat.py:92
xmin
double xmin
Definition: listroot.cxx:60
z
#define z
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
TH2I_LW::create
static TH2I_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xmin, const double &xmax, unsigned nbinsy, const double &ymin, const double &ymax)
Definition: TH2I_LW.cxx:33
TrigConf::L1DataDef::TriggerTypeConfig
Definition: L1DataDef.h:42
LVL1::TrigT1CaloLWHistogramToolV1::intDoubleString
std::string intDoubleString(int num, double val, int precision=2)
Return int/double pair as a string.
Definition: TrigT1CaloLWHistogramToolV1.cxx:95
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMEta
TH1F_LW * bookJEMEta(const std::string &name, const std::string &title)
Book JEM eta.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1052
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
python.subdetectors.mmg.names
names
Definition: mmg.py:8
covarianceTool.title
title
Definition: covarianceTool.py:542
TH2I_LW.h
LVL1::TrigT1CaloLWHistogramToolV1::m_shrinkEtaBins
bool m_shrinkEtaBins
Shrink eta bins to same size flag.
Definition: TrigT1CaloLWHistogramToolV1.h:494
LVL1::TrigT1CaloLWHistogramToolV1::bookProfile2D
TProfile2D_LW * bookProfile2D(const std::string &name, const std::string &title, int nx, double xmin, double xmax, int ny, double ymin, double ymax)
Book and register a 2D profile histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:676
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMHadEta
TH1F_LW * bookPPMHadEta(const std::string &name, const std::string &title)
Book PPM Had eta.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1301
LVL1::TrigT1CaloLWHistogramToolV1::bookMissingEtSigThresholds
TH1F_LW * bookMissingEtSigThresholds(const std::string &name, const std::string &title)
Book JEM MissingEtSig thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1243
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMHadEtaVsPhi
TH2F_LW * bookPPMHadEtaVsPhi(const std::string &name, const std::string &title)
Book PPM Had eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1367
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
TriggerThreshold.h
LVL1::TrigT1CaloLWHistogramToolV1::jemFrameLoc
void jemFrameLoc(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with JEM frame/local coord.
Definition: TrigT1CaloLWHistogramToolV1.cxx:465
LWHist2D::resetActiveBinLoop
virtual void resetActiveBinLoop()=0
LVL1::TrigT1CaloLWHistogramToolV1::cpmCrateModule
void cpmCrateModule(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with CPM crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:405
TProfile2D_LW::setSums
void setSums(const double &sumW, const double &sumW2, const double &sumWX, const double &sumWX2, const double &sumWY, const double &sumWY2, const double &sumWXY, const double &sumWZ, const double &sumWZ2)
Definition: TProfile2D_LW.cxx:306
LVL1::TrigT1CaloLWHistogramToolV1::bookTH1F
TH1F * bookTH1F(const std::string &name, const std::string &title, int nx, double xmin, double xmax)
ROOT versions.
Definition: TrigT1CaloLWHistogramToolV1.cxx:754
TProfile2D_LW::getSums
void getSums(double &sumW, double &sumW2, double &sumWX, double &sumWX2, double &sumWY, double &sumWY2, double &sumWXY, double &sumWZ, double &sumWZ2) const
Definition: TProfile2D_LW.cxx:281
compute_lumi.denom
denom
Definition: compute_lumi.py:76
DataError.h
TH1::SetBinError
void SetBinError(int, double)
Definition: rootspy.cxx:304
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMErrorsVsCrateModule
TH2F_LW * bookPPMErrorsVsCrateModule(const std::string &name, const std::string &title, int firstCrate, int lastCrate)
Book PPM ASIC errors vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1498
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
ManagedMonitorToolBase::MonGroup::regHist
StatusCode regHist(TH1 *h)
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition: ManagedMonitorToolBase.cxx:195
TrigConf::name
Definition: HLTChainList.h:35
LWHist2D
Definition: LWHist2D.h:25
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMEventVsCrateModule
TH2I_LW * bookCPMEventVsCrateModule(const std::string &name, const std::string &title)
Book CPM events with error/mismatch vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:896
min
#define min(a, b)
Definition: cfImp.cxx:40
LWHist::LWHistAxis
Definition: LWHist.h:109
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
TProfile2D_LW::GetNbinsY
unsigned GetNbinsY() const
Definition: TProfile2D_LW.cxx:265
LVL1::TrigT1CaloLWHistogramToolV1::fillEventNumber
void fillEventNumber(LWHist2D *hist, double y)
Fill Error/Mismatch event number.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1608
LVL1::TrigT1CaloLWHistogramToolV1::backwardJetThresholds
void backwardJetThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with Backward Jet threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:498
TProfile2D_LW::GetBinInfo
void GetBinInfo(unsigned binx, unsigned biny, double &entries, double &content, double &error) const
Definition: TProfile2D_LW.cxx:329
CompareRootFiles.hist1
hist1
Definition: CompareRootFiles.py:36
TH2I_LW
Definition: TH2I_LW.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LVL1::TrigT1CaloLWHistogramToolV1::fillThresholdsVsY
void fillThresholdsVsY(LWHist2D *hist, int val, int y, int nThresh, int nBits, int offset=0)
Fill weighted thresholds 2D, X axis.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1654
LVL1::TrigT1CaloLWHistogramToolV1::jemCrateModule
void jemCrateModule(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with JEM crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:429
LVL1::TrigT1CaloLWHistogramToolV1::findBinPPMEmEtaVsPhi
void findBinPPMEmEtaVsPhi(LWHist *hist, double eta, double phi, int &binx, int &biny)
Find bin in Em eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1961
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
QuadLinear.h
TH2F_LW::create
static TH2F_LW * create(const char *name, const char *title, unsigned nbinsx, const double &xmin, const double &xmax, unsigned nbinsy, const double &ymin, const double &ymax)
Definition: TH2F_LW.cxx:33
LVL1::TrigT1CaloLWHistogramToolV1::bookBackwardJetThresholds
TH1F_LW * bookBackwardJetThresholds(const std::string &name, const std::string &title)
Book JEM backward jet thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1187
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMEmEta
TH1F_LW * bookPPMEmEta(const std::string &name, const std::string &title)
Book PPM Em eta.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1282
TProfile2D_LW.h
LVL1::TrigT1CaloLWHistogramToolV1::mainJetThresholds
void mainJetThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with Main Jet threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:490
LVL1::TrigT1CaloLWHistogramToolV1::bookProfilePPMHadEtaVsPhi
TProfile2D_LW * bookProfilePPMHadEtaVsPhi(const std::string &name, const std::string &title)
Book PPM Had eta vs phi profile.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1430
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMSubStatusVsCrateModule
TH2F_LW * bookJEMSubStatusVsCrateModule(const std::string &name, const std::string &title)
Book JEM sub-status errors vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1255
TH1::Sumw2
void Sumw2()
Definition: rootspy.cxx:284
TrigConf::L1DataDef::UNDEF
@ UNDEF
Definition: L1DataDef.h:39
LVL1::TrigT1CaloLWHistogramToolV1::fillJEMEtaVsPhi
void fillJEMEtaVsPhi(LWHist2D *hist, double eta, double phi, double weight=1.)
Fill JEM eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1774
LVL1::TrigT1CaloLWHistogramToolV1::fillXVsThresholds
void fillXVsThresholds(LWHist2D *hist, int x, int val, int nThresh, int nBits, int offset=0)
Fill weighted thresholds 2D, Y axis.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1668
TProfile2D_LW
Definition: TProfile2D_LW.h:24
LVL1::TrigT1CaloLWHistogramToolV1::thresholdString
std::string thresholdString(int val, int nThresh, int nBits=1)
Put threshold hit values into a string suitable for printing.
Definition: TrigT1CaloLWHistogramToolV1.cxx:262
LVL1::DataError::ChannelDisabled
@ ChannelDisabled
Definition: DataError.h:33
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMRoIEtaVsPhi
TH2F_LW * bookJEMRoIEtaVsPhi(const std::string &name, const std::string &title)
Book JEM RoI eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1108
LVL1::TrigT1CaloLWHistogramToolV1::bookProfile
TProfile_LW * bookProfile(const std::string &name, const std::string &title, int nx, double xmin, double xmax)
Book and register a 1D profile histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:612
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMCrateModuleVsChipLocalCoord
TH2F_LW * bookCPMCrateModuleVsChipLocalCoord(const std::string &name, const std::string &title)
Book CPM crate/module vs chip/local coordinate.
Definition: TrigT1CaloLWHistogramToolV1.cxx:794
LVL1::TrigT1CaloLWHistogramToolV1::book2I
TH2I_LW * book2I(const std::string &name, const std::string &title, int nx, double xmin, double xmax, int ny, double ymin, double ymax)
Book and register a 2D histogram of integers displayed as text.
Definition: TrigT1CaloLWHistogramToolV1.cxx:715
LArCellBinning.xbins
int xbins
Definition: LArCellBinning.py:163
L1DataDef.h
TProfile2D_LW::GetNbinsX
unsigned GetNbinsX() const
Definition: TProfile2D_LW.cxx:264
ReadCellNoiseFromCoolCompare.v2
v2
Definition: ReadCellNoiseFromCoolCompare.py:364
LVL1::TrigT1CaloLWHistogramToolV1::finalize
virtual StatusCode finalize()
Definition: TrigT1CaloLWHistogramToolV1.cxx:84
LVL1::TrigT1CaloLWHistogramToolV1::thresholdsSame
int thresholdsSame(int val1, int val2, int nThresh, int nBits)
Flag which threshold hit values are non-zero and the same.
Definition: TrigT1CaloLWHistogramToolV1.cxx:277
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMRoIEtaVsPhi
TH2F_LW * bookCPMRoIEtaVsPhi(const std::string &name, const std::string &title)
Book CPM RoI eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:863
LVL1::TrigT1CaloLWHistogramToolV1::thresholdsDiff
int thresholdsDiff(int val1, int val2, int nThresh, int nBits)
Flag which threshold hit values are different.
Definition: TrigT1CaloLWHistogramToolV1.cxx:292
LVL1::TrigT1CaloLWHistogramToolV1::bookSumEtThresholds
TH1F_LW * bookSumEtThresholds(const std::string &name, const std::string &title)
Book JEM SumEt thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1231
LWHist::Reset
virtual void Reset()=0
LWHist::GetEntries
virtual unsigned GetEntries() const =0
LVL1::TrigT1CaloLWHistogramToolV1::bookMainJetThresholds
TH1F_LW * bookMainJetThresholds(const std::string &name, const std::string &title)
Book JEM main jet thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1176
LVL1::TrigT1CaloLWHistogramToolV1::thresholdMask
unsigned int thresholdMask(const std::string &type)
Get threshold bit mask for given type.
Definition: TrigT1CaloLWHistogramToolV1.cxx:308
LVL1::TrigT1CaloLWHistogramToolV1::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: TrigT1CaloLWHistogramToolV1.cxx:63
TrigConf::L1DataDef::TriggerTypeConfig::max
unsigned int max
Definition: L1DataDef.h:47
ConvertOldUJHistosToNewHistos.jetType
string jetType
Definition: ConvertOldUJHistosToNewHistos.py:121
LVL1::TrigT1CaloLWHistogramToolV1::bookMissingEtThresholds
TH1F_LW * bookMissingEtThresholds(const std::string &name, const std::string &title)
Book JEM MissingEt thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1220
LVL1::TrigT1CaloLWHistogramToolV1::thresholds
void thresholds(LWHist *hist, const std::string &type, int offset=0, bool xAxis=true)
Label bins with threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:246
LVL1::TrigT1CaloLWHistogramToolV1::forwardJetThresholds
void forwardJetThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with Forward Jet threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:506
TrigConf::L1DataDef::TriggerType
TriggerType
Definition: L1DataDef.h:30
y
#define y
TH1F
Definition: rootspy.cxx:320
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
LVL1::TrigT1CaloLWHistogramToolV1::registerHist
void registerHist(LWHist *hist)
Register a histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:742
LVL1::TrigT1CaloLWHistogramToolV1::thresholdNames
bool thresholdNames(const std::string &type, std::vector< std::string > &names)
Get list of threshold names for given type.
Definition: TrigT1CaloLWHistogramToolV1.cxx:191
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMEventVsCrateModule
TH2I_LW * bookJEMEventVsCrateModule(const std::string &name, const std::string &title)
Book JEM events with error/mismatch vs crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1029
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMEtaVsPhi
TH2F_LW * bookJEMEtaVsPhi(const std::string &name, const std::string &title)
Book JEM eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1067
TrigConf::CTPConfig::menu
const Menu & menu() const
Definition: CTPConfig.h:38
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TH1
Definition: rootspy.cxx:268
DeMoScan.first
bool first
Definition: DeMoScan.py:534
LVL1::TrigT1CaloLWHistogramToolV1::cpmCrateCMM
void cpmCrateCMM(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with CPM crate/CMM.
Definition: TrigT1CaloLWHistogramToolV1.cxx:393
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LWHist2D::getSums
virtual void getSums(double &sumW, double &sumW2, double &sumWX, double &sumWX2, double &sumWY, double &sumWY2, double &sumWXY) const =0
LVL1::TrigT1CaloLWHistogramToolV1::bookPPMEmEtaVsPhi
TH2F_LW * bookPPMEmEtaVsPhi(const std::string &name, const std::string &title)
Book PPM Em eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1320
LVL1::TrigT1CaloLWHistogramToolV1::missingEtThresholds
void missingEtThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with MissingEt threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:522
xmax
double xmax
Definition: listroot.cxx:61
LVL1::TrigT1CaloLWHistogramToolV1::ppmCrateModule
void ppmCrateModule(LWHist *hist, int firstCrate, int lastCrate, int offset=0, bool xAxis=true)
Label bins with PPM crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:551
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:232
LVL1::TrigT1CaloLWHistogramToolV1::bookForwardJetThresholds
TH1F_LW * bookForwardJetThresholds(const std::string &name, const std::string &title)
Book JEM forward jet thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1198
entries
double entries
Definition: listroot.cxx:49
LVL1::TrigT1CaloLWHistogramToolV1::jetEtThresholds
void jetEtThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with JetEt threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:514
TrigConf::CTPConfig
Definition: CTPConfig.h:27
LArCellBinning.step
step
Definition: LArCellBinning.py:158
LVL1::TrigT1CaloLWHistogramToolV1::numbers
void numbers(LWHist *hist, int min, int max, int step=1, int offset=0, bool xAxis=true)
Label bins with numbers.
Definition: TrigT1CaloLWHistogramToolV1.cxx:144
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMCrateModuleVsThreshold
TH2F_LW * bookCPMCrateModuleVsThreshold(const std::string &name, const std::string &title)
Book CPM crate/module vs thresholds.
Definition: TrigT1CaloLWHistogramToolV1.cxx:823
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
LArG4GenerateShowerLib.nevents
nevents
Definition: LArG4GenerateShowerLib.py:19
LVL1::TrigT1CaloLWHistogramToolV1::m_eventSamples
int m_eventSamples
Number of Error Event Number Samples.
Definition: TrigT1CaloLWHistogramToolV1.h:492
LVL1::TrigT1CaloLWHistogramToolV1::setBinPPMEmEtaVsPhi
void setBinPPMEmEtaVsPhi(LWHist2D *hist, int binx, int biny, double content, double error=-1.)
Set bin content and optionally error in Em eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1991
LWHist2D::SetBinContentAndError
virtual void SetBinContentAndError(unsigned binx, unsigned biny, const double &content, const double &error)=0
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
TH2F_LW
Definition: TH2F_LW.h:23
LVL1::TrigT1CaloLWHistogramToolV1::fillPPMEmEtaVsPhi
void fillPPMEmEtaVsPhi(LWHist2D *hist, double eta, double phi, double weight=1.)
Fill PPM Em eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1841
LVL1::TrigT1CaloLWHistogramToolV1::fillPPMHadEtaVsPhi
void fillPPMHadEtaVsPhi(LWHist2D *hist, double eta, double phi, double weight=1.)
Fill PPM Had eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1872
LVL1::TrigT1CaloLWHistogramToolV1::efficienciesForMerge
void efficienciesForMerge(LWHist *lw1, LWHist *lw2, LWHist *lw3)
Compute efficiencies and errors for perBinEffPerCent merge method.
Definition: TrigT1CaloLWHistogramToolV1.cxx:2043
fillSCTHists.etaMod
etaMod
Definition: fillSCTHists.py:23
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMModuleVsCrate
TH2F_LW * bookJEMModuleVsCrate(const std::string &name, const std::string &title)
Book JEM module Vs crate.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1039
LWHist::getROOTHistBase
virtual TH1 * getROOTHistBase()=0
error
Definition: IImpactPoint3dEstimator.h:70
minValue
#define minValue(current, test)
Definition: CompoundLayerMaterialCreator.h:21
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
LWHist.h
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMEtaVsPhi
TH2F_LW * bookCPMEtaVsPhi(const std::string &name, const std::string &title)
Book CPM eta vs phi.
Definition: TrigT1CaloLWHistogramToolV1.cxx:834
LVL1::TrigT1CaloLWHistogramToolV1::numberPairs2
void numberPairs2(LWHist *hist, int firstMin, int firstMax, int secondMin, int secondMax, int step=1, int offset=0, bool xAxis=true)
Label bins with number pairs without skipping bins when stepping.
Definition: TrigT1CaloLWHistogramToolV1.cxx:126
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMCrateModuleVsExEyEt
TH2F_LW * bookJEMCrateModuleVsExEyEt(const std::string &name, const std::string &title)
Book JEM crate/module vs EX,Ey,Et.
Definition: TrigT1CaloLWHistogramToolV1.cxx:993
LVL1::TrigT1CaloLWHistogramToolV1::scaleForMerge
void scaleForMerge(LWHist2D *hist, int nevents)
Scale histogram quantities by number of events for weightedAverage merge.
Definition: TrigT1CaloLWHistogramToolV1.cxx:2023
LVL1::TrigT1CaloLWHistogramToolV1::cpmCMMCrateModule
void cpmCMMCrateModule(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with CPM/CMM crate/module.
Definition: TrigT1CaloLWHistogramToolV1.cxx:379
LVL1::TrigT1CaloLWHistogramToolV1::bookCPMCrateModuleVsFPGA
TH2F_LW * bookCPMCrateModuleVsFPGA(const std::string &name, const std::string &title)
Book CPM crate/module vs FPGA.
Definition: TrigT1CaloLWHistogramToolV1.cxx:805
LVL1::TrigT1CaloLWHistogramToolV1::getMinMaxBin
bool getMinMaxBin(LWHist2D *hist, int &minBinx, int &minBiny, int &maxBinx, int &maxBiny, double &minValue, double &maxValue)
Get Minimum and Maximun bins and contents of 2D histogram.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1515
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
LVL1::TrigT1CaloLWHistogramToolV1::m_monGroup
ManagedMonitorToolBase::MonGroup * m_monGroup
Current MonGroup or 0 if not wanted.
Definition: TrigT1CaloLWHistogramToolV1.h:486
LVL1::TrigT1CaloLWHistogramToolV1::missingEtSigThresholds
void missingEtSigThresholds(LWHist *hist, int offset=0, bool xAxis=true)
Label bins with MissingEtSig threshold names.
Definition: TrigT1CaloLWHistogramToolV1.cxx:538
ymax
double ymax
Definition: listroot.cxx:64
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMSubStatusVsCrate
TH2F_LW * bookJEMSubStatusVsCrate(const std::string &name, const std::string &title)
Book JEM sub-status errors vs crate.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1266
LVL1::TrigT1CaloLWHistogramToolV1::bookProfilePPMEmEtaVsPhi
TProfile2D_LW * bookProfilePPMEmEtaVsPhi(const std::string &name, const std::string &title)
Book PPM Em eta vs phi profile.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1382
LVL1::TrigT1CaloLWHistogramToolV1::numberPairs
void numberPairs(LWHist *hist, int firstMin, int firstMax, int secondMin, int secondMax, int step=1, int offset=0, bool xAxis=true)
Label bins with number pairs.
Definition: TrigT1CaloLWHistogramToolV1.cxx:107
CompareRootFiles.hist2
hist2
Definition: CompareRootFiles.py:37
LWHist2D.h
LVL1::TrigT1CaloLWHistogramToolV1::bookJEMCrateModuleVsFrameLoc
TH2F_LW * bookJEMCrateModuleVsFrameLoc(const std::string &name, const std::string &title)
Book JEM crate/module vs frame/local coord.
Definition: TrigT1CaloLWHistogramToolV1.cxx:1007
LWHist2D::setSums
virtual void setSums(const double &sumW, const double &sumW2, const double &sumWX, const double &sumWX2, const double &sumWY, const double &sumWY2, const double &sumWXY)=0