ATLAS Offline Software
Loading...
Searching...
No Matches
L1TriggerTowerToolRun3.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5// L1TriggerTowerToolRun3.h,
7
8 /***************************************************************************
9 * *
10 * *
11 ***************************************************************************/
12
13#ifndef L1TRIGGERTOWERTOOLRUN3_H
14#define L1TRIGGERTOWERTOOLRUN3_H
15
17#include "GaudiKernel/IIncidentListener.h"
18#include "GaudiKernel/ToolHandle.h"
19#include "GaudiKernel/ServiceHandle.h"
24#include "TrigConfData/L1Menu.h"
31
32
33class CaloIdManager;
34class CaloLVL1_ID;
36class Incident;
37
38namespace LVL1
39{
41 class IL1CaloTTIdTools;
43
55
56 class L1TriggerTowerToolRun3 : virtual public IL1TriggerTowerToolRun3, public IIncidentListener, public AthAlgTool
57 {
58 public:
59
60 L1TriggerTowerToolRun3(const std::string&,const std::string&,const IInterface*);
61
63 virtual ~L1TriggerTowerToolRun3 ();
64
66 virtual StatusCode initialize() override;
68 virtual StatusCode finalize() override;
70 virtual void handle(const Incident&) override;
71
73 virtual void process(const EventContext& ctx,
74 const std::vector<int> &digits,
75 double eta, double phi, int layer,
76 std::vector<int> &et, std::vector<int> &bcidResults,
77 std::vector<int> &bcidDecisions, bool useJepLut = true) override;
78
79 virtual void process(const EventContext& ctx,
80 const std::vector<int> &digits, const L1CaloCoolChannelId& channelId,
81 std::vector<int> &et, std::vector<int> &bcidResults,
82 std::vector<int> &bcidDecisions, bool useJepLut = true) override;
83
84 virtual void simulateChannel(const EventContext& ctx, const xAOD::TriggerTower& tt, std::vector<int>& outCpLut,std::vector<int>& outJepLut, std::vector<int>& bcidResults, std::vector<int>& bcidDecisions) const override;
85
86 virtual void pedestalCorrection(std::vector<int>& firInOut, int firPed, int iElement, int layer,
87 int bcid, float mu, std::vector<int_least16_t>& correctionOut) override;
88 virtual void fir(const EventContext& ctx, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
89 virtual void fir(const std::vector<int> &digits, const std::vector<int> &firCoeffs, std::vector<int> &output) const override;
90 virtual void dropBits(const EventContext& ctx, const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
91 virtual void dropBits(const std::vector<int> &fir, unsigned int first, std::vector<int> &output) const override;
92 virtual void etRange(const EventContext& ctx, const std::vector<int> &et, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
93 virtual void etRange(const std::vector<int> &et, int energyLow, int energyHigh, std::vector<int> &output) const override;
94 virtual void peakBcid(const EventContext& ctx, const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
95 virtual void peakBcid(const std::vector<int> &fir, unsigned int strategy, std::vector<int> &output) const override;
96 virtual void satBcid(const EventContext& ctx, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
97 virtual void satBcid(const std::vector<int> &digits, int satLow, int satHigh, int satLevel, std::vector<int> &output) const override;
98 virtual void bcid(const EventContext& ctx, const std::vector<int> &fir, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
99 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;
100 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;
101 virtual void bcidDecisionRange(const EventContext& ctx, const std::vector<int>& lutInput, const std::vector<int>& digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
102 virtual void bcidDecision(const EventContext& ctx, const std::vector<int> &bcidResults, const std::vector<int> &range, std::vector<int> &output) const override;
103 virtual void cpLut(const EventContext& ctx, const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
104 virtual void jepLut(const EventContext& ctx, const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
105 virtual void lut(const std::vector<int> &fir, int slope, int offset, int cut, int strategy, bool disabled, std::vector<int> &output) const override;
106 virtual void applyEtRange(const EventContext& ctx, const std::vector<int>& lut, const std::vector<int>& range, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
107 virtual void firParams(const EventContext& ctx, const L1CaloCoolChannelId& channelId, std::vector<int> &firCoeffs) const override;
108 virtual void bcidParams(const EventContext& ctx, const L1CaloCoolChannelId& channelId, int &energyLow, int &energyHigh, int &decisionSource, std::vector<unsigned int> &decisionConditions,
109 unsigned int &peakFinderStrategy, int &satLow, int &satHigh, int &satLevel) const override;
110 virtual void cpLutParams(const EventContext& ctx, const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override;
111 virtual void jepLutParams(const EventContext& ctx, const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override;
112 virtual Identifier identifier(double eta, double phi, int layer) override;
113 virtual HWIdentifier hwIdentifier(const Identifier& id) override;
114 virtual HWIdentifier hwIdentifier(double eta, double phi, int layer) override;
115 virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer) override;
116 virtual L1CaloCoolChannelId channelID(const Identifier& id) override;
117 virtual bool satOverride(const EventContext& ctx, int range) const override;
118 virtual bool disabledChannel(const EventContext& ctx, const L1CaloCoolChannelId& channelId) const override;
119 virtual double FCalTTeta(const L1CaloCoolChannelId& channelId) override;
120 virtual double FCalTTeta(double nominalEta, double phi, int layer) override;
121 virtual std::pair<double, double> refValues(const EventContext& ctx, const L1CaloCoolChannelId& channelId) override;
122
123 private:
124 bool isRun2(const EventContext& ctx) const;
125 void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const std::vector<unsigned int> &mask, std::vector<int> &output) const;
126 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;
127
129 bool disabledChannel(const EventContext& ctx, const L1CaloCoolChannelId& channelId, unsigned int& noiseCut) const;
130
131 // calculate the LUT offset from DB parameters
132 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;
133
136
139 ToolHandle<LVL1::IL1CaloTTIdTools> m_l1CaloTTIdTools;
140 ToolHandle<CaloTriggerTowerService> m_ttSvc;
141
143 ToolHandle<LVL1::IL1CaloMappingTool> m_mappingTool;
144
145
146 SG::ReadCondHandleKey<L1CaloPprConditionsContainerRun2> m_pprConditionsContainerRun2{ this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"};
147 SG::ReadCondHandleKey<L1CaloPprDisabledChannelContainerRun2> m_pprDisabledChannelContainer{ this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"};
148 SG::ReadCondHandleKey<L1CaloPpmFineTimeRefsContainer> m_ppmFineTimeRefsContainer{ this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"};
149 SG::ReadCondHandleKey<L1CaloRunParametersContainer> m_runParametersContainer{ this, "InputKeyRunParameters", "L1CaloRunParametersContainer"};
150
151
153 std::vector<unsigned int> m_idTable;
154
157 ToolHandle<LVL1::IL1DynamicPedestalProvider> m_dynamicPedestalProvider;
158
159 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{ this, "EventInfoKey", "EventInfo", "" };
160 SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey{ this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" };
161
162 // xAOD ConfigSvc is useable in both RAWtoALL jobs and from ESD, AOD.
163 ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc{this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc"};
164 const TrigConf::L1Menu* getL1Menu(const EventContext& ctx) const;
165
167 static const int s_saturationValue = 255;
168 static const int s_maxTowers = 7168;
169 static const int m_nBcid = 350; // mc12: max 350 // all: 3564
170 };
171
172} // end of namespace
173
174#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Property holding a SG store/key/clid from which a ReadHandle is made.
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.
virtual std::pair< double, double > refValues(const EventContext &ctx, const L1CaloCoolChannelId &channelId) override
virtual StatusCode finalize() override
standard Athena-Algorithm method
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainer > m_ppmFineTimeRefsContainer
virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer) override
Return Cool channel identifier for given tower coordinates.
virtual void firParams(const EventContext &ctx, const L1CaloCoolChannelId &channelId, std::vector< int > &firCoeffs) const override
Return FIR filter parameters for a channel.
virtual HWIdentifier hwIdentifier(const Identifier &id) override
Return online identifier for given offline identifier.
ToolHandle< LVL1::IL1DynamicPedestalProvider > m_dynamicPedestalProvider
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
virtual void etRange(const EventContext &ctx, const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
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
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
virtual void bcid(const EventContext &ctx, 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...
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_pprDisabledChannelContainer
static const int s_saturationValue
Parameters.
virtual void satBcid(const EventContext &ctx, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Saturated pulse BCID.
virtual bool satOverride(const EventContext &ctx, int range) const override
virtual void cpLut(const EventContext &ctx, 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.
virtual StatusCode initialize() override
standard Athena-Algorithm method
virtual void fir(const EventContext &ctx, 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...
std::vector< unsigned int > m_idTable
Mapping lookup table.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
bool m_correctFir
Baseline correction Tool.
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainer
virtual void jepLutParams(const EventContext &ctx, const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override
virtual void jepLut(const EventContext &ctx, const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
L1TriggerTowerToolRun3(const std::string &, const std::string &, const IInterface *)
virtual Identifier identifier(double eta, double phi, int layer) override
Return offline identifier for given tower coordinates.
virtual double FCalTTeta(const L1CaloCoolChannelId &channelId) override
Return median eta of trigger tower from L1CaloCoolChannelId.
virtual void cpLutParams(const EventContext &ctx, const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override
bool isRun2(const EventContext &ctx) const
virtual void applyEtRange(const EventContext &ctx, 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...
ToolHandle< CaloTriggerTowerService > m_ttSvc
virtual void simulateChannel(const EventContext &ctx, 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.
virtual bool disabledChannel(const EventContext &ctx, const L1CaloCoolChannelId &channelId) const override
Check for disabled channel.
virtual void pedestalCorrection(std::vector< int > &firInOut, int firPed, int iElement, int layer, int bcid, float mu, std::vector< int_least16_t > &correctionOut) override
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
virtual void handle(const Incident &) override
catch begRun
virtual void bcidDecisionRange(const EventContext &ctx, const std::vector< int > &lutInput, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
SG::ReadCondHandleKey< L1CaloPprConditionsContainerRun2 > m_pprConditionsContainerRun2
virtual void bcidDecision(const EventContext &ctx, const std::vector< int > &bcidResults, const std::vector< int > &range, std::vector< int > &output) const override
virtual void bcidParams(const EventContext &ctx, 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.
virtual void peakBcid(const EventContext &ctx, const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Peak finder BCID.
const TrigConf::L1Menu * getL1Menu(const EventContext &ctx) const
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
virtual ~L1TriggerTowerToolRun3()
default destructor
ToolHandle< LVL1::IL1CaloMappingTool > m_mappingTool
and mappings
const CaloIdManager * m_caloMgr
Id managers.
virtual void dropBits(const EventContext &ctx, const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Property holding a SG store/key/clid from which a ReadHandle is made.
L1 menu configuration.
Definition L1Menu.h:29
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.
Extra patterns decribing particle interation process.