ATLAS Offline Software
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 
29 class CaloIdManager;
30 class CaloLVL1_ID;
32 class Incident;
33 class L1CaloCondSvc;
38 
39 
40 namespace LVL1
41 {
42  class IL1CaloMappingTool;
43  class IL1CaloTTIdTools;
44  class IL1DynamicPedestalProvider;
45 
58  class ATLAS_NOT_THREAD_SAFE L1TriggerTowerTool : virtual public IL1TriggerTowerTool, public IIncidentListener, public AthAlgTool
59  {
60  public:
61 
62  L1TriggerTowerTool(const std::string&,const std::string&,const IInterface*);
63 
65  virtual ~L1TriggerTowerTool ();
66 
68  virtual StatusCode initialize();
70  virtual StatusCode finalize();
72  virtual void handle(const Incident&);
74  virtual StatusCode retrieveConditions();
75 
77  virtual void process(const std::vector<int> &digits,
78  double eta, double phi, int layer,
79  std::vector<int> &et, std::vector<int> &bcidResults,
80  std::vector<int> &bcidDecisions, bool useJepLut = true);
81 
82  virtual void process(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId,
83  std::vector<int> &et, std::vector<int> &bcidResults,
84  std::vector<int> &bcidDecisions, bool useJepLut = true);
85 
86  virtual void simulateChannel(const xAOD::TriggerTower& tt, std::vector<int>& outCpLut, std::vector<int>& outJepLut, std::vector<int>& bcidResults, std::vector<int>& bcidDecisions);
87 
88  virtual void pedestalCorrection(std::vector<int>& firInOut, int firPed, int iElement, int layer,
89  int bcid, float mu, std::vector<int_least16_t>& correctionOut);
90  virtual void fir(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
91  virtual void fir(const std::vector<int> &digits, const std::vector<int> &firCoeffs, std::vector<int> &output);
92  virtual void dropBits(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
93  virtual void dropBits(const std::vector<int> &fir, unsigned int first, std::vector<int> &output);
94  virtual void etRange(const std::vector<int> &et, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
95  virtual void etRange(const std::vector<int> &et, int energyLow, int energyHigh, std::vector<int> &output);
96  virtual void peakBcid(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
97  virtual void peakBcid(const std::vector<int> &fir, unsigned int strategy, std::vector<int> &output);
98  virtual void satBcid(const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
99  virtual void satBcid(const std::vector<int> &digits, int satLow, int satHigh, int satLevel, std::vector<int> &output);
100  virtual void bcid(const std::vector<int> &fir, const std::vector<int> &digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
101  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);
102  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,
103  unsigned int strategy, int satLow, int satHigh, int satLevel, std::vector<int> &result, std::vector<int> &decision);
104  virtual void bcidDecisionRange(const std::vector<int>& lutInput, const std::vector<int>& digits, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
105  virtual void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
106  virtual void bcidDecision(const std::vector<int> &bcidResults, const std::vector<int> &range, const std::vector<unsigned int> &mask, std::vector<int> &output);
107  virtual void lut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
108  virtual void cpLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
109  virtual void jepLut(const std::vector<int> &fir, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
110  virtual void lut(const std::vector<int> &fir, int slope, int offset, int cut, int ped, int strategy, bool disabled, std::vector<int> &output);
111  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);
112  virtual void applyEtRange(const std::vector<int>& lut, const std::vector<int>& range, const L1CaloCoolChannelId& channelId, std::vector<int> &output);
113  virtual void firParams(const L1CaloCoolChannelId& channelId, std::vector<int> &firCoeffs);
114  virtual void bcidParams(const L1CaloCoolChannelId& channelId, int &energyLow, int &energyHigh, int &decisionSource, std::vector<unsigned int> &decisionConditions,
115  unsigned int &peakFinderStrategy, int &satLow, int &satHigh, int &satLevel);
116  virtual void lutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled);
117  virtual void cpLutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled);
118  virtual void jepLutParams(const L1CaloCoolChannelId& channelId, int &startBit, int &slope, int &offset, int &cut, int &pedValue, float &pedMean, int &strategy, bool &disabled);
119  virtual Identifier identifier(double eta, double phi, int layer);
120  virtual HWIdentifier hwIdentifier(const Identifier& id);
121  virtual HWIdentifier hwIdentifier(double eta, double phi, int layer);
122  virtual L1CaloCoolChannelId channelID(double eta, double phi, int layer);
123  virtual L1CaloCoolChannelId channelID(const Identifier& id);
124  virtual bool satOverride(int range, const L1CaloCoolChannelId& channelId);
125  virtual bool disabledChannel(const L1CaloCoolChannelId& channelId);
126  virtual double FCalTTeta(const L1CaloCoolChannelId& channelId);
127  virtual double FCalTTeta(double nominalEta, double phi, int layer);
128  virtual void setDebug(bool debug);
129  virtual std::pair<double, double> refValues(const L1CaloCoolChannelId& channelId);
130  virtual StatusCode loadFTRefs();
131 
132  private:
133  bool isRun2() const;
134 
136  template <typename T>
137  void printVec(const std::vector<T>& vec);
138 
140  bool disabledChannel(const L1CaloCoolChannelId& channelId, unsigned int& noiseCut);
141 
142  bool m_debug = false;
143 
146 
149 // L1CaloTTIdTools* m_l1CaloTTIdTools;
150  ToolHandle<LVL1::IL1CaloTTIdTools> m_l1CaloTTIdTools;
151  ToolHandle<CaloTriggerTowerService> m_ttSvc;
152 
154  ToolHandle<LVL1::IL1CaloMappingTool> m_mappingTool;
155 
158 
159  // one of L1CaloPprConditionsContainer{,Run2}*
160 
162  L1CaloPprChanStrategyContainer* m_strategyContainer = nullptr;
163  L1CaloDerivedRunParsContainer* m_derivedRunParsContainer = nullptr;
164  L1CaloRunParametersContainer* m_runParametersContainer = nullptr;
165 
167  // one of L1CaloPprDisabledChannelContainer{,Run2}*
169 
172 
173 
175  std::vector<unsigned int> m_idTable;
176 
179  ToolHandle<LVL1::IL1DynamicPedestalProvider> m_dynamicPedestalProvider;
180 
182  { this, "EventInfoKey", "EventInfo", "" };
183  SG::ReadHandleKey<TrigConf::L1Menu> m_L1MenuKey{ this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu", "L1 Menu" };
184 
185 
187  static const int s_saturationValue = 255;
188  static const int s_maxTowers = 7168;
189  static const int m_nBcid = 350; // mc12: max 350 // all: 3564
190  };
191 
192 } // end of namespace
193 
194 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
et
Extra patterns decribing particle interation process.
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
LVL1::L1TriggerTowerTool::m_conditionsContainer
std::any m_conditionsContainer
Definition: L1TriggerTowerTool.h:166
get_generator_info.result
result
Definition: get_generator_info.py:21
LVL1::L1TriggerTowerTool::m_ttSvc
ToolHandle< CaloTriggerTowerService > m_ttSvc
Definition: L1TriggerTowerTool.h:151
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LVL1::L1TriggerTowerTool::m_l1CaloTTIdTools
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
Definition: L1TriggerTowerTool.h:150
initialize
void initialize()
Definition: run_EoverP.cxx:894
CaloTriggerTowerService
Tool providing the mapping of the online and offline TriggerTower identifiers as well as the TT-cells...
Definition: CaloTriggerTowerService.h:50
LVL1::L1TriggerTowerTool::m_l1CondSvc
ServiceHandle< L1CaloCondSvc > m_l1CondSvc
L1Calo conditions.
Definition: L1TriggerTowerTool.h:157
LVL1::L1TriggerTowerTool::m_idTable
std::vector< unsigned int > m_idTable
Mapping lookup table.
Definition: L1TriggerTowerTool.h:175
TriggerTowerContainer.h
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
SG::ReadHandleKey< xAOD::EventInfo >
HWIdentifier
Definition: HWIdentifier.h:13
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
LVL1::L1TriggerTowerTool::m_dbFineTimeRefsTowers
L1CaloPpmFineTimeRefsContainer * m_dbFineTimeRefsTowers
For the fine time monitoring.
Definition: L1TriggerTowerTool.h:171
LVL1::L1TriggerTowerTool::m_caloMgr
const CaloIdManager * m_caloMgr
Id managers.
Definition: L1TriggerTowerTool.h:145
LVL1::L1TriggerTowerTool::m_dynamicPedestalProvider
ToolHandle< LVL1::IL1DynamicPedestalProvider > m_dynamicPedestalProvider
Definition: L1TriggerTowerTool.h:179
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition: CaloIdManager.h:45
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
AthAlgTool.h
LVL1::L1TriggerTowerTool::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
and tools for computing identifiers
Definition: L1TriggerTowerTool.h:148
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
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
LVL1::L1TriggerTowerTool::m_disabledChannelContainer
std::any m_disabledChannelContainer
Definition: L1TriggerTowerTool.h:168
Make4DCorrelationMatrix.nominalEta
int nominalEta
Definition: Make4DCorrelationMatrix.py:80
SCT_Monitoring::disabled
@ disabled
Definition: SCT_MonitoringNumbers.h:60
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
merge.output
output
Definition: merge.py:17
python.TrigConfigSvcUtils.isRun2
def isRun2(cursor, schemaname)
Definition: TrigConfigSvcUtils.py:290
L1CaloDerivedRunParsContainer
Definition: L1CaloDerivedRunParsContainer.h:26
LVL1::L1TriggerTowerTool
Definition: L1TriggerTowerTool.h:59
CaloLVL1_ID
Helper class for offline TT identifiers.
Definition: CaloLVL1_ID.h:66
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
L1CaloPprChanStrategyContainer
Definition: L1CaloPprChanStrategyContainer.h:25
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
EventInfo.h
LVL1::IL1TriggerTowerTool
Definition: IL1TriggerTowerTool.h:29
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
IL1TriggerTowerTool.h
L1CaloCoolChannelId
Definition: L1CaloCoolChannelId.h:10
LVL1::L1TriggerTowerTool::m_mappingTool
ToolHandle< LVL1::IL1CaloMappingTool > m_mappingTool
and mappings
Definition: L1TriggerTowerTool.h:154
LVL1::L1TriggerTowerTool::m_correctFir
bool m_correctFir
Baseline correction Tool.
Definition: L1TriggerTowerTool.h:178
DeMoScan.first
bool first
Definition: DeMoScan.py:534
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
AthAlgTool
Definition: AthAlgTool.h:26
L1Menu.h
checker_macros.h
Define macros for attributes used to control the static checker.
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
L1CaloPpmFineTimeRefsContainer
Definition: L1CaloPpmFineTimeRefsContainer.h:30
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
L1CaloCondSvc
L1CaloCondSvc class.
Definition: L1CaloCondSvc.h:39
L1CaloRunParametersContainer
Definition: L1CaloRunParametersContainer.h:26
ServiceHandle< L1CaloCondSvc >