ATLAS Offline Software
Loading...
Searching...
No Matches
L1TriggerTowerToolRun3.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 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 std::vector<int> &digits,
74 double eta, double phi, int layer,
75 std::vector<int> &et, std::vector<int> &bcidResults,
76 std::vector<int> &bcidDecisions, bool useJepLut = true) override;
77
78 virtual void process(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId,
79 std::vector<int> &et, std::vector<int> &bcidResults,
80 std::vector<int> &bcidDecisions, bool useJepLut = true) override;
81
82 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;
83
84 virtual void pedestalCorrection(std::vector<int>& firInOut, int firPed, int iElement, int layer,
85 int bcid, float mu, std::vector<int_least16_t>& correctionOut) override;
86 virtual void fir(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
87 virtual void fir(const std::vector<int> &digits, const std::vector<int> &firCoeffs, std::vector<int> &output) const override;
88 virtual void dropBits(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
89 virtual void dropBits(const std::vector<int> &fir, unsigned int first, std::vector<int> &output) const override;
90 virtual void etRange(const std::vector<int> &et, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
91 virtual void etRange(const std::vector<int> &et, int energyLow, int energyHigh, std::vector<int> &output) const override;
92 virtual void peakBcid(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
93 virtual void peakBcid(const std::vector<int> &fir, unsigned int strategy, std::vector<int> &output) const override;
94 virtual void satBcid(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
95 virtual void satBcid(const std::vector<int> &digits, int satLow, int satHigh, int satLevel, std::vector<int> &output) const override;
96 virtual void bcid(const std::vector<int> &fir, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
97 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;
98 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;
99 virtual void bcidDecisionRange(const std::vector<int>& lutInput, const std::vector<int>& digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
100 virtual void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, std::vector<int> &output) const override;
101 virtual void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const std::vector<unsigned int> &mask, std::vector<int> &output) const;
102 virtual void cpLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
103 virtual void jepLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
104 virtual void lut(const std::vector<int> &fir, int slope, int offset, int cut, int strategy, bool disabled, std::vector<int> &output) const override;
105 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;
106 virtual void applyEtRange(const std::vector<int>& lut, const std::vector<int>& range, const L1CaloCoolChannelId& channelId, std::vector<int> &output) const override;
107 virtual void firParams(const L1CaloCoolChannelId& channelId, std::vector<int> &firCoeffs) const override;
108 virtual void bcidParams(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 L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override;
111 virtual void jepLutParams(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(int range) const override;
118 virtual bool disabledChannel(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 L1CaloCoolChannelId& channelId) override;
122
123 private:
124 bool isRun2() const;
125
127 bool disabledChannel(const L1CaloCoolChannelId& channelId, unsigned int& noiseCut) const;
128
129 // calculate the LUT offset from DB parameters
130 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;
131
134
137 ToolHandle<LVL1::IL1CaloTTIdTools> m_l1CaloTTIdTools;
138 ToolHandle<CaloTriggerTowerService> m_ttSvc;
139
141 ToolHandle<LVL1::IL1CaloMappingTool> m_mappingTool;
142
143
144 SG::ReadCondHandleKey<L1CaloPprConditionsContainerRun2> m_pprConditionsContainerRun2{ this, "InputKeyPprConditionsRun2", "L1CaloPprConditionsContainerRun2"};
145 SG::ReadCondHandleKey<L1CaloPprDisabledChannelContainerRun2> m_pprDisabledChannelContainer{ this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"};
146 SG::ReadCondHandleKey<L1CaloPpmFineTimeRefsContainer> m_ppmFineTimeRefsContainer{ this, "InputKeyTimeRefs", "L1CaloPpmFineTimeRefsContainer"};
147 SG::ReadCondHandleKey<L1CaloRunParametersContainer> m_runParametersContainer{ this, "InputKeyRunParameters", "L1CaloRunParametersContainer"};
148
149
151 std::vector<unsigned int> m_idTable;
152
155 ToolHandle<LVL1::IL1DynamicPedestalProvider> m_dynamicPedestalProvider;
156
157 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{ this, "EventInfoKey", "EventInfo", "" };
158 SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey{ this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" };
159
160 // xAOD ConfigSvc is useable in both RAWtoALL jobs and from ESD, AOD.
161 ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc{this, "TrigConfigSvc", "TrigConf::xAODConfigSvc/xAODConfigSvc"};
162 const TrigConf::L1Menu* getL1Menu(const EventContext& ctx) const;
163
165 static const int s_saturationValue = 255;
166 static const int s_maxTowers = 7168;
167 static const int m_nBcid = 350; // mc12: max 350 // all: 3564
168 };
169
170} // end of namespace
171
172#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 void peakBcid(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Peak finder BCID.
virtual StatusCode finalize() override
standard Athena-Algorithm method
SG::ReadCondHandleKey< L1CaloPpmFineTimeRefsContainer > m_ppmFineTimeRefsContainer
virtual void jepLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer) override
Return Cool channel identifier for given tower coordinates.
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...
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 std::pair< double, double > refValues(const L1CaloCoolChannelId &channelId) override
virtual bool disabledChannel(const L1CaloCoolChannelId &channelId) const override
Check for disabled channel.
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
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
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...
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_pprDisabledChannelContainer
static const int s_saturationValue
Parameters.
virtual void bcidDecisionRange(const std::vector< int > &lutInput, const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
virtual void dropBits(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
virtual bool satOverride(int range) 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 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.
std::vector< unsigned int > m_idTable
Mapping lookup table.
virtual void cpLut(const std::vector< int > &fir, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
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.
bool m_correctFir
Baseline correction Tool.
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainer
virtual void cpLutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override
L1TriggerTowerToolRun3(const std::string &, const std::string &, const IInterface *)
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...
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.
ToolHandle< CaloTriggerTowerService > m_ttSvc
virtual void jepLutParams(const L1CaloCoolChannelId &channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled) override
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 satBcid(const std::vector< int > &digits, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
Saturated pulse BCID.
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
virtual void etRange(const std::vector< int > &et, const L1CaloCoolChannelId &channelId, std::vector< int > &output) const override
virtual void firParams(const L1CaloCoolChannelId &channelId, std::vector< int > &firCoeffs) const override
Return FIR filter parameters for a channel.
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
virtual void handle(const Incident &) override
catch begRun
SG::ReadCondHandleKey< L1CaloPprConditionsContainerRun2 > m_pprConditionsContainerRun2
virtual void bcidDecision(const std::vector< int > &bcidResults, const std::vector< int > &range, std::vector< int > &output) const override
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.
Property holding a SG store/key/clid from which a ReadHandle is made.
L1 menu configuration.
Definition L1Menu.h:28
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.