ATLAS Offline Software
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::L1TriggerTowerToolRun3 Class Reference

#include <L1TriggerTowerToolRun3.h>

Inheritance diagram for LVL1::L1TriggerTowerToolRun3:
Collaboration diagram for LVL1::L1TriggerTowerToolRun3:

Public Member Functions

 L1TriggerTowerToolRun3 (const std::string &, const std::string &, const IInterface *)
 
virtual ~L1TriggerTowerToolRun3 ()
 default destructor More...
 
virtual StatusCode initialize () override
 standard Athena-Algorithm method More...
 
virtual StatusCode finalize () override
 standard Athena-Algorithm method More...
 
virtual void handle (const Incident &) override
 catch begRun 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) override
 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) override
 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) const override
 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) override
 
virtual void fir (const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 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) const override
 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) const override
 
virtual void dropBits (const std::vector< int > &fir, unsigned int first, std::vector< int > &output) const override
 Truncate FIR results for LUT input. More...
 
virtual void etRange (const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 
virtual void etRange (const std::vector< int > &et, int energyLow, int energyHigh, std::vector< int > &output) const override
 Identify BCID decision range. More...
 
virtual void peakBcid (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 Peak finder BCID. More...
 
virtual void peakBcid (const std::vector< int > &fir, unsigned int strategy, std::vector< int > &output) const override
 Peak finder BCID. More...
 
virtual void satBcid (const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 Saturated pulse BCID. More...
 
virtual void satBcid (const std::vector< int > &digits, int satLow, int satHigh, int satLevel, std::vector< int > &output) const override
 Saturated pulse BCID. More...
 
virtual void bcid (const std::vector< int > &fir, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 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) const override
 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) const override
 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) const override
 
virtual void bcidDecision (const std::vector< int > &bcidResults, const std::vector< int > &range, std::vector< int > &output) const override
 
virtual void bcidDecision (const std::vector< int > &bcidResults, const std::vector< int > &range, const std::vector< unsigned int > &mask, std::vector< int > &output) const
 Evaluate BCID decision based on BCID word, ET range and decision mask. More...
 
virtual void cpLut (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 
virtual void jepLut (const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 
virtual void lut (const std::vector< int > &fir, int slope, int offset, int cut, int strategy, bool disabled, std::vector< int > &output) const override
 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) const
 
virtual void applyEtRange (const std::vector< int > &lut, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
 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) const override
 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) const override
 Return BCID 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) override
 
virtual void jepLutParams (const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override
 
virtual Identifier identifier (double eta, double phi, int layer) override
 Return offline identifier for given tower coordinates. More...
 
virtual HWIdentifier hwIdentifier (const Identifier &id) override
 Return online identifier for given offline identifier. More...
 
virtual HWIdentifier hwIdentifier (double eta, double phi, int layer) override
 Return online identifier for given tower coordinates. More...
 
virtual L1CaloCoolChannelId channelID (double eta, double phi, int layer) override
 Return Cool channel identifier for given tower coordinates. More...
 
virtual L1CaloCoolChannelId channelID (const Identifier &id) override
 Return Cool channel identifier for given offline identifier. More...
 
virtual bool satOverride (int range) const override
 
virtual bool disabledChannel (const L1CaloCoolChannelId &channelId) const override
 Check for disabled channel. More...
 
virtual double FCalTTeta (const L1CaloCoolChannelId &channelId) override
 Return median eta of trigger tower from L1CaloCoolChannelId. More...
 
virtual double FCalTTeta (double nominalEta, double phi, int layer) override
 Calculate median eta of FCAL trigger tower from nominal eta and layer. More...
 
virtual std::pair< double, double > refValues (const L1CaloCoolChannelId &channelId) override
 
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
 
bool disabledChannel (const L1CaloCoolChannelId &channelId, unsigned int &noiseCut) const
 Get extra noise cut with disabled channel. More...
 
unsigned int getLutOffset (const double &pedMean, const unsigned int &firStartBit, const std::vector< short int > &firCoeff, const unsigned int &lutSlope, const unsigned int &lutStrategy) const
 
const TrigConf::L1MenugetL1Menu (const EventContext &ctx) const
 
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

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< L1CaloPprConditionsContainerRun2m_pprConditionsContainerRun2 { this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"}
 
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2m_pprDisabledChannelContainer { this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"}
 
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainerm_ppmFineTimeRefsContainer { this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"}
 
SG::ReadCondHandleKey< L1CaloRunParametersContainerm_runParametersContainer { this, "InputKeyRunParameters", "L1CaloRunParametersContainer"}
 
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" }
 
ServiceHandle< TrigConf::ITrigConfigSvcm_configSvc {this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc"}
 
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: L1TriggerTowerToolRun3->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 56 of file L1TriggerTowerToolRun3.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

◆ L1TriggerTowerToolRun3()

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

Definition at line 40 of file L1TriggerTowerToolRun3.cxx.

43  :
44  AthAlgTool(t,n,p),
45  m_caloMgr(0),
46  m_lvl1Helper(0),
47  m_l1CaloTTIdTools("LVL1::L1CaloTTIdTools/L1CaloTTIdTools", this),
48  m_ttSvc("CaloTriggerTowerService/CaloTriggerTowerService", this),
49  m_mappingTool("", this),
50  m_correctFir(false),
52 {
53  declareInterface<IL1TriggerTowerToolRun3>(this);
54 
55  declareProperty( "BaselineCorrection", m_correctFir );
56  declareProperty( "L1DynamicPedestalProvider", m_dynamicPedestalProvider );
57 }

◆ ~L1TriggerTowerToolRun3()

LVL1::L1TriggerTowerToolRun3::~L1TriggerTowerToolRun3 ( )
virtual

default destructor

Definition at line 61 of file L1TriggerTowerToolRun3.cxx.

61 {}

Member Function Documentation

◆ applyEtRange()

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

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::IL1TriggerTowerToolRun3.

Definition at line 914 of file L1TriggerTowerToolRun3.cxx.

915 {
917  std::vector<int>::const_iterator itlut = lut.begin();
918  std::vector<int>::const_iterator itrange = range.begin();
919  while ( itlut != lut.end() && itrange != range.end() ) {
920  if (!disabled && satOverride((*itrange))) output.push_back(s_saturationValue);
921  else output.push_back(*itlut);
922  ++itlut;
923  ++itrange;
924  }
925 
926  ATH_MSG_DEBUG( "::applyEtRange: output: " << output);
927 
928 }

◆ bcid() [1/3]

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

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 330 of file L1TriggerTowerToolRun3.cxx.

331 {
332  // Get decision flags for the 2 BCID algorithms
333  std::vector<int> peak;
334  peakBcid(filter, channelId, peak);
335  std::vector<int> sat;
336  satBcid(digits, channelId, sat);
337 
338  output.clear();
339  output.reserve(sat.size()); // avoid frequent reallocations
340 
341  std::vector<int>::iterator itpeak = peak.begin();
342  std::vector<int>::iterator itsat = sat.begin();
343  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
344  output.push_back( (*itpeak<<2) + (*itsat<<1) );
345  }
346 
347  ATH_MSG_DEBUG( "::bcid: bcidResults: " << output);
348 
349 }

◆ bcid() [2/3]

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

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 354 of file L1TriggerTowerToolRun3.cxx.

356 {
357  // Get decision flags for the 2 BCID algorithms
358  std::vector<int> peak;
359  peakBcid(filter, strategy, peak);
360  std::vector<int> sat;
361  satBcid(digits, satLow, satHigh, satLevel, sat);
362 
363  output.clear();
364  output.reserve(sat.size()); // avoid frequent reallocations
365 
366  std::vector<int>::iterator itpeak = peak.begin();
367  std::vector<int>::iterator itsat = sat.begin();
368  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
369  output.push_back( (*itpeak<<2) + (*itsat<<1) );
370  }
371 
372  ATH_MSG_DEBUG( "::bcid: bcidResults: " << output);
373 }

◆ bcid() [3/3]

void LVL1::L1TriggerTowerToolRun3::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 
) const
overridevirtual

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

evaluate BCID decisions

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 378 of file L1TriggerTowerToolRun3.cxx.

380 {
381  // Get decision flags for the 2 BCID algorithms
382  std::vector<int> peak;
383  peakBcid(filter, strategy, peak);
384  std::vector<int> sat;
385  satBcid(digits, satLow, satHigh, satLevel, sat);
386 
387  result.clear();
388  result.reserve(sat.size()); // avoid frequent reallocations
389  decision.clear();
390 
391  std::vector<int>::iterator itpeak = peak.begin();
392  std::vector<int>::iterator itsat = sat.begin();
393  for ( ; itpeak!=peak.end() && itsat!=sat.end(); ++itpeak, ++itsat ) {
394  result.push_back( (*itpeak<<2) + (*itsat<<1) );
395  }
396 
397  ATH_MSG_DEBUG( "::bcid: bcidResults: " << result);
398 
399 
400 
402  std::vector<int> decisionRange;
403  if (!(decisionSource&0x1)) etRange(digits, energyLow, energyHigh, decisionRange);
404  else etRange(lutInput, energyLow, energyHigh, decisionRange);
405  bcidDecision(result, decisionRange, decisionConditions, decision);
406  ATH_MSG_DEBUG( "::bcid: bcidDecisions: " << decision);
407 
408 }

◆ bcidDecision() [1/2]

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

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

Definition at line 662 of file L1TriggerTowerToolRun3.cxx.

663 {
664  output.clear();
665  output.reserve(bcidResults.size()); // avoid frequent reallocations
666 
667  std::vector<int>::const_iterator itBcid = bcidResults.begin();
668  std::vector<int>::const_iterator itRange = range.begin();
669  int nRange = mask.size();
670 
671  for ( ; itBcid != bcidResults.end() && itRange != range.end(); ++itBcid, ++itRange) {
672  if ((*itRange) < nRange && (mask[*itRange]&(0x1<<*itBcid))) output.push_back(1);
673  else output.push_back(0);
674  }
675 
676  ATH_MSG_DEBUG( "::bcidDecision: output: " << output);
677 
678 
679 }

◆ bcidDecision() [2/2]

void LVL1::L1TriggerTowerToolRun3::bcidDecision ( const std::vector< int > &  bcidResults,
const std::vector< int > &  range,
std::vector< int > &  output 
) const
overridevirtual

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 640 of file L1TriggerTowerToolRun3.cxx.

641 {
642  unsigned int decision1 = 0;
643  unsigned int decision2 = 0;
644  unsigned int decision3 = 0;
646 
648  std::tie(decision1, decision2, decision3) = getBcidDecision<L1CaloPprConditionsContainerRun2>(pprConditionsRun2);
649  } else ATH_MSG_WARNING( "::bcidDecision: No Conditions Container retrieved" );
650 
651  // Reverse the order! (see elog 97082 9/06/10)
652  std::vector<unsigned int> mask = { decision3, decision2, decision1 };
653 
654  ATH_MSG_DEBUG( "::bcidDecision: masks: " << MSG::hex
655  << decision3 << " " << decision2 << " " << decision1 << MSG::dec );
656 
657  bcidDecision(bcidResults, range, mask, output);
658 }

◆ bcidDecisionRange()

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 614 of file L1TriggerTowerToolRun3.cxx.

615 {
616  int decisionSource = 0;
618 
620  decisionSource = getDecisionSource<L1CaloPprConditionsContainerRun2>(pprConditionsRun2);
621 
622  } else ATH_MSG_WARNING( "::bcidDecisionRange: No Conditions Container retrieved" );
623 
624  if (!(decisionSource&0x1)) etRange(digits, channelId, output);
625  else etRange(lutInput, channelId, output);
626 
627  ATH_MSG_DEBUG( "::bcidDecisionRange: decisionSource: " << decisionSource);
628  ATH_MSG_DEBUG( " output: " << output);
629 
630 
631 }

◆ bcidParams()

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

Return BCID parameters for a channel.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1050 of file L1TriggerTowerToolRun3.cxx.

1052 {
1053  energyLow = 0;
1054  energyHigh = 0;
1055  decisionSource = 0;
1056  decisionConditions.clear();
1057  peakFinderStrategy = 0;
1058  satLevel = 0;
1059  satLow = 0;
1060  satHigh = 0;
1061 
1063 
1065  using std::get;
1066  std::tuple<unsigned int, unsigned int, unsigned int> bcidDecision;
1067  std::tuple<bool, int, int> bcidEnergyRange;
1068  std::tuple<bool, int, int, int> saturation;
1069 
1070  using Cont = L1CaloPprConditionsContainerRun2;
1071  bcidDecision = getBcidDecision<Cont>(pprConditionsRun2);
1072  peakFinderStrategy = getStrategy<Cont>(pprConditionsRun2);
1073  decisionSource = getDecisionSource<Cont>(pprConditionsRun2);
1074  bcidEnergyRange = getBcidEnergyRange<Cont>(channelId.id(), pprConditionsRun2);
1075  saturation = getSaturation<Cont>(channelId.id(), pprConditionsRun2);
1076 
1077 
1078  decisionConditions = { get<2>(bcidDecision),
1079  get<1>(bcidDecision),
1080  get<0>(bcidDecision) }; // reverse order
1081  if(get<0>(bcidEnergyRange)) {
1082  std::tie(std::ignore, energyLow, energyHigh) = bcidEnergyRange;
1083  } else ATH_MSG_WARNING( "::bcidParams: No BcidEnergyRange found" );
1084 
1085  if(get<0>(saturation)) {
1086  std::tie(std::ignore, satLevel, satLow, satHigh) = saturation;
1087  } else ATH_MSG_WARNING( "::bcidParams: No Saturation found" );
1088  } else ATH_MSG_WARNING( "::bcid:Params No Conditions Container retrieved" );
1089 
1090  ATH_MSG_DEBUG( "::bcidParams: satLevel: " << satLevel
1091  << " satLow: " << satLow << " satHigh: " << satHigh << endmsg
1092  << " energyLow: " << energyLow << " energyHigh: " << energyHigh << endmsg
1093  << " decisionSource: " << decisionSource << " peakFinderStrategy: "
1094  << peakFinderStrategy );
1095 
1096 }

◆ channelID() [1/2]

L1CaloCoolChannelId LVL1::L1TriggerTowerToolRun3::channelID ( const Identifier id)
overridevirtual

Return Cool channel identifier for given offline identifier.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1273 of file L1TriggerTowerToolRun3.cxx.

1274 {
1275  L1CaloCoolChannelId coolId(0);
1276  if (m_ttSvc) {
1277  try {
1278  HWIdentifier hwId = hwIdentifier(id);
1279  coolId = m_ttSvc->createL1CoolChannelId(hwId);
1280  }
1281  catch (const CaloID_Exception&) { coolId = L1CaloCoolChannelId(0); }
1282  }
1283  return coolId;
1284 }

◆ channelID() [2/2]

L1CaloCoolChannelId LVL1::L1TriggerTowerToolRun3::channelID ( double  eta,
double  phi,
int  layer 
)
overridevirtual

Return Cool channel identifier for given tower coordinates.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1238 of file L1TriggerTowerToolRun3.cxx.

1239 {
1240  // Use direct lookup table if possible
1241  const double absEta = std::abs(eta);
1242  int index = 0;
1243  if (absEta < 2.5) {
1244  const int etaBin = 10.*absEta;
1245  const int phiBin = phi*(32/M_PI);
1246  index = (etaBin<<6) + phiBin;
1247  } else if (absEta < 3.2) {
1248  const int etaBin = 5.*(absEta - 2.5);
1249  const int phiBin = phi*(16./M_PI);
1250  index = 1600 + (etaBin<<5) + phiBin;
1251  } else {
1252  const int etaBin = (absEta - 3.2)*(1./0.425);
1253  const int phiBin = phi*(8./M_PI);
1254  index = 1728 + (etaBin<<4) + phiBin;
1255  }
1256  if (eta < 0.) index += 1792;
1257  if (layer > 0) index += 3584;
1258  if (index >= s_maxTowers) return L1CaloCoolChannelId(0);
1259  if (m_idTable.empty()) {
1260  m_idTable.reserve(s_maxTowers);
1261  m_idTable.assign(s_maxTowers, 0);
1262  }
1263  if (m_idTable[index] == 0) {
1264  Identifier id = identifier(eta, phi, layer);
1265  L1CaloCoolChannelId coolID = channelID(id);
1266  m_idTable[index] = coolID.id();
1267  }
1269 }

◆ cpLut()

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 682 of file L1TriggerTowerToolRun3.cxx.

683 {
684  int startBit = 0;
685  int strategy = 0;
686  int offset = 0;
687  int slope = 0;
688  int cut = 0;
689  unsigned short scale_menu = 0;
690  double pedMean = 0;
691  int ped = 0;
692  int hwCoeffSum = 0;
693  const std::vector<short int>* hwCoeffs;
694 
695 
697  const EventContext& ctx = Gaudi::Hive::currentContext();
698 
700  auto settings = pprConditionsRun2->pprConditions(channelId.id());
701  if (settings) {
702  startBit = settings->firStartBit();
703  strategy = settings->lutCpStrategy();
704  slope = settings->lutCpSlope();
705  cut = settings->lutCpNoiseCut();
706  ped = settings->pedValue();
707  pedMean = settings->pedMean();
708 
709  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
710 
711  auto l1Menu = getL1Menu(ctx);
712  scale_menu = l1Menu->thrExtraInfo().EM().emScale(); // Retrieve scale param from menu
713 
714  for( auto &coeffs : *hwCoeffs) {
715  hwCoeffSum += coeffs;
716  }
717 
718  offset = this->getLutOffset(pedMean, startBit, *hwCoeffs, slope, strategy);
719 
720  ATH_MSG_DEBUG( "::cpLut: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
721  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
722 
723  } else ATH_MSG_WARNING( "::cpLut: No L1CaloPprConditions found" );
724  } else ATH_MSG_WARNING( "::cpLut: No Conditions Container retrieved" );
725 
726  ATH_MSG_DEBUG( "::cpLut: LUT strategy/offset/slope/cut/ped: "
727  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
728 
729  unsigned int noiseCut = 0;
730  bool disabled = disabledChannel(channelId, noiseCut);
731  if (noiseCut > 0) cut = noiseCut;
732  if(strategy == 2) {
733  // take the global scale into account - translate strategy to 1 for Run-1 compatible treatment
734  lut(fir, scale_menu*slope, scale_menu*offset, scale_menu*cut, 1, disabled, output);
735  } else if(strategy == 1 || strategy == 0){
736  lut(fir, slope, offset, cut, strategy, disabled, output);
737  } else if (strategy == 4) {
738  // Run-3 FCAL LUT filling scheme (strategy 4) which is identical to
739  // Run-2 strategy 2, but contains an additional fixed factor of 2.
740  lut(fir, scale_menu*slope, scale_menu*offset, scale_menu*cut, 4, disabled, output);
741 
742  }
743 
744  else {
745  ATH_MSG_WARNING(" ::cpLut: Unknown stragegy: " << strategy);
746  output.push_back(0); //avoid crashing with Unknown stragegy
747  }
748 }

◆ cpLutParams()

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1098 of file L1TriggerTowerToolRun3.cxx.

1099 {
1100  startBit = 0;
1101  strategy = 0;
1102  offset = 0;
1103  slope = 0;
1104  cut = 0;
1105  pedValue = 0;
1106  pedMean = 0.;
1107  disabled = true;
1108  int hwCoeffSum = 0;
1109  const std::vector<short int>* hwCoeffs;
1110 
1111 
1112  if(!isRun2()) {
1113  // assert instead ?!
1114  ATH_MSG_WARNING("::cpLutParams: Run-1 data - behaviour undefined!");
1115  }
1116 
1118 
1120  const auto settings = pprConditionsRun2->pprConditions(channelId.id());
1121  if(settings) {
1122  startBit = settings->firStartBit();
1123  strategy = settings->lutCpStrategy();
1124  slope = settings->lutCpSlope();
1125  cut = settings->lutCpNoiseCut();
1126  pedValue = settings->pedValue();
1127  pedMean = settings->pedMean();
1128 
1129  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
1130 
1131  for( auto &coeffs : *hwCoeffs) {
1132  hwCoeffSum += coeffs;
1133  }
1134 
1135  offset = this->getLutOffset(pedMean, startBit, *hwCoeffs, slope, strategy);
1136 
1137  ATH_MSG_VERBOSE( "::jepLutParams: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1138  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1139 
1140  } else ATH_MSG_WARNING( "::cpLutParams: No L1CaloPprConditions found" );
1141  } else ATH_MSG_WARNING( "::cpLutParams: No Conditions Container retrieved" );
1142 
1143  ATH_MSG_VERBOSE( "::cpLutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1144  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1145  unsigned int noiseCut = 0;
1146  disabled = disabledChannel(channelId, noiseCut);
1147  if (noiseCut > 0) cut = noiseCut;
1148 }

◆ 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::L1TriggerTowerToolRun3::disabledChannel ( const L1CaloCoolChannelId channelId) const
overridevirtual

Check for disabled channel.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1317 of file L1TriggerTowerToolRun3.cxx.

1318 {
1319  unsigned int noiseCut = 0;
1320  return disabledChannel(channelId, noiseCut);
1321 }

◆ disabledChannel() [2/2]

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

Get extra noise cut with disabled channel.

Check for disabled channel with noise cut.

Definition at line 1324 of file L1TriggerTowerToolRun3.cxx.

1325 {
1326 
1328  bool isDisabled = false;
1329  noiseCut = 0;
1331 
1332  const auto disabledChan = pprDisabledChannel->pprDisabledChannel(channelId.id());
1333 
1334  if (disabledChan) {
1335  if (!disabledChan->disabledBits()) {
1336  ChanCalibErrorCode calibError(disabledChan->calibErrorCode());
1337  if (calibError.chanValid()) {
1338  ChanDeadErrorCode deadError(disabledChan->deadErrorCode());
1339  if (deadError.chanValid()) noiseCut = disabledChan->noiseCut();
1340  //else isDisabled = true;
1341  } //else isDisabled = true;
1342  } else isDisabled = true;
1343 
1344  ATH_MSG_DEBUG( MSG::hex
1345  << "::disabledChannel: calibErrorCode: " << (disabledChan->calibErrorCode()).errorCode()
1346  << " deadErrorCode: " << (disabledChan->deadErrorCode()).errorCode()
1347  << " noiseCut: " << disabledChan->noiseCut()
1348  << " disabledBits: " << disabledChan->disabledBits()
1349  << MSG::dec );
1350 
1351  } else {
1352  ATH_MSG_DEBUG( "::disabledChannel: No L1CaloPprDisabledChannel found" );
1353  }
1354  } else {
1355  ATH_MSG_WARNING( "::disabledChannel: No DisabledChannel Container retrieved" );
1356  }
1357  if (isDisabled) ATH_MSG_DEBUG( "::disabledChannel: Channel is disabled" );
1358 
1359  return isDisabled;
1360 }

◆ dropBits() [1/2]

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 987 of file L1TriggerTowerToolRun3.cxx.

988 {
989  unsigned int start = 0;
991 
993  bool available = false;
994  std::tie(available, start) = getFirStartBit<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
995  if(!available)ATH_MSG_WARNING( "::dropBits: No L1CaloPprConditions found" );
996  } else ATH_MSG_WARNING( "::dropBits: No Conditions Container retrieved" );
997 
998  ATH_MSG_DEBUG( "::dropBits: firStartBit: " << start );
999 
1000  dropBits(fir, start, output);
1001 }

◆ dropBits() [2/2]

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

Truncate FIR results for LUT input.

mask to select appropriate 10 bit range

overflow detection

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1005 of file L1TriggerTowerToolRun3.cxx.

1006 {
1007  output.clear();
1008  output.reserve(fir.size()); // avoid frequent reallocations
1009 
1011  unsigned int mask = (0x3ff<<start);
1012 
1014  int max = 1<<(10+start);
1015 
1016  for( auto it : fir) {
1017  if (it>=max) output.push_back(0x3ff);
1018  else output.push_back((it&mask)>>start);
1019  }
1020 
1021  ATH_MSG_DEBUG( "::dropBits: output: " << output);
1022 }

◆ etRange() [1/2]

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 942 of file L1TriggerTowerToolRun3.cxx.

943 {
944  int energyLow = 0;
945  int energyHigh = 0;
947 
949  bool available = false;
950  std::tie(available, energyLow, energyHigh) = getBcidEnergyRange<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
951  if(!available) ATH_MSG_WARNING("::etRange: No L1CaloPprConditions found");
952  } else ATH_MSG_WARNING("::etRange: No Conditions Container retrieved");
953 
954  ATH_MSG_VERBOSE( "::etRange: energyLow: " << energyLow
955  << " energyHigh: " << energyHigh);
956 
957  etRange(et, energyLow, energyHigh, output);
958 }

◆ etRange() [2/2]

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

Identify BCID decision range.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 962 of file L1TriggerTowerToolRun3.cxx.

963 {
964  output.clear();
965  output.reserve(et.size()); // avoid frequent reallocations
966  for( auto it : et) {
967  if (it <= energyLow) output.push_back(0);
968  else if (it <= energyHigh) output.push_back(1);
969  else output.push_back(2);
970  }
971 
972  ATH_MSG_DEBUG( "::etRange: output: " << output);
973 
974 
975 }

◆ 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::L1TriggerTowerToolRun3::FCalTTeta ( const L1CaloCoolChannelId channelId)
overridevirtual

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::IL1TriggerTowerToolRun3.

Definition at line 1397 of file L1TriggerTowerToolRun3.cxx.

1398 {
1399  if ( !m_mappingTool.isValid() ) {
1400  throw GaudiException("No mapping tool configured",
1401  "L1TriggerTowerToolRun3::FCalTTeta", StatusCode::FAILURE);
1402  }
1403 
1405  unsigned int crate = channelId.crate();
1406  unsigned int module = channelId.module();
1407  unsigned int mcm = channelId.subModule();
1408  unsigned int pin = channelId.channel();
1409  int channel = pin*16 + mcm;
1410 
1412  double eta;
1413  double phi;
1414  int layer;
1415  if(!m_mappingTool->mapping(crate, module, channel, eta, phi, layer)) {
1416  ATH_MSG_WARNING("::FCalTTeta: could not map 0x" << std::hex << channelId.id() << std::dec);
1417  }
1418 
1420  return FCalTTeta(eta, phi, layer);
1421 }

◆ FCalTTeta() [2/2]

double LVL1::L1TriggerTowerToolRun3::FCalTTeta ( double  nominalEta,
double  phi,
int  layer 
)
overridevirtual

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

Hopefully this will be a short-term work-around

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1366 of file L1TriggerTowerToolRun3.cxx.

1367 {
1368  double eta = nominalEta;
1369  float abseta = std::abs(eta);
1370  if (abseta<3.2) return eta; // If called for non-FCAL TT return input value
1371  if (layer == 0) {
1372  int sign = ((eta > 0) ? 1 : -1);
1373  if (abseta < 3.6) eta = 3.15 * sign;
1374  else if (abseta < 4.0) eta = 3.33 * sign;
1375  else if (abseta < 4.5) eta = 3.72 * sign;
1376  else eta = 4.41 * sign;
1377  }
1378  else if (eta > 0) {
1379  if (abseta < 3.6) eta = 3.36;
1380  else if (abseta < 4.0) eta = 3.45;
1381  else if (abseta < 4.5) eta = 4.17;
1382  else eta = 4.19;
1383  }
1384  else {
1385  if (abseta < 3.6) eta = -3.45;
1386  else if (abseta < 4.0) eta = -3.36;
1387  else if (abseta < 4.5) eta = -4.19;
1388  else eta = -4.17;
1389  }
1390  return eta;
1391 }

◆ finalize()

StatusCode LVL1::L1TriggerTowerToolRun3::finalize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 118 of file L1TriggerTowerToolRun3.cxx.

119 {
120  return StatusCode::SUCCESS;
121 }

◆ fir() [1/2]

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

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::IL1TriggerTowerToolRun3.

Definition at line 422 of file L1TriggerTowerToolRun3.cxx.

423 {
424 
426 
428  std::vector<int> firCoeffs;
430  const std::vector<short int>* hwCoeffs;
431  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
432  if(hwCoeffs) {
436  firCoeffs.reserve(hwCoeffs->size()); // avoid frequent reallocations
437  for (auto &i : reverse(*hwCoeffs)) {
438  firCoeffs.push_back(i);
439  }
440  } else ATH_MSG_WARNING( "::fir: No L1CaloPprConditions found" );
441  } else ATH_MSG_WARNING( "::fir: No Conditions Container retrieved" );
442 
443  ATH_MSG_DEBUG( "::fir: FIR coefficients: " << firCoeffs);
444 
445 
446  fir(digits, firCoeffs, output);
447 }

◆ fir() [2/2]

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

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::IL1TriggerTowerToolRun3.

Definition at line 453 of file L1TriggerTowerToolRun3.cxx.

454 {
455  output.clear();
456  output.reserve(digits.size()); // avoid frequent reallocations
459  int firstFIR = -1;
460  int lastFIR = 0;
461  for (unsigned int i = 0; i < firCoeffs.size(); ++i) {
462  if (firstFIR < 0 && firCoeffs[i] != 0) firstFIR = i;
463  if (firCoeffs[i] != 0) lastFIR = i;
464  }
465  if (firstFIR < 0) firstFIR = lastFIR + 1;
466 
467  for (int i = 0; i < (int)digits.size(); i++) {
468  int sum = 0;
470  if (i >= 2-firstFIR && i < (int)digits.size()+2-lastFIR) {
471  for (int j = firstFIR; j <= lastFIR; ++j) {
472  sum += digits[i+j-2]*firCoeffs[j];
473  }
474  }
475  if (sum < 0) sum = 0;
476  output.push_back(sum);
477  }
478 
479  ATH_MSG_DEBUG( "::fir: output: " << output);
480 
481 }

◆ firParams()

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

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::IL1TriggerTowerToolRun3.

Definition at line 1025 of file L1TriggerTowerToolRun3.cxx.

1026 {
1028  firCoeffs.clear();
1031  const std::vector<short int>* hwCoeffs = nullptr;
1032  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2 );
1033 
1034  if(hwCoeffs) {
1038  firCoeffs.reserve(hwCoeffs->size()); // avoid frequent reallocations
1039  for (int i = hwCoeffs->size()-1; i >= 0; --i) firCoeffs.push_back((*hwCoeffs)[i]);
1040 
1041  } else ATH_MSG_WARNING( "::firParams: No L1CaloPprConditions found" );
1042  } else ATH_MSG_WARNING( "::firParams: No Conditions Container retrieved" );
1043 
1044 
1045  ATH_MSG_DEBUG( "::fir: FIR coefficients: " << firCoeffs);
1046 
1047 }

◆ getL1Menu()

const TrigConf::L1Menu * LVL1::L1TriggerTowerToolRun3::getL1Menu ( const EventContext &  ctx) const
private

Definition at line 1510 of file L1TriggerTowerToolRun3.cxx.

1510  {
1511  const TrigConf::L1Menu* menu = nullptr;
1512 
1513  StatusCode sc = m_configSvc.retrieve();
1514  if (sc.isFailure()) {
1515  ATH_MSG_WARNING( "Cannot retrieve trigger configuration service" );
1516  }
1517 
1518  if (detStore()->contains<TrigConf::L1Menu>(m_L1MenuKey.key())) {
1520  if( l1MenuHandle.isValid() ){
1521  menu=l1MenuHandle.cptr();
1522  }
1523  } else {
1524  menu = &(m_configSvc->l1Menu(ctx));
1525  }
1526 
1527  return menu;
1528 }

◆ getLutOffset()

unsigned int LVL1::L1TriggerTowerToolRun3::getLutOffset ( const double &  pedMean,
const unsigned int &  firStartBit,
const std::vector< short int > &  firCoeff,
const unsigned int &  lutSlope,
const unsigned int &  lutStrategy 
) const
private

Definition at line 1484 of file L1TriggerTowerToolRun3.cxx.

1485 {
1486  unsigned int lutOffset = 0;
1487  // essential to save in long long to avoid rounding errors
1488  long long int lutOffsetLong = 0;
1489  long long int lutSlopeLong = lutSlope;
1490  long long int firStartBitLong = firStartBit;
1491  long long int pedMeanLong = std::lround(pedMean * 10000.);
1492  long long int firCoeffSum = 0;
1493 
1494  for (unsigned int i=0; i<firCoeff.size(); i++) {
1495  firCoeffSum += firCoeff.at(i);
1496  }
1497 
1498  if ( lutStrategy == 0 ) {
1499  lutOffsetLong = ((pedMeanLong*firCoeffSum) >> firStartBitLong);
1500  }
1501  else {
1502  lutOffsetLong = ((pedMeanLong*firCoeffSum*lutSlopeLong) >> firStartBitLong) - ((lutSlopeLong * 10000) >> 1);
1503  }
1504 
1505  lutOffsetLong = (lutOffsetLong + (10000-1))/10000;
1506  lutOffset = static_cast<unsigned int>( lutOffsetLong < 0 ? 0 : lutOffsetLong );
1507  return lutOffset;
1508 }

◆ handle()

void LVL1::L1TriggerTowerToolRun3::handle ( const Incident &  inc)
overridevirtual

catch begRun

Definition at line 125 of file L1TriggerTowerToolRun3.cxx.

126 {
127  if (inc.type()=="BeginRun") {
128  ATH_MSG_DEBUG( "Resetting mapping table at start of run" );
129 
130  m_idTable.clear();
131  }
132 }

◆ hwIdentifier() [1/2]

HWIdentifier LVL1::L1TriggerTowerToolRun3::hwIdentifier ( const Identifier id)
overridevirtual

Return online identifier for given offline identifier.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1218 of file L1TriggerTowerToolRun3.cxx.

1219 {
1220  HWIdentifier hwId(0);
1221  if (m_ttSvc) {
1222  try { hwId = m_ttSvc->createTTChannelID(id, false); }
1223  catch (const CaloID_Exception&) { hwId = HWIdentifier(0); }
1224  }
1225  return hwId;
1226 }

◆ hwIdentifier() [2/2]

HWIdentifier LVL1::L1TriggerTowerToolRun3::hwIdentifier ( double  eta,
double  phi,
int  layer 
)
overridevirtual

Return online identifier for given tower coordinates.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1230 of file L1TriggerTowerToolRun3.cxx.

1231 {
1232  Identifier id = identifier(eta, phi, layer);
1233  return hwIdentifier(id);
1234 }

◆ identifier()

Identifier LVL1::L1TriggerTowerToolRun3::identifier ( double  eta,
double  phi,
int  layer 
)
overridevirtual

Return offline identifier for given tower coordinates.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1202 of file L1TriggerTowerToolRun3.cxx.

1203 {
1204  Identifier id(0);
1206  int pos_neg_z = m_l1CaloTTIdTools->pos_neg_z(eta);
1207  int region = m_l1CaloTTIdTools->regionIndex(eta);
1208  int ieta = m_l1CaloTTIdTools->etaIndex(eta);
1209  int iphi = m_l1CaloTTIdTools->phiIndex(eta, phi);
1210 
1211  id = m_lvl1Helper->tower_id(pos_neg_z, layer, region, ieta, iphi);
1212  }
1213  return id;
1214 }

◆ initialize()

StatusCode LVL1::L1TriggerTowerToolRun3::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 65 of file L1TriggerTowerToolRun3.cxx.

66 {
67 
68  // Reading the Condition Containers Run 3 style
73 
74  ATH_CHECK(m_l1CaloTTIdTools.retrieve());
75 
76  if(!m_ttSvc.retrieve().isSuccess()) {
77  ATH_MSG_WARNING( "Could not retrieve CaloTriggerTowerService Tool" );
78  } else {
79  ATH_MSG_INFO("Retrieved Tool " << m_ttSvc);
80  }
81 
82  StatusCode scID = detStore()->retrieve(m_caloMgr);
83  if (scID.isFailure()) {
84  ATH_MSG_WARNING( "Cannot retrieve m_caloMgr" );
85  } else {
87  }
88 
89  if (!m_mappingTool.empty()) {
90  ATH_CHECK( m_mappingTool.retrieve() );
91  }
92 
93  // Incident Service:
94  SmartIF<IIncidentSvc> incSvc{service("IncidentSvc")};
95  ATH_CHECK( incSvc.isValid() );
96  incSvc->addListener(this, "BeginRun");
97 
98  // Pedestal Correction
99  if (m_correctFir) {
101  ATH_MSG_INFO( "Retrieved L1DynamicPedestalProvider: " << m_dynamicPedestalProvider );
102  }
103 
105 
107 
108 
109 
110 
111  ATH_MSG_INFO( "Initialization completed" );
112 
113  return StatusCode::SUCCESS;
114 }

◆ 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::IL1TriggerTowerToolRun3::interfaceID ( )
inlinestaticinherited

Definition at line 89 of file IL1TriggerTowerToolRun3.h.

90 {
91  return IID_IL1TriggerTowerToolRun3;
92 }

◆ isRun2()

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

Definition at line 1474 of file L1TriggerTowerToolRun3.cxx.

1475 {
1476  const EventContext& ctx = Gaudi::Hive::currentContext();
1477  if (ctx.eventID().run_number() >= 253377) return true;
1478 
1480  if (eventInfo->eventType (xAOD::EventInfo::IS_SIMULATION)) return true;
1481  return false;
1482 }

◆ jepLut()

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 750 of file L1TriggerTowerToolRun3.cxx.

751 {
752  int startBit = 0;
753  int strategy = 0;
754  int offset = 0;
755  int slope = 0;
756  int cut = 0;
757  unsigned short scale_db = 0;
758  unsigned short scale_menu = 0;
759  int ped = 0;
760  double pedMean = 0;
761  int hwCoeffSum = 0;
762  const std::vector<short int>* hwCoeffs;
763  short par1 = 0;
764  short par2 = 0;
765  short par3 = 0;
766  short par4 = 0;
767 
768  if(!isRun2()) {
769  // assert instead ?!
770  ATH_MSG_WARNING("::jepLut: Run-1 data - behaviour undefined!");
771  }
772 
773 
775  const EventContext& ctx = Gaudi::Hive::currentContext();
776 
778  const auto settings = pprConditionsRun2->pprConditions(channelId.id());
779  if (settings) {
780  startBit = settings->firStartBit();
781  strategy = settings->lutJepStrategy();
782  slope = settings->lutJepSlope();
783  cut = settings->lutJepNoiseCut();
784  ped = settings->pedValue();
785  pedMean = settings->pedMean();
786  scale_db = settings->lutJepScale();
787 
788  auto l1Menu = getL1Menu(ctx);
789  scale_menu = l1Menu->thrExtraInfo().JET().jetScale(); // Retrieve scale param from menu
790 
791  if (strategy == 3) {
792  par1 = settings->lutJepPar1();
793  par2 = settings->lutJepPar2();
794  par3 = settings->lutJepPar3();
795  par4 = settings->lutJepPar4();
796  }
797 
798  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
799 
800  for( auto &coeffs : *hwCoeffs) {
801  hwCoeffSum += coeffs;
802  }
803 
804  offset = this->getLutOffset(pedMean, startBit, *hwCoeffs, slope, strategy);
805 
806  ATH_MSG_VERBOSE( "::jepLut: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
807  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
808 
809  } else ATH_MSG_WARNING( "::jepLut: No L1CaloPprConditions found" );
810  } else ATH_MSG_WARNING( "::jepLut: No Conditions Container retrieved" );
811 
812  ATH_MSG_VERBOSE( "::jepLut: LUT strategy/offset/slope/cut/ped: "
813  << strategy << " " << offset << " " << slope << " " << cut << " " << ped << " " );
814 
815  unsigned int noiseCut = 0;
816  bool disabled = disabledChannel(channelId, noiseCut);
817  if (noiseCut > 0) cut = noiseCut;
818 
819  if(strategy == 3) {
820  nonLinearLut(fir, slope, offset, cut, scale_db, par1, par2, par3, par4, disabled, output);
821  }
822  else if(strategy == 2) {
823  // take the global scale into account - translate strategy to 1 for Run-1 compatible treatment
824  lut(fir, scale_menu*slope, scale_menu*offset, scale_menu*cut, 1, disabled, output);
825 
826  }else if(strategy == 1 || strategy == 0) {
827  lut(fir, slope, offset, cut, strategy, disabled, output);
828  }
829  else if (strategy == 4) {
830  // Run-3 FCAL LUT filling scheme (strategy 4) which is identical to
831  // Run-2 strategy 2, but contains an additional fixed factor of 2.
832  lut(fir, scale_menu*slope, scale_menu*offset, scale_menu*cut, 4, disabled, output);
833 
834  }
835 
836  else {
837  ATH_MSG_WARNING(" ::jepLut: Unknown stragegy: " << strategy);
838  output.push_back(0);//avoid crashing with Unknown stragegy
839  }
840 
841 
842 }

◆ jepLutParams()

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1150 of file L1TriggerTowerToolRun3.cxx.

1151 {
1152  startBit = 0;
1153  strategy = 0;
1154  offset = 0;
1155  slope = 0;
1156  cut = 0;
1157  pedValue = 0;
1158  pedMean = 0.;
1159  disabled = true;
1160  int hwCoeffSum = 0;
1161  const std::vector<short int>* hwCoeffs;
1162 
1163  if(!isRun2()) {
1164  // assert instead ?!
1165  ATH_MSG_WARNING("::jepLutParams: Run-1 data - behaviour undefined!");
1166  }
1167 
1170  const auto settings = pprConditionsRun2->pprConditions(channelId.id());
1171  if(settings) {
1172  startBit = settings->firStartBit();
1173  strategy = settings->lutJepStrategy();
1174  slope = settings->lutJepSlope();
1175  cut = settings->lutJepNoiseCut();
1176  pedValue = settings->pedValue();
1177  pedMean = settings->pedMean();
1178 
1179  hwCoeffs = getFirCoefficients<L1CaloPprConditionsContainerRun2>(channelId.id(),pprConditionsRun2);
1180 
1181  for( auto &coeffs : *hwCoeffs) {
1182  hwCoeffSum += coeffs;
1183  }
1184 
1185  offset = this->getLutOffset(pedMean, startBit, *hwCoeffs, slope, strategy);
1186 
1187  ATH_MSG_VERBOSE( "::jepLutParams: Offset: offset/strategy/pedMean/firCoeffSum/startBit/slope: "
1188  << offset << " " << strategy << " " << " " << pedMean << " " << hwCoeffSum << " " << startBit << " " << slope );
1189 
1190  } else ATH_MSG_WARNING( "::jepLutParams: No L1CaloPprConditions found" );
1191  } else ATH_MSG_WARNING( "::jepLutParams: No Conditions Container retrieved" );
1192 
1193  ATH_MSG_VERBOSE( "::jepLutParams: LUT startBit/strategy/offset/slope/cut/pedValue/pedMean: "
1194  << startBit << " " << strategy << " " << offset << " " << slope << " " << cut << " " << pedValue << " " << pedMean );
1195  unsigned int noiseCut = 0;
1196  disabled = disabledChannel(channelId, noiseCut);
1197  if (noiseCut > 0) cut = noiseCut;
1198 }

◆ lut()

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

LUT simulation: pedestal subtraction, energy calibration and threshold.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 845 of file L1TriggerTowerToolRun3.cxx.

846 {
847  output.clear();
848  output.reserve(fir.size()); // avoid frequent reallocations
849 
850  const int reScale = 2;
851  for( auto it : fir) {
852  int out = 0;
853  if (!disabled) {
854  if (strategy == 0 && it >= offset+cut) { // Original scheme
855  out = ((it-offset)*slope + 2048)>>12;
856  }
857  else if (strategy == 1 && it*slope >= offset+cut) { // New scheme
858  out = (it*slope - offset + 2048)>>12;
859  }
860  // Note: for strategy 2, the code is called with strategy=1
861  else if (strategy == 4 && it*slope >= offset+ cut/reScale) { // FCAL
862  out = (it*slope*reScale - offset*reScale + 2048)>>12;
863  }
864  if (out < 0) out = 0;
866  }
867  output.push_back(out);
868  }
869 
870  ATH_MSG_DEBUG( "::lut: output: " << output);
871 
872 }

◆ 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::L1TriggerTowerToolRun3::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 
) const
virtual

Definition at line 874 of file L1TriggerTowerToolRun3.cxx.

875 {
876  output.clear();
877  output.reserve(fir.size()); // avoid frequent reallocations
878 
879 
880  for( auto it : fir) {
881  int out = 0;
882  if (!disabled) {
883  // turn shorts into double
884  double nll_slope = 0.001 * scale;
885  double nll_offset = 0.001 * par1;
886  double nll_ampl = 0.001 * par2;
887  double nll_expo = 0.;
888  if(par3) {
889  nll_expo = -1. / (4096 * 0.001*par3);
890  } else {
891  nll_ampl = 0.;
892  }
893  double nll_noise = 0.001 * par4;
894 
895  // noise cut
896  if (it * slope < offset + nll_noise * cut) {
897  output.push_back(0);
898  continue;
899  }
900  // actual calculation
901  out = int((((int)(2048 + nll_slope * (it * slope - offset)))>>12) + nll_offset + nll_ampl * std::exp(nll_expo * (it * slope - offset)));
902 
904  if(out < 0) out = 0;
905  }
906  output.push_back(out);
907  }
908  ATH_MSG_DEBUG( "::nonLinearLut: output: " << output);
909 
910 }

◆ 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::L1TriggerTowerToolRun3::peakBcid ( const std::vector< int > &  fir,
const L1CaloCoolChannelId channelId,
std::vector< int > &  output 
) const
overridevirtual

Peak finder BCID.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 491 of file L1TriggerTowerToolRun3.cxx.

492 {
493  unsigned int strategy = 0;
495 
496 
498  strategy = getStrategy<L1CaloPprConditionsContainerRun2>( pprConditionsRun2);
499  } else ATH_MSG_WARNING( "::peakBcid: No Conditions Container retrieved" );
500 
501  ATH_MSG_DEBUG( "::peakBcid: peak-finder strategy: " << strategy );
502 
504 }

◆ peakBcid() [2/2]

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

Peak finder BCID.

Cannot evaluate for first and last samples in vector

Select peak-finder strategy & test

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 507 of file L1TriggerTowerToolRun3.cxx.

508 {
509  output.clear();
510  output.reserve(fir.size()); // avoid frequent reallocations
511 
512  for (unsigned int i = 0; i < fir.size(); i++) {
513  int result = 0;
515  if (i > 0 && i < fir.size()-1) {
517  if (strategy&0x1) {
518  if ( (fir[i-1]<fir[i]) && (fir[i+1]<fir[i]) ) result = 1;
519  } else {
520  if ( (fir[i-1]<fir[i]) && (fir[i+1]<=fir[i]) ) result = 1;
521  }
522  }
523  output.push_back(result);
524  }
525 
526  ATH_MSG_DEBUG( "::peakBcid: output: " << output);
527 
528 
529 }

◆ pedestalCorrection()

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

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1456 of file L1TriggerTowerToolRun3.cxx.

1456  {
1457  unsigned nFIR = firInOut.size();
1458  correctionOut.assign(nFIR, 0u);
1459 
1460  if(!m_correctFir) return;
1461 
1462  // apply the pedestal correction
1463  for(unsigned i = 0; i != nFIR; ++i) {
1464  correctionOut[i] = (m_dynamicPedestalProvider->dynamicPedestal(iElement, layer, firPed, bcid + i - nFIR/2, mu) - firPed);
1465  firInOut[i] -= correctionOut[i];
1466 
1467  if(firInOut[i] < 0) firInOut[i] = 0;
1468  }
1469 
1470  ATH_MSG_DEBUG( "::pedestalCorrection(BCID=" << bcid << ", mu = " << mu << "): " << correctionOut);
1471 
1472 }

◆ process() [1/2]

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

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::IL1TriggerTowerToolRun3.

Definition at line 152 of file L1TriggerTowerToolRun3.cxx.

155 {
156 
157  ATH_MSG_DEBUG( "::process: ==== Entered Process ====" );
158  ATH_MSG_DEBUG( "::process: digits: " << digits);
159  ATH_MSG_DEBUG( " channelID: " << MSG::hex << channelId.id() << MSG::dec );
160 
161 
163  et.clear();
164  bcidResults.clear();
165  bcidDecisions.clear();
166 
167  ATH_MSG_DEBUG( "::process: ---- FIR filter ----" );
168 
170  std::vector<int> filter;
171  fir(digits, channelId, filter);
172  std::vector<int> lutInput;
173  dropBits(filter, channelId, lutInput);
174 
175  ATH_MSG_DEBUG( "::process: ---- BCID algorithms ----" );
176 
178  bcid(filter, digits, channelId, bcidResults);
179 
180  ATH_MSG_DEBUG( "::process: ---- BCID decisions ----" );
181 
183  std::vector<int> decisionRange;
184  bcidDecisionRange(lutInput, digits, channelId, decisionRange);
185  bcidDecision(bcidResults, decisionRange, bcidDecisions);
186 
187  ATH_MSG_DEBUG( "::process: ---- LUT ET calculation ----" );
188 
190  std::vector<int> lutOutput;
191  if(useJepLut) jepLut(lutInput, channelId, lutOutput);
192  else cpLut(lutInput, channelId, lutOutput);
193 
194 
195  ATH_MSG_DEBUG( "::process: ---- use ET range ----" );
196 
199  applyEtRange(lutOutput, decisionRange, channelId, et);
200 
201  ATH_MSG_DEBUG( "::process: ==== Leaving Process ====" );
202 }

◆ process() [2/2]

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

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::IL1TriggerTowerToolRun3.

Definition at line 138 of file L1TriggerTowerToolRun3.cxx.

141 {
143  L1CaloCoolChannelId id = channelID(eta, phi, layer);
144 
146  process(digits, id, et, bcidResults, bcidDecisions, useJepLut);
147 }

◆ refValues()

std::pair< double, double > LVL1::L1TriggerTowerToolRun3::refValues ( const L1CaloCoolChannelId channelId)
overridevirtual

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1425 of file L1TriggerTowerToolRun3.cxx.

1426 {
1427  //method returning the fine time reference and calibration value
1428  //the fineTimeReference folder has to be loaded first using the method L1TriggerTowerToolRun3::loadFTRefs
1429  double reference = 0;
1430  double calib = 0;
1432 
1434  const L1CaloPpmFineTimeRefs* ftref = ppmFineTimeRefs->ppmFineTimeRefs(channelId.id());
1435  if (ftref) {
1436  FineTimeErrorCode errorCode(ftref->errorCode());
1437 // if (errorCode.chanValid()) { //this should be changed at some point, at the moment the error code is ignored
1438  reference = ftref->refValue();
1439  calib = ftref->calibValue();
1440 // }
1441 
1442  ATH_MSG_VERBOSE( MSG::hex
1443  << "::refValues: errorCode: " << (ftref->errorCode()).errorCode()
1444  << MSG::dec << " reference: " << ftref->refValue() << " calib: " << ftref->calibValue() );
1445 
1446  } else {
1447  ATH_MSG_VERBOSE( "::refValue: No FineTimeRefsTowers found" );
1448  }
1449  } else {
1450  ATH_MSG_VERBOSE( "::refValue: No FineTimeRefs Container retrieved" );
1451  }
1452 
1453  return std::make_pair(reference, calib);
1454 }

◆ 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  }

◆ satBcid() [1/2]

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

Saturated pulse BCID.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 542 of file L1TriggerTowerToolRun3.cxx.

543 {
544  int satLevel = 0;
545  int satLow = 0;
546  int satHigh = 0;
548 
550  bool available = false;
551  std::tie(available, satLevel, satLow, satHigh) = getSaturation<L1CaloPprConditionsContainerRun2>(channelId.id(), pprConditionsRun2);
552  if(!available) ATH_MSG_WARNING( "::satBcid: No L1CaloPprConditions found" );
553  } else ATH_MSG_WARNING( "::satBcid: No Conditions Container retrieved" );
554 
555  ATH_MSG_DEBUG( "::satBcid: satLevel: " << satLevel
556  << " satLow: " << satLow
557  << " satHigh: " << satHigh );
558 
559  satBcid(digits, satLow, satHigh, satLevel, output);
560 }

◆ satBcid() [2/2]

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

Saturated pulse BCID.

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 564 of file L1TriggerTowerToolRun3.cxx.

565 {
566  output.clear();
567  output.reserve(digits.size()); // avoid frequent reallocations
568 
569  bool enabled = true;
570  int flag[2] = {0,0};
571 
572  for (unsigned int i = 0; i<digits.size(); i++) {
573  // Algorithm can set flag for following sample. So here we
574  // propagate such flags into the current sample.
575  flag[0] = flag[1];
576  flag[1] = 0;
577 
578  if (digits[i]>=satLevel) { // do we have saturation?
579  if (enabled && i>1) { // is algorithm active?
580  bool low = (digits[i-2]>satLow);
581  bool high = (digits[i-1]>satHigh);
582  if (high) { // flag current or next sample?
583  if (low) {
584  flag[0] = 1;
585  }
586  else {
587  flag[1] = 1;
588  }
589  }
590  else {
591  flag[1] = 1;
592  }
593  }
594  enabled = false; // after first saturation, disable algorithm
595  }
596  else {
597  enabled = true; // unsaturated sample reenables algorithm
598  }
599  output.push_back(flag[0]);
600  }
601 
602  ATH_MSG_DEBUG( "::satBcid: output: " << output);
603 
604 }

◆ satOverride()

bool LVL1::L1TriggerTowerToolRun3::satOverride ( int  range) const
overridevirtual

Implements LVL1::IL1TriggerTowerToolRun3.

Definition at line 1294 of file L1TriggerTowerToolRun3.cxx.

1295 {
1296 
1298 
1299  bool override = false;
1301  std::tuple<bool, bool, bool> satOverride;
1302  satOverride = getSatOverride<L1CaloPprConditionsContainerRun2>(pprConditionsRun2);
1303  // NB Reverse order as for bcidDecision1/2/3
1304  if (range == 0) override = std::get<2>(satOverride);
1305  else if (range == 1) override = std::get<1>(satOverride);
1306  else if (range == 2) override = std::get<0>(satOverride);
1307  } else ATH_MSG_WARNING( "::satOverride: No Conditions Container retrieved" );
1308 
1309  ATH_MSG_VERBOSE( "::satOverride: range " << range
1310  << " has saturation override flag " << override );
1311 
1312  return override;
1313 }

◆ simulateChannel()

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

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::IL1TriggerTowerToolRun3.

Definition at line 216 of file L1TriggerTowerToolRun3.cxx.

216  {
217 
218  //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
219 
221  unsigned int readoutConfigID = runParameters->runParameters(1)->readoutConfigID();
222  ATH_MSG_DEBUG("RunParameters:: readoutConfigID " << readoutConfigID);
223 
224  std::vector<uint16_t> digits40;
225 
226  if(readoutConfigID == 5 or readoutConfigID == 6){
227 
228 
229  ATH_MSG_DEBUG("80 MHz readout detected, emulating 40 MHz samples");
230 
231  int nSlices = tt.adc().size();
232 
233  if((nSlices%4)==3){
234  for (int i=0 ; i < (nSlices-1)/2 ; i++ ){
235  digits40.push_back(tt.adc().at(2*i+1));
236  }
237  }
238  else if((nSlices%4)==1){
239  for (int i=0 ; i <= (nSlices-1)/2 ; i++){
240  digits40.push_back(tt.adc().at(2*i));
241  }
242  }
243 
244 
245  }else{
246  ATH_MSG_DEBUG("40 MHz readout detected");
247  digits40 = tt.adc();
248  }
249 
250  const auto& digits = convertVectorType<int>(digits40);
251 
252  L1CaloCoolChannelId channelId {tt.coolId()};
253 
254  ATH_MSG_DEBUG( "::simulateChannel: ==== Entered Process ====" );
255  ATH_MSG_DEBUG( "::simulateChannel: digits: " << digits );
256  ATH_MSG_DEBUG( "::simulateChannel: channelID: " << MSG::hex << channelId.id() << MSG::dec );
257 
258 
260  outCpLut.clear();
261  outJepLut.clear();
262  bcidResults.clear();
263  bcidDecisions.clear();
264 
266  ATH_MSG_DEBUG( "::simulateChannel: ---- FIR filter ----" );
267  std::vector<int> filter;
268  fir(digits, channelId, filter);
269 
270 
272  ATH_MSG_DEBUG( "::simulateChannel: ---- pedestalCorrection ----" );
273  // the correction is only available for each LUT slice in the read-out (not ADC/Filter slice)
274  // therefore we can only apply it to the #LUT central filter slices
275  const std::size_t nCorr = tt.correctionEnabled().size();
276  const std::size_t filterOffset = filter.size()/2 - nCorr/2;
277  for(std::size_t iCorr = 0; iCorr < nCorr; ++iCorr) {
278  filter[filterOffset + iCorr] -= tt.correction()[iCorr] * tt.correctionEnabled()[iCorr];
279  }
280 
281  ATH_MSG_DEBUG("::simulateChannel: filter: " << filter);
282 
283 
284  std::vector<int> lutInput;
285  dropBits(filter, channelId, lutInput);
286 
287  ATH_MSG_DEBUG( "::simulateChannel: ---- BCID algorithms ---- ");
288 
290  bcid(filter, digits, channelId, bcidResults);
291 
292 
294  std::vector<int> decisionRange;
295  bcidDecisionRange(lutInput, digits, channelId, decisionRange);
296  bcidDecision(bcidResults, decisionRange, bcidDecisions);
297 
298  ATH_MSG_DEBUG( "::simulateChannel: bcidDecisionRange " << decisionRange);
299  ATH_MSG_DEBUG( "::simulateChannel: bcidDecisions " << bcidDecisions);
300 
301 
302 
303  ATH_MSG_DEBUG( "::simulateChannel: ---- LUT ET calculation ----" );
304 
306  std::vector<int> cpLutOutput, jepLutOutput;
307  cpLut(lutInput, channelId, cpLutOutput);
308  jepLut(lutInput, channelId, jepLutOutput);
309 
310  ATH_MSG_DEBUG( "::simulateChannel: cpLut " << cpLutOutput);
311  ATH_MSG_DEBUG( "::simulateChannel: jepLut " << jepLutOutput);
312 
313  ATH_MSG_DEBUG( "::simulateChannel: ---- use ET range ----" );
314 
317  applyEtRange(cpLutOutput, decisionRange, channelId, outCpLut);
318  applyEtRange(jepLutOutput, decisionRange, channelId, outJepLut);
319 
320  ATH_MSG_DEBUG( "::simulateChannel: cpLut applyETRange " << outCpLut);
321  ATH_MSG_DEBUG( "::simulateChannel: jepLut applyETRange " << outJepLut);
322 
323 
324  ATH_MSG_DEBUG( "::simulateChannel: ==== Leaving Process ====" );
325 }

◆ 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::L1TriggerTowerToolRun3::m_caloMgr
private

Id managers.

Definition at line 133 of file L1TriggerTowerToolRun3.h.

◆ m_configSvc

ServiceHandle<TrigConf::ITrigConfigSvc> LVL1::L1TriggerTowerToolRun3::m_configSvc {this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc"}
private

Definition at line 161 of file L1TriggerTowerToolRun3.h.

◆ m_correctFir

bool LVL1::L1TriggerTowerToolRun3::m_correctFir
private

Baseline correction Tool.

Definition at line 154 of file L1TriggerTowerToolRun3.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_dynamicPedestalProvider

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

Definition at line 155 of file L1TriggerTowerToolRun3.h.

◆ m_eventInfoKey

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

Definition at line 157 of file L1TriggerTowerToolRun3.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::L1TriggerTowerToolRun3::m_idTable
private

Mapping lookup table.

Definition at line 151 of file L1TriggerTowerToolRun3.h.

◆ m_l1CaloTTIdTools

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

Definition at line 137 of file L1TriggerTowerToolRun3.h.

◆ m_L1MenuKey

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

Definition at line 158 of file L1TriggerTowerToolRun3.h.

◆ m_lvl1Helper

const CaloLVL1_ID* LVL1::L1TriggerTowerToolRun3::m_lvl1Helper
private

and tools for computing identifiers

Definition at line 136 of file L1TriggerTowerToolRun3.h.

◆ m_mappingTool

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

and mappings

Definition at line 141 of file L1TriggerTowerToolRun3.h.

◆ m_nBcid

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

Definition at line 167 of file L1TriggerTowerToolRun3.h.

◆ m_ppmFineTimeRefsContainer

SG::ReadCondHandleKey<L1CaloPpmFineTimeRefsContainer> LVL1::L1TriggerTowerToolRun3::m_ppmFineTimeRefsContainer { this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"}
private

Definition at line 146 of file L1TriggerTowerToolRun3.h.

◆ m_pprConditionsContainerRun2

SG::ReadCondHandleKey<L1CaloPprConditionsContainerRun2> LVL1::L1TriggerTowerToolRun3::m_pprConditionsContainerRun2 { this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"}
private

Definition at line 144 of file L1TriggerTowerToolRun3.h.

◆ m_pprDisabledChannelContainer

SG::ReadCondHandleKey<L1CaloPprDisabledChannelContainerRun2> LVL1::L1TriggerTowerToolRun3::m_pprDisabledChannelContainer { this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"}
private

Definition at line 145 of file L1TriggerTowerToolRun3.h.

◆ m_runParametersContainer

SG::ReadCondHandleKey<L1CaloRunParametersContainer> LVL1::L1TriggerTowerToolRun3::m_runParametersContainer { this, "InputKeyRunParameters", "L1CaloRunParametersContainer"}
private

Definition at line 147 of file L1TriggerTowerToolRun3.h.

◆ m_ttSvc

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

Definition at line 138 of file L1TriggerTowerToolRun3.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::L1TriggerTowerToolRun3::s_maxTowers = 7168
staticprivate

Definition at line 166 of file L1TriggerTowerToolRun3.h.

◆ s_saturationValue

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

Parameters.

Definition at line 165 of file L1TriggerTowerToolRun3.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
L1CaloPprConditionsContainerRun2
Container of L1CaloPprConditions objects, inherit from the abstract base class AbstractL1CaloConditio...
Definition: L1CaloPprConditionsContainerRun2.h:32
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
test_pyathena.eta
eta
Definition: test_pyathena.py:10
LVL1::L1TriggerTowerToolRun3::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) const
Definition: L1TriggerTowerToolRun3.cxx:874
LVL1::L1TriggerTowerToolRun3::m_ttSvc
ToolHandle< CaloTriggerTowerService > m_ttSvc
Definition: L1TriggerTowerToolRun3.h:138
LVL1::L1TriggerTowerToolRun3::disabledChannel
virtual bool disabledChannel(const L1CaloCoolChannelId &channelId) const override
Check for disabled channel.
Definition: L1TriggerTowerToolRun3.cxx:1317
LVL1::L1TriggerTowerToolRun3::m_L1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
Definition: L1TriggerTowerToolRun3.h:158
et
Extra patterns decribing particle interation process.
LVL1::L1TriggerTowerToolRun3::bcidDecisionRange
virtual void bcidDecisionRange(const std::vector< int > &lutInput, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Definition: L1TriggerTowerToolRun3.cxx:614
FineTimeErrorCode
FineTimeErrorCode class for L1Calo error codes.
Definition: FineTimeErrorCode.h:19
get_generator_info.result
result
Definition: get_generator_info.py:21
max
#define max(a, b)
Definition: cfImp.cxx:41
LVL1::L1TriggerTowerToolRun3::m_pprDisabledChannelContainer
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_pprDisabledChannelContainer
Definition: L1TriggerTowerToolRun3.h:145
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
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloID_Exception
Exception class for Calo Identifiers.
Definition: CaloID_Exception.h:20
LVL1::L1TriggerTowerToolRun3::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: L1TriggerTowerToolRun3.h:157
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1::L1TriggerTowerToolRun3::identifier
virtual Identifier identifier(double eta, double phi, int layer) override
Return offline identifier for given tower coordinates.
Definition: L1TriggerTowerToolRun3.cxx:1202
LVL1::L1TriggerTowerToolRun3::isRun2
bool isRun2() const
Definition: L1TriggerTowerToolRun3.cxx:1474
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
LVL1::L1TriggerTowerToolRun3::m_caloMgr
const CaloIdManager * m_caloMgr
Id managers.
Definition: L1TriggerTowerToolRun3.h:133
python.TriggerConfig.menu
menu
Definition: TriggerConfig.py:842
LVL1::L1TriggerTowerToolRun3::m_runParametersContainer
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainer
Definition: L1TriggerTowerToolRun3.h:147
LVL1::L1TriggerTowerToolRun3::satOverride
virtual bool satOverride(int range) const override
Definition: L1TriggerTowerToolRun3.cxx:1294
skel.it
it
Definition: skel.GENtoEVGEN.py:396
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::L1TriggerTowerToolRun3::satBcid
virtual void satBcid(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Saturated pulse BCID.
Definition: L1TriggerTowerToolRun3.cxx:542
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
LVL1::L1TriggerTowerToolRun3::etRange
virtual void etRange(const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Definition: L1TriggerTowerToolRun3.cxx:942
LVL1::L1TriggerTowerToolRun3::cpLut
virtual void cpLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Definition: L1TriggerTowerToolRun3.cxx:682
ChanCalibErrorCode
ChanCalibErrorCode class for L1Calo error codes Adapted from /LVL1/l1calo/coolL1Calo/coolL1Calo/ChanE...
Definition: ChanCalibErrorCode.h:20
LVL1::L1TriggerTowerToolRun3::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) override
Take in vector of ADC digits, return PPrASIC results.
Definition: L1TriggerTowerToolRun3.cxx:138
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
reference
Definition: hcg.cxx:437
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
LVL1::L1TriggerTowerToolRun3::m_configSvc
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
Definition: L1TriggerTowerToolRun3.h:161
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
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
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LVL1::L1TriggerTowerToolRun3::hwIdentifier
virtual HWIdentifier hwIdentifier(const Identifier &id) override
Return online identifier for given offline identifier.
Definition: L1TriggerTowerToolRun3.cxx:1218
LVL1::L1TriggerTowerToolRun3::FCalTTeta
virtual double FCalTTeta(const L1CaloCoolChannelId &channelId) override
Return median eta of trigger tower from L1CaloCoolChannelId.
Definition: L1TriggerTowerToolRun3.cxx:1397
LVL1::L1TriggerTowerToolRun3::fir
virtual void fir(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
This FIR simulation produces a vector of same length as digit vector, with peak positions correspondi...
Definition: L1TriggerTowerToolRun3.cxx:422
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
covarianceTool.filter
filter
Definition: covarianceTool.py:514
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
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:270
python.PyAthena.module
module
Definition: PyAthena.py:131
perfmonmt-refit.coeffs
coeffs
Definition: perfmonmt-refit.py:105
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
menu
make the sidebar many part of the config
Definition: hcg.cxx:551
LVL1::L1TriggerTowerToolRun3::bcidDecision
virtual void bcidDecision(const std::vector< int > &bcidResults, const std::vector< int > &range, std::vector< int > &output) const override
Definition: L1TriggerTowerToolRun3.cxx:640
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
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::L1TriggerTowerToolRun3::getL1Menu
const TrigConf::L1Menu * getL1Menu(const EventContext &ctx) const
Definition: L1TriggerTowerToolRun3.cxx:1510
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::L1TriggerTowerToolRun3::bcid
virtual void bcid(const std::vector< int > &fir, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Evaluate both peak-finder and saturated BCID algorithms and return vector of predicted BCID result wo...
Definition: L1TriggerTowerToolRun3.cxx:330
master.flag
bool flag
Definition: master.py:29
LVL1::L1TriggerTowerToolRun3::s_maxTowers
static const int s_maxTowers
Definition: L1TriggerTowerToolRun3.h:166
LVL1::L1TriggerTowerToolRun3::getLutOffset
unsigned int getLutOffset(const double &pedMean, const unsigned int &firStartBit, const std::vector< short int > &firCoeff, const unsigned int &lutSlope, const unsigned int &lutStrategy) const
Definition: L1TriggerTowerToolRun3.cxx:1484
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Make4DCorrelationMatrix.nominalEta
int nominalEta
Definition: Make4DCorrelationMatrix.py:80
LVL1::L1TriggerTowerToolRun3::dropBits
virtual void dropBits(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Definition: L1TriggerTowerToolRun3.cxx:987
SCT_Monitoring::disabled
@ disabled
Definition: SCT_MonitoringNumbers.h:60
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LVL1::L1TriggerTowerToolRun3::m_idTable
std::vector< unsigned int > m_idTable
Mapping lookup table.
Definition: L1TriggerTowerToolRun3.h:151
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
LVL1::L1TriggerTowerToolRun3::s_saturationValue
static const int s_saturationValue
Parameters.
Definition: L1TriggerTowerToolRun3.h:165
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
LVL1::L1TriggerTowerToolRun3::m_l1CaloTTIdTools
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
Definition: L1TriggerTowerToolRun3.h:137
merge.output
output
Definition: merge.py:17
LVL1::L1TriggerTowerToolRun3::lut
virtual void lut(const std::vector< int > &fir, int slope, int offset, int cut, int strategy, bool disabled, std::vector< int > &output) const override
LUT simulation: pedestal subtraction, energy calibration and threshold.
Definition: L1TriggerTowerToolRun3.cxx:845
LVL1::L1TriggerTowerToolRun3::m_dynamicPedestalProvider
ToolHandle< LVL1::IL1DynamicPedestalProvider > m_dynamicPedestalProvider
Definition: L1TriggerTowerToolRun3.h:155
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LVL1::L1TriggerTowerToolRun3::applyEtRange
virtual void applyEtRange(const std::vector< int > &lut, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Use ET range to return appropriate ET value Do not test BCID here, since no guarantee enough ADC samp...
Definition: L1TriggerTowerToolRun3.cxx:914
xAOD::phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
Definition: L2StandAloneMuon_v2.cxx:144
LVL1::L1TriggerTowerToolRun3::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
Definition: L1TriggerTowerToolRun3.h:136
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
L1CaloPpmFineTimeRefs::refValue
double refValue(void) const
Definition: L1CaloPpmFineTimeRefs.h:38
LVL1::L1TriggerTowerToolRun3::m_pprConditionsContainerRun2
SG::ReadCondHandleKey< L1CaloPprConditionsContainerRun2 > m_pprConditionsContainerRun2
Definition: L1TriggerTowerToolRun3.h:144
LVL1::L1TriggerTowerToolRun3::m_correctFir
bool m_correctFir
Baseline correction Tool.
Definition: L1TriggerTowerToolRun3.h:154
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
PlotSFuncertainty.calib
calib
Definition: PlotSFuncertainty.py:110
L1CaloCoolChannelId
Definition: L1CaloCoolChannelId.h:10
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:234
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LVL1::L1TriggerTowerToolRun3::channelID
virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer) override
Return Cool channel identifier for given tower coordinates.
Definition: L1TriggerTowerToolRun3.cxx:1238
LVL1::L1TriggerTowerToolRun3::peakBcid
virtual void peakBcid(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Peak finder BCID.
Definition: L1TriggerTowerToolRun3.cxx:491
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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
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
LVL1::L1TriggerTowerToolRun3::m_mappingTool
ToolHandle< LVL1::IL1CaloMappingTool > m_mappingTool
and mappings
Definition: L1TriggerTowerToolRun3.h:141
LVL1::L1TriggerTowerToolRun3::jepLut
virtual void jepLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Definition: L1TriggerTowerToolRun3.cxx:750
LVL1::L1TriggerTowerToolRun3::m_ppmFineTimeRefsContainer
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainer > m_ppmFineTimeRefsContainer
Definition: L1TriggerTowerToolRun3.h:146
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
Identifier
Definition: IdentifierFieldParser.cxx:14