Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LVL1::L1TriggerTowerTool Class Reference

#include <L1TriggerTowerTool.h>

Inheritance diagram for LVL1::L1TriggerTowerTool:
Collaboration diagram for LVL1::L1TriggerTowerTool:

Public Member Functions

 L1TriggerTowerTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~L1TriggerTowerTool ()
 default destructor More...
 
virtual StatusCode initialize ()
 standard Athena-Algorithm method More...
 
virtual StatusCode finalize ()
 standard Athena-Algorithm method More...
 
virtual void handle (const Incident &)
 catch begRun More...
 
virtual StatusCode retrieveConditions ()
 Retrieve pointers to the L1Calo conditions containers. More...
 
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. More...
 
virtual void process (const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &et, std::vector< int > &bcidResults, std::vector< int > &bcidDecisions, bool useJepLut=true)
 All-in-one routine - give it the ADC counts and TT identifier, and it returns the results. More...
 
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. More...
 
virtual void pedestalCorrection (std::vector< int > &firInOut, int firPed, int iElement, int layer, int bcid, float mu, std::vector< int_least16_t > &correctionOut)
 
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 corresponding. More...
 
virtual void fir (const std::vector< int > &digits, const std::vector< int > &firCoeffs, std::vector< int > &output)
 This FIR simulation produces a vector of same length as digit vector, with peak positions corresponding. More...
 
virtual void dropBits (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 
virtual void dropBits (const std::vector< int > &fir, unsigned int first, std::vector< int > &output)
 Truncate FIR results for LUT input. More...
 
virtual void etRange (const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 
virtual void etRange (const std::vector< int > &et, int energyLow, int energyHigh, std::vector< int > &output)
 Identify BCID decision range. More...
 
virtual void peakBcid (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 Peak finder BCID. More...
 
virtual void peakBcid (const std::vector< int > &fir, unsigned int strategy, std::vector< int > &output)
 Peak finder BCID. More...
 
virtual void satBcid (const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 Saturated pulse BCID. More...
 
virtual void satBcid (const std::vector< int > &digits, int satLow, int satHigh, int satLevel, std::vector< int > &output)
 Saturated pulse BCID. More...
 
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 words. More...
 
virtual void bcid (const std::vector< int > &fir, const std::vector< int > &digits, unsigned int strategy, int satLow, int satHigh, int satLevel, std::vector< int > &output)
 Evaluate both peak-finder and saturated BCID algorithms and return vector of predicted BCID result words. More...
 
virtual void bcid (const std::vector< int > &fir, const std::vector< int > &lutInput, const std::vector< int > &digits, int energyLow, int energyHigh, int decisionSource, std::vector< unsigned int > &decisionConditions, unsigned int strategy, int satLow, int satHigh, int satLevel, std::vector< int > &result, std::vector< int > &decision)
 Evaluate both peak-finder and saturated BCID algorithms and return vectors of predicted BCID result and decision words. More...
 
virtual void bcidDecisionRange (const std::vector< int > &lutInput, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 
virtual void bcidDecision (const std::vector< int > &bcidResults, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 
virtual void bcidDecision (const std::vector< int > &bcidResults, const std::vector< int > &range, const std::vector< unsigned int > &mask, std::vector< int > &output)
 Evaluate BCID decision based on BCID word, ET range and decision mask. More...
 
virtual void lut (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 LUT simulation: pedestal subtraction, energy calibration and threshold. More...
 
virtual void cpLut (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 
virtual void jepLut (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
 
virtual void lut (const std::vector< int > &fir, int slope, int offset, int cut, int ped, int strategy, bool disabled, std::vector< int > &output)
 LUT simulation: pedestal subtraction, energy calibration and threshold. More...
 
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)
 
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 samples to evaluate it reliably. More...
 
virtual void firParams (const L1CaloCoolChannelId &channelId, std::vector< int > &firCoeffs)
 Return FIR filter parameters for a channel. More...
 
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. More...
 
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. More...
 
virtual void cpLutParams (const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
 
virtual void jepLutParams (const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
 
virtual Identifier identifier (double eta, double phi, int layer)
 Return offline identifier for given tower coordinates. More...
 
virtual HWIdentifier hwIdentifier (const Identifier &id)
 Return online identifier for given offline identifier. More...
 
virtual HWIdentifier hwIdentifier (double eta, double phi, int layer)
 Return online identifier for given tower coordinates. More...
 
virtual L1CaloCoolChannelId channelID (double eta, double phi, int layer)
 Return Cool channel identifier for given tower coordinates. More...
 
virtual L1CaloCoolChannelId channelID (const Identifier &id)
 Return Cool channel identifier for given offline identifier. More...
 
virtual bool satOverride (int range, const L1CaloCoolChannelId &channelId)
 
virtual bool disabledChannel (const L1CaloCoolChannelId &channelId)
 Check for disabled channel. More...
 
virtual double FCalTTeta (const L1CaloCoolChannelId &channelId)
 Return median eta of trigger tower from L1CaloCoolChannelId. More...
 
virtual double FCalTTeta (double nominalEta, double phi, int layer)
 Calculate median eta of FCAL trigger tower from nominal eta and layer. More...
 
virtual void setDebug (bool debug)
 Finer control of debug printing. More...
 
virtual std::pair< double, double > refValues (const L1CaloCoolChannelId &channelId)
 
virtual StatusCode loadFTRefs ()
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool isRun2 () const
 
template<typename T >
void printVec (const std::vector< T > &vec)
 Print a vector to debug. More...
 
bool disabledChannel (const L1CaloCoolChannelId &channelId, unsigned int &noiseCut)
 Get extra noise cut with disabled channel. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

bool m_debug = false
 
const CaloIdManagerm_caloMgr
 Id managers. More...
 
const CaloLVL1_IDm_lvl1Helper
 and tools for computing identifiers More...
 
ToolHandle< LVL1::IL1CaloTTIdToolsm_l1CaloTTIdTools
 
ToolHandle< CaloTriggerTowerServicem_ttSvc
 
ToolHandle< LVL1::IL1CaloMappingToolm_mappingTool
 and mappings More...
 
SG::ReadCondHandleKey< L1CaloRunParametersContainerm_runParametersContainerKey { this, "InputKeyRunParameters", "L1CaloRunParametersContainer"}
 L1Calo conditions. More...
 
SG::ReadCondHandleKey< L1CaloPprConditionsContainerRun2m_conditionsContainerKeyRun2 { this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"}
 
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2m_disabledChannelContainerKeyRun2 { this, "InputKeyDisabledChannelRun2", "L1CaloPprDisabledChannelContainerRun2"}
 
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainerm_dbFineTimeRefsTowersKey { this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"}
 
const L1CaloRunParametersContainerm_runParametersContainer = nullptr
 
std::any m_conditionsContainer
 
std::any m_disabledChannelContainer
 
const L1CaloPpmFineTimeRefsContainerm_dbFineTimeRefsTowers = nullptr
 For the fine time monitoring. More...
 
std::vector< unsigned int > m_idTable
 Mapping lookup table. More...
 
bool m_correctFir
 Baseline correction Tool. More...
 
ToolHandle< LVL1::IL1DynamicPedestalProviderm_dynamicPedestalProvider
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey { this, "EventInfoKey", "EventInfo", "" }
 
SG::ReadHandleKey< TrigConf::L1Menum_L1MenuKey { this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" }
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Static Private Attributes

static const int s_saturationValue = 255
 Parameters. More...
 
static const int s_maxTowers = 7168
 
static const int m_nBcid = 350
 

Detailed Description

This is a tool to reconstruct the L1 EM/tau trigger sums for a particular RoI location from the stored TriggerTowers. Used for offline monitoring and trigger reconstruction.

Useage: L1TriggerTowerTool->process(digits, eta, phi, EmHad, //inputs et, bcid, bcidresult) //outputs

Author
Alan Watson Alan..nosp@m.Wats.nosp@m.on@ce.nosp@m.rn.c.nosp@m.h

Definition at line 60 of file L1TriggerTowerTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1TriggerTowerTool()

LVL1::L1TriggerTowerTool::L1TriggerTowerTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 57 of file L1TriggerTowerTool.cxx.

60  :
61  AthAlgTool(t,n,p),
62  m_caloMgr(0),
63  m_lvl1Helper(0),
64  m_l1CaloTTIdTools("LVL1::L1CaloTTIdTools/L1CaloTTIdTools", this),
65  m_ttSvc("CaloTriggerTowerService/CaloTriggerTowerService", this),
66  m_mappingTool("", this),
68  m_correctFir(false),
70 {
71  declareInterface<IL1TriggerTowerTool>(this);
72 
73  declareProperty( "BaselineCorrection", m_correctFir );
74  declareProperty( "L1DynamicPedestalProvider", m_dynamicPedestalProvider );
75 }

◆ ~L1TriggerTowerTool()

LVL1::L1TriggerTowerTool::~L1TriggerTowerTool ( )
virtual

default destructor

Definition at line 79 of file L1TriggerTowerTool.cxx.

80 {
81 }

Member Function Documentation

◆ applyEtRange()

void LVL1::L1TriggerTowerTool::applyEtRange ( const std::vector< int > &  lut,
const std::vector< int > &  range,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Use ET range to return appropriate ET value Do not test BCID here, since no guarantee enough ADC samples to evaluate it reliably.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1015 of file L1TriggerTowerTool.cxx.

1016 {
1018  std::vector<int>::const_iterator itlut = lut.begin();
1019  std::vector<int>::const_iterator itrange = range.begin();
1020  while ( itlut != lut.end() && itrange != range.end() ) {
1021  if (!disabled && satOverride((*itrange), channelId)) output.push_back(s_saturationValue);
1022  else output.push_back(*itlut);
1023  ++itlut;
1024  ++itrange;
1025  }
1026  if (m_debug) {
1027  ATH_MSG_VERBOSE( "::applyEtRange: output: ");
1028  printVec(output);
1029  ATH_MSG_VERBOSE(" ");
1030  }
1031 }

◆ bcid() [1/3]

void LVL1::L1TriggerTowerTool::bcid ( const std::vector< int > &  fir,
const std::vector< int > &  digits,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Evaluate both peak-finder and saturated BCID algorithms and return vector of predicted BCID result words.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 388 of file L1TriggerTowerTool.cxx.

389 {
390  // Get decision flags for the 2 BCID algorithms
391  std::vector<int> peak;
392  peakBcid(filter, channelId, peak);
393  std::vector<int> sat;
394  satBcid(digits, channelId, sat);
395 
396  output.clear();
397  output.reserve(sat.size()); // avoid frequent reallocations
398 
399  std::vector<int>::iterator itpeak = peak.begin();
400  std::vector<int>::iterator itsat = sat.begin();
401  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
402  output.push_back( (*itpeak<<2) + (*itsat<<1) );
403  }
404  if (m_debug) {
405  ATH_MSG_VERBOSE( "::bcid: bcidResults: ");
406  printVec(output);
407  ATH_MSG_VERBOSE(" ");
408  }
409 }

◆ bcid() [2/3]

void LVL1::L1TriggerTowerTool::bcid ( const std::vector< int > &  fir,
const std::vector< int > &  digits,
unsigned int  strategy,
int  satLow,
int  satHigh,
int  satLevel,
std::vector< int > &  output 
)
virtual

Evaluate both peak-finder and saturated BCID algorithms and return vector of predicted BCID result words.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 414 of file L1TriggerTowerTool.cxx.

416 {
417  // Get decision flags for the 2 BCID algorithms
418  std::vector<int> peak;
419  peakBcid(filter, strategy, peak);
420  std::vector<int> sat;
421  satBcid(digits, satLow, satHigh, satLevel, sat);
422 
423  output.clear();
424  output.reserve(sat.size()); // avoid frequent reallocations
425 
426  std::vector<int>::iterator itpeak = peak.begin();
427  std::vector<int>::iterator itsat = sat.begin();
428  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
429  output.push_back( (*itpeak<<2) + (*itsat<<1) );
430  }
431  if (m_debug) {
432  ATH_MSG_VERBOSE( "::bcid: bcidResults: ");
433  printVec(output);
434  ATH_MSG_VERBOSE(" ");
435  }
436 }

◆ bcid() [3/3]

void LVL1::L1TriggerTowerTool::bcid ( const std::vector< int > &  fir,
const std::vector< int > &  lutInput,
const std::vector< int > &  digits,
int  energyLow,
int  energyHigh,
int  decisionSource,
std::vector< unsigned int > &  decisionConditions,
unsigned int  strategy,
int  satLow,
int  satHigh,
int  satLevel,
std::vector< int > &  result,
std::vector< int > &  decision 
)
virtual

Evaluate both peak-finder and saturated BCID algorithms and return vectors of predicted BCID result and decision words.

evaluate BCID decisions

Implements LVL1::IL1TriggerTowerTool.

Definition at line 441 of file L1TriggerTowerTool.cxx.

443 {
444  // Get decision flags for the 2 BCID algorithms
445  std::vector<int> peak;
446  peakBcid(filter, strategy, peak);
447  std::vector<int> sat;
448  satBcid(digits, satLow, satHigh, satLevel, sat);
449 
450  result.clear();
451  result.reserve(sat.size()); // avoid frequent reallocations
452  decision.clear();
453 
454  std::vector<int>::iterator itpeak = peak.begin();
455  std::vector<int>::iterator itsat = sat.begin();
456  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
457  result.push_back( (*itpeak<<2) + (*itsat<<1) );
458  }
459  if (m_debug) {
460  ATH_MSG_VERBOSE( "::bcid: bcidResults: ");
461  printVec(result);
462  ATH_MSG_VERBOSE(" ");
463  }
464 
466  std::vector<int> decisionRange;
467  if (!(decisionSource&0x1)) etRange(digits, energyLow, energyHigh, decisionRange);
468  else etRange(lutInput, energyLow, energyHigh, decisionRange);
469  bcidDecision(result, decisionRange, decisionConditions, decision);
470  if (m_debug) {
471  ATH_MSG_VERBOSE( "::bcid: bcidDecisions: ");
472  printVec(decision);
473  ATH_MSG_VERBOSE(" ");
474  }
475 }

◆ bcidDecision() [1/2]

void LVL1::L1TriggerTowerTool::bcidDecision ( const std::vector< int > &  bcidResults,
const std::vector< int > &  range,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 716 of file L1TriggerTowerTool.cxx.

717 {
718  unsigned int decision1 = 0;
719  unsigned int decision2 = 0;
720  unsigned int decision3 = 0;
721  if(m_conditionsContainer.has_value()) {
722  if(isRun2())
723  std::tie(decision1, decision2, decision3) = getBcidDecision<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
724  else
725  std::tie(decision1, decision2, decision3) = getBcidDecision<L1CaloPprConditionsContainer>(m_conditionsContainer);
726  } else ATH_MSG_WARNING( "::bcidDecision: No Conditions Container retrieved" );
727 
728  // Reverse the order! (see elog 97082 9/06/10)
729  std::vector<unsigned int> mask = { decision3, decision2, decision1 };
730 
731  ATH_MSG_VERBOSE( "::bcidDecision: masks: " << MSG::hex
732  << decision3 << " " << decision2 << " " << decision1 << MSG::dec );
733 
734  bcidDecision(bcidResults, range, mask, output);
735 }

◆ bcidDecision() [2/2]

void LVL1::L1TriggerTowerTool::bcidDecision ( const std::vector< int > &  bcidResults,
const std::vector< int > &  range,
const std::vector< unsigned int > &  mask,
std::vector< int > &  output 
)
virtual

Evaluate BCID decision based on BCID word, ET range and decision mask.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 739 of file L1TriggerTowerTool.cxx.

740 {
741  output.clear();
742  output.reserve(bcidResults.size()); // avoid frequent reallocations
743 
744  std::vector<int>::const_iterator itBcid = bcidResults.begin();
745  std::vector<int>::const_iterator itRange = range.begin();
746  int nRange = mask.size();
747 
748  for ( ; itBcid != bcidResults.end() && itRange != range.end(); ++itBcid, ++itRange) {
749  if ((*itRange) < nRange && (mask[*itRange]&(0x1<<*itBcid))) output.push_back(1);
750  else output.push_back(0);
751  }
752  if (m_debug) {
753  ATH_MSG_VERBOSE( "::bcidDecision: output: ");
754  printVec(output);
755  ATH_MSG_VERBOSE(" ");
756  }
757 }

◆ bcidDecisionRange()

void LVL1::L1TriggerTowerTool::bcidDecisionRange ( const std::vector< int > &  lutInput,
const std::vector< int > &  digits,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 689 of file L1TriggerTowerTool.cxx.

690 {
691  int decisionSource = 0;
692  if (m_conditionsContainer.has_value()) {
693  if(isRun2()) decisionSource = getDecisionSource<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
694  else decisionSource = getDecisionSource<L1CaloPprConditionsContainer>(m_conditionsContainer);
695 
696  } else ATH_MSG_WARNING( "::bcidDecisionRange: No Conditions Container retrieved" );
697 
698  if (!(decisionSource&0x1)) etRange(digits, channelId, output);
699  else etRange(lutInput, channelId, output);
700  if (m_debug) {
701  ATH_MSG_VERBOSE( "::bcidDecisionRange: decisionSource: " << decisionSource);
702  ATH_MSG_VERBOSE( " output: ");
703  printVec(output);
704  ATH_MSG_VERBOSE(" ");
705  }
706 }

◆ bcidParams()

void LVL1::L1TriggerTowerTool::bcidParams ( const L1CaloCoolChannelId channelId,
int &  energyLow,
int &  energyHigh,
int &  decisionSource,
std::vector< unsigned int > &  decisionConditions,
unsigned int &  peakFinderStrategy,
int &  satLow,
int &  satHigh,
int &  satLevel 
)
virtual

Return BCID parameters for a channel.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1162 of file L1TriggerTowerTool.cxx.

1164 {
1165  energyLow = 0;
1166  energyHigh = 0;
1167  decisionSource = 0;
1168  decisionConditions.clear();
1169  peakFinderStrategy = 0;
1170  satLevel = 0;
1171  satLow = 0;
1172  satHigh = 0;
1173 
1174  if(m_conditionsContainer.has_value()) {
1175  using std::get;
1176  std::tuple<unsigned int, unsigned int, unsigned int> bcidDecision;
1177  std::tuple<bool, int, int> bcidEnergyRange;
1178  std::tuple<bool, int, int, int> saturation;
1179  if(isRun2()) {
1180  using Cont = L1CaloPprConditionsContainerRun2;
1181  bcidDecision = getBcidDecision<Cont>(m_conditionsContainer);
1182  peakFinderStrategy = getStrategy<Cont>(m_conditionsContainer);
1183  decisionSource = getDecisionSource<Cont>(m_conditionsContainer);
1184  bcidEnergyRange = getBcidEnergyRange<Cont>(channelId.id(), m_conditionsContainer);
1185  saturation = getSaturation<Cont>(channelId.id(), m_conditionsContainer);
1186  } else {
1187  using Cont = L1CaloPprConditionsContainer;
1188  bcidDecision = getBcidDecision<Cont>(m_conditionsContainer);
1189  peakFinderStrategy = getStrategy<Cont>(m_conditionsContainer);
1190  decisionSource = getDecisionSource<Cont>(m_conditionsContainer);
1191  bcidEnergyRange = getBcidEnergyRange<Cont>(channelId.id(), m_conditionsContainer);
1192  saturation = getSaturation<Cont>(channelId.id(), m_conditionsContainer);
1193  }
1194 
1195  decisionConditions = { get<2>(bcidDecision),
1196  get<1>(bcidDecision),
1197  get<0>(bcidDecision) }; // reverse order
1198  if(get<0>(bcidEnergyRange)) {
1199  std::tie(std::ignore, energyLow, energyHigh) = bcidEnergyRange;
1200  } else ATH_MSG_WARNING( "::bcidParams: No BcidEnergyRange found" );
1201 
1202  if(get<0>(saturation)) {
1203  std::tie(std::ignore, satLevel, satLow, satHigh) = saturation;
1204  } else ATH_MSG_WARNING( "::bcidParams: No Saturation found" );
1205  } else ATH_MSG_WARNING( "::bcid:Params No Conditions Container retrieved" );
1206 
1207  ATH_MSG_VERBOSE( "::bcidParams: satLevel: " << satLevel
1208  << " satLow: " << satLow << " satHigh: " << satHigh << endmsg
1209  << " energyLow: " << energyLow << " energyHigh: " << energyHigh << endmsg
1210  << " decisionSource: " << decisionSource << " peakFinderStrategy: "
1211  << peakFinderStrategy );
1212 
1213 }

◆ channelID() [1/2]

L1CaloCoolChannelId LVL1::L1TriggerTowerTool::channelID ( const Identifier id)
virtual

Return Cool channel identifier for given offline identifier.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1442 of file L1TriggerTowerTool.cxx.

1443 {
1444  L1CaloCoolChannelId coolId(0);
1445  if (m_ttSvc) {
1446  try {
1447  HWIdentifier hwId = hwIdentifier(id);
1448  coolId = m_ttSvc->createL1CoolChannelId(hwId);
1449  }
1450  catch (const CaloID_Exception&) { coolId = L1CaloCoolChannelId(0); }
1451  }
1452  return coolId;
1453 }

◆ channelID() [2/2]

L1CaloCoolChannelId LVL1::L1TriggerTowerTool::channelID ( double  eta,
double  phi,
int  layer 
)
virtual

Return Cool channel identifier for given tower coordinates.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1407 of file L1TriggerTowerTool.cxx.

1408 {
1409  // Use direct lookup table if possible
1410  const double absEta = fabs(eta);
1411  int index = 0;
1412  if (absEta < 2.5) {
1413  const int etaBin = 10.*absEta;
1414  const int phiBin = phi*(32/M_PI);
1415  index = (etaBin<<6) + phiBin;
1416  } else if (absEta < 3.2) {
1417  const int etaBin = 5.*(absEta - 2.5);
1418  const int phiBin = phi*(16./M_PI);
1419  index = 1600 + (etaBin<<5) + phiBin;
1420  } else {
1421  const int etaBin = (absEta - 3.2)*(1./0.425);
1422  const int phiBin = phi*(8./M_PI);
1423  index = 1728 + (etaBin<<4) + phiBin;
1424  }
1425  if (eta < 0.) index += 1792;
1426  if (layer > 0) index += 3584;
1427  if (index >= s_maxTowers) return L1CaloCoolChannelId(0);
1428  if (m_idTable.empty()) {
1429  m_idTable.reserve(s_maxTowers);
1430  m_idTable.assign(s_maxTowers, 0);
1431  }
1432  if (m_idTable[index] == 0) {
1433  Identifier id = identifier(eta, phi, layer);
1434  L1CaloCoolChannelId coolID = channelID(id);
1435  m_idTable[index] = coolID.id();
1436  }
1438 }

◆ cpLut()

void LVL1::L1TriggerTowerTool::cpLut ( const std::vector< int > &  fir,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 796 of file L1TriggerTowerTool.cxx.

797 {
798  int startBit = 0;
799  int strategy = 0;
800  int offset = 0;
801  double offsetReal = 0;
802  int slope = 0;
803  int cut = 0;
804  unsigned short scale = 0;
805  double pedMean = 0;
806  int ped = 0;
807  int hwCoeffSum = 0;
808  const std::vector<short int>* hwCoeffs;
809 
810  if(!isRun2()) {
811  // assert instead ?!
812  ATH_MSG_WARNING("::cpLut: Run-1 data - behaviour undefined!");
813  }
814 
815  if(m_conditionsContainer.has_value()) {
816  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
817  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
818  if (settings) {
819  startBit = settings->firStartBit();
820  strategy = settings->lutCpStrategy();
821  slope = settings->lutCpSlope();
822  cut = settings->lutCpNoiseCut();
823  scale = settings->lutCpScale();
824  ped = settings->pedValue();
825  pedMean = settings->pedMean();
826 
827  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
828 
829  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
830  hwCoeffSum += hwCoeffs->at(i);
831  }
832 
833  if (strategy == 0){
834  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
835  }
836  else{
837  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
838  }
839  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
840 
841  ATH_MSG_VERBOSE( "::cpLut: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
842  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
843 
844  } else ATH_MSG_WARNING( "::cpLut: No L1CaloPprConditions found" );
845  } else ATH_MSG_WARNING( "::cpLut: No Conditions Container retrieved" );
846 
847  ATH_MSG_VERBOSE( "::cpLut: LUT strategy/offset/slope/cut/ped: "
848  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
849 
850  unsigned int noiseCut = 0;
851  bool disabled = disabledChannel(channelId, noiseCut);
852  if (noiseCut > 0) cut = noiseCut;
853  if(strategy == 2) {
854  // take the global scale into account - translate strategy to 1 for Run-1 compatible treatment
855  lut(fir, scale*slope, scale*offset, scale*cut, ped, 1, disabled, output);
856  } else if(strategy == 1 || strategy == 0){
857  lut(fir, slope, offset, cut, ped, strategy, disabled, output);
858  } else ATH_MSG_WARNING(" ::cpLut: Unknown stragegy: " << strategy);
859 }

◆ cpLutParams()

void LVL1::L1TriggerTowerTool::cpLutParams ( const L1CaloCoolChannelId channelId,
int &  startBit,
int &  slope,
int &  offset,
int &  cut,
int &  pedValue,
float &  pedMean,
int &  strategy,
bool &  disabled 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1254 of file L1TriggerTowerTool.cxx.

1255 {
1256  startBit = 0;
1257  strategy = 0;
1258  offset = 0;
1259  double offsetReal = 0;
1260  slope = 0;
1261  cut = 0;
1262  pedValue = 0;
1263  pedMean = 0.;
1264  disabled = true;
1265  int hwCoeffSum = 0;
1266  const std::vector<short int>* hwCoeffs;
1267 
1268  if(!isRun2()) {
1269  // assert instead ?!
1270  ATH_MSG_WARNING("::cpLutParams: Run-1 data - behaviour undefined!");
1271  }
1272 
1273  if(m_conditionsContainer.has_value()) {
1274  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
1275 
1276  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
1277  if(settings) {
1278  startBit = settings->firStartBit();
1279  strategy = settings->lutCpStrategy();
1280  slope = settings->lutCpSlope();
1281  cut = settings->lutCpNoiseCut();
1282  pedValue = settings->pedValue();
1283  pedMean = settings->pedMean();
1284 
1285  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1286  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
1287  hwCoeffSum += hwCoeffs->at(i);
1288  }
1289 
1290  if (strategy == 0){
1291  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
1292  }
1293  else{
1294  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
1295  }
1296  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
1297 
1298  ATH_MSG_VERBOSE( "::jepLutParams: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1299  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1300 
1301  } else ATH_MSG_WARNING( "::cpLutParams: No L1CaloPprConditions found" );
1302  } else ATH_MSG_WARNING( "::cpLutParams: No Conditions Container retrieved" );
1303 
1304  ATH_MSG_VERBOSE( "::cpLutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1305  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1306  unsigned int noiseCut = 0;
1307  disabled = disabledChannel(channelId, noiseCut);
1308  if (noiseCut > 0) cut = noiseCut;
1309 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ disabledChannel() [1/2]

bool LVL1::L1TriggerTowerTool::disabledChannel ( const L1CaloCoolChannelId channelId)
virtual

Check for disabled channel.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1487 of file L1TriggerTowerTool.cxx.

1488 {
1489  unsigned int noiseCut = 0;
1490  return disabledChannel(channelId, noiseCut);
1491 }

◆ disabledChannel() [2/2]

bool LVL1::L1TriggerTowerTool::disabledChannel ( const L1CaloCoolChannelId channelId,
unsigned int &  noiseCut 
)
private

Get extra noise cut with disabled channel.

Check for disabled channel with noise cut.

Definition at line 1494 of file L1TriggerTowerTool.cxx.

1495 {
1496  bool isDisabled = false;
1497  noiseCut = 0;
1498  if(m_disabledChannelContainer.has_value()) {
1499  const L1CaloPprDisabledChannel* disabledChan = nullptr;
1500  if(isRun2()) disabledChan = std::any_cast<L1CaloPprDisabledChannelContainerRun2*>(m_disabledChannelContainer)->pprDisabledChannel(channelId.id());
1501  else disabledChan = std::any_cast<L1CaloPprDisabledChannelContainer*>(m_disabledChannelContainer)->pprDisabledChannel(channelId.id());
1502 
1503  if (disabledChan) {
1504  if (!disabledChan->disabledBits()) {
1505  ChanCalibErrorCode calibError(disabledChan->calibErrorCode());
1506  if (calibError.chanValid()) {
1507  ChanDeadErrorCode deadError(disabledChan->deadErrorCode());
1508  if (deadError.chanValid()) noiseCut = disabledChan->noiseCut();
1509  //else isDisabled = true;
1510  } //else isDisabled = true;
1511  } else isDisabled = true;
1512 
1513  ATH_MSG_VERBOSE( MSG::hex
1514  << "::disabledChannel: calibErrorCode: " << (disabledChan->calibErrorCode()).errorCode()
1515  << " deadErrorCode: " << (disabledChan->deadErrorCode()).errorCode()
1516  << " noiseCut: " << disabledChan->noiseCut()
1517  << " disabledBits: " << disabledChan->disabledBits()
1518  << MSG::dec );
1519 
1520  } else {
1521  ATH_MSG_VERBOSE( "::disabledChannel: No L1CaloPprDisabledChannel found" );
1522  }
1523  } else {
1524  ATH_MSG_WARNING( "::disabledChannel: No DisabledChannel Container retrieved" );
1525  }
1526  if (isDisabled && m_debug) ATH_MSG_VERBOSE( "::disabledChannel: Channel is disabled" );
1527 
1528  return isDisabled;
1529 }

◆ dropBits() [1/2]

void LVL1::L1TriggerTowerTool::dropBits ( const std::vector< int > &  fir,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1091 of file L1TriggerTowerTool.cxx.

1092 {
1093  unsigned int start = 0;
1094  if(m_conditionsContainer.has_value()) {
1095  bool available = false;
1096  if(isRun2())
1097  std::tie(available, start) = getFirStartBit<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1098  else
1099  std::tie(available, start) = getFirStartBit<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
1100  if(!available)ATH_MSG_WARNING( "::dropBits: No L1CaloPprConditions found" );
1101  } else ATH_MSG_WARNING( "::dropBits: No Conditions Container retrieved" );
1102 
1103  ATH_MSG_VERBOSE( "::dropBits: firStartBit: " << start );
1104 
1105  dropBits(fir, start, output);
1106 }

◆ dropBits() [2/2]

void LVL1::L1TriggerTowerTool::dropBits ( const std::vector< int > &  fir,
unsigned int  first,
std::vector< int > &  output 
)
virtual

Truncate FIR results for LUT input.

mask to select appropriate 10 bit range

overflow detection

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1110 of file L1TriggerTowerTool.cxx.

1111 {
1112  output.clear();
1113  output.reserve(fir.size()); // avoid frequent reallocations
1114 
1116  unsigned int mask = (0x3ff<<start);
1117 
1119  int max = 1<<(10+start);
1120 
1121  for (std::vector<int>::const_iterator it = fir.begin(); it != fir.end(); ++it) {
1122  if ((*it)>=max) output.push_back(0x3ff);
1123  else output.push_back(((*it)&mask)>>start);
1124  }
1125  if (m_debug) {
1126  ATH_MSG_VERBOSE( "::dropBits: output: ");
1127  printVec(output);
1128  ATH_MSG_VERBOSE(" ");
1129  }
1130 }

◆ etRange() [1/2]

void LVL1::L1TriggerTowerTool::etRange ( const std::vector< int > &  et,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1043 of file L1TriggerTowerTool.cxx.

1044 {
1045  int energyLow = 0;
1046  int energyHigh = 0;
1047  if (m_conditionsContainer.has_value()) {
1048  bool available = false;
1049  if(isRun2())
1050  std::tie(available, energyLow, energyHigh) = getBcidEnergyRange<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1051  else
1052  std::tie(available, energyLow, energyHigh) = getBcidEnergyRange<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
1053 
1054  if(!available) ATH_MSG_WARNING("::etRange: No L1CaloPprConditions found");
1055  } else ATH_MSG_WARNING("::etRange: No Conditions Container retrieved");
1056 
1057  ATH_MSG_VERBOSE( "::etRange: energyLow: " << energyLow
1058  << " energyHigh: " << energyHigh);
1059 
1060  etRange(et, energyLow, energyHigh, output);
1061 }

◆ etRange() [2/2]

void LVL1::L1TriggerTowerTool::etRange ( const std::vector< int > &  et,
int  energyLow,
int  energyHigh,
std::vector< int > &  output 
)
virtual

Identify BCID decision range.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1065 of file L1TriggerTowerTool.cxx.

1066 {
1067  output.clear();
1068  output.reserve(et.size()); // avoid frequent reallocations
1069  for (std::vector<int>::const_iterator it = et.begin(); it != et.end(); ++it) {
1070  if ((*it) <= energyLow) output.push_back(0);
1071  else if ((*it) <= energyHigh) output.push_back(1);
1072  else output.push_back(2);
1073  }
1074  if (m_debug) {
1075  ATH_MSG_VERBOSE( "::etRange: output: ");
1076  printVec(output);
1077  ATH_MSG_VERBOSE(" ");
1078  }
1079 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ FCalTTeta() [1/2]

double LVL1::L1TriggerTowerTool::FCalTTeta ( const L1CaloCoolChannelId channelId)
virtual

Return median eta of trigger tower from L1CaloCoolChannelId.

For FCAL towers this is the physical centre of the eta range - for other towers the normal tower eta will be returned

Get crate/module/submodule/channel from the CoolId

use these with mapping tool to get eta

for FCAL, convert nominal eta to physical

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1572 of file L1TriggerTowerTool.cxx.

1573 {
1574  if ( !m_mappingTool.isValid() ) {
1575  throw GaudiException("No mapping tool configured",
1576  "L1TriggerTowerTool::FCalTTeta", StatusCode::FAILURE);
1577  }
1578 
1580  unsigned int crate = channelId.crate();
1581  unsigned int module = channelId.module();
1582  unsigned int mcm = channelId.subModule();
1583  unsigned int pin = channelId.channel();
1584  int channel = pin*16 + mcm;
1585 
1587  double eta;
1588  double phi;
1589  int layer;
1590  if(!m_mappingTool->mapping(crate, module, channel, eta, phi, layer)) {
1591  ATH_MSG_WARNING("::FCalTTeta: could not map 0x" << std::hex << channelId.id() << std::dec);
1592  }
1593 
1595  return FCalTTeta(eta, phi, layer);
1596 }

◆ FCalTTeta() [2/2]

double LVL1::L1TriggerTowerTool::FCalTTeta ( double  nominalEta,
double  phi,
int  layer 
)
virtual

Calculate median eta of FCAL trigger tower from nominal eta and layer.

Hopefully this will be a short-term work-around

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1541 of file L1TriggerTowerTool.cxx.

1542 {
1543  double eta = nominalEta;
1544  float abseta = fabs(eta);
1545  if (abseta<3.2) return eta; // If called for non-FCAL TT return input value
1546  if (layer == 0) {
1547  int sign = ((eta > 0) ? 1 : -1);
1548  if (abseta < 3.6) eta = 3.15 * sign;
1549  else if (abseta < 4.0) eta = 3.33 * sign;
1550  else if (abseta < 4.5) eta = 3.72 * sign;
1551  else eta = 4.41 * sign;
1552  }
1553  else if (eta > 0) {
1554  if (abseta < 3.6) eta = 3.36;
1555  else if (abseta < 4.0) eta = 3.45;
1556  else if (abseta < 4.5) eta = 4.17;
1557  else eta = 4.19;
1558  }
1559  else {
1560  if (abseta < 3.6) eta = -3.45;
1561  else if (abseta < 4.0) eta = -3.36;
1562  else if (abseta < 4.5) eta = -4.19;
1563  else eta = -4.17;
1564  }
1565  return eta;
1566 }

◆ finalize()

StatusCode LVL1::L1TriggerTowerTool::finalize ( )
virtual

standard Athena-Algorithm method

Definition at line 136 of file L1TriggerTowerTool.cxx.

137 {
138  return StatusCode::SUCCESS;
139 }

◆ fir() [1/2]

void LVL1::L1TriggerTowerTool::fir ( const std::vector< int > &  digits,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

This FIR simulation produces a vector of same length as digit vector, with peak positions corresponding.

However, first 2 and last 2 FIR sums will be incomplete, and so are zeroed here

Get coefficients from COOL DB

Ordering of coeffs in hw makes sense for hw implementation, but is not most natural for processing vectors in software. So reverse order here before using

Implements LVL1::IL1TriggerTowerTool.

Definition at line 489 of file L1TriggerTowerTool.cxx.

490 {
492  std::vector<int> firCoeffs;
493  if(m_conditionsContainer.has_value()) {
494  const std::vector<short int>* hwCoeffs;
495  if(isRun2())
496  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
497  else
498  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
499  if(hwCoeffs) {
503  firCoeffs.reserve(hwCoeffs->size()); // avoid frequent reallocations
504  for (int i = hwCoeffs->size()-1; i >= 0; --i) firCoeffs.push_back((*hwCoeffs)[i]);
505 
506  } else ATH_MSG_WARNING( "::fir: No L1CaloPprConditions found" );
507  } else ATH_MSG_WARNING( "::fir: No Conditions Container retrieved" );
508 
509  if (m_debug) {
510  ATH_MSG_VERBOSE( "::fir: FIR coefficients: ");
511  printVec(firCoeffs);
512  ATH_MSG_VERBOSE(" ");
513  }
514 
515  fir(digits, firCoeffs, output);
516 }

◆ fir() [2/2]

void LVL1::L1TriggerTowerTool::fir ( const std::vector< int > &  digits,
const std::vector< int > &  firCoeffs,
std::vector< int > &  output 
)
virtual

This FIR simulation produces a vector of same length as digit vector, with peak positions corresponding.

However, since there are less FIR coefficients than digits the first and last few sums will be incomplete, and so are zeroed here

need to know first and last non-zero coefficient to know how which outputs can be calculated from supplied input digits

Only calculate where enough informations

Implements LVL1::IL1TriggerTowerTool.

Definition at line 522 of file L1TriggerTowerTool.cxx.

523 {
524  output.clear();
525  output.reserve(digits.size()); // avoid frequent reallocations
528  int firstFIR = -1;
529  int lastFIR = 0;
530  for (unsigned int i = 0; i < firCoeffs.size(); ++i) {
531  if (firstFIR < 0 && firCoeffs[i] != 0) firstFIR = i;
532  if (firCoeffs[i] != 0) lastFIR = i;
533  }
534  if (firstFIR < 0) firstFIR = lastFIR + 1;
535 
536  for (int i = 0; i < (int)digits.size(); i++) {
537  int sum = 0;
539  if (i >= 2-firstFIR && i < (int)digits.size()+2-lastFIR) {
540  for (int j = firstFIR; j <= lastFIR; ++j) {
541  sum += digits[i+j-2]*firCoeffs[j];
542  }
543  }
544  if (sum < 0) sum = 0;
545  output.push_back(sum);
546  }
547  if (m_debug) {
548  ATH_MSG_VERBOSE( "::fir: output: ");
549  printVec(output);
550  ATH_MSG_VERBOSE(" ");
551  }
552 }

◆ firParams()

void LVL1::L1TriggerTowerTool::firParams ( const L1CaloCoolChannelId channelId,
std::vector< int > &  firCoeffs 
)
virtual

Return FIR filter parameters for a channel.

Get coefficients from COOL DB

Ordering of coeffs in hw makes sense for hw implementation, but is not most natural for processing vectors in software. So reverse order here before using

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1133 of file L1TriggerTowerTool.cxx.

1134 {
1136  firCoeffs.clear();
1137  if(m_conditionsContainer.has_value()) {
1138  const std::vector<short int>* hwCoeffs = nullptr;
1139  if(isRun2())
1140  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1141  else
1142  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
1143 
1144  if(hwCoeffs) {
1148  firCoeffs.reserve(hwCoeffs->size()); // avoid frequent reallocations
1149  for (int i = hwCoeffs->size()-1; i >= 0; --i) firCoeffs.push_back((*hwCoeffs)[i]);
1150 
1151  } else ATH_MSG_WARNING( "::firParams: No L1CaloPprConditions found" );
1152  } else ATH_MSG_WARNING( "::firParams: No Conditions Container retrieved" );
1153 
1154  if (m_debug) {
1155  ATH_MSG_VERBOSE( "::fir: FIR coefficients: ");
1156  printVec(firCoeffs);
1157  ATH_MSG_VERBOSE(" ");
1158  }
1159 }

◆ handle()

void LVL1::L1TriggerTowerTool::handle ( const Incident &  inc)
virtual

catch begRun

Definition at line 143 of file L1TriggerTowerTool.cxx.

144 {
145  if (inc.type()=="BeginRun") {
146  ATH_MSG_DEBUG( "Resetting mapping table at start of run" );
147 
148  m_idTable.clear();
149  }
150 }

◆ hwIdentifier() [1/2]

HWIdentifier LVL1::L1TriggerTowerTool::hwIdentifier ( const Identifier id)
virtual

Return online identifier for given offline identifier.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1387 of file L1TriggerTowerTool.cxx.

1388 {
1389  HWIdentifier hwId(0);
1390  if (m_ttSvc) {
1391  try { hwId = m_ttSvc->createTTChannelID(id, false); }
1392  catch (const CaloID_Exception&) { hwId = HWIdentifier(0); }
1393  }
1394  return hwId;
1395 }

◆ hwIdentifier() [2/2]

HWIdentifier LVL1::L1TriggerTowerTool::hwIdentifier ( double  eta,
double  phi,
int  layer 
)
virtual

Return online identifier for given tower coordinates.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1399 of file L1TriggerTowerTool.cxx.

1400 {
1401  Identifier id = identifier(eta, phi, layer);
1402  return hwIdentifier(id);
1403 }

◆ identifier()

Identifier LVL1::L1TriggerTowerTool::identifier ( double  eta,
double  phi,
int  layer 
)
virtual

Return offline identifier for given tower coordinates.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1371 of file L1TriggerTowerTool.cxx.

1372 {
1373  Identifier id(0);
1375  int pos_neg_z = m_l1CaloTTIdTools->pos_neg_z(eta);
1376  int region = m_l1CaloTTIdTools->regionIndex(eta);
1377  int ieta = m_l1CaloTTIdTools->etaIndex(eta);
1378  int iphi = m_l1CaloTTIdTools->phiIndex(eta, phi);
1379 
1380  id = m_lvl1Helper->tower_id(pos_neg_z, layer, region, ieta, iphi);
1381  }
1382  return id;
1383 }

◆ initialize()

StatusCode LVL1::L1TriggerTowerTool::initialize ( )
virtual

standard Athena-Algorithm method

Definition at line 85 of file L1TriggerTowerTool.cxx.

86 {
87  m_debug = msgLvl(MSG::VERBOSE); // May want to make this VERBOSE!
88 
93 
94 
95  ATH_CHECK(m_l1CaloTTIdTools.retrieve());
96 
97  if(!m_ttSvc.retrieve().isSuccess()) {
98  ATH_MSG_WARNING( "Could not retrieve CaloTriggerTowerService Tool" );
99  } else {
100  ATH_MSG_INFO("Retrieved Tool " << m_ttSvc);
101  }
102 
103  StatusCode scID = detStore()->retrieve(m_caloMgr);
104  if (scID.isFailure()) {
105  ATH_MSG_WARNING( "Cannot retrieve m_caloMgr" );
106  } else {
108  }
109 
110  if (!m_mappingTool.empty()) {
111  ATH_CHECK( m_mappingTool.retrieve() );
112  }
113 
114  // Incident Service:
115  SmartIF<IIncidentSvc> incSvc{service("IncidentSvc")};
116  ATH_CHECK( incSvc.isValid() );
117  incSvc->addListener(this, "BeginRun");
118 
119  // Pedestal Correction
120  if (m_correctFir) {
122  ATH_MSG_INFO( "Retrieved L1DynamicPedestalProvider: " << m_dynamicPedestalProvider );
123  }
124 
126 
128 
129  ATH_MSG_INFO( "Initialization completed" );
130 
131  return StatusCode::SUCCESS;
132 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & LVL1::IL1TriggerTowerTool::interfaceID ( )
inlinestaticinherited

Definition at line 95 of file IL1TriggerTowerTool.h.

96 {
97  return IID_IL1TriggerTowerTool;
98 }

◆ isRun2()

bool LVL1::L1TriggerTowerTool::isRun2 ( ) const
private

Definition at line 1682 of file L1TriggerTowerTool.cxx.

1683 {
1684  const EventContext& ctx = Gaudi::Hive::currentContext();
1685  if (ctx.eventID().run_number() >= 253377) return true;
1686 
1688  if (eventInfo->eventType (xAOD::EventInfo::IS_SIMULATION)) return true;
1689  return false;
1690 }

◆ jepLut()

void LVL1::L1TriggerTowerTool::jepLut ( const std::vector< int > &  fir,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 861 of file L1TriggerTowerTool.cxx.

862 {
863  int startBit = 0;
864  int strategy = 0;
865  int offset = 0;
866  double offsetReal = 0;
867  int slope = 0;
868  int cut = 0;
869  unsigned short scale_db = 0;
870  unsigned short scale_menu = 0;
871  int ped = 0;
872  double pedMean = 0;
873  int hwCoeffSum = 0;
874  const std::vector<short int>* hwCoeffs;
875  short par1 = 0;
876  short par2 = 0;
877  short par3 = 0;
878  short par4 = 0;
879 
880  if(!isRun2()) {
881  // assert instead ?!
882  ATH_MSG_WARNING("::jepLut: Run-1 data - behaviour undefined!");
883  }
884 
885  if(m_conditionsContainer.has_value()) {
886  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
887  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
888  if (settings) {
889  startBit = settings->firStartBit();
890  strategy = settings->lutJepStrategy();
891  slope = settings->lutJepSlope();
892  cut = settings->lutJepNoiseCut();
893  ped = settings->pedValue();
894  pedMean = settings->pedMean();
895  scale_db = settings->lutJepScale();
896 
897  auto l1Menu = SG::makeHandle( m_L1MenuKey );
898  scale_menu = l1Menu->thrExtraInfo().JET().jetScale(); // Retrieve scale param from menu
899  if (strategy == 3) {
900  par1 = settings->lutJepPar1();
901  par2 = settings->lutJepPar2();
902  par3 = settings->lutJepPar3();
903  par4 = settings->lutJepPar4();
904  }
905 
906  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
907 
908  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
909  hwCoeffSum += hwCoeffs->at(i);
910  }
911 
912  if (strategy == 0){
913  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
914  }
915  else{
916  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
917  }
918  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
919 
920  ATH_MSG_VERBOSE( "::jepLut: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
921  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
922 
923  } else ATH_MSG_WARNING( "::jepLut: No L1CaloPprConditions found" );
924  } else ATH_MSG_WARNING( "::jepLut: No Conditions Container retrieved" );
925 
926  ATH_MSG_VERBOSE( "::jepLut: LUT strategy/offset/slope/cut/ped: "
927  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
928 
929  unsigned int noiseCut = 0;
930  bool disabled = disabledChannel(channelId, noiseCut);
931  if (noiseCut > 0) cut = noiseCut;
932 
933  if(strategy == 3) {
934  nonLinearLut(fir, slope, offset, cut, scale_db, par1, par2, par3, par4, disabled, output);
935  }
936  else if(strategy == 2) {
937  // take the global scale into account - translate strategy to 1 for Run-1 compatible treatment
938  lut(fir, scale_menu*slope, scale_menu*offset, scale_menu*cut, ped, 1, disabled, output);
939  }else if(strategy == 1 || strategy == 0) {
940  lut(fir, slope, offset, cut, ped, strategy, disabled, output);
941  } else ATH_MSG_WARNING(" ::jepLut: Unknown stragegy: " << strategy);
942 }

◆ jepLutParams()

void LVL1::L1TriggerTowerTool::jepLutParams ( const L1CaloCoolChannelId channelId,
int &  startBit,
int &  slope,
int &  offset,
int &  cut,
int &  pedValue,
float &  pedMean,
int &  strategy,
bool &  disabled 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1311 of file L1TriggerTowerTool.cxx.

1312 {
1313  startBit = 0;
1314  strategy = 0;
1315  offset = 0;
1316  double offsetReal = 0;
1317  slope = 0;
1318  cut = 0;
1319  pedValue = 0;
1320  pedMean = 0.;
1321  disabled = true;
1322  int hwCoeffSum = 0;
1323  const std::vector<short int>* hwCoeffs;
1324 
1325  if(!isRun2()) {
1326  // assert instead ?!
1327  ATH_MSG_WARNING("::jepLutParams: Run-1 data - behaviour undefined!");
1328  }
1329 
1330  if(m_conditionsContainer.has_value()) {
1331  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainerRun2*>(m_conditionsContainer);
1332 
1333  const L1CaloPprConditionsRun2* settings = conditionsContainer->pprConditions(channelId.id());
1334  if(settings) {
1335  startBit = settings->firStartBit();
1336  strategy = settings->lutJepStrategy();
1337  slope = settings->lutJepSlope();
1338  cut = settings->lutJepNoiseCut();
1339  pedValue = settings->pedValue();
1340  pedMean = settings->pedMean();
1341 
1342  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
1343 
1344  for (unsigned int i = 0; i < hwCoeffs->size(); i++){
1345  hwCoeffSum += hwCoeffs->at(i);
1346  }
1347 
1348  if (strategy == 0){
1349  offsetReal = pedMean * hwCoeffSum / pow(2.,startBit);
1350  }
1351  else{
1352  offsetReal = pedMean * hwCoeffSum * slope / pow(2.,startBit) - slope/2.;
1353  }
1354  offset = static_cast<unsigned short>( offsetReal < 0. ? 0 : offsetReal + 0.5 );
1355 
1356  ATH_MSG_VERBOSE( "::jepLutParams: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1357  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1358 
1359  } else ATH_MSG_WARNING( "::jepLutParams: No L1CaloPprConditions found" );
1360  } else ATH_MSG_WARNING( "::jepLutParams: No Conditions Container retrieved" );
1361 
1362  ATH_MSG_VERBOSE( "::jepLutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1363  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1364  unsigned int noiseCut = 0;
1365  disabled = disabledChannel(channelId, noiseCut);
1366  if (noiseCut > 0) cut = noiseCut;
1367 }

◆ loadFTRefs()

StatusCode LVL1::L1TriggerTowerTool::loadFTRefs ( )
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1612 of file L1TriggerTowerTool.cxx.

1613 {
1614  //method to load the FineTimeReferences Folder from COOL or an sqlite file (needs to be included in the job options)
1615  //implementation very similar to L1TriggerTowerTool::retrieveConditions
1616  //calling this method outside of fillHistograms() can result in Errors
1617 
1618  // this method new requires L1CalCondAlg to be scheduled
1619  m_dbFineTimeRefsTowers = nullptr;
1620  bool verbose = msgLvl(MSG::VERBOSE);
1622  CHECK_WITH_CONTEXT(rh.isValid(), "L1TriggerTowerTool");
1623  m_dbFineTimeRefsTowers = (*rh);
1624  if (verbose) {
1625  ATH_MSG_VERBOSE( "Retrieved FineTimeReferences Container" );
1626  rh->dump();
1627  }
1628  return StatusCode::SUCCESS;
1629 }

◆ lut() [1/2]

void LVL1::L1TriggerTowerTool::lut ( const std::vector< int > &  fir,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

LUT simulation: pedestal subtraction, energy calibration and threshold.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 760 of file L1TriggerTowerTool.cxx.

761 {
762  int strategy = 0;
763  int offset = 0;
764  int slope = 0;
765  int cut = 0;
766  int ped = 0;
767 
768  if(isRun2()) {
769  // assert instead ?!
770  ATH_MSG_WARNING("::lut: Run-2 data - behaviour undefined!");
771  }
772 
773  if(m_conditionsContainer.has_value()) {
774  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainer*>(m_conditionsContainer);
775  const L1CaloPprConditions* settings = conditionsContainer->pprConditions(channelId.id());
776  if (settings) {
777  strategy = settings->lutStrategy();
778  offset = settings->lutOffset();
779  slope = settings->lutSlope();
780  cut = settings->lutNoiseCut();
781  ped = settings->pedValue();
782  } else ATH_MSG_WARNING( "::lut: No L1CaloPprConditions found" );
783  } else ATH_MSG_WARNING( "::lut: No Conditions Container retrieved" );
784 
785  ATH_MSG_VERBOSE( "::lut: LUT strategy/offset/slope/cut/ped: "
786  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
787 
788  unsigned int noiseCut = 0;
789  bool disabled = disabledChannel(channelId, noiseCut);
790  if (noiseCut > 0) cut = noiseCut;
791 
792  lut(fir, slope, offset, cut, ped, strategy, disabled, output);
793 }

◆ lut() [2/2]

void LVL1::L1TriggerTowerTool::lut ( const std::vector< int > &  fir,
int  slope,
int  offset,
int  cut,
int  ped,
int  strategy,
bool  disabled,
std::vector< int > &  output 
)
virtual

LUT simulation: pedestal subtraction, energy calibration and threshold.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 946 of file L1TriggerTowerTool.cxx.

947 {
948  output.clear();
949  output.reserve(fir.size()); // avoid frequent reallocations
950 
951  std::vector<int>::const_iterator it = fir.begin();
952  for ( ; it != fir.end(); ++it) {
953  int out = 0;
954  if (!disabled) {
955  if (strategy == 0 && (*it) >= offset+cut) { // Original scheme
956  out = (((*it)-offset)*slope + 2048)>>12;
957  } else if (strategy == 1 && (*it)*slope >= offset+cut) { // New scheme
958  out = ((*it)*slope - offset + 2048)>>12;
959  }
960  if (out < 0) out = 0;
962  }
963  output.push_back(out);
964  }
965  if (m_debug) {
966  ATH_MSG_VERBOSE( "::lut: output: ");
967  printVec(output);
968  ATH_MSG_VERBOSE(" ");
969  }
970 }

◆ lutParams()

void LVL1::L1TriggerTowerTool::lutParams ( const L1CaloCoolChannelId channelId,
int &  startBit,
int &  slope,
int &  offset,
int &  cut,
int &  pedValue,
float &  pedMean,
int &  strategy,
bool &  disabled 
)
virtual

Return LUT parameters for a channel.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1216 of file L1TriggerTowerTool.cxx.

1217 {
1218  startBit = 0;
1219  strategy = 0;
1220  offset = 0;
1221  slope = 0;
1222  cut = 0;
1223  pedValue = 0;
1224  pedMean = 0.;
1225  disabled = true;
1226 
1227  if(isRun2()) {
1228  // assert instead ?!
1229  ATH_MSG_WARNING("::lutParams: Run-2 data - behaviour undefined!");
1230  }
1231 
1232  if(m_conditionsContainer.has_value()) {
1233  auto conditionsContainer = std::any_cast<L1CaloPprConditionsContainer*>(m_conditionsContainer);
1234 
1235  const L1CaloPprConditions* settings = conditionsContainer->pprConditions(channelId.id());
1236  if (settings) {
1237  startBit = settings->firStartBit();
1238  strategy = settings->lutStrategy();
1239  offset = settings->lutOffset();
1240  slope = settings->lutSlope();
1241  cut = settings->lutNoiseCut();
1242  pedValue = settings->pedValue();
1243  pedMean = settings->pedMean();
1244  } else ATH_MSG_WARNING( "::lutParams: No L1CaloPprConditions found" );
1245  } else ATH_MSG_WARNING( "::lutParams: No Conditions Container retrieved" );
1246 
1247  ATH_MSG_VERBOSE( "::lutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1248  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1249  unsigned int noiseCut = 0;
1250  disabled = disabledChannel(channelId, noiseCut);
1251  if (noiseCut > 0) cut = noiseCut;
1252 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ nonLinearLut()

void LVL1::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 
)
virtual

Definition at line 972 of file L1TriggerTowerTool.cxx.

973 {
974  output.clear();
975  output.reserve(fir.size()); // avoid frequent reallocations
976 
977  std::vector<int>::const_iterator it = fir.begin();
978  for ( ; it != fir.end(); ++it) {
979  int out = 0;
980  if (!disabled) {
981  // turn shorts into double
982  double nll_slope = 0.001 * scale;
983  double nll_offset = 0.001 * par1;
984  double nll_ampl = 0.001 * par2;
985  double nll_expo = 0.;
986  if(par3) {
987  nll_expo = -1. / (4096 * 0.001*par3);
988  } else {
989  nll_ampl = 0.;
990  }
991  double nll_noise = 0.001 * par4;
992 
993  // noise cut
994  if ((*it) * slope < offset + nll_noise * cut) {
995  output.push_back(0);
996  continue;
997  }
998  // actual calculation
999  out = int((((int)(2048 + nll_slope * ((*it) * slope - offset)))>>12) + nll_offset + nll_ampl * std::exp(nll_expo * ((*it) * slope - offset)));
1000 
1002  if(out < 0) out = 0;
1003  }
1004  output.push_back(out);
1005  }
1006  if (m_debug) {
1007  ATH_MSG_VERBOSE( "::nonLinearLut: output: ");
1008  printVec(output);
1009  ATH_MSG_VERBOSE(" ");
1010  }
1011 }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ peakBcid() [1/2]

void LVL1::L1TriggerTowerTool::peakBcid ( const std::vector< int > &  fir,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Peak finder BCID.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 562 of file L1TriggerTowerTool.cxx.

563 {
564  unsigned int strategy = 0;
565  if(m_conditionsContainer.has_value()) {
566  if(isRun2())
567  strategy = getStrategy<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
568  else
569  strategy = getStrategy<L1CaloPprConditionsContainer>(m_conditionsContainer);
570  } else ATH_MSG_WARNING( "::peakBcid: No Conditions Container retrieved" );
571 
572  ATH_MSG_VERBOSE( "::peakBcid: peak-finder strategy: " << strategy );
573 
574  peakBcid(fir, strategy, output);
575 }

◆ peakBcid() [2/2]

void LVL1::L1TriggerTowerTool::peakBcid ( const std::vector< int > &  fir,
unsigned int  strategy,
std::vector< int > &  output 
)
virtual

Peak finder BCID.

Cannot evaluate for first and last samples in vector

Select peak-finder strategy & test

Implements LVL1::IL1TriggerTowerTool.

Definition at line 578 of file L1TriggerTowerTool.cxx.

579 {
580  output.clear();
581  output.reserve(fir.size()); // avoid frequent reallocations
582 
583  for (unsigned int i = 0; i < fir.size(); i++) {
584  int result = 0;
586  if (i > 0 && i < fir.size()-1) {
588  if (strategy&0x1) {
589  if ( (fir[i-1]<fir[i]) && (fir[i+1]<fir[i]) ) result = 1;
590  } else {
591  if ( (fir[i-1]<fir[i]) && (fir[i+1]<=fir[i]) ) result = 1;
592  }
593  }
594  output.push_back(result);
595  }
596  if (m_debug) {
597  ATH_MSG_VERBOSE( "::peakBcid: output: ");
598  printVec(output);
599  ATH_MSG_VERBOSE(" ");
600  }
601 }

◆ pedestalCorrection()

void LVL1::L1TriggerTowerTool::pedestalCorrection ( std::vector< int > &  firInOut,
int  firPed,
int  iElement,
int  layer,
int  bcid,
float  mu,
std::vector< int_least16_t > &  correctionOut 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1661 of file L1TriggerTowerTool.cxx.

1661  {
1662  unsigned nFIR = firInOut.size();
1663  correctionOut.assign(nFIR, 0u);
1664 
1665  if(!m_correctFir) return;
1666 
1667  // apply the pedestal correction
1668  for(unsigned i = 0; i != nFIR; ++i) {
1669  correctionOut[i] = (m_dynamicPedestalProvider->dynamicPedestal(iElement, layer, firPed, bcid + i - nFIR/2, mu) - firPed);
1670  firInOut[i] -= correctionOut[i];
1671 
1672  if(firInOut[i] < 0) firInOut[i] = 0;
1673  }
1674 
1675  if(m_debug) {
1676  ATH_MSG_VERBOSE( "::pedestalCorrection(BCID=" << bcid << ", mu = " << mu << "): ");
1677  printVec(correctionOut);
1678  ATH_MSG_VERBOSE(" ");
1679  }
1680 }

◆ printVec()

template<typename T >
void LVL1::L1TriggerTowerTool::printVec ( const std::vector< T > &  vec)
private

Print a vector to debug.

Definition at line 1600 of file L1TriggerTowerTool.cxx.

1601 {
1602  if (m_debug) {
1603  if (vec.empty()) ATH_MSG_VERBOSE( " empty ");
1604  else {
1605  for(auto v : vec) {
1606  ATH_MSG_VERBOSE( v << " ");
1607  }
1608  }
1609  }
1610 }

◆ process() [1/2]

void LVL1::L1TriggerTowerTool::process ( const std::vector< int > &  digits,
const L1CaloCoolChannelId channelId,
std::vector< int > &  et,
std::vector< int > &  bcidResults,
std::vector< int > &  bcidDecisions,
bool  useJepLut = true 
)
virtual

All-in-one routine - give it the ADC counts and TT identifier, and it returns the results.

Initialise

emulate FIR filter

emulate the two BCID algorithms

evaluate BCID decisions

LUT ET calculation

Use ET range to return appropriate ET value do not test BCID here, since no guarantee enough ADC samples to evaluate it reliably

Implements LVL1::IL1TriggerTowerTool.

Definition at line 210 of file L1TriggerTowerTool.cxx.

213 {
214  if (m_debug) {
215  ATH_MSG_VERBOSE( "::process: ==== Entered Process ====" );
216  ATH_MSG_VERBOSE( "::process: digits: ");
217  printVec(digits);
218  ATH_MSG_VERBOSE( " channelID: " << MSG::hex << channelId.id() << MSG::dec );
219  }
220 
222  et.clear();
223  bcidResults.clear();
224  bcidDecisions.clear();
225 
226  ATH_MSG_VERBOSE( "::process: ---- FIR filter ----" );
227 
229  std::vector<int> filter;
230  fir(digits, channelId, filter);
231  std::vector<int> lutInput;
232  dropBits(filter, channelId, lutInput);
233 
234  ATH_MSG_VERBOSE( "::process: ---- BCID algorithms ----" );
235 
237  bcid(filter, digits, channelId, bcidResults);
238 
239  ATH_MSG_VERBOSE( "::process: ---- BCID decisions ----" );
240 
242  std::vector<int> decisionRange;
243  bcidDecisionRange(lutInput, digits, channelId, decisionRange);
244  bcidDecision(bcidResults, decisionRange, channelId, bcidDecisions);
245 
246  ATH_MSG_VERBOSE( "::process: ---- LUT ET calculation ----" );
247 
249  std::vector<int> lutOutput;
250  if(isRun2()) {
251  if(useJepLut) jepLut(lutInput, channelId, lutOutput);
252  else cpLut(lutInput, channelId, lutOutput);
253  } else {
254  lut(lutInput, channelId, lutOutput);
255  }
256 
257  ATH_MSG_VERBOSE( "::process: ---- use ET range ----" );
258 
261  applyEtRange(lutOutput, decisionRange, channelId, et);
262 
263  ATH_MSG_VERBOSE( "::process: ==== Leaving Process ====" );
264 }

◆ process() [2/2]

void LVL1::L1TriggerTowerTool::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 
)
virtual

Take in vector of ADC digits, return PPrASIC results.

All-in-one routine - give it the ADC counts and TT identifier, and it returns the results.

Find channelID for this tower

then process the tower

Implements LVL1::IL1TriggerTowerTool.

Definition at line 196 of file L1TriggerTowerTool.cxx.

199 {
201  L1CaloCoolChannelId id = channelID(eta, phi, layer);
202 
204  process(digits, id, et, bcidResults, bcidDecisions, useJepLut);
205 }

◆ refValues()

std::pair< double, double > LVL1::L1TriggerTowerTool::refValues ( const L1CaloCoolChannelId channelId)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1631 of file L1TriggerTowerTool.cxx.

1632 {
1633  //method returning the fine time reference and calibration value
1634  //the fineTimeReference folder has to be loaded first using the method L1TriggerTowerTool::loadFTRefs
1635  double reference = 0;
1636  double calib = 0;
1637 
1638  if (m_dbFineTimeRefsTowers) {
1640  if (ftref) {
1641  FineTimeErrorCode errorCode(ftref->errorCode());
1642 // if (errorCode.chanValid()) { //this should be changed at some point, at the moment the error code is ignored
1643  reference = ftref->refValue();
1644  calib = ftref->calibValue();
1645 // }
1646 
1647  ATH_MSG_VERBOSE( MSG::hex
1648  << "::refValues: errorCode: " << (ftref->errorCode()).errorCode()
1649  << MSG::dec << " reference: " << ftref->refValue() << " calib: " << ftref->calibValue() );
1650 
1651  } else {
1652  ATH_MSG_VERBOSE( "::refValue: No FineTimeRefsTowers found" );
1653  }
1654  } else {
1655  ATH_MSG_VERBOSE( "::refValue: No FineTimeRefs Container retrieved" );
1656  }
1657 
1658  return std::make_pair(reference, calib);
1659 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ retrieveConditions()

StatusCode LVL1::L1TriggerTowerTool::retrieveConditions ( )
virtual

Retrieve pointers to the L1Calo conditions containers.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 155 of file L1TriggerTowerTool.cxx.

156 {
157  ATH_MSG_VERBOSE("L1TriggerTowerTool::retrieveConditions");
158 
159  // retrieving direct from detector store, requires L1CaloCondAlg to have been scheduled
160  // strategy logic etc is now done inside the L1CaloCondAlg too
161  // so we just need to retrieve three containers (runpars, conditions, disabledchannels) ...
162  bool verbose = msgLvl(MSG::VERBOSE);
163 
165  CHECK_WITH_CONTEXT(rh_rp.isValid(), "L1TriggerTowerTool");
166  m_runParametersContainer = (*rh_rp);
167  if (verbose) {
168  ATH_MSG_VERBOSE( "Retrieved RunParametersContainer" );
169  rh_rp->dump();
170  }
171 
172  if(isRun2()) {
174  CHECK_WITH_CONTEXT(rh_c.isValid(), "L1TriggerTowerTool");
175  m_conditionsContainer = (*rh_c);
176  if (verbose) {
177  ATH_MSG_VERBOSE( "Retrieved ConditionsContainer" );
178  rh_c->dump();
179  }
181  CHECK_WITH_CONTEXT(rh_dc.isValid(), "L1TriggerTowerTool");
182  m_disabledChannelContainer = (*rh_dc);
183  if (verbose) {
184  ATH_MSG_VERBOSE( "Retrieved DisabledChannelContainer" );
185  rh_dc->dump();
186  }
187  } else {
188  ATH_MSG_ERROR("non-Run2 no longer supported ... requires update to L1CaloCondAlg to create non-Run2 versions of containers");
189  return StatusCode::FAILURE;
190  }
191  return StatusCode::SUCCESS;
192 }

◆ satBcid() [1/2]

void LVL1::L1TriggerTowerTool::satBcid ( const std::vector< int > &  digits,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
)
virtual

Saturated pulse BCID.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 614 of file L1TriggerTowerTool.cxx.

615 {
616  int satLevel = 0;
617  int satLow = 0;
618  int satHigh = 0;
619  if (m_conditionsContainer.has_value()) {
620  bool available = false;
621  if(isRun2())
622  std::tie(available, satLevel, satLow, satHigh) = getSaturation<L1CaloPprConditionsContainerRun2>(channelId.id(), m_conditionsContainer);
623  else
624  std::tie(available, satLevel, satLow, satHigh) = getSaturation<L1CaloPprConditionsContainer>(channelId.id(), m_conditionsContainer);
625  if(!available) ATH_MSG_WARNING( "::satBcid: No L1CaloPprConditions found" );
626  } else ATH_MSG_WARNING( "::satBcid: No Conditions Container retrieved" );
627 
628  ATH_MSG_VERBOSE( "::satBcid: satLevel: " << satLevel
629  << " satLow: " << satLow
630  << " satHigh: " << satHigh );
631 
632  satBcid(digits, satLow, satHigh, satLevel, output);
633 }

◆ satBcid() [2/2]

void LVL1::L1TriggerTowerTool::satBcid ( const std::vector< int > &  digits,
int  satLow,
int  satHigh,
int  satLevel,
std::vector< int > &  output 
)
virtual

Saturated pulse BCID.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 637 of file L1TriggerTowerTool.cxx.

638 {
639  output.clear();
640  output.reserve(digits.size()); // avoid frequent reallocations
641 
642  bool enabled = true;
643  int flag[2] = {0,0};
644 
645  for (unsigned int i = 0; i<digits.size(); i++) {
646  // Algorithm can set flag for following sample. So here we
647  // propagate such flags into the current sample.
648  flag[0] = flag[1];
649  flag[1] = 0;
650 
651  if (digits[i]>=satLevel) { // do we have saturation?
652  if (enabled && i>1) { // is algorithm active?
653  bool low = (digits[i-2]>satLow);
654  bool high = (digits[i-1]>satHigh);
655  if (high) { // flag current or next sample?
656  if (low) {
657  flag[0] = 1;
658  }
659  else {
660  flag[1] = 1;
661  }
662  }
663  else {
664  flag[1] = 1;
665  }
666  }
667  enabled = false; // after first saturation, disable algorithm
668  }
669  else {
670  enabled = true; // unsaturated sample reenables algorithm
671  }
672  output.push_back(flag[0]);
673  }
674  if (m_debug) {
675  ATH_MSG_VERBOSE( "::satBcid: output: ");
676  printVec(output);
677  ATH_MSG_VERBOSE(" ");
678  }
679 }

◆ satOverride()

bool LVL1::L1TriggerTowerTool::satOverride ( int  range,
const L1CaloCoolChannelId channelId 
)
virtual

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1464 of file L1TriggerTowerTool.cxx.

1465 {
1466  bool override = false;
1467  if(m_conditionsContainer.has_value()) {
1468  std::tuple<bool, bool, bool> satOverride;
1469  if(isRun2())
1470  satOverride = getSatOverride<L1CaloPprConditionsContainerRun2>(m_conditionsContainer);
1471  else
1472  satOverride = getSatOverride<L1CaloPprConditionsContainer>(m_conditionsContainer);
1473  // NB Reverse order as for bcidDecision1/2/3
1474  if (range == 0) override = std::get<2>(satOverride);
1475  if (range == 1) override = std::get<1>(satOverride);
1476  if (range == 2) override = std::get<0>(satOverride);
1477  } else ATH_MSG_WARNING( "::satOverride: No Conditions Container retrieved" );
1478 
1479  ATH_MSG_VERBOSE( "::satOverride: range " << range
1480  << " has saturation override flag " << override );
1481 
1482  return override;
1483 }

◆ setDebug()

void LVL1::L1TriggerTowerTool::setDebug ( bool  debug)
virtual

Finer control of debug printing.

Implements LVL1::IL1TriggerTowerTool.

Definition at line 1533 of file L1TriggerTowerTool.cxx.

1534 {
1535  m_debug = (debug && msgLvl(MSG::VERBOSE));
1536 }

◆ simulateChannel()

void LVL1::L1TriggerTowerTool::simulateChannel ( const xAOD::TriggerTower tt,
std::vector< int > &  outCpLut,
std::vector< int > &  outJepLut,
std::vector< int > &  bcidResults,
std::vector< int > &  bcidDecisions 
)
virtual

All-in-one routine - give it the TT identifier, and it returns the results.

Initialise

emulate FIR filter

apply pedestal correction

emulate the two BCID algorithms

evaluate BCID decisions

LUT ET calculation

Use ET range to return appropriate ET value do not test BCID here, since no guarantee enough ADC samples to evaluate it reliably

Implements LVL1::IL1TriggerTowerTool.

Definition at line 278 of file L1TriggerTowerTool.cxx.

279 {
280 
281  //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
282 
283  unsigned int readoutConfigID = std::cbegin(*m_runParametersContainer)->readoutConfigID();
284 
285  if(m_debug){
286  ATH_MSG_VERBOSE("ReadoutConfigID = " << readoutConfigID );
287  }
288 
289  std::vector<uint16_t> digits40;
290 
291  if(readoutConfigID == 5 or readoutConfigID == 6){
292 
293  if(m_debug){
294  ATH_MSG_VERBOSE("80 MHz readout detected, emulating 40 MHz samples");
295  }
296 
297  int nSlices = tt.adc().size();
298 
299  if((nSlices%4)==3){
300  for (int i=0 ; i < (nSlices-1)/2 ; i++ ){
301  digits40.push_back(tt.adc().at(2*i+1));
302  }
303  }
304  else if((nSlices%4)==1){
305  for (int i=0 ; i <= (nSlices-1)/2 ; i++){
306  digits40.push_back(tt.adc().at(2*i));
307  }
308  }
309 
310 
311  }else{
312  if(m_debug){
313  ATH_MSG_VERBOSE("40 MHz readout detected");
314  }
315  digits40 = tt.adc();
316  }
317 
318  const auto& digits = convertVectorType<int>(digits40);
319 
320  L1CaloCoolChannelId channelId {tt.coolId()};
321 
322  if (m_debug) {
323  ATH_MSG_VERBOSE( "::simulateChannel: ==== Entered Process ====" );
324  ATH_MSG_VERBOSE( "::simulateChannel: digits: ");
325  printVec(digits);
326  ATH_MSG_VERBOSE( "::simulateChannel: channelID: " << MSG::hex << channelId.id() << MSG::dec );
327  }
328 
330  outCpLut.clear();
331  outJepLut.clear();
332  bcidResults.clear();
333  bcidDecisions.clear();
334 
336  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- FIR filter ----" );
337  std::vector<int> filter;
338  fir(digits, channelId, filter);
339  if (m_debug) printVec(filter);
340 
341 
343  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- pedestalCorrection ----" );
344  // the correction is only available for each LUT slice in the read-out (not ADC/Filter slice)
345  // therefore we can only apply it to the #LUT central filter slices
346  const std::size_t nCorr = tt.correctionEnabled().size();
347  const std::size_t filterOffset = filter.size()/2 - nCorr/2;
348  for(std::size_t iCorr = 0; iCorr < nCorr; ++iCorr) {
349  filter[filterOffset + iCorr] -= tt.correction()[iCorr] * tt.correctionEnabled()[iCorr];
350  }
351  if (m_debug) printVec(filter);
352 
353  std::vector<int> lutInput;
354  dropBits(filter, channelId, lutInput);
355 
356  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- BCID algorithms ----" );
357 
359  bcid(filter, digits, channelId, bcidResults);
360 
361  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- BCID decisions ----" );
362 
364  std::vector<int> decisionRange;
365  bcidDecisionRange(lutInput, digits, channelId, decisionRange);
366  bcidDecision(bcidResults, decisionRange, channelId, bcidDecisions);
367 
368  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- LUT ET calculation ----" );
369 
371  std::vector<int> cpLutOutput, jepLutOutput;
372  cpLut(lutInput, channelId, cpLutOutput);
373  jepLut(lutInput, channelId, jepLutOutput);
374 
375  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ---- use ET range ----" );
376 
379  applyEtRange(cpLutOutput, decisionRange, channelId, outCpLut);
380  applyEtRange(jepLutOutput, decisionRange, channelId, outJepLut);
381 
382  if (m_debug) ATH_MSG_VERBOSE( "::simulateChannel: ==== Leaving Process ====" );
383 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_caloMgr

const CaloIdManager* LVL1::L1TriggerTowerTool::m_caloMgr
private

Id managers.

Definition at line 147 of file L1TriggerTowerTool.h.

◆ m_conditionsContainer

std::any LVL1::L1TriggerTowerTool::m_conditionsContainer
private

Definition at line 168 of file L1TriggerTowerTool.h.

◆ m_conditionsContainerKeyRun2

SG::ReadCondHandleKey<L1CaloPprConditionsContainerRun2> LVL1::L1TriggerTowerTool::m_conditionsContainerKeyRun2 { this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"}
private

Definition at line 160 of file L1TriggerTowerTool.h.

◆ m_correctFir

bool LVL1::L1TriggerTowerTool::m_correctFir
private

Baseline correction Tool.

Definition at line 179 of file L1TriggerTowerTool.h.

◆ m_dbFineTimeRefsTowers

const L1CaloPpmFineTimeRefsContainer* LVL1::L1TriggerTowerTool::m_dbFineTimeRefsTowers = nullptr
private

For the fine time monitoring.

Definition at line 172 of file L1TriggerTowerTool.h.

◆ m_dbFineTimeRefsTowersKey

SG::ReadCondHandleKey<L1CaloPpmFineTimeRefsContainer> LVL1::L1TriggerTowerTool::m_dbFineTimeRefsTowersKey { this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"}
private

Definition at line 162 of file L1TriggerTowerTool.h.

◆ m_debug

bool LVL1::L1TriggerTowerTool::m_debug = false
private

Definition at line 144 of file L1TriggerTowerTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_disabledChannelContainer

std::any LVL1::L1TriggerTowerTool::m_disabledChannelContainer
private

Definition at line 169 of file L1TriggerTowerTool.h.

◆ m_disabledChannelContainerKeyRun2

SG::ReadCondHandleKey<L1CaloPprDisabledChannelContainerRun2> LVL1::L1TriggerTowerTool::m_disabledChannelContainerKeyRun2 { this, "InputKeyDisabledChannelRun2", "L1CaloPprDisabledChannelContainerRun2"}
private

Definition at line 161 of file L1TriggerTowerTool.h.

◆ m_dynamicPedestalProvider

ToolHandle<LVL1::IL1DynamicPedestalProvider> LVL1::L1TriggerTowerTool::m_dynamicPedestalProvider
private

Definition at line 180 of file L1TriggerTowerTool.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> LVL1::L1TriggerTowerTool::m_eventInfoKey { this, "EventInfoKey", "EventInfo", "" }
private

Definition at line 182 of file L1TriggerTowerTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idTable

std::vector<unsigned int> LVL1::L1TriggerTowerTool::m_idTable
private

Mapping lookup table.

Definition at line 176 of file L1TriggerTowerTool.h.

◆ m_l1CaloTTIdTools

ToolHandle<LVL1::IL1CaloTTIdTools> LVL1::L1TriggerTowerTool::m_l1CaloTTIdTools
private

Definition at line 152 of file L1TriggerTowerTool.h.

◆ m_L1MenuKey

SG::ReadHandleKey<TrigConf::L1Menu> LVL1::L1TriggerTowerTool::m_L1MenuKey { this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" }
private

Definition at line 184 of file L1TriggerTowerTool.h.

◆ m_lvl1Helper

const CaloLVL1_ID* LVL1::L1TriggerTowerTool::m_lvl1Helper
private

and tools for computing identifiers

Definition at line 150 of file L1TriggerTowerTool.h.

◆ m_mappingTool

ToolHandle<LVL1::IL1CaloMappingTool> LVL1::L1TriggerTowerTool::m_mappingTool
private

and mappings

Definition at line 156 of file L1TriggerTowerTool.h.

◆ m_nBcid

const int LVL1::L1TriggerTowerTool::m_nBcid = 350
staticprivate

Definition at line 190 of file L1TriggerTowerTool.h.

◆ m_runParametersContainer

const L1CaloRunParametersContainer* LVL1::L1TriggerTowerTool::m_runParametersContainer = nullptr
private

Definition at line 164 of file L1TriggerTowerTool.h.

◆ m_runParametersContainerKey

SG::ReadCondHandleKey<L1CaloRunParametersContainer> LVL1::L1TriggerTowerTool::m_runParametersContainerKey { this, "InputKeyRunParameters", "L1CaloRunParametersContainer"}
private

L1Calo conditions.

Definition at line 159 of file L1TriggerTowerTool.h.

◆ m_ttSvc

ToolHandle<CaloTriggerTowerService> LVL1::L1TriggerTowerTool::m_ttSvc
private

Definition at line 153 of file L1TriggerTowerTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ s_maxTowers

const int LVL1::L1TriggerTowerTool::s_maxTowers = 7168
staticprivate

Definition at line 189 of file L1TriggerTowerTool.h.

◆ s_saturationValue

const int LVL1::L1TriggerTowerTool::s_saturationValue = 255
staticprivate

Parameters.

Definition at line 188 of file L1TriggerTowerTool.h.


The documentation for this class was generated from the following files:
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:189
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
L1CaloPprConditionsRun2::lutJepPar2
short lutJepPar2() const
Definition: L1CaloPprConditionsRun2.h:90
test_pyathena.eta
eta
Definition: test_pyathena.py:10
LVL1::L1TriggerTowerTool::channelID
virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer)
Return Cool channel identifier for given tower coordinates.
Definition: L1TriggerTowerTool.cxx:1407
L1CaloPprConditions::lutOffset
unsigned short lutOffset() const
Definition: L1CaloPprConditions.h:47
et
Extra patterns decribing particle interation process.
FineTimeErrorCode
FineTimeErrorCode class for L1Calo error codes.
Definition: FineTimeErrorCode.h:19
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:168
get_generator_info.result
result
Definition: get_generator_info.py:21
L1CaloPprConditionsRun2::firStartBit
unsigned short firStartBit() const
Definition: L1CaloPprConditionsRun2.h:74
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:153
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloID_Exception
Exception class for Calo Identifiers.
Definition: CaloID_Exception.h:20
L1CaloPprConditionsRun2::lutCpNoiseCut
unsigned short lutCpNoiseCut() const
Definition: L1CaloPprConditionsRun2.h:79
L1CaloPprConditionsRun2::lutJepScale
unsigned short lutJepScale() const
Definition: L1CaloPprConditionsRun2.h:93
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
LVL1::L1TriggerTowerTool::m_l1CaloTTIdTools
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
Definition: L1TriggerTowerTool.h:152
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1::L1TriggerTowerTool::m_conditionsContainerKeyRun2
SG::ReadCondHandleKey< L1CaloPprConditionsContainerRun2 > m_conditionsContainerKeyRun2
Definition: L1TriggerTowerTool.h:160
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
LVL1::L1TriggerTowerTool::FCalTTeta
virtual double FCalTTeta(const L1CaloCoolChannelId &channelId)
Return median eta of trigger tower from L1CaloCoolChannelId.
Definition: L1TriggerTowerTool.cxx:1572
L1CaloPprConditionsRun2::lutJepStrategy
unsigned short lutJepStrategy() const
Definition: L1CaloPprConditionsRun2.h:85
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
LVL1::L1TriggerTowerTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: L1TriggerTowerTool.h:183
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:1015
LVL1::L1TriggerTowerTool::m_idTable
std::vector< unsigned int > m_idTable
Mapping lookup table.
Definition: L1TriggerTowerTool.h:176
skel.it
it
Definition: skel.GENtoEVGEN.py:407
LVL1::L1TriggerTowerTool::m_runParametersContainerKey
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainerKey
L1Calo conditions.
Definition: L1TriggerTowerTool.h:159
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LVL1::L1TriggerTowerTool::m_dbFineTimeRefsTowers
const L1CaloPpmFineTimeRefsContainer * m_dbFineTimeRefsTowers
For the fine time monitoring.
Definition: L1TriggerTowerTool.h:172
L1CaloPprConditions::pedMean
float pedMean() const
Definition: L1CaloPprConditions.h:51
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:9
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:972
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:796
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:184
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
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
LVL1::L1TriggerTowerTool::m_disabledChannelContainerKeyRun2
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_disabledChannelContainerKeyRun2
Definition: L1TriggerTowerTool.h:161
L1CaloPprConditionsRun2::lutCpScale
unsigned short lutCpScale() const
Definition: L1CaloPprConditionsRun2.h:84
LVL1::L1TriggerTowerTool::s_saturationValue
static const int s_saturationValue
Parameters.
Definition: L1TriggerTowerTool.h:188
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
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
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
covarianceTool.filter
filter
Definition: covarianceTool.py:514
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
ChanDeadErrorCode
ChanDeadErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanDe...
Definition: ChanDeadErrorCode.h:20
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
L1CaloPprConditionsRun2::lutJepPar1
short lutJepPar1() const
Definition: L1CaloPprConditionsRun2.h:89
python.PyAthena.module
module
Definition: PyAthena.py:131
LVL1::L1TriggerTowerTool::m_caloMgr
const CaloIdManager * m_caloMgr
Id managers.
Definition: L1TriggerTowerTool.h:147
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
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:180
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
lumiFormat.i
int i
Definition: lumiFormat.py:85
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:716
L1CaloPprDisabledChannel::calibErrorCode
ChanCalibErrorCode calibErrorCode(void) const
Definition: L1CaloPprDisabledChannel.h:41
beamspotman.n
n
Definition: beamspotman.py:731
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:760
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
master.flag
bool flag
Definition: master.py:29
LVL1::L1TriggerTowerTool::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
Definition: L1TriggerTowerTool.h:150
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:107
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:169
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Make4DCorrelationMatrix.nominalEta
int nominalEta
Definition: Make4DCorrelationMatrix.py:80
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
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:489
LVL1::L1TriggerTowerTool::satOverride
virtual bool satOverride(int range, const L1CaloCoolChannelId &channelId)
Definition: L1TriggerTowerTool.cxx:1464
LVL1::L1TriggerTowerTool::satBcid
virtual void satBcid(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Saturated pulse BCID.
Definition: L1TriggerTowerTool.cxx:614
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
L1CaloPprConditions
Transient conditions class for objects defined by the online framework and retrieved from COOL.
Definition: L1CaloPprConditions.h:23
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
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:388
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge.output
output
Definition: merge.py:17
L1CaloPprDisabledChannel::noiseCut
unsigned int noiseCut() const
Definition: L1CaloPprDisabledChannel.h:53
LVL1::L1TriggerTowerTool::hwIdentifier
virtual HWIdentifier hwIdentifier(const Identifier &id)
Return online identifier for given offline identifier.
Definition: L1TriggerTowerTool.cxx:1387
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:196
L1CaloPprConditions::pedValue
unsigned int pedValue() const
Definition: L1CaloPprConditions.h:50
LVL1::L1TriggerTowerTool::peakBcid
virtual void peakBcid(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Peak finder BCID.
Definition: L1TriggerTowerTool.cxx:562
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
L1CaloPprConditionsRun2::lutJepPar3
short lutJepPar3() const
Definition: L1CaloPprConditionsRun2.h:91
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
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:1371
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
L1CaloPpmFineTimeRefs::refValue
double refValue(void) const
Definition: L1CaloPpmFineTimeRefs.h:38
LVL1::L1TriggerTowerTool::m_dbFineTimeRefsTowersKey
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainer > m_dbFineTimeRefsTowersKey
Definition: L1TriggerTowerTool.h:162
L1CaloPprDisabledChannel::deadErrorCode
ChanDeadErrorCode deadErrorCode(void) const
Definition: L1CaloPprDisabledChannel.h:44
columnar::ContainerId::eventInfo
@ eventInfo
LVL1::L1TriggerTowerTool::isRun2
bool isRun2() const
Definition: L1TriggerTowerTool.cxx:1682
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
PlotSFuncertainty.calib
calib
Definition: PlotSFuncertainty.py:110
python.PyAthena.v
v
Definition: PyAthena.py:154
L1CaloCoolChannelId
Definition: L1CaloCoolChannelId.h:10
DeMoScan.index
string index
Definition: DeMoScan.py:364
LVL1::L1TriggerTowerTool::m_mappingTool
ToolHandle< LVL1::IL1CaloMappingTool > m_mappingTool
and mappings
Definition: L1TriggerTowerTool.h:156
a
TList * a
Definition: liststreamerinfos.cxx:10
L1CaloPprConditionsContainer
Container of L1CaloPprConditions objects, inherit from the abstract base class AbstractL1CaloConditio...
Definition: L1CaloPprConditionsContainer.h:28
h
L1CaloPprConditionsRun2::pedValue
unsigned int pedValue() const
Definition: L1CaloPprConditionsRun2.h:94
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LVL1::L1TriggerTowerTool::m_correctFir
bool m_correctFir
Baseline correction Tool.
Definition: L1TriggerTowerTool.h:179
LVL1::L1TriggerTowerTool::m_debug
bool m_debug
Definition: L1TriggerTowerTool.h:144
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
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
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:244
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
LVL1::L1TriggerTowerTool::disabledChannel
virtual bool disabledChannel(const L1CaloCoolChannelId &channelId)
Check for disabled channel.
Definition: L1TriggerTowerTool.cxx:1487
LVL1::L1TriggerTowerTool::etRange
virtual void etRange(const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:1043
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
L1CaloPprConditionsRun2::lutCpStrategy
unsigned short lutCpStrategy() const
Definition: L1CaloPprConditionsRun2.h:76
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
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:689
L1CaloPprConditionsRun2
Transient conditions class for objects defined by the online framework and retrieved from COOL for th...
Definition: L1CaloPprConditionsRun2.h:21
LVL1::L1TriggerTowerTool::m_runParametersContainer
const L1CaloRunParametersContainer * m_runParametersContainer
Definition: L1TriggerTowerTool.h:164
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
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
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:861
LVL1::L1TriggerTowerTool::dropBits
virtual void dropBits(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Definition: L1TriggerTowerTool.cxx:1091
L1CaloPpmFineTimeRefs::errorCode
FineTimeErrorCode errorCode(void) const
Definition: L1CaloPpmFineTimeRefs.h:37
L1CaloPpmFineTimeRefs
Definition: L1CaloPpmFineTimeRefs.h:23
fitman.k
k
Definition: fitman.py:528
L1CaloPpmFineTimeRefs::calibValue
double calibValue(void) const
Definition: L1CaloPpmFineTimeRefs.h:40
LVL1::L1TriggerTowerTool::printVec
void printVec(const std::vector< T > &vec)
Print a vector to debug.
Definition: L1TriggerTowerTool.cxx:1600
Identifier
Definition: IdentifierFieldParser.cxx:14