ATLAS Offline Software
L1TriggerTowerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 // L1TriggerTowerTool.cxx
7 #include "L1TriggerTowerTool.h"
8 
9 #include "GaudiKernel/Incident.h"
10 #include "GaudiKernel/IIncidentSvc.h"
11 #include "GaudiKernel/GaudiException.h"
12 
16 
28 
31 
34 
37 
41 
42 #include "StoreGate/ReadHandle.h"
43 #include "GaudiKernel/ThreadLocalContext.h"
44 
45 #include <cstdint>
46 #include <tuple>
47 
48 namespace LVL1
49 {
50 
51 //================ Static Constants ============================================
52 
55 
56 //================ Constructor =================================================
57 
59  const std::string& n,
60  const IInterface* p )
61  :
62  AthAlgTool(t,n,p),
63  m_caloMgr(0),
64  m_lvl1Helper(0),
65  m_l1CaloTTIdTools("LVL1::L1CaloTTIdTools/L1CaloTTIdTools", this),
66  m_ttSvc("CaloTriggerTowerService/CaloTriggerTowerService", this),
67  m_mappingTool("", this),
68  m_l1CondSvc("L1CaloCondSvc", n),
69  m_dbFineTimeRefsTowers(0),
70  m_correctFir(false),
71  m_dynamicPedestalProvider("", this)
72 {
73  declareInterface<IL1TriggerTowerTool>(this);
74 
75  declareProperty( "BaselineCorrection", m_correctFir );
76  declareProperty( "L1DynamicPedestalProvider", m_dynamicPedestalProvider );
77 }
78 
79 //================ Destructor =================================================
80 
82 {
83 }
84 
85 //================ Initialisation =================================================
86 
88 {
89  m_debug = msgLvl(MSG::VERBOSE); // May want to make this VERBOSE!
90 
91 
92  ATH_CHECK(m_l1CondSvc.retrieve());
93  ATH_CHECK(m_l1CaloTTIdTools.retrieve());
94 
95  if(!m_ttSvc.retrieve().isSuccess()) {
96  ATH_MSG_WARNING( "Could not retrieve CaloTriggerTowerService Tool" );
97  } else {
98  ATH_MSG_INFO("Retrieved Tool " << m_ttSvc);
99  }
100 
101  StatusCode scID = detStore()->retrieve(m_caloMgr);
102  if (scID.isFailure()) {
103  ATH_MSG_WARNING( "Cannot retrieve m_caloMgr" );
104  } else {
106  }
107 
108  if (!m_mappingTool.empty()) {
109  ATH_CHECK( m_mappingTool.retrieve() );
110  }
111 
112  // Incident Service:
113  IIncidentSvc* incSvc = 0;
114  if (service("IncidentSvc", incSvc).isFailure()) {
115  ATH_MSG_WARNING( "Unable to retrieve pointer to IncidentSvc " );
116  }
117  else {
118  incSvc->addListener(this, "BeginRun");
119  }
120 
121  // Pedestal Correction
122  if (m_correctFir) {
124  ATH_MSG_INFO( "Retrieved L1DynamicPedestalProvider: " << m_dynamicPedestalProvider );
125  }
126 
128 
130 
131  ATH_MSG_INFO( "Initialization completed" );
132 
133  return StatusCode::SUCCESS;
134 }
135 
136 //================ Finalisation =================================================
137 
139 {
140  return StatusCode::SUCCESS;
141 }
142 
143 //================ Reset mapping table at start of run ============================
144 
145 void L1TriggerTowerTool::handle(const Incident& inc)
146 {
147  if (inc.type()=="BeginRun") {
148  ATH_MSG_DEBUG( "Resetting mapping table at start of run" );
149 
150  m_idTable.clear();
151  }
152 }
153 
154 //================= Now the actual user calls ===================================
155 
156 namespace { // helper function
157  template<class T>
159  T* C = nullptr;
160  CHECK_WITH_CONTEXT(svc->retrieve(C), "L1TriggerTowerTool");
161  target = C;
162  return StatusCode::SUCCESS;
163  }
164 
165  template<class T, class FolderMap>
166  StatusCode retrieveGenericWithFolders ATLAS_NOT_THREAD_SAFE (ServiceHandle<L1CaloCondSvc>& svc, const FolderMap& fmap, std::any& target) {
167  T* C = nullptr;
168  CHECK_WITH_CONTEXT(svc->retrieve(C, fmap), "L1TriggerTowerTool");
169  target = C;
170  return StatusCode::SUCCESS;
171  }
172 
173 } // anonymous namespace
174 
177 {
178  ATH_MSG_VERBOSE("L1TriggerTowerTool::retrieveConditions");
179  if (m_l1CondSvc) {
180  ATH_MSG_VERBOSE( "Retrieving Conditions Containers" );
181  bool verbose = msgLvl(MSG::VERBOSE);
182 
183  bool is_run2 = isRun2();
184 
185  if(is_run2) {
186  CHECK_WITH_CONTEXT(m_l1CondSvc->retrieve(m_derivedRunParsContainer), "L1TriggerTowerTool");
187  if (std::cbegin(*m_derivedRunParsContainer) == std::cend(*m_derivedRunParsContainer)) {
188  ATH_MSG_WARNING("Empty L1CaloDerivedRunParsContainer");
189  return StatusCode::FAILURE;
190  }
191 
192  CHECK_WITH_CONTEXT(m_l1CondSvc->retrieve(m_runParametersContainer), "L1TriggerTowerTool");
193  if (std::cbegin(*m_runParametersContainer) == std::cend(*m_runParametersContainer)) {
194  ATH_MSG_WARNING("Empty L1CaloRunParametersContainer");
195  return StatusCode::FAILURE;
196  }
197 
198 
199  std::string timingRegime = std::cbegin(*m_derivedRunParsContainer)->timingRegime();
200 
201  CHECK_WITH_CONTEXT(m_l1CondSvc->retrieve(m_strategyContainer), "L1TriggerTowerTool");
202 
203  std::string strategy;
204  for(const auto& it: *m_strategyContainer){
205  if (it.timingRegime() == timingRegime){
206  strategy = it.strategy();
207  }
208  }
209 
210  std::map<L1CaloPprConditionsContainerRun2::eCoolFolders, std::string>
211  coolFoldersKeysMap = {
212  {
214  "/TRIGGER/L1Calo/V2/Configuration/PprChanDefaults"
215  }
216  };
217 
218  if (strategy.empty()){
220  = "/TRIGGER/L1Calo/V2/Calibration/" + timingRegime + "/PprChanCalib";
221  } else {
223  "/TRIGGER/L1Calo/V2/Calibration/" + timingRegime + "/PprChanCommon";
225  "/TRIGGER/L1Calo/V2/Calibration/" + timingRegime + "/PprChan" + strategy;
226  }
227 
228  CHECK(retrieveGenericWithFolders<L1CaloPprConditionsContainerRun2>(
229  m_l1CondSvc, coolFoldersKeysMap, m_conditionsContainer));
230 
231  CHECK(retrieveGeneric<L1CaloPprDisabledChannelContainerRun2>(m_l1CondSvc, m_disabledChannelContainer));
232  } else {
233  CHECK(retrieveGeneric<L1CaloPprConditionsContainer>(m_l1CondSvc, m_conditionsContainer));
234  CHECK(retrieveGeneric<L1CaloPprDisabledChannelContainer>(m_l1CondSvc, m_disabledChannelContainer));
235  }
236 
237 
238  if(verbose) {
239  ATH_MSG_VERBOSE( "Retrieved ConditionsContainer" );
240  if(is_run2){
241  std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer)->dump();
242  } else{
243  std::any_cast<L1CaloPprConditionsContainer*>(m_conditionsContainer)->dump();
244  }
245  }
246 
247  if(verbose) {
248  if(is_run2){
249  ATH_MSG_VERBOSE( "Retrieved DerivedRunParsContainer" );
251  ATH_MSG_VERBOSE( "Retrieved RunParametersContainer" );
253  ATH_MSG_VERBOSE( "Retrieved StrategyContainer" );
255  }
256  }
257 
258  ATH_MSG_VERBOSE( "Retrieved DisabledChannelContainer" );
259  if (verbose) {
260  if(is_run2)
261  std::any_cast<L1CaloPprDisabledChannelContainerRun2*>(m_disabledChannelContainer)->dump();
262  else
263  std::any_cast<L1CaloPprDisabledChannelContainer*>(m_disabledChannelContainer)->dump();
264  }
265 
266  } else {
267  ATH_MSG_ERROR("Could not retrieve Conditions Containers");
268  return StatusCode::FAILURE;
269  }
270 
271  return StatusCode::SUCCESS;
272 }
273 
276 void L1TriggerTowerTool::process(const std::vector<int> &digits, double eta, double phi, int layer,
277  std::vector<int> &et, std::vector<int> &bcidResults,
278  std::vector<int> &bcidDecisions, bool useJepLut /* = true */)
279 {
282 
284  process(digits, id, et, bcidResults, bcidDecisions, useJepLut);
285 }
286 
287 
290 void L1TriggerTowerTool::process(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId,
291  std::vector<int> &et, std::vector<int> &bcidResults,
292  std::vector<int> &bcidDecisions, bool useJepLut /* = true */)
293 {
294  if (m_debug) {
295  ATH_MSG_VERBOSE( "::process: ==== Entered Process ====" );
296  ATH_MSG_VERBOSE( "::process: digits: ");
297  printVec(digits);
298  ATH_MSG_VERBOSE( " channelID: " << MSG::hex << channelId.id() << MSG::dec );
299  }
300 
302  et.clear();
303  bcidResults.clear();
304  bcidDecisions.clear();
305 
306  ATH_MSG_VERBOSE( "::process: ---- FIR filter ----" );
307 
309  std::vector<int> filter;
310  fir(digits, channelId, filter);
311  std::vector<int> lutInput;
312  dropBits(filter, channelId, lutInput);
313 
314  ATH_MSG_VERBOSE( "::process: ---- BCID algorithms ----" );
315 
317  bcid(filter, digits, channelId, bcidResults);
318 
319  ATH_MSG_VERBOSE( "::process: ---- BCID decisions ----" );
320 
322  std::vector<int> decisionRange;
323  bcidDecisionRange(lutInput, digits, channelId, decisionRange);
324  bcidDecision(bcidResults, decisionRange, channelId, bcidDecisions);
325 
326  ATH_MSG_VERBOSE( "::process: ---- LUT ET calculation ----" );
327 
329  std::vector<int> lutOutput;
330  if(isRun2()) {
331  if(useJepLut) jepLut(lutInput, channelId, lutOutput);
332  else cpLut(lutInput, channelId, lutOutput);
333  } else {
334  lut(lutInput, channelId, lutOutput);
335  }
336 
337  ATH_MSG_VERBOSE( "::process: ---- use ET range ----" );
338 
341  applyEtRange(lutOutput, decisionRange, channelId, et);
342 
343  ATH_MSG_VERBOSE( "::process: ==== Leaving Process ====" );
344 }
345 
346 namespace {
347 // helper function to convert vectors of different type
348 template <typename DST, typename SRC>
349 std::vector<DST> convertVectorType(const std::vector<SRC>& s) {
350  std::vector<DST> d(s.size());
352  [](SRC v){return static_cast<DST>(v);});
353  return d;
354 }
355 }
356 
358 void L1TriggerTowerTool::simulateChannel(const xAOD::TriggerTower& tt, std::vector<int>& outCpLut, std::vector<int>& outJepLut, std::vector<int>& bcidResults, std::vector<int>& bcidDecisions)
359 {
360 
361  //If we have 80 MHz readout, we need to extract the 40 MHz samples. The central 80 MHz sample is always a 40 MHz sample. We use the cool database (runParameters folder) to understand if we are in 80MHz readout
362 
363  unsigned int readoutConfigID = std::cbegin(*m_runParametersContainer)->readoutConfigID();
364 
365  if(m_debug){
366  ATH_MSG_VERBOSE("ReadoutConfigID = " << readoutConfigID );
367  }
368 
369  std::vector<uint16_t> digits40;
370 
371  if(readoutConfigID == 5 or readoutConfigID == 6){
372 
373  if(m_debug){
374  ATH_MSG_VERBOSE("80 MHz readout detected, emulating 40 MHz samples");
375  }
376 
377  int nSlices = tt.adc().size();
378 
379  if((nSlices%4)==3){
380  for (int i=0 ; i < (nSlices-1)/2 ; i++ ){
381  digits40.push_back(tt.adc().at(2*i+1));
382  }
383  }
384  else if((nSlices%4)==1){
385  for (int i=0 ; i <= (nSlices-1)/2 ; i++){
386  digits40.push_back(tt.adc().at(2*i));
387  }
388  }
389 
390 
391  }else{
392  if(m_debug){
393  ATH_MSG_VERBOSE("40 MHz readout detected");
394  }
395  digits40 = tt.adc();
396  }
397 
398  const auto& digits = convertVectorType<int>(digits40);
399 
400  L1CaloCoolChannelId channelId {tt.coolId()};
401 
402  if (m_debug) {
403  ATH_MSG_VERBOSE( "::simulateChannel: ==== Entered Process ====" );
404  ATH_MSG_VERBOSE( "::simulateChannel: digits: ");
405  printVec(digits);
406  ATH_MSG_VERBOSE( "::simulateChannel: channelID: " << MSG::hex << channelId.id() << MSG::dec );
407  }
408 
410  outCpLut.clear();
411  outJepLut.clear();
412  bcidResults.clear();
413  bcidDecisions.clear();
414 
416  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- FIR filter ----" );
417  std::vector<int> filter;
418  fir(digits, channelId, filter);
419  if (m_debug) printVec(filter);
420 
421 
423  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- pedestalCorrection ----" );
424  // the correction is only available for each LUT slice in the read-out (not ADC/Filter slice)
425  // therefore we can only apply it to the #LUT central filter slices
426  const std::size_t nCorr = tt.correctionEnabled().size();
427  const std::size_t filterOffset = filter.size()/2 - nCorr/2;
428  for(std::size_t iCorr = 0; iCorr < nCorr; ++iCorr) {
429  filter[filterOffset + iCorr] -= tt.correction()[iCorr] * tt.correctionEnabled()[iCorr];
430  }
431  if (m_debug) printVec(filter);
432 
433  std::vector<int> lutInput;
434  dropBits(filter, channelId, lutInput);
435 
436  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- BCID algorithms ----" );
437 
439  bcid(filter, digits, channelId, bcidResults);
440 
441  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- BCID decisions ----" );
442 
444  std::vector<int> decisionRange;
445  bcidDecisionRange(lutInput, digits, channelId, decisionRange);
446  bcidDecision(bcidResults, decisionRange, channelId, bcidDecisions);
447 
448  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- LUT ET calculation ----" );
449 
451  std::vector<int> cpLutOutput, jepLutOutput;
452  cpLut(lutInput, channelId, cpLutOutput);
453  jepLut(lutInput, channelId, jepLutOutput);
454 
455  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- use ET range ----" );
456 
459  applyEtRange(cpLutOutput, decisionRange, channelId, outCpLut);
460  applyEtRange(jepLutOutput, decisionRange, channelId, outJepLut);
461 
462  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ==== Leaving Process ====" );
463 }
464 
468 void L1TriggerTowerTool::bcid(const std::vector<int> &filter, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
469 {
470  // Get decision flags for the 2 BCID algorithms
471  std::vector<int> peak;
472  peakBcid(filter, channelId, peak);
473  std::vector<int> sat;
474  satBcid(digits, channelId, sat);
475 
476  output.clear();
477  output.reserve(sat.size()); // avoid frequent reallocations
478 
479  std::vector<int>::iterator itpeak = peak.begin();
480  std::vector<int>::iterator itsat = sat.begin();
481  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
482  output.push_back( (*itpeak<<2) + (*itsat<<1) );
483  }
484  if (m_debug) {
485  ATH_MSG_VERBOSE( "::bcid: bcidResults: ");
486  printVec(output);
487  ATH_MSG_VERBOSE(" ");
488  }
489 }
490 
494 void L1TriggerTowerTool::bcid(const std::vector<int> &filter, const std::vector<int> &digits,
495  unsigned int strategy, int satLow, int satHigh, int satLevel, std::vector<int> &output)
496 {
497  // Get decision flags for the 2 BCID algorithms
498  std::vector<int> peak;
499  peakBcid(filter, strategy, peak);
500  std::vector<int> sat;
501  satBcid(digits, satLow, satHigh, satLevel, sat);
502 
503  output.clear();
504  output.reserve(sat.size()); // avoid frequent reallocations
505 
506  std::vector<int>::iterator itpeak = peak.begin();
507  std::vector<int>::iterator itsat = sat.begin();
508  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
509  output.push_back( (*itpeak<<2) + (*itsat<<1) );
510  }
511  if (m_debug) {
512  ATH_MSG_VERBOSE( "::bcid: bcidResults: ");
513  printVec(output);
514  ATH_MSG_VERBOSE(" ");
515  }
516 }
517 
521 void L1TriggerTowerTool::bcid(const std::vector<int> &filter, const std::vector<int> &lutInput, const std::vector<int> &digits, int energyLow, int energyHigh, int decisionSource, std::vector<unsigned int> &decisionConditions,
522  unsigned int strategy, int satLow, int satHigh, int satLevel, std::vector<int> &result, std::vector<int> &decision)
523 {
524  // Get decision flags for the 2 BCID algorithms
525  std::vector<int> peak;
526  peakBcid(filter, strategy, peak);
527  std::vector<int> sat;
528  satBcid(digits, satLow, satHigh, satLevel, sat);
529 
530  result.clear();
531  result.reserve(sat.size()); // avoid frequent reallocations
532  decision.clear();
533 
534  std::vector<int>::iterator itpeak = peak.begin();
535  std::vector<int>::iterator itsat = sat.begin();
536  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
537  result.push_back( (*itpeak<<2) + (*itsat<<1) );
538  }
539  if (m_debug) {
540  ATH_MSG_VERBOSE( "::bcid: bcidResults: ");
541  printVec(result);
542  ATH_MSG_VERBOSE(" ");
543  }
544 
546  std::vector<int> decisionRange;
547  if (!(decisionSource&0x1)) etRange(digits, energyLow, energyHigh, decisionRange);
548  else etRange(lutInput, energyLow, energyHigh, decisionRange);
549  bcidDecision(result, decisionRange, decisionConditions, decision);
550  if (m_debug) {
551  ATH_MSG_VERBOSE( "::bcid: bcidDecisions: ");
552  printVec(decision);
553  ATH_MSG_VERBOSE(" ");
554  }
555 }
556 
557 namespace { // helper function
558  template<class T>
559  const std::vector<short int>* getFirCoefficients(unsigned int coolId, std::any& C) {
560  auto settings = std::any_cast<T*>(C)->pprConditions(coolId);
561  if(!settings) return nullptr;
562  return &(settings->firCoefficients());
563  }
564 } // anonymous namespace
565 
569 void L1TriggerTowerTool::fir(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
570 {
572  std::vector<int> firCoeffs;
573  if(m_conditionsContainer.has_value()) {
574  const std::vector<short int>* hwCoeffs;
575  if(isRun2())
576  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
577  else
578  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
579  if(hwCoeffs) {
583  firCoeffs.reserve(hwCoeffs->size()); // avoid frequent reallocations
584  for (int i = hwCoeffs->size()-1; i >= 0; --i) firCoeffs.push_back((*hwCoeffs)[i]);
585 
586  } else ATH_MSG_WARNING( "::fir: No L1CaloPprConditions found" );
587  } else ATH_MSG_WARNING( "::fir: No Conditions Container retrieved" );
588 
589  if (m_debug) {
590  ATH_MSG_VERBOSE( "::fir: FIR coefficients: ");
591  printVec(firCoeffs);
592  ATH_MSG_VERBOSE(" ");
593  }
594 
595  fir(digits, firCoeffs, output);
596 }
597 
602 void L1TriggerTowerTool::fir(const std::vector<int> &digits, const std::vector<int> &firCoeffs, std::vector<int> &output)
603 {
604  output.clear();
605  output.reserve(digits.size()); // avoid frequent reallocations
608  int firstFIR = -1;
609  int lastFIR = 0;
610  for (unsigned int i = 0; i < firCoeffs.size(); ++i) {
611  if (firstFIR < 0 && firCoeffs[i] != 0) firstFIR = i;
612  if (firCoeffs[i] != 0) lastFIR = i;
613  }
614  if (firstFIR < 0) firstFIR = lastFIR + 1;
615 
616  for (int i = 0; i < (int)digits.size(); i++) {
617  int sum = 0;
619  if (i >= 2-firstFIR && i < (int)digits.size()+2-lastFIR) {
620  for (int j = firstFIR; j <= lastFIR; ++j) {
621  sum += digits[i+j-2]*firCoeffs[j];
622  }
623  }
624  if (sum < 0) sum = 0;
625  output.push_back(sum);
626  }
627  if (m_debug) {
628  ATH_MSG_VERBOSE( "::fir: output: ");
629  printVec(output);
630  ATH_MSG_VERBOSE(" ");
631  }
632 }
633 
634 namespace {
635  template<typename T>
636  unsigned int getStrategy(std::any& C) {
637  return std::any_cast<T*>(C)->peakFinderCond();
638  }
639 }
640 
642 void L1TriggerTowerTool::peakBcid(const std::vector<int> &fir, const L1CaloCoolChannelId& /*channelId*/, std::vector<int> &output)
643 {
644  unsigned int strategy = 0;
645  if(m_conditionsContainer.has_value()) {
646  if(isRun2())
647  strategy = getStrategy<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
648  else
649  strategy = getStrategy<L1CaloPprConditionsContainer>(m_conditionsContainer);
650  } else ATH_MSG_WARNING( "::peakBcid: No Conditions Container retrieved" );
651 
652  ATH_MSG_VERBOSE( "::peakBcid: peak-finder strategy: " << strategy );
653 
655 }
656 
658 void L1TriggerTowerTool::peakBcid(const std::vector<int> &fir, unsigned int strategy, std::vector<int> &output)
659 {
660  output.clear();
661  output.reserve(fir.size()); // avoid frequent reallocations
662 
663  for (unsigned int i = 0; i < fir.size(); i++) {
664  int result = 0;
666  if (i > 0 && i < fir.size()-1) {
668  if (strategy&0x1) {
669  if ( (fir[i-1]<fir[i]) && (fir[i+1]<fir[i]) ) result = 1;
670  } else {
671  if ( (fir[i-1]<fir[i]) && (fir[i+1]<=fir[i]) ) result = 1;
672  }
673  }
674  output.push_back(result);
675  }
676  if (m_debug) {
677  ATH_MSG_VERBOSE( "::peakBcid: output: ");
678  printVec(output);
679  ATH_MSG_VERBOSE(" ");
680  }
681 }
682 
683 namespace { // helper function
684  template<class T>
685  std::tuple<bool, int, int, int> getSaturation(unsigned int coolId, std::any& C) {
686  auto settings = std::any_cast<T*>(C)->pprConditions(coolId);
687  if(!settings) return std::make_tuple(false, 0, 0, 0);
688  return std::make_tuple(true, settings->satBcidLevel(), settings->satBcidThreshLow(),
689  settings->satBcidThreshHigh());
690  }
691 } // anonymous namespace
692 
694 void L1TriggerTowerTool::satBcid(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
695 {
696  int satLevel = 0;
697  int satLow = 0;
698  int satHigh = 0;
699  if (m_conditionsContainer.has_value()) {
700  bool available = false;
701  if(isRun2())
702  std::tie(available, satLevel, satLow, satHigh) = getSaturation<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
703  else
704  std::tie(available, satLevel, satLow, satHigh) = getSaturation<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
705  if(!available) ATH_MSG_WARNING( "::satBcid: No L1CaloPprConditions found" );
706  } else ATH_MSG_WARNING( "::satBcid: No Conditions Container retrieved" );
707 
708  ATH_MSG_VERBOSE( "::satBcid: satLevel: " << satLevel
709  << " satLow: " << satLow
710  << " satHigh: " << satHigh );
711 
712  satBcid(digits, satLow, satHigh, satLevel, output);
713 }
714 
717 void L1TriggerTowerTool::satBcid(const std::vector<int> &digits, int satLow, int satHigh, int satLevel, std::vector<int> &output)
718 {
719  output.clear();
720  output.reserve(digits.size()); // avoid frequent reallocations
721 
722  bool enabled = true;
723  int flag[2] = {0,0};
724 
725  for (unsigned int i = 0; i<digits.size(); i++) {
726  // Algorithm can set flag for following sample. So here we
727  // propagate such flags into the current sample.
728  flag[0] = flag[1];
729  flag[1] = 0;
730 
731  if (digits[i]>=satLevel) { // do we have saturation?
732  if (enabled && i>1) { // is algorithm active?
733  bool low = (digits[i-2]>satLow);
734  bool high = (digits[i-1]>satHigh);
735  if (high) { // flag current or next sample?
736  if (low) {
737  flag[0] = 1;
738  }
739  else {
740  flag[1] = 1;
741  }
742  }
743  else {
744  flag[1] = 1;
745  }
746  }
747  enabled = false; // after first saturation, disable algorithm
748  }
749  else {
750  enabled = true; // unsaturated sample reenables algorithm
751  }
752  output.push_back(flag[0]);
753  }
754  if (m_debug) {
755  ATH_MSG_VERBOSE( "::satBcid: output: ");
756  printVec(output);
757  ATH_MSG_VERBOSE(" ");
758  }
759 }
760 
762 namespace {
763  template<typename T>
764  unsigned int getDecisionSource(std::any& C) {
765  return std::any_cast<T*>(C)->decisionSource();
766  }
767 }
768 
769 void L1TriggerTowerTool::bcidDecisionRange(const std::vector<int>& lutInput, const std::vector<int>& digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
770 {
771  int decisionSource = 0;
772  if (m_conditionsContainer.has_value()) {
773  if(isRun2()) decisionSource = getDecisionSource<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
774  else decisionSource = getDecisionSource<L1CaloPprConditionsContainer>(m_conditionsContainer);
775 
776  } else ATH_MSG_WARNING( "::bcidDecisionRange: No Conditions Container retrieved" );
777 
778  if (!(decisionSource&0x1)) etRange(digits, channelId, output);
779  else etRange(lutInput, channelId, output);
780  if (m_debug) {
781  ATH_MSG_VERBOSE( "::bcidDecisionRange: decisionSource: " << decisionSource);
782  ATH_MSG_VERBOSE( " output: ");
783  printVec(output);
784  ATH_MSG_VERBOSE(" ");
785  }
786 }
787 
789 namespace { // helper function
790  template<class T>
791  std::tuple<unsigned int, unsigned int, unsigned int> getBcidDecision(std::any& C) {
792  auto CC = std::any_cast<T*>(C);
793  return std::make_tuple(CC->bcidDecision1(), CC->bcidDecision2(), CC->bcidDecision3());
794  }
795 } // anonymous namespace
796 void L1TriggerTowerTool::bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const L1CaloCoolChannelId& /*channelId*/, std::vector<int> &output)
797 {
798  unsigned int decision1 = 0;
799  unsigned int decision2 = 0;
800  unsigned int decision3 = 0;
801  if(m_conditionsContainer.has_value()) {
802  if(isRun2())
803  std::tie(decision1, decision2, decision3) = getBcidDecision<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
804  else
805  std::tie(decision1, decision2, decision3) = getBcidDecision<L1CaloPprConditionsContainer>(m_conditionsContainer);
806  } else ATH_MSG_WARNING( "::bcidDecision: No Conditions Container retrieved" );
807 
808  // Reverse the order! (see elog 97082 9/06/10)
809  std::vector<unsigned int> mask = { decision3, decision2, decision1 };
810 
811  ATH_MSG_VERBOSE( "::bcidDecision: masks: " << MSG::hex
812  << decision3 << " " << decision2 << " " << decision1 << MSG::dec );
813 
814  bcidDecision(bcidResults, range, mask, output);
815 }
816 
819 void L1TriggerTowerTool::bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const std::vector<unsigned int> &mask, std::vector<int> &output)
820 {
821  output.clear();
822  output.reserve(bcidResults.size()); // avoid frequent reallocations
823 
824  std::vector<int>::const_iterator itBcid = bcidResults.begin();
825  std::vector<int>::const_iterator itRange = range.begin();
826  int nRange = mask.size();
827 
828  for ( ; itBcid != bcidResults.end() && itRange != range.end(); ++itBcid, ++itRange) {
829  if ((*itRange) < nRange && (mask[*itRange]&(0x1<<*itBcid))) output.push_back(1);
830  else output.push_back(0);
831  }
832  if (m_debug) {
833  ATH_MSG_VERBOSE( "::bcidDecision: output: ");
834  printVec(output);
835  ATH_MSG_VERBOSE(" ");
836  }
837 }
838 
840 void L1TriggerTowerTool::lut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
841 {
842  int strategy = 0;
843  int offset = 0;
844  int slope = 0;
845  int cut = 0;
846  int ped = 0;
847 
848  if(isRun2()) {
849  // assert instead ?!
850  ATH_MSG_WARNING("::lut: Run-2 data - behaviour undefined!");
851  }
852 
853  if(m_conditionsContainer.has_value()) {
854  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainer*>(m_conditionsContainer);
855  const L1CaloPprConditions* settings = conditionsContainer->pprConditions(channelId.id());
856  if (settings) {
857  strategy = settings->lutStrategy();
858  offset = settings->lutOffset();
859  slope = settings->lutSlope();
860  cut = settings->lutNoiseCut();
861  ped = settings->pedValue();
862  } else ATH_MSG_WARNING( "::lut: No L1CaloPprConditions found" );
863  } else ATH_MSG_WARNING( "::lut: No Conditions Container retrieved" );
864 
865  ATH_MSG_VERBOSE( "::lut: LUT strategy/offset/slope/cut/ped: "
866  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
867 
868  unsigned int noiseCut = 0;
869  bool disabled = disabledChannel(channelId, noiseCut);
870  if (noiseCut > 0) cut = noiseCut;
871 
872  lut(fir, slope, offset, cut, ped, strategy, disabled, output);
873 }
874 
875 // TODO implement scale
876 void L1TriggerTowerTool::cpLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
877 {
878  int startBit = 0;
879  int strategy = 0;
880  int offset = 0;
881  double offsetReal = 0;
882  int slope = 0;
883  int cut = 0;
884  unsigned short scale = 0;
885  double pedMean = 0;
886  int ped = 0;
887  int hwCoeffSum = 0;
888  const std::vector<short int>* hwCoeffs;
889 
890  if(!isRun2()) {
891  // assert instead ?!
892  ATH_MSG_WARNING("::cpLut: Run-1 data - behaviour undefined!");
893  }
894 
895  if(m_conditionsContainer.has_value()) {
896  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
897  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
898  if (settings) {
899  startBit = settings->firStartBit();
900  strategy = settings->lutCpStrategy();
901  slope = settings->lutCpSlope();
902  cut = settings->lutCpNoiseCut();
903  scale = settings->lutCpScale();
904  ped = settings->pedValue();
905  pedMean = settings->pedMean();
906 
907  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
908 
909  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
910  hwCoeffSum += hwCoeffs->at(i);
911  }
912 
913  if (strategy == 0){
914  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
915  }
916  else{
917  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
918  }
919  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
920 
921  ATH_MSG_VERBOSE( "::cpLut: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
922  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
923 
924  } else ATH_MSG_WARNING( "::cpLut: No L1CaloPprConditions found" );
925  } else ATH_MSG_WARNING( "::cpLut: No Conditions Container retrieved" );
926 
927  ATH_MSG_VERBOSE( "::cpLut: LUT strategy/offset/slope/cut/ped: "
928  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
929 
930  unsigned int noiseCut = 0;
931  bool disabled = disabledChannel(channelId, noiseCut);
932  if (noiseCut > 0) cut = noiseCut;
933  if(strategy == 2) {
934  // take the global scale into account - translate strategy to 1 for Run-1 compatible treatment
935  lut(fir, scale*slope, scale*offset, scale*cut, ped, 1, disabled, output);
936  } else if(strategy == 1 || strategy == 0){
937  lut(fir, slope, offset, cut, ped, strategy, disabled, output);
938  } else ATH_MSG_WARNING(" ::cpLut: Unknown stragegy: " << strategy);
939 }
940 
941 void L1TriggerTowerTool::jepLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
942 {
943  int startBit = 0;
944  int strategy = 0;
945  int offset = 0;
946  double offsetReal = 0;
947  int slope = 0;
948  int cut = 0;
949  unsigned short scale_db = 0;
950  unsigned short scale_menu = 0;
951  int ped = 0;
952  double pedMean = 0;
953  int hwCoeffSum = 0;
954  const std::vector<short int>* hwCoeffs;
955  short par1 = 0;
956  short par2 = 0;
957  short par3 = 0;
958  short par4 = 0;
959 
960  if(!isRun2()) {
961  // assert instead ?!
962  ATH_MSG_WARNING("::jepLut: Run-1 data - behaviour undefined!");
963  }
964 
965  if(m_conditionsContainer.has_value()) {
966  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
967  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
968  if (settings) {
969  startBit = settings->firStartBit();
970  strategy = settings->lutJepStrategy();
971  slope = settings->lutJepSlope();
972  cut = settings->lutJepNoiseCut();
973  ped = settings->pedValue();
974  pedMean = settings->pedMean();
975  scale_db = settings->lutJepScale();
976 
977  auto l1Menu = SG::makeHandle( m_L1MenuKey );
978  scale_menu = l1Menu->thrExtraInfo().JET().jetScale(); // Retrieve scale param from menu
979  if (strategy == 3) {
980  par1 = settings->lutJepPar1();
981  par2 = settings->lutJepPar2();
982  par3 = settings->lutJepPar3();
983  par4 = settings->lutJepPar4();
984  }
985 
986  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
987 
988  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
989  hwCoeffSum += hwCoeffs->at(i);
990  }
991 
992  if (strategy == 0){
993  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
994  }
995  else{
996  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
997  }
998  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
999 
1000  ATH_MSG_VERBOSE( "::jepLut: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1001  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1002 
1003  } else ATH_MSG_WARNING( "::jepLut: No L1CaloPprConditions found" );
1004  } else ATH_MSG_WARNING( "::jepLut: No Conditions Container retrieved" );
1005 
1006  ATH_MSG_VERBOSE( "::jepLut: LUT strategy/offset/slope/cut/ped: "
1007  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
1008 
1009  unsigned int noiseCut = 0;
1010  bool disabled = disabledChannel(channelId, noiseCut);
1011  if (noiseCut > 0) cut = noiseCut;
1012 
1013  if(strategy == 3) {
1014  nonLinearLut(fir, slope, offset, cut, scale_db, par1, par2, par3, par4, disabled, output);
1015  }
1016  else if(strategy == 2) {
1017  // take the global scale into account - translate strategy to 1 for Run-1 compatible treatment
1018  lut(fir, scale_menu*slope, scale_menu*offset, scale_menu*cut, ped, 1, disabled, output);
1019  }else if(strategy == 1 || strategy == 0) {
1020  lut(fir, slope, offset, cut, ped, strategy, disabled, output);
1021  } else ATH_MSG_WARNING(" ::jepLut: Unknown stragegy: " << strategy);
1022 }
1023 
1026 void L1TriggerTowerTool::lut(const std::vector<int> &fir, int slope, int offset, int cut, int /*ped*/, int strategy, bool disabled, std::vector<int> &output)
1027 {
1028  output.clear();
1029  output.reserve(fir.size()); // avoid frequent reallocations
1030 
1031  std::vector<int>::const_iterator it = fir.begin();
1032  for ( ; it != fir.end(); ++it) {
1033  int out = 0;
1034  if (!disabled) {
1035  if (strategy == 0 && (*it) >= offset+cut) { // Original scheme
1036  out = (((*it)-offset)*slope + 2048)>>12;
1037  } else if (strategy == 1 && (*it)*slope >= offset+cut) { // New scheme
1038  out = ((*it)*slope - offset + 2048)>>12;
1039  }
1040  if (out < 0) out = 0;
1042  }
1043  output.push_back(out);
1044  }
1045  if (m_debug) {
1046  ATH_MSG_VERBOSE( "::lut: output: ");
1047  printVec(output);
1048  ATH_MSG_VERBOSE(" ");
1049  }
1050 }
1051 
1052 void L1TriggerTowerTool::nonLinearLut(const std::vector<int> &fir, int slope, int offset, int cut, int scale, short par1, short par2, short par3, short par4, bool disabled, std::vector<int> &output)
1053 {
1054  output.clear();
1055  output.reserve(fir.size()); // avoid frequent reallocations
1056 
1057  std::vector<int>::const_iterator it = fir.begin();
1058  for ( ; it != fir.end(); ++it) {
1059  int out = 0;
1060  if (!disabled) {
1061  // turn shorts into double
1062  double nll_slope = 0.001 * scale;
1063  double nll_offset = 0.001 * par1;
1064  double nll_ampl = 0.001 * par2;
1065  double nll_expo = 0.;
1066  if(par3) {
1067  nll_expo = -1. / (4096 * 0.001*par3);
1068  } else {
1069  nll_ampl = 0.;
1070  }
1071  double nll_noise = 0.001 * par4;
1072 
1073  // noise cut
1074  if ((*it) * slope < offset + nll_noise * cut) {
1075  output.push_back(0);
1076  continue;
1077  }
1078  // actual calculation
1079  out = int((((int)(2048 + nll_slope * ((*it) * slope - offset)))>>12) + nll_offset + nll_ampl * std::exp(nll_expo * ((*it) * slope - offset)));
1080 
1082  if(out < 0) out = 0;
1083  }
1084  output.push_back(out);
1085  }
1086  if (m_debug) {
1087  ATH_MSG_VERBOSE( "::nonLinearLut: output: ");
1088  printVec(output);
1089  ATH_MSG_VERBOSE(" ");
1090  }
1091 }
1095 void L1TriggerTowerTool::applyEtRange(const std::vector<int>& lut, const std::vector<int>& range, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
1096 {
1098  std::vector<int>::const_iterator itlut = lut.begin();
1099  std::vector<int>::const_iterator itrange = range.begin();
1100  while ( itlut != lut.end() && itrange != range.end() ) {
1101  if (!disabled && satOverride((*itrange), channelId)) output.push_back(s_saturationValue);
1102  else output.push_back(*itlut);
1103  ++itlut;
1104  ++itrange;
1105  }
1106  if (m_debug) {
1107  ATH_MSG_VERBOSE( "::applyEtRange: output: ");
1108  printVec(output);
1109  ATH_MSG_VERBOSE(" ");
1110  }
1111 }
1112 
1114 namespace { // helper function
1115  template<class T>
1116  std::tuple<bool, int, int> getBcidEnergyRange(unsigned int coolId, std::any& C) {
1117  auto settings = std::any_cast<T*>(C)->pprConditions(coolId);
1118  if(!settings) return std::make_tuple(false, 0, 0);
1119  return std::make_tuple(true, settings->bcidEnergyRangeLow(), settings->bcidEnergyRangeHigh());
1120  }
1121 } // anonymous namespace
1122 
1123 void L1TriggerTowerTool::etRange(const std::vector<int> &et, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
1124 {
1125  int energyLow = 0;
1126  int energyHigh = 0;
1127  if (m_conditionsContainer.has_value()) {
1128  bool available = false;
1129  if(isRun2())
1130  std::tie(available, energyLow, energyHigh) = getBcidEnergyRange<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1131  else
1132  std::tie(available, energyLow, energyHigh) = getBcidEnergyRange<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
1133 
1134  if(!available) ATH_MSG_WARNING("::etRange: No L1CaloPprConditions found");
1135  } else ATH_MSG_WARNING("::etRange: No Conditions Container retrieved");
1136 
1137  ATH_MSG_VERBOSE( "::etRange: energyLow: " << energyLow
1138  << " energyHigh: " << energyHigh);
1139 
1140  etRange(et, energyLow, energyHigh, output);
1141 }
1142 
1145 void L1TriggerTowerTool::etRange(const std::vector<int> &et, int energyLow, int energyHigh, std::vector<int> &output)
1146 {
1147  output.clear();
1148  output.reserve(et.size()); // avoid frequent reallocations
1149  for (std::vector<int>::const_iterator it = et.begin(); it != et.end(); ++it) {
1150  if ((*it) <= energyLow) output.push_back(0);
1151  else if ((*it) <= energyHigh) output.push_back(1);
1152  else output.push_back(2);
1153  }
1154  if (m_debug) {
1155  ATH_MSG_VERBOSE( "::etRange: output: ");
1156  printVec(output);
1157  ATH_MSG_VERBOSE(" ");
1158  }
1159 }
1160 
1162 namespace { // helper function
1163  template<class T>
1164  std::tuple<bool, int> getFirStartBit(unsigned int coolId, std::any& C) {
1165  auto settings = std::any_cast<T*>(C)->pprConditions(coolId);
1166  if(!settings) return std::make_tuple(false, 0);
1167  return std::make_tuple(true, settings->firStartBit());
1168  }
1169 } // anonymous namespace
1170 
1171 void L1TriggerTowerTool::dropBits(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output)
1172 {
1173  unsigned int start = 0;
1174  if(m_conditionsContainer.has_value()) {
1175  bool available = false;
1176  if(isRun2())
1177  std::tie(available, start) = getFirStartBit<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1178  else
1179  std::tie(available, start) = getFirStartBit<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
1180  if(!available)ATH_MSG_WARNING( "::dropBits: No L1CaloPprConditions found" );
1181  } else ATH_MSG_WARNING( "::dropBits: No Conditions Container retrieved" );
1182 
1183  ATH_MSG_VERBOSE( "::dropBits: firStartBit: " << start );
1184 
1185  dropBits(fir, start, output);
1186 }
1187 
1190 void L1TriggerTowerTool::dropBits(const std::vector<int> &fir, unsigned int start, std::vector<int> &output)
1191 {
1192  output.clear();
1193  output.reserve(fir.size()); // avoid frequent reallocations
1194 
1196  unsigned int mask = (0x3ff<<start);
1197 
1199  int max = 1<<(10+start);
1200 
1201  for (std::vector<int>::const_iterator it = fir.begin(); it != fir.end(); ++it) {
1202  if ((*it)>=max) output.push_back(0x3ff);
1203  else output.push_back(((*it)&mask)>>start);
1204  }
1205  if (m_debug) {
1206  ATH_MSG_VERBOSE( "::dropBits: output: ");
1207  printVec(output);
1208  ATH_MSG_VERBOSE(" ");
1209  }
1210 }
1211 
1213 void L1TriggerTowerTool::firParams(const L1CaloCoolChannelId& channelId, std::vector<int> &firCoeffs)
1214 {
1216  firCoeffs.clear();
1217  if(m_conditionsContainer.has_value()) {
1218  const std::vector<short int>* hwCoeffs = nullptr;
1219  if(isRun2())
1220  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1221  else
1222  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
1223 
1224  if(hwCoeffs) {
1228  firCoeffs.reserve(hwCoeffs->size()); // avoid frequent reallocations
1229  for (int i = hwCoeffs->size()-1; i >= 0; --i) firCoeffs.push_back((*hwCoeffs)[i]);
1230 
1231  } else ATH_MSG_WARNING( "::firParams: No L1CaloPprConditions found" );
1232  } else ATH_MSG_WARNING( "::firParams: No Conditions Container retrieved" );
1233 
1234  if (m_debug) {
1235  ATH_MSG_VERBOSE( "::fir: FIR coefficients: ");
1236  printVec(firCoeffs);
1237  ATH_MSG_VERBOSE(" ");
1238  }
1239 }
1240 
1242 void L1TriggerTowerTool::bcidParams(const L1CaloCoolChannelId& channelId, int &energyLow, int &energyHigh, int &decisionSource, std::vector<unsigned int> &decisionConditions,
1243  unsigned int &peakFinderStrategy, int &satLow, int &satHigh, int &satLevel)
1244 {
1245  energyLow = 0;
1246  energyHigh = 0;
1247  decisionSource = 0;
1248  decisionConditions.clear();
1249  peakFinderStrategy = 0;
1250  satLevel = 0;
1251  satLow = 0;
1252  satHigh = 0;
1253 
1254  if(m_conditionsContainer.has_value()) {
1255  using std::get;
1256  std::tuple<unsigned int, unsigned int, unsigned int> bcidDecision;
1257  std::tuple<bool, int, int> bcidEnergyRange;
1258  std::tuple<bool, int, int, int> saturation;
1259  if(isRun2()) {
1260  using Cont = L1CaloPprConditionsContainerRun2;
1261  bcidDecision = getBcidDecision<Cont>(m_conditionsContainer);
1262  peakFinderStrategy = getStrategy<Cont>(m_conditionsContainer);
1263  decisionSource = getDecisionSource<Cont>(m_conditionsContainer);
1264  bcidEnergyRange = getBcidEnergyRange<Cont>(channelId.id(), m_conditionsContainer);
1265  saturation = getSaturation<Cont>(channelId.id(), m_conditionsContainer);
1266  } else {
1267  using Cont = L1CaloPprConditionsContainer;
1268  bcidDecision = getBcidDecision<Cont>(m_conditionsContainer);
1269  peakFinderStrategy = getStrategy<Cont>(m_conditionsContainer);
1270  decisionSource = getDecisionSource<Cont>(m_conditionsContainer);
1271  bcidEnergyRange = getBcidEnergyRange<Cont>(channelId.id(), m_conditionsContainer);
1272  saturation = getSaturation<Cont>(channelId.id(), m_conditionsContainer);
1273  }
1274 
1275  decisionConditions = { get<2>(bcidDecision),
1276  get<1>(bcidDecision),
1277  get<0>(bcidDecision) }; // reverse order
1278  if(get<0>(bcidEnergyRange)) {
1279  std::tie(std::ignore, energyLow, energyHigh) = bcidEnergyRange;
1280  } else ATH_MSG_WARNING( "::bcidParams: No BcidEnergyRange found" );
1281 
1282  if(get<0>(saturation)) {
1283  std::tie(std::ignore, satLevel, satLow, satHigh) = saturation;
1284  } else ATH_MSG_WARNING( "::bcidParams: No Saturation found" );
1285  } else ATH_MSG_WARNING( "::bcid:Params No Conditions Container retrieved" );
1286 
1287  ATH_MSG_VERBOSE( "::bcidParams: satLevel: " << satLevel
1288  << " satLow: " << satLow << " satHigh: " << satHigh << endmsg
1289  << " energyLow: " << energyLow << " energyHigh: " << energyHigh << endmsg
1290  << " decisionSource: " << decisionSource << " peakFinderStrategy: "
1291  << peakFinderStrategy );
1292 
1293 }
1294 
1296 void L1TriggerTowerTool::lutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
1297 {
1298  startBit = 0;
1299  strategy = 0;
1300  offset = 0;
1301  slope = 0;
1302  cut = 0;
1303  pedValue = 0;
1304  pedMean = 0.;
1305  disabled = true;
1306 
1307  if(isRun2()) {
1308  // assert instead ?!
1309  ATH_MSG_WARNING("::lutParams: Run-2 data - behaviour undefined!");
1310  }
1311 
1312  if(m_conditionsContainer.has_value()) {
1313  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainer*>(m_conditionsContainer);
1314 
1315  const L1CaloPprConditions* settings = conditionsContainer->pprConditions(channelId.id());
1316  if (settings) {
1317  startBit = settings->firStartBit();
1318  strategy = settings->lutStrategy();
1319  offset = settings->lutOffset();
1320  slope = settings->lutSlope();
1321  cut = settings->lutNoiseCut();
1322  pedValue = settings->pedValue();
1323  pedMean = settings->pedMean();
1324  } else ATH_MSG_WARNING( "::lutParams: No L1CaloPprConditions found" );
1325  } else ATH_MSG_WARNING( "::lutParams: No Conditions Container retrieved" );
1326 
1327  ATH_MSG_VERBOSE( "::lutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1328  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1329  unsigned int noiseCut = 0;
1330  disabled = disabledChannel(channelId, noiseCut);
1331  if (noiseCut > 0) cut = noiseCut;
1332 }
1333 
1334 void L1TriggerTowerTool::cpLutParams(const L1CaloCoolChannelId& channelId, int& startBit, int& slope, int& offset, int& cut, int& pedValue, float& pedMean, int& strategy, bool& disabled)
1335 {
1336  startBit = 0;
1337  strategy = 0;
1338  offset = 0;
1339  double offsetReal = 0;
1340  slope = 0;
1341  cut = 0;
1342  pedValue = 0;
1343  pedMean = 0.;
1344  disabled = true;
1345  int hwCoeffSum = 0;
1346  const std::vector<short int>* hwCoeffs;
1347 
1348  if(!isRun2()) {
1349  // assert instead ?!
1350  ATH_MSG_WARNING("::cpLutParams: Run-1 data - behaviour undefined!");
1351  }
1352 
1353  if(m_conditionsContainer.has_value()) {
1354  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
1355 
1356  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
1357  if(settings) {
1358  startBit = settings->firStartBit();
1359  strategy = settings->lutCpStrategy();
1360  slope = settings->lutCpSlope();
1361  cut = settings->lutCpNoiseCut();
1362  pedValue = settings->pedValue();
1363  pedMean = settings->pedMean();
1364 
1365  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1366  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
1367  hwCoeffSum += hwCoeffs->at(i);
1368  }
1369 
1370  if (strategy == 0){
1371  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
1372  }
1373  else{
1374  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
1375  }
1376  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
1377 
1378  ATH_MSG_VERBOSE( "::jepLutParams: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1379  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1380 
1381  } else ATH_MSG_WARNING( "::cpLutParams: No L1CaloPprConditions found" );
1382  } else ATH_MSG_WARNING( "::cpLutParams: No Conditions Container retrieved" );
1383 
1384  ATH_MSG_VERBOSE( "::cpLutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1385  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1386  unsigned int noiseCut = 0;
1387  disabled = disabledChannel(channelId, noiseCut);
1388  if (noiseCut > 0) cut = noiseCut;
1389 }
1390 
1391 void L1TriggerTowerTool::jepLutParams(const L1CaloCoolChannelId& channelId, int& startBit, int& slope, int& offset, int& cut, int& pedValue, float& pedMean, int& strategy, bool& disabled)
1392 {
1393  startBit = 0;
1394  strategy = 0;
1395  offset = 0;
1396  double offsetReal = 0;
1397  slope = 0;
1398  cut = 0;
1399  pedValue = 0;
1400  pedMean = 0.;
1401  disabled = true;
1402  int hwCoeffSum = 0;
1403  const std::vector<short int>* hwCoeffs;
1404 
1405  if(!isRun2()) {
1406  // assert instead ?!
1407  ATH_MSG_WARNING("::jepLutParams: Run-1 data - behaviour undefined!");
1408  }
1409 
1410  if(m_conditionsContainer.has_value()) {
1411  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
1412 
1413  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
1414  if(settings) {
1415  startBit = settings->firStartBit();
1416  strategy = settings->lutJepStrategy();
1417  slope = settings->lutJepSlope();
1418  cut = settings->lutJepNoiseCut();
1419  pedValue = settings->pedValue();
1420  pedMean = settings->pedMean();
1421 
1422  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1423 
1424  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
1425  hwCoeffSum += hwCoeffs->at(i);
1426  }
1427 
1428  if (strategy == 0){
1429  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
1430  }
1431  else{
1432  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
1433  }
1434  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
1435 
1436  ATH_MSG_VERBOSE( "::jepLutParams: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1437  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1438 
1439  } else ATH_MSG_WARNING( "::jepLutParams: No L1CaloPprConditions found" );
1440  } else ATH_MSG_WARNING( "::jepLutParams: No Conditions Container retrieved" );
1441 
1442  ATH_MSG_VERBOSE( "::jepLutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1443  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1444  unsigned int noiseCut = 0;
1445  disabled = disabledChannel(channelId, noiseCut);
1446  if (noiseCut > 0) cut = noiseCut;
1447 }
1448 
1452 {
1453  Identifier id(0);
1455  int pos_neg_z = m_l1CaloTTIdTools->pos_neg_z(eta);
1456  int region = m_l1CaloTTIdTools->regionIndex(eta);
1457  int ieta = m_l1CaloTTIdTools->etaIndex(eta);
1458  int iphi = m_l1CaloTTIdTools->phiIndex(eta, phi);
1459 
1460  id = m_lvl1Helper->tower_id(pos_neg_z, layer, region, ieta, iphi);
1461  }
1462  return id;
1463 }
1464 
1468 {
1469  HWIdentifier hwId(0);
1470  if (m_ttSvc) {
1471  try { hwId = m_ttSvc->createTTChannelID(id, false); }
1472  catch (const CaloID_Exception&) { hwId = HWIdentifier(0); }
1473  }
1474  return hwId;
1475 }
1476 
1480 {
1481  Identifier id = identifier(eta, phi, layer);
1482  return hwIdentifier(id);
1483 }
1484 
1488 {
1489  // Use direct lookup table if possible
1490  const double absEta = fabs(eta);
1491  int index = 0;
1492  if (absEta < 2.5) {
1493  const int etaBin = 10.*absEta;
1494  const int phiBin = phi*(32/M_PI);
1495  index = (etaBin<<6) + phiBin;
1496  } else if (absEta < 3.2) {
1497  const int etaBin = 5.*(absEta - 2.5);
1498  const int phiBin = phi*(16./M_PI);
1499  index = 1600 + (etaBin<<5) + phiBin;
1500  } else {
1501  const int etaBin = (absEta - 3.2)*(1./0.425);
1502  const int phiBin = phi*(8./M_PI);
1503  index = 1728 + (etaBin<<4) + phiBin;
1504  }
1505  if (eta < 0.) index += 1792;
1506  if (layer > 0) index += 3584;
1507  if (index >= s_maxTowers) return L1CaloCoolChannelId(0);
1508  if (m_idTable.empty()) {
1509  m_idTable.reserve(s_maxTowers);
1510  m_idTable.assign(s_maxTowers, 0);
1511  }
1512  if (m_idTable[index] == 0) {
1513  Identifier id = identifier(eta, phi, layer);
1514  L1CaloCoolChannelId coolID = channelID(id);
1515  m_idTable[index] = coolID.id();
1516  }
1518 }
1519 
1523 {
1524  L1CaloCoolChannelId coolId(0);
1525  if (m_ttSvc) {
1526  try {
1527  HWIdentifier hwId = hwIdentifier(id);
1528  coolId = m_ttSvc->createL1CoolChannelId(hwId);
1529  }
1530  catch (const CaloID_Exception&) { coolId = L1CaloCoolChannelId(0); }
1531  }
1532  return coolId;
1533 }
1534 
1536 namespace { // helper function
1537  template<class T>
1538  std::tuple<bool, bool, bool> getSatOverride(std::any& C) {
1539  auto CC = std::any_cast<T*>(C);
1540  return std::make_tuple(CC->satOverride1(), CC->satOverride2(), CC->satOverride3());
1541  }
1542 } // anonymous namespace
1543 
1545 {
1546  bool override = false;
1547  if(m_conditionsContainer.has_value()) {
1548  std::tuple<bool, bool, bool> satOverride;
1549  if(isRun2())
1550  satOverride = getSatOverride<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
1551  else
1552  satOverride = getSatOverride<L1CaloPprConditionsContainer>(m_conditionsContainer);
1553  // NB Reverse order as for bcidDecision1/2/3
1554  if (range == 0) override = std::get<2>(satOverride);
1555  if (range == 1) override = std::get<1>(satOverride);
1556  if (range == 2) override = std::get<0>(satOverride);
1557  } else ATH_MSG_WARNING( "::satOverride: No Conditions Container retrieved" );
1558 
1559  ATH_MSG_VERBOSE( "::satOverride: range " << range
1560  << " has saturation override flag " << override );
1561 
1562  return override;
1563 }
1564 
1568 {
1569  unsigned int noiseCut = 0;
1570  return disabledChannel(channelId, noiseCut);
1571 }
1572 
1575 {
1576  bool isDisabled = false;
1577  noiseCut = 0;
1578  if(m_disabledChannelContainer.has_value()) {
1579  const L1CaloPprDisabledChannel* disabledChan = nullptr;
1580  if(isRun2()) disabledChan = std::any_cast<L1CaloPprDisabledChannelContainerRun2*>(m_disabledChannelContainer)->pprDisabledChannel(channelId.id());
1581  else disabledChan = std::any_cast<L1CaloPprDisabledChannelContainer*>(m_disabledChannelContainer)->pprDisabledChannel(channelId.id());
1582 
1583  if (disabledChan) {
1584  if (!disabledChan->disabledBits()) {
1585  ChanCalibErrorCode calibError(disabledChan->calibErrorCode());
1586  if (calibError.chanValid()) {
1587  ChanDeadErrorCode deadError(disabledChan->deadErrorCode());
1588  if (deadError.chanValid()) noiseCut = disabledChan->noiseCut();
1589  //else isDisabled = true;
1590  } //else isDisabled = true;
1591  } else isDisabled = true;
1592 
1593  ATH_MSG_VERBOSE( MSG::hex
1594  << "::disabledChannel: calibErrorCode: " << (disabledChan->calibErrorCode()).errorCode()
1595  << " deadErrorCode: " << (disabledChan->deadErrorCode()).errorCode()
1596  << " noiseCut: " << disabledChan->noiseCut()
1597  << " disabledBits: " << disabledChan->disabledBits()
1598  << MSG::dec );
1599 
1600  } else {
1601  ATH_MSG_VERBOSE( "::disabledChannel: No L1CaloPprDisabledChannel found" );
1602  }
1603  } else {
1604  ATH_MSG_WARNING( "::disabledChannel: No DisabledChannel Container retrieved" );
1605  }
1606  if (isDisabled && m_debug) ATH_MSG_VERBOSE( "::disabledChannel: Channel is disabled" );
1607 
1608  return isDisabled;
1609 }
1610 
1614 {
1615  m_debug = (debug && msgLvl(MSG::VERBOSE));
1616 }
1617 
1621 double L1TriggerTowerTool::FCalTTeta(double nominalEta, double /*phi*/, int layer)
1622 {
1623  double eta = nominalEta;
1624  float abseta = fabs(eta);
1625  if (abseta<3.2) return eta; // If called for non-FCAL TT return input value
1626  if (layer == 0) {
1627  int sign = ((eta > 0) ? 1 : -1);
1628  if (abseta < 3.6) eta = 3.15 * sign;
1629  else if (abseta < 4.0) eta = 3.33 * sign;
1630  else if (abseta < 4.5) eta = 3.72 * sign;
1631  else eta = 4.41 * sign;
1632  }
1633  else if (eta > 0) {
1634  if (abseta < 3.6) eta = 3.36;
1635  else if (abseta < 4.0) eta = 3.45;
1636  else if (abseta < 4.5) eta = 4.17;
1637  else eta = 4.19;
1638  }
1639  else {
1640  if (abseta < 3.6) eta = -3.45;
1641  else if (abseta < 4.0) eta = -3.36;
1642  else if (abseta < 4.5) eta = -4.19;
1643  else eta = -4.17;
1644  }
1645  return eta;
1646 }
1647 
1653 {
1654  if ( !m_mappingTool.isValid() ) {
1655  throw GaudiException("No mapping tool configured",
1656  "L1TriggerTowerTool::FCalTTeta", StatusCode::FAILURE);
1657  }
1658 
1660  unsigned int crate = channelId.crate();
1661  unsigned int module = channelId.module();
1662  unsigned int mcm = channelId.subModule();
1663  unsigned int pin = channelId.channel();
1664  int channel = pin*16 + mcm;
1665 
1667  double eta;
1668  double phi;
1669  int layer;
1670  if(!m_mappingTool->mapping(crate, module, channel, eta, phi, layer)) {
1671  ATH_MSG_WARNING("::FCalTTeta: could not map 0x" << std::hex << channelId.id() << std::dec);
1672  }
1673 
1675  return FCalTTeta(eta, phi, layer);
1676 }
1677 
1679 template <typename T>
1680 void L1TriggerTowerTool::printVec(const std::vector<T>& vec)
1681 {
1682  if (m_debug) {
1683  if (vec.empty()) ATH_MSG_VERBOSE( " empty ");
1684  else {
1685  for(auto v : vec) {
1686  ATH_MSG_VERBOSE( v << " ");
1687  }
1688  }
1689  }
1690 }
1691 
1693 {
1694  //method to load the FineTimeReferences Folder from COOL or an sqlite file (needs to be included in the job options)
1695  //implementation very similar to L1TriggerTowerTool::retrieveConditions
1696  //calling this method outside of fillHistograms() can result in Errors
1697  StatusCode sc;
1699 
1700  if (m_l1CondSvc) {
1701  ATH_MSG_VERBOSE( "Retrieving FineTimeReferences Containers" );
1702  bool verbose = msgLvl(MSG::VERBOSE);
1703 
1704 
1705  sc = m_l1CondSvc->retrieve(m_dbFineTimeRefsTowers);
1706  if (sc.isFailure()) {
1707  ATH_MSG_WARNING( "No FineTimeReferences Folder found" );
1708  return sc;
1709  }
1710  ATH_MSG_VERBOSE( "Retrieved FineTimeReferences Container" );
1712 
1713  } else {
1714  ATH_MSG_WARNING( "Could not retrieve FineTimeReferences, as Conditon Service not present" );
1715  return StatusCode::FAILURE;
1716  }
1717 
1718  return StatusCode::SUCCESS;
1719 }
1720 
1722 {
1723  //method returning the fine time reference and calibration value
1724  //the fineTimeReference folder has to be loaded first using the method L1TriggerTowerTool::loadFTRefs
1725  double reference = 0;
1726  double calib = 0;
1727 
1728  if (m_dbFineTimeRefsTowers) {
1730  if (ftref) {
1731  FineTimeErrorCode errorCode(ftref->errorCode());
1732 // if (errorCode.chanValid()) { //this should be changed at some point, at the moment the error code is ignored
1733  reference = ftref->refValue();
1734  calib = ftref->calibValue();
1735 // }
1736 
1737  ATH_MSG_VERBOSE( MSG::hex
1738  << "::refValues: errorCode: " << (ftref->errorCode()).errorCode()
1739  << MSG::dec << " reference: " << ftref->refValue() << " calib: " << ftref->calibValue() );
1740 
1741  } else {
1742  ATH_MSG_VERBOSE( "::refValue: No FineTimeRefsTowers found" );
1743  }
1744  } else {
1745  ATH_MSG_VERBOSE( "::refValue: No FineTimeRefs Container retrieved" );
1746  }
1747 
1748  return std::make_pair(reference, calib);
1749 }
1750 
1751 void L1TriggerTowerTool::pedestalCorrection(std::vector<int>& firInOut, int firPed, int iElement, int layer, int bcid, float mu, std::vector<int_least16_t>& correctionOut) {
1752  unsigned nFIR = firInOut.size();
1753  correctionOut.assign(nFIR, 0u);
1754 
1755  if(!m_correctFir) return;
1756 
1757  // apply the pedestal correction
1758  for(unsigned i = 0; i != nFIR; ++i) {
1759  correctionOut[i] = (m_dynamicPedestalProvider->dynamicPedestal(iElement, layer, firPed, bcid + i - nFIR/2, mu) - firPed);
1760  firInOut[i] -= correctionOut[i];
1761 
1762  if(firInOut[i] < 0) firInOut[i] = 0;
1763  }
1764 
1765  if(m_debug) {
1766  ATH_MSG_VERBOSE( "::pedestalCorrection(BCID=" << bcid << ", mu = " << mu << "): ");
1767  printVec(correctionOut);
1768  ATH_MSG_VERBOSE(" ");
1769  }
1770 }
1771 
1773 {
1774  const EventContext& ctx = Gaudi::Hive::currentContext();
1775  if (ctx.eventID().run_number() >= 253377) return true;
1776 
1778  if (eventInfo->eventType (xAOD::EventInfo::IS_SIMULATION)) return true;
1779  return false;
1780 }
1781 
1782 } // end of namespace
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
L1CaloPprConditionsRun2::lutCpSlope
unsigned short lutCpSlope() const
Definition: L1CaloPprConditionsRun2.h:78
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
L1CaloPprConditionsContainerRun2
Container of L1CaloPprConditions objects, inherit from the abstract base class AbstractL1CaloConditio...
Definition: L1CaloPprConditionsContainerRun2.h:32
LVL1::L1TriggerTowerTool::s_maxTowers
static const int s_maxTowers
Definition: L1TriggerTowerTool.h:188
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
L1CaloPprConditionsRun2::lutJepPar2
short lutJepPar2() const
Definition: L1CaloPprConditionsRun2.h:90
LVL1::L1TriggerTowerTool::simulateChannel
virtual void simulateChannel(const xAOD::TriggerTower &tt, std::vector< int > &outCpLut, std::vector< int > &outJepLut, std::vector< int > &bcidResults, std::vector< int > &bcidDecisions)
All-in-one routine - give it the TT identifier, and it returns the results.
Definition: L1TriggerTowerTool.cxx:358
IL1CaloTTIdTools.h
LVL1::L1TriggerTowerTool::channelID
virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer)
Return Cool channel identifier for given tower coordinates.
Definition: L1TriggerTowerTool.cxx:1487
L1CaloPprConditions::lutOffset
unsigned short lutOffset() const
Definition: L1CaloPprConditions.h:47
et
Extra patterns decribing particle interation process.
L1CaloPprDisabledChannelContainerRun2.h
FineTimeErrorCode
FineTimeErrorCode class for L1Calo error codes.
Definition: FineTimeErrorCode.h:19
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CHECK_WITH_CONTEXT
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:396
L1CaloPprConditions::lutSlope
unsigned short lutSlope() const
Definition: L1CaloPprConditions.h:48
LVL1::L1TriggerTowerTool::m_conditionsContainer
std::any m_conditionsContainer
Definition: L1TriggerTowerTool.h:166
LVL1::L1TriggerTowerTool::refValues
virtual std::pair< double, double > refValues(const L1CaloCoolChannelId &channelId)
Definition: L1TriggerTowerTool.cxx:1721
get_generator_info.result
result
Definition: get_generator_info.py:21
L1CaloPprConditionsRun2::firStartBit
unsigned short firStartBit() const
Definition: L1CaloPprConditionsRun2.h:74
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
L1CaloPpmFineTimeRefsContainer::ppmFineTimeRefs
const L1CaloPpmFineTimeRefs * ppmFineTimeRefs(unsigned int channelId) const
Definition: L1CaloPpmFineTimeRefsContainer.cxx:119
L1CaloPprDisabledChannel
Transient conditions class for objects defined by the online framework and retrieved from COOL.
Definition: L1CaloPprDisabledChannel.h:25
LVL1::L1TriggerTowerTool::m_ttSvc
ToolHandle< CaloTriggerTowerService > m_ttSvc
Definition: L1TriggerTowerTool.h:151
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloID_Exception
Exception class for Calo Identifiers.
Definition: CaloID_Exception.h:20
L1CaloPprConditionsRun2::lutCpNoiseCut
unsigned short lutCpNoiseCut() const
Definition: L1CaloPprConditionsRun2.h:79
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
LVL1::L1TriggerTowerTool::retrieveConditions
virtual StatusCode retrieveConditions()
Retrieve pointers to the L1Calo conditions containers.
Definition: L1TriggerTowerTool.cxx:176
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
L1CaloPprConditionsRun2::lutJepScale
unsigned short lutJepScale() const
Definition: L1CaloPprConditionsRun2.h:93
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
LVL1::L1TriggerTowerTool::m_l1CaloTTIdTools
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
Definition: L1TriggerTowerTool.h:150
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
LVL1::L1TriggerTowerTool::FCalTTeta
virtual double FCalTTeta(const L1CaloCoolChannelId &channelId)
Return median eta of trigger tower from L1CaloCoolChannelId.
Definition: L1TriggerTowerTool.cxx:1652
LVL1::L1TriggerTowerTool::setDebug
virtual void setDebug(bool debug)
Finer control of debug printing.
Definition: L1TriggerTowerTool.cxx:1613
L1CaloPprConditionsContainerRun2::ePprChanDefaults
@ ePprChanDefaults
Definition: L1CaloPprConditionsContainerRun2.h:45
L1CaloPprConditionsRun2::lutJepStrategy
unsigned short lutJepStrategy() const
Definition: L1CaloPprConditionsRun2.h:85
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
LVL1::L1TriggerTowerTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: L1TriggerTowerTool.h:182
LVL1::L1TriggerTowerTool::applyEtRange
virtual void applyEtRange(const std::vector< int > &lut, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Use ET range to return appropriate ET value Do not test BCID here, since no guarantee enough ADC samp...
Definition: L1TriggerTowerTool.cxx:1095
LVL1::L1TriggerTowerTool::m_l1CondSvc
ServiceHandle< L1CaloCondSvc > m_l1CondSvc
L1Calo conditions.
Definition: L1TriggerTowerTool.h:157
LVL1::L1TriggerTowerTool::m_idTable
std::vector< unsigned int > m_idTable
Mapping lookup table.
Definition: L1TriggerTowerTool.h:175
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
IL1DynamicPedestalProvider.h
skel.it
it
Definition: skel.GENtoEVGEN.py:423
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
FineTimeErrorCode.h
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LVL1::L1TriggerTowerTool::m_strategyContainer
L1CaloPprChanStrategyContainer * m_strategyContainer
For Run2 strategy (LowMu, HighMu)
Definition: L1TriggerTowerTool.h:162
L1CaloCondSvc.h
L1CaloPprConditions::pedMean
float pedMean() const
Definition: L1CaloPprConditions.h:51
ChanCalibErrorCode::chanValid
bool chanValid() const
Checks if channel is valid, ie.
Definition: ChanCalibErrorCode.cxx:46
ChanCalibErrorCode
ChanCalibErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanE...
Definition: ChanCalibErrorCode.h:20
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LVL1::L1TriggerTowerTool::nonLinearLut
virtual void nonLinearLut(const std::vector< int > &fir, int slope, int offset, int cut, int scale, short par1, short par2, short par3, short par4, bool disabled, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:1052
reference
Definition: hcg.cxx:437
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LVL1::L1TriggerTowerTool::cpLut
virtual void cpLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:876
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LVL1::L1TriggerTowerTool::m_L1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
Definition: L1TriggerTowerTool.h:183
L1CaloPprConditions::lutStrategy
unsigned short lutStrategy() const
Definition: L1CaloPprConditions.h:46
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
HWIdentifier
Definition: HWIdentifier.h:13
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
LVL1::L1TriggerTowerTool::L1TriggerTowerTool
L1TriggerTowerTool(const std::string &, const std::string &, const IInterface *)
Definition: L1TriggerTowerTool.cxx:58
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
L1CaloDerivedRunParsContainer.h
L1CaloDerivedRunPars.h
L1CaloPprConditionsRun2::lutCpScale
unsigned short lutCpScale() const
Definition: L1CaloPprConditionsRun2.h:84
LVL1::L1TriggerTowerTool::s_saturationValue
static const int s_saturationValue
Parameters.
Definition: L1TriggerTowerTool.h:187
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
L1CaloPpmFineTimeRefsContainer::dump
void dump() const
Definition: L1CaloPpmFineTimeRefsContainer.cxx:137
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LVL1::L1TriggerTowerTool::m_dbFineTimeRefsTowers
L1CaloPpmFineTimeRefsContainer * m_dbFineTimeRefsTowers
For the fine time monitoring.
Definition: L1TriggerTowerTool.h:171
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
covarianceTool.filter
filter
Definition: covarianceTool.py:514
ChanDeadErrorCode
ChanDeadErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanDe...
Definition: ChanDeadErrorCode.h:20
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
L1CaloPprChanStrategyContainer.h
L1CaloPprConditionsRun2::lutJepPar1
short lutJepPar1() const
Definition: L1CaloPprConditionsRun2.h:89
python.PyAthena.module
module
Definition: PyAthena.py:134
LVL1::L1TriggerTowerTool::m_caloMgr
const CaloIdManager * m_caloMgr
Id managers.
Definition: L1TriggerTowerTool.h:145
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:54
L1CaloPprChanStrategy.h
L1CaloPprConditions::lutNoiseCut
unsigned short lutNoiseCut() const
Definition: L1CaloPprConditions.h:49
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
LVL1::L1TriggerTowerTool::m_dynamicPedestalProvider
ToolHandle< LVL1::IL1DynamicPedestalProvider > m_dynamicPedestalProvider
Definition: L1TriggerTowerTool.h:179
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
L1TriggerTowerTool.h
lumiFormat.i
int i
Definition: lumiFormat.py:92
LVL1::L1TriggerTowerTool::bcidDecision
virtual void bcidDecision(const std::vector< int > &bcidResults, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:796
L1CaloPprDisabledChannel::calibErrorCode
ChanCalibErrorCode calibErrorCode(void) const
Definition: L1CaloPprDisabledChannel.h:41
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
LVL1::L1TriggerTowerTool::initialize
virtual StatusCode initialize()
standard Athena-Algorithm method
Definition: L1TriggerTowerTool.cxx:87
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
LVL1::L1TriggerTowerTool::lut
virtual void lut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
LUT simulation: pedestal subtraction, energy calibration and threshold.
Definition: L1TriggerTowerTool.cxx:840
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CP::is_run2
bool is_run2(egEnergyCorr::ESModel model)
Definition: EgammaCalibrationAndSmearingTool.cxx:225
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
L1CaloRunParametersContainer::dump
void dump() const
Definition: L1CaloRunParametersContainer.cxx:117
LVL1::L1TriggerTowerTool::bcidParams
virtual void bcidParams(const L1CaloCoolChannelId &channelId, int &energyLow, int &energyHigh, int &decisionSource, std::vector< unsigned int > &decisionConditions, unsigned int &peakFinderStrategy, int &satLow, int &satHigh, int &satLevel)
Return BCID parameters for a channel.
Definition: L1TriggerTowerTool.cxx:1242
master.flag
bool flag
Definition: master.py:29
L1CaloRunParametersContainer.h
LVL1::L1TriggerTowerTool::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
Definition: L1TriggerTowerTool.h:148
LVL1::L1TriggerTowerTool::finalize
virtual StatusCode finalize()
standard Athena-Algorithm method
Definition: L1TriggerTowerTool.cxx:138
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
L1CaloCoolChannelId::id
unsigned int id() const
Definition: L1CaloCoolChannelId.h:32
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
CaloIdManager::getLVL1_ID
const CaloLVL1_ID * getLVL1_ID(void) const
Definition: CaloIdManager.cxx:75
LVL1::L1TriggerTowerTool::m_disabledChannelContainer
std::any m_disabledChannelContainer
Definition: L1TriggerTowerTool.h:168
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Make4DCorrelationMatrix.nominalEta
int nominalEta
Definition: Make4DCorrelationMatrix.py:80
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
ChanDeadErrorCode::chanValid
bool chanValid() const
Definition: ChanDeadErrorCode.h:62
SCT_Monitoring::disabled
@ disabled
Definition: SCT_MonitoringNumbers.h:60
L1CaloPprConditionsRun2::lutJepSlope
unsigned short lutJepSlope() const
Definition: L1CaloPprConditionsRun2.h:87
L1CaloPprConditionsRun2::lutJepNoiseCut
unsigned short lutJepNoiseCut() const
Definition: L1CaloPprConditionsRun2.h:88
L1CaloPprConditionsContainerRun2::ePprChanCalib
@ ePprChanCalib
Definition: L1CaloPprConditionsContainerRun2.h:45
L1CaloPprConditionsRun2::lutJepPar4
short lutJepPar4() const
Definition: L1CaloPprConditionsRun2.h:92
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
L1CaloPprDisabledChannel::disabledBits
unsigned int disabledBits() const
Definition: L1CaloPprDisabledChannel.h:56
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
LVL1::L1TriggerTowerTool::fir
virtual void fir(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
This FIR simulation produces a vector of same length as digit vector, with peak positions correspondi...
Definition: L1TriggerTowerTool.cxx:569
LVL1::L1TriggerTowerTool::satOverride
virtual bool satOverride(int range, const L1CaloCoolChannelId &channelId)
Definition: L1TriggerTowerTool.cxx:1544
LVL1::L1TriggerTowerTool::satBcid
virtual void satBcid(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Saturated pulse BCID.
Definition: L1TriggerTowerTool.cxx:694
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
LVL1::L1TriggerTowerTool::m_derivedRunParsContainer
L1CaloDerivedRunParsContainer * m_derivedRunParsContainer
Definition: L1TriggerTowerTool.h:163
L1CaloPprConditions
Transient conditions class for objects defined by the online framework and retrieved from COOL.
Definition: L1CaloPprConditions.h:23
LVL1::L1TriggerTowerTool::loadFTRefs
virtual StatusCode loadFTRefs()
Definition: L1TriggerTowerTool.cxx:1692
L1CaloPprConditionsContainerRun2.h
LVL1::L1TriggerTowerTool::bcid
virtual void bcid(const std::vector< int > &fir, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Evaluate both peak-finder and saturated BCID algorithms and return vector of predicted BCID result wo...
Definition: L1TriggerTowerTool.cxx:468
merge.output
output
Definition: merge.py:17
L1CaloPprDisabledChannel::noiseCut
unsigned int noiseCut() const
Definition: L1CaloPprDisabledChannel.h:53
L1CaloPprDisabledChannelContainer.h
LVL1::L1TriggerTowerTool::hwIdentifier
virtual HWIdentifier hwIdentifier(const Identifier &id)
Return online identifier for given offline identifier.
Definition: L1TriggerTowerTool.cxx:1467
LVL1::L1TriggerTowerTool::process
virtual void process(const std::vector< int > &digits, double eta, double phi, int layer, std::vector< int > &et, std::vector< int > &bcidResults, std::vector< int > &bcidDecisions, bool useJepLut=true)
Take in vector of ADC digits, return PPrASIC results.
Definition: L1TriggerTowerTool.cxx:276
ChanDeadErrorCode.h
L1CaloPprConditions::pedValue
unsigned int pedValue() const
Definition: L1CaloPprConditions.h:50
L1CaloRunParameters.h
LVL1::L1TriggerTowerTool::peakBcid
virtual void peakBcid(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Peak finder BCID.
Definition: L1TriggerTowerTool.cxx:642
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
L1CaloPprConditionsRun2::lutJepPar3
short lutJepPar3() const
Definition: L1CaloPprConditionsRun2.h:91
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
LVL1::L1TriggerTowerTool::identifier
virtual Identifier identifier(double eta, double phi, int layer)
Return offline identifier for given tower coordinates.
Definition: L1TriggerTowerTool.cxx:1451
IL1CaloMappingTool.h
LVL1::L1TriggerTowerTool::pedestalCorrection
virtual void pedestalCorrection(std::vector< int > &firInOut, int firPed, int iElement, int layer, int bcid, float mu, std::vector< int_least16_t > &correctionOut)
Definition: L1TriggerTowerTool.cxx:1751
L1CaloPprConditionsContainer.h
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
L1CaloPpmFineTimeRefsContainer.h
L1CaloPpmFineTimeRefs::refValue
double refValue(void) const
Definition: L1CaloPpmFineTimeRefs.h:38
L1CaloPprDisabledChannel::deadErrorCode
ChanDeadErrorCode deadErrorCode(void) const
Definition: L1CaloPprDisabledChannel.h:44
LVL1::L1TriggerTowerTool::isRun2
bool isRun2() const
Definition: L1TriggerTowerTool.cxx:1772
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
PlotSFuncertainty.calib
calib
Definition: PlotSFuncertainty.py:110
python.PyAthena.v
v
Definition: PyAthena.py:157
L1CaloCoolChannelId
Definition: L1CaloCoolChannelId.h:10
LVL1::L1TriggerTowerTool::lutParams
virtual void lutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
Return LUT parameters for a channel.
Definition: L1TriggerTowerTool.cxx:1296
DeMoScan.index
string index
Definition: DeMoScan.py:362
LVL1::L1TriggerTowerTool::m_mappingTool
ToolHandle< LVL1::IL1CaloMappingTool > m_mappingTool
and mappings
Definition: L1TriggerTowerTool.h:154
CaloLVL1_ID.h
L1CaloPprConditionsContainer
Container of L1CaloPprConditions objects, inherit from the abstract base class AbstractL1CaloConditio...
Definition: L1CaloPprConditionsContainer.h:28
LVL1::L1TriggerTowerTool::m_runParametersContainer
L1CaloRunParametersContainer * m_runParametersContainer
Definition: L1TriggerTowerTool.h:164
L1CaloPprConditionsRun2::pedValue
unsigned int pedValue() const
Definition: L1CaloPprConditionsRun2.h:94
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloTriggerTowerService.h
LVL1::L1TriggerTowerTool::m_correctFir
bool m_correctFir
Baseline correction Tool.
Definition: L1TriggerTowerTool.h:178
LVL1::L1TriggerTowerTool::m_debug
bool m_debug
Definition: L1TriggerTowerTool.h:142
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
L1CaloPprConditionsContainerRun2::ePprChanCalibStrategy
@ ePprChanCalibStrategy
Definition: L1CaloPprConditionsContainerRun2.h:45
L1CaloPpmFineTimeRefs.h
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
L1CaloPprConditions::firStartBit
unsigned short firStartBit() const
Definition: L1CaloPprConditions.h:44
LVL1::L1TriggerTowerTool::cpLutParams
virtual void cpLutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
Definition: L1TriggerTowerTool.cxx:1334
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:232
LVL1::L1TriggerTowerTool::disabledChannel
virtual bool disabledChannel(const L1CaloCoolChannelId &channelId)
Check for disabled channel.
Definition: L1TriggerTowerTool.cxx:1567
LVL1::L1TriggerTowerTool::etRange
virtual void etRange(const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:1123
CaloIdManager.h
L1CaloPprChanStrategyContainer::dump
void dump() const
Definition: L1CaloPprChanStrategyContainer.cxx:99
LVL1::L1TriggerTowerTool::~L1TriggerTowerTool
virtual ~L1TriggerTowerTool()
default destructor
Definition: L1TriggerTowerTool.cxx:81
L1CaloPprConditionsRun2::lutCpStrategy
unsigned short lutCpStrategy() const
Definition: L1CaloPprConditionsRun2.h:76
LVL1::L1TriggerTowerTool::handle
virtual void handle(const Incident &)
catch begRun
Definition: L1TriggerTowerTool.cxx:145
COOLRates.target
target
Definition: COOLRates.py:1106
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
LVL1::L1TriggerTowerTool::bcidDecisionRange
virtual void bcidDecisionRange(const std::vector< int > &lutInput, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:769
L1CaloPprConditionsRun2
Transient conditions class for objects defined by the online framework and retrieved from COOL for th...
Definition: L1CaloPprConditionsRun2.h:21
ReadHandle.h
Handle class for reading from StoreGate.
AthAlgTool
Definition: AthAlgTool.h:26
CaloLVL1_ID::tower_id
Identifier tower_id(int pos_neg_z, int sampling, int region, int eta, int phi) const
build a tower identifier
Definition: CaloLVL1_ID.h:429
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
L1CaloPprConditionsContainerRun2::ePprChanCalibCommon
@ ePprChanCalibCommon
Definition: L1CaloPprConditionsContainerRun2.h:45
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
ChanCalibErrorCode.h
LVL1::L1TriggerTowerTool::jepLutParams
virtual void jepLutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
Definition: L1TriggerTowerTool.cxx:1391
L1CaloPprConditionsRun2::pedMean
float pedMean() const
Definition: L1CaloPprConditionsRun2.h:95
LVL1::L1TriggerTowerTool::jepLut
virtual void jepLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:941
LVL1::L1TriggerTowerTool::dropBits
virtual void dropBits(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:1171
LVL1::L1TriggerTowerTool::firParams
virtual void firParams(const L1CaloCoolChannelId &channelId, std::vector< int > &firCoeffs)
Return FIR filter parameters for a channel.
Definition: L1TriggerTowerTool.cxx:1213
Analysis::CC
@ CC
Definition: JpsiFinder.h:39
L1CaloPpmFineTimeRefs::errorCode
FineTimeErrorCode errorCode(void) const
Definition: L1CaloPpmFineTimeRefs.h:37
L1CaloPpmFineTimeRefs
Definition: L1CaloPpmFineTimeRefs.h:23
xAOD::EventInfo_v1::eventType
bool eventType(EventType type) const
Check for one particular bitmask value.
L1CaloPprConditionsRun2.h
L1CaloDerivedRunParsContainer::dump
void dump() const
Definition: L1CaloDerivedRunParsContainer.cxx:94
L1CaloPpmFineTimeRefs::calibValue
double calibValue(void) const
Definition: L1CaloPpmFineTimeRefs.h:40
ServiceHandle< L1CaloCondSvc >
LVL1::L1TriggerTowerTool::printVec
void printVec(const std::vector< T > &vec)
Print a vector to debug.
Definition: L1TriggerTowerTool.cxx:1680