ATLAS Offline Software
Loading...
Searching...
No Matches
L1TriggerTowerTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
5// L1TriggerTowerTool.h,
7
8 /***************************************************************************
9 * *
10 * *
11 ***************************************************************************/
12
13#ifndef L1TRIGGERTOWERTOOL_H
14#define L1TRIGGERTOWERTOOL_H
15
16#include <any>
17
19#include "GaudiKernel/IIncidentListener.h"
20#include "GaudiKernel/ToolHandle.h"
21#include "GaudiKernel/ServiceHandle.h"
26#include "TrigConfData/L1Menu.h"
28
33
34class CaloIdManager;
35class CaloLVL1_ID;
37class Incident;
38
39
40
41
42namespace LVL1
43{
45 class IL1CaloTTIdTools;
47
59
60 class ATLAS_NOT_THREAD_SAFE L1TriggerTowerTool : virtual public IL1TriggerTowerTool, public IIncidentListener, public AthAlgTool
61 {
62 public:
63
64 L1TriggerTowerTool(const std::string&,const std::string&,const IInterface*);
65
67 virtual ~L1TriggerTowerTool ();
68
70 virtual StatusCode initialize();
72 virtual StatusCode finalize();
74 virtual void handle(const Incident&);
76 virtual StatusCode retrieveConditions();
77
79 virtual void process(const std::vector<int> &digits,
80 double eta, double phi, int layer,
81 std::vector<int> &et, std::vector<int> &bcidResults,
82 std::vector<int> &bcidDecisions, bool useJepLut = true);
83
84 virtual void process(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId,
85 std::vector<int> &et, std::vector<int> &bcidResults,
86 std::vector<int> &bcidDecisions, bool useJepLut = true);
87
88 virtual void simulateChannel(const xAOD::TriggerTower& tt, std::vector<int>& outCpLut, std::vector<int>& outJepLut, std::vector<int>& bcidResults, std::vector<int>& bcidDecisions);
89
90 virtual void pedestalCorrection(std::vector<int>& firInOut, int firPed, int iElement, int layer,
91 int bcid, float mu, std::vector<int_least16_t>& correctionOut);
92 virtual void fir(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
93 virtual void fir(const std::vector<int> &digits, const std::vector<int> &firCoeffs, std::vector<int> &output);
94 virtual void dropBits(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
95 virtual void dropBits(const std::vector<int> &fir, unsigned int first, std::vector<int> &output);
96 virtual void etRange(const std::vector<int> &et, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
97 virtual void etRange(const std::vector<int> &et, int energyLow, int energyHigh, std::vector<int> &output);
98 virtual void peakBcid(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
99 virtual void peakBcid(const std::vector<int> &fir, unsigned int strategy, std::vector<int> &output);
100 virtual void satBcid(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
101 virtual void satBcid(const std::vector<int> &digits, int satLow, int satHigh, int satLevel, std::vector<int> &output);
102 virtual void bcid(const std::vector<int> &fir, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
103 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);
104 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,
105 unsigned int strategy, int satLow, int satHigh, int satLevel, std::vector<int> &result, std::vector<int> &decision);
106 virtual void bcidDecisionRange(const std::vector<int>& lutInput, const std::vector<int>& digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
107 virtual void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
108 virtual void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const std::vector<unsigned int> &mask, std::vector<int> &output);
109 virtual void lut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
110 virtual void cpLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
111 virtual void jepLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
112 virtual void lut(const std::vector<int> &fir, int slope, int offset, int cut, int ped, int strategy, bool disabled, std::vector<int> &output);
113 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);
114 virtual void applyEtRange(const std::vector<int>& lut, const std::vector<int>& range, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
115 virtual void firParams(const L1CaloCoolChannelId& channelId, std::vector<int> &firCoeffs);
116 virtual void bcidParams(const L1CaloCoolChannelId& channelId, int &energyLow, int &energyHigh, int &decisionSource, std::vector<unsigned int> &decisionConditions,
117 unsigned int &peakFinderStrategy, int &satLow, int &satHigh, int &satLevel);
118 virtual void lutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled);
119 virtual void cpLutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled);
120 virtual void jepLutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled);
121 virtual Identifier identifier(double eta, double phi, int layer);
122 virtual HWIdentifier hwIdentifier(const Identifier& id);
123 virtual HWIdentifier hwIdentifier(double eta, double phi, int layer);
124 virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer);
125 virtual L1CaloCoolChannelId channelID(const Identifier& id);
126 virtual bool satOverride(int range, const L1CaloCoolChannelId& channelId);
127 virtual bool disabledChannel(const L1CaloCoolChannelId& channelId);
128 virtual double FCalTTeta(const L1CaloCoolChannelId& channelId);
129 virtual double FCalTTeta(double nominalEta, double phi, int layer);
130 virtual void setDebug(bool debug);
131 virtual std::pair<double, double> refValues(const L1CaloCoolChannelId& channelId);
132 virtual StatusCode loadFTRefs();
133
134 private:
135 bool isRun2() const;
136
138 template <typename T>
139 void printVec(const std::vector<T>& vec);
140
142 bool disabledChannel(const L1CaloCoolChannelId& channelId, unsigned int& noiseCut);
143
144 bool m_debug = false;
145
148
151// L1CaloTTIdTools* m_l1CaloTTIdTools;
152 ToolHandle<LVL1::IL1CaloTTIdTools> m_l1CaloTTIdTools;
153 ToolHandle<CaloTriggerTowerService> m_ttSvc;
154
156 ToolHandle<LVL1::IL1CaloMappingTool> m_mappingTool;
157
159 SG::ReadCondHandleKey<L1CaloRunParametersContainer> m_runParametersContainerKey{ this, "InputKeyRunParameters", "L1CaloRunParametersContainer"};
160 SG::ReadCondHandleKey<L1CaloPprConditionsContainerRun2> m_conditionsContainerKeyRun2{ this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"};
161 SG::ReadCondHandleKey<L1CaloPprDisabledChannelContainerRun2> m_disabledChannelContainerKeyRun2{ this, "InputKeyDisabledChannelRun2", "L1CaloPprDisabledChannelContainerRun2"};
162 SG::ReadCondHandleKey<L1CaloPpmFineTimeRefsContainer> m_dbFineTimeRefsTowersKey{ this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"};
163
165
166 // - Note: 2024, dropped support for non-Run2 case
167 // this is why these were std::any, to allow for both possibilities when it was previously supported
168 std::any m_conditionsContainer; // one of L1CaloPprConditionsContainer{,Run2}*
169 std::any m_disabledChannelContainer; // one of L1CaloPprDisabledChannelContainer{,Run2}*
170
173
174
176 std::vector<unsigned int> m_idTable;
177
180 ToolHandle<LVL1::IL1DynamicPedestalProvider> m_dynamicPedestalProvider;
181
183 { this, "EventInfoKey", "EventInfo", "" };
184 SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey{ this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" };
185
186
188 static const int s_saturationValue = 255;
189 static const int s_maxTowers = 7168;
190 static const int m_nBcid = 350; // mc12: max 350 // all: 3564
191 };
192
193} // end of namespace
194
195#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::vector< size_t > vec
const bool debug
Property holding a SG store/key/clid from which a ReadHandle is made.
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
This class initializes the Calo (LAr and Tile) offline identifiers.
Helper class for offline TT identifiers.
Definition CaloLVL1_ID.h:66
Tool providing the mapping of the online and offline TriggerTower identifiers as well as the TT-cells...
Encapsulates the ID of one channel of conditions data in COOL, ie the ID of a row in a table.
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainerKey
L1Calo conditions.
ToolHandle< LVL1::IL1CaloMappingTool > m_mappingTool
and mappings
virtual Identifier identifier(double eta, double phi, int layer)
Return offline identifier for given tower coordinates.
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainer > m_dbFineTimeRefsTowersKey
virtual void setDebug(bool debug)
Finer control of debug printing.
virtual void cpLutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
L1TriggerTowerTool(const std::string &, const std::string &, const IInterface *)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
const CaloIdManager * m_caloMgr
Id managers.
virtual bool disabledChannel(const L1CaloCoolChannelId &channelId)
Check for disabled channel.
const L1CaloRunParametersContainer * m_runParametersContainer
ToolHandle< LVL1::IL1DynamicPedestalProvider > m_dynamicPedestalProvider
SG::ReadCondHandleKey< L1CaloPprConditionsContainerRun2 > m_conditionsContainerKeyRun2
void printVec(const std::vector< T > &vec)
Print a vector to debug.
virtual std::pair< double, double > refValues(const L1CaloCoolChannelId &channelId)
virtual void dropBits(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
virtual void jepLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
virtual void firParams(const L1CaloCoolChannelId &channelId, std::vector< int > &firCoeffs)
Return FIR filter parameters for a channel.
virtual void bcidParams(const L1CaloCoolChannelId &channelId, int &energyLow, int &energyHigh, int &decisionSource, std::vector< unsigned int > &decisionConditions, unsigned int &peakFinderStrategy, int &satLow, int &satHigh, int &satLevel)
Return BCID parameters for a channel.
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
virtual StatusCode retrieveConditions()
Retrieve pointers to the L1Calo conditions containers.
virtual void lut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
LUT simulation: pedestal subtraction, energy calibration and threshold.
virtual double FCalTTeta(const L1CaloCoolChannelId &channelId)
Return median eta of trigger tower from L1CaloCoolChannelId.
virtual void handle(const Incident &)
catch begRun
virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer)
Return Cool channel identifier for given tower coordinates.
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
virtual void simulateChannel(const xAOD::TriggerTower &tt, std::vector< int > &outCpLut, std::vector< int > &outJepLut, std::vector< int > &bcidResults, std::vector< int > &bcidDecisions)
All-in-one routine - give it the TT identifier, and it returns the results.
virtual void satBcid(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Saturated pulse BCID.
virtual void fir(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
This FIR simulation produces a vector of same length as digit vector, with peak positions correspondi...
virtual void peakBcid(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Peak finder BCID.
ToolHandle< CaloTriggerTowerService > m_ttSvc
bool m_correctFir
Baseline correction Tool.
virtual StatusCode loadFTRefs()
virtual void applyEtRange(const std::vector< int > &lut, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Use ET range to return appropriate ET value Do not test BCID here, since no guarantee enough ADC samp...
virtual HWIdentifier hwIdentifier(const Identifier &id)
Return online identifier for given offline identifier.
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)
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_disabledChannelContainerKeyRun2
virtual bool satOverride(int range, const L1CaloCoolChannelId &channelId)
virtual void bcidDecision(const std::vector< int > &bcidResults, const std::vector< int > &range, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
virtual void bcid(const std::vector< int > &fir, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
Evaluate both peak-finder and saturated BCID algorithms and return vector of predicted BCID result wo...
virtual void jepLutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
virtual void cpLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
virtual void bcidDecisionRange(const std::vector< int > &lutInput, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
virtual void pedestalCorrection(std::vector< int > &firInOut, int firPed, int iElement, int layer, int bcid, float mu, std::vector< int_least16_t > &correctionOut)
std::vector< unsigned int > m_idTable
Mapping lookup table.
static const int s_saturationValue
Parameters.
virtual StatusCode finalize()
standard Athena-Algorithm method
virtual void lutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled)
Return LUT parameters for a channel.
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
virtual void etRange(const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output)
const L1CaloPpmFineTimeRefsContainer * m_dbFineTimeRefsTowers
For the fine time monitoring.
Property holding a SG store/key/clid from which a ReadHandle is made.
const std::string process
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.
void initialize()
Extra patterns decribing particle interation process.