ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::jFEXForwardElecAlgo Class Reference

#include <jFEXForwardElecAlgo.h>

Inheritance diagram for LVL1::jFEXForwardElecAlgo:
Collaboration diagram for LVL1::jFEXForwardElecAlgo:

Public Member Functions

 jFEXForwardElecAlgo (const std::string &type, const std::string &name, const IInterface *parent)
 Constructors.
virtual StatusCode initialize () override
 standard Athena-Algorithm method
virtual ~jFEXForwardElecAlgo ()
 Destructor.
virtual StatusCode safetyTest () override
 Standard methods.
virtual void setup (int inputTable[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width], int jfex, int fpga) override
virtual std::unordered_map< uint, jFEXForwardElecInfocalculateEDM () override
virtual void setFPGAEnergy (std::unordered_map< int, std::vector< int > > etmapEM, std::unordered_map< int, std::vector< int > > etmapHAD) override
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () 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
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

virtual std::array< float, 2 > getEtaPhi (uint) override
virtual std::array< int, 2 > getEtEmHad (uint) const override
bool getEMSat (unsigned int ttID)
bool isValidSeed (uint seedTTID) const
void findAndFillNextTT (jFEXForwardElecInfo &elCluster, int neta, int nphi)
StatusCode ReadfromFile (const std::string &, std::unordered_map< unsigned int, std::vector< unsigned int > > &) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< LVL1::jTowerContainerm_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "jTower input container"}
SG::ReadHandle< jTowerContainerm_jTowerContainer
std::unordered_map< int, std::vector< int > > m_map_Etvalues_EM
std::unordered_map< int, std::vector< int > > m_map_Etvalues_HAD
int m_jFEXalgoTowerID [FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
int m_jfex
int m_fpga
const int m_Edge_dR2 = std::round( (std::pow(2*M_PI/32,2)) * 1e5 )
const int m_Edge_dR3 = std::round( (std::pow(3*M_PI/32,2)) * 1e5 )
const int m_Edge_dR4 = std::round( (std::pow(4*M_PI/32,2)) * 1e5 )
Gaudi::Property< std::string > m_IsoMapStr {this, "IsoMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_iso.dat", "Contains Trigger towers in (forward) EM layer used for isolation"}
Gaudi::Property< std::string > m_Frac1MapStr {this, "Frac1Map", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_frac.dat", "Contains Trigger towers in FCal layer2 used for hadronic fraction 1 discriminant"}
Gaudi::Property< std::string > m_Frac2MapStr {this, "Frac2Map", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_frac2.dat", "Contains Trigger towers in FCal layer3 used for hadronic fraction 2 discriminant"}
Gaudi::Property< std::string > m_SearchGTauStr {this, "SearchGTauMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_searchGTau.dat" , "Contains Trigger tower to find local max (greater than)"}
Gaudi::Property< std::string > m_SearchGeTauStr {this, "SearchGeTauMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_searchGeTau.dat", "Contains Trigger tower to find local max (greater or equal than)"}
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SeedRingMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_1stRingMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_IsoMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Frac1Map
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Frac2Map
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGTauMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGeTauMap
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static constexpr float m_2PI = 2*M_PI
static constexpr float m_TT_Size_phi = M_PI/32

Detailed Description

Definition at line 25 of file jFEXForwardElecAlgo.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

◆ jFEXForwardElecAlgo()

LVL1::jFEXForwardElecAlgo::jFEXForwardElecAlgo ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructors.

Definition at line 28 of file jFEXForwardElecAlgo.cxx.

28 : AthAlgTool(type, name, parent) {
29 declareInterface<IjFEXForwardElecAlgo>(this);
30 }
AthAlgTool()
Default constructor:

◆ ~jFEXForwardElecAlgo()

LVL1::jFEXForwardElecAlgo::~jFEXForwardElecAlgo ( )
virtual

Destructor.

Definition at line 33 of file jFEXForwardElecAlgo.cxx.

33 {
34 }

Member Function Documentation

◆ calculateEDM()

std::unordered_map< uint, LVL1::jFEXForwardElecInfo > LVL1::jFEXForwardElecAlgo::calculateEDM ( void )
overridevirtual

Implements LVL1::IjFEXForwardElecAlgo.

Definition at line 228 of file jFEXForwardElecAlgo.cxx.

228 {
229 std::unordered_map<uint, LVL1::jFEXForwardElecInfo> clusterList;
230 std::vector<int> lower_centre_neta;
231 std::vector<int> upper_centre_neta;
232
233 //check if we are in module 0 or 5 and assign corrrect eta FEXAlgoSpace parameters
234 if(m_jfex == 0) {
235 //Module 0
236 lower_centre_neta.assign({FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMB_start_eta, // 28
239
240 upper_centre_neta.assign({FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMB_end_eta, // 37
243 }
244 else {
245 //Module 5
246 lower_centre_neta.assign({FEXAlgoSpaceDefs::jFEX_algoSpace_A_EMB_eta, // 8
249
250 upper_centre_neta.assign({FEXAlgoSpaceDefs::jFEX_algoSpace_A_EMIE_eta, // 17
253 }
254
255 //define phi FEXAlgoSpace parameters
258
259 //loop over different EM/FCAL1 eta phi core fpga regions with different granularities. These are potential seed towers for electron clusters
260 for(uint region = 0; region<3; region++) {
261 for(int nphi = lower_centre_nphi[region]; nphi < upper_centre_nphi[region]; nphi++) {
262 for(int neta = lower_centre_neta[region]; neta < upper_centre_neta[region]; neta++) {
263
264 // ignore seeds for |eta| < 2.3 or from the first FCAL eta bin
265 if (m_jfex == 0 && neta >= FEXAlgoSpaceDefs::jFEX_algoSpace_C_FwdEl_start) continue;
266 if (m_jfex == 5 && neta <= FEXAlgoSpaceDefs::jFEX_algoSpace_A_FwdEl_start) continue;
267 if (m_jfex == 0 && neta == FEXAlgoSpaceDefs::jFEX_algoSpace_C_FCAL1_1st) continue;
268 if (m_jfex == 5 && neta == FEXAlgoSpaceDefs::jFEX_algoSpace_A_FCAL1_1st) continue;
269
270 // define ttID (only FCAL1 in the third region) which will be the key for class in map, ignore tower ID = 0
271 uint ttID = m_jFEXalgoTowerID[nphi][neta];
272 if(ttID == 0) continue;
273 //check if seed candidate is actual seed (passes local maximum criteria)
274 if(!isValidSeed(ttID)) continue;
275
276 //gather some first, basic information for resulting cluster/TOB
277 jFEXForwardElecInfo elCluster;
278 elCluster.setup(m_jfex, ttID, neta, nphi);
279 const auto [centreTT_eta, centreTT_phi] = getEtaPhi(ttID);
280 const auto [centreTT_EtEM, centreTT_EtHad] = getEtEmHad(ttID);
281 elCluster.setCoreTTfPhi(centreTT_phi);
282 elCluster.setCoreTTfEta(centreTT_eta);
283 elCluster.setCoreTTEtEM(centreTT_EtEM);
284 elCluster.setCoreTTSatEM(getEMSat(ttID));
285 elCluster.setNextTTEtEM(0);
286 elCluster.setNextTTID(0);
287 elCluster.setTTEtEMiso(0);
288
289 //find "NextTT", i.e., highest ET neighbour
290 findAndFillNextTT(elCluster, neta, nphi);
291
292 // sum up EM isolation using the isolation map and remove cluster ET
293 {
294 int sumEtEM = 0;
295 auto it_iso_map = m_IsoMap.find(ttID);
296 if(it_iso_map != m_IsoMap.end()) {
297 for(const auto& gtt : it_iso_map->second){
298 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
299 sumEtEM += tmp_EtEM;
300 }
301 elCluster.setTTEtEMiso(sumEtEM-elCluster.getNextTTEtEM());
302 } else {
303 ATH_MSG_ERROR("Could not find TT" << ttID << " in jEM isolation map file.");
304 }
305 }
306
307 if(fabs(centreTT_eta) < 3.2) {
308 // for non-FCal positions only Frac1 is meaningful and has a "trivial" mapping
309 elCluster.setTTEtHad1(centreTT_EtHad);
310 elCluster.setTTEtHad2(0);
311 } else {
312 // sum up Et for hadronic fraction 1
313 {
314 int sumEtHad1 = 0;
315 auto it_frac1_map = m_Frac1Map.find(ttID);
316 if(it_frac1_map != m_Frac1Map.end()) {
317 for(const auto& gtt : it_frac1_map->second){
318 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
319 sumEtHad1 += tmp_EtHad;
320 }
321 elCluster.setTTEtHad1(sumEtHad1);
322 } else {
323 ATH_MSG_ERROR("Could not find TT" << ttID << " in jEM frac1 map file.");
324 }
325 }
326
327 // sum up Et for hadronic fraction 2 (only FCal!)
328 {
329 int sumEtHad2 = 0;
330 auto it_frac2_map = m_Frac2Map.find(ttID);
331 if(it_frac2_map != m_Frac2Map.end()) {
332 for(const auto& gtt : it_frac2_map->second) {
333 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
334 sumEtHad2 += tmp_EtHad;
335 }
336 elCluster.setTTEtHad2(sumEtHad2);
337 } else {
338 ATH_MSG_ERROR("Could not find TT" << ttID << " in jEM frac2 map file.");
339 }
340 }
341 }
342
343 // save this cluster in the list
344 clusterList[ttID] = std::move(elCluster);
345 }//eta
346 }//phi
347 }// 3 regions
348 return clusterList;
349 }
#define ATH_MSG_ERROR(x)
unsigned int uint
static constexpr int jFEX_algoSpace_A_FCAL1_1st
static constexpr int jFEX_algoSpace_C_EMB_start_eta
static constexpr int jFEX_algoSpace_A_FCAL_end_eta
static constexpr int jFEX_algoSpace_C_EMB_end_eta
static constexpr int jFEX_algoSpace_EMIE_end_phi
static constexpr int jFEX_algoSpace_C_FCAL_end_eta
static constexpr int jFEX_algoSpace_A_EMB_eta
static constexpr int jFEX_algoSpace_A_FCAL_start_eta
static constexpr int jFEX_algoSpace_C_FCAL_start_eta
static constexpr int jFEX_algoSpace_A_EMIE_eta
static constexpr int jFEX_algoSpace_FCAL_end_phi
static constexpr int jFEX_algoSpace_C_FCAL1_1st
static constexpr int jFEX_algoSpace_EMB_end_phi
static constexpr int jFEX_algoSpace_A_FwdEl_start
static constexpr int jFEX_algoSpace_FCAL_start_phi
static constexpr int jFEX_algoSpace_EMIE_start_phi
static constexpr int jFEX_algoSpace_C_FwdEl_start
static constexpr int jFEX_algoSpace_EMB_start_phi
static constexpr int jFEX_algoSpace_C_EMIE_start_eta
static constexpr int jFEX_algoSpace_C_EMIE_end_eta
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Frac1Map
std::unordered_map< unsigned int, std::vector< unsigned int > > m_Frac2Map
virtual std::array< int, 2 > getEtEmHad(uint) const override
int m_jFEXalgoTowerID[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
virtual std::array< float, 2 > getEtaPhi(uint) override
void findAndFillNextTT(jFEXForwardElecInfo &elCluster, int neta, int nphi)
bool isValidSeed(uint seedTTID) const
bool getEMSat(unsigned int ttID)
std::unordered_map< unsigned int, std::vector< unsigned int > > m_IsoMap

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

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

◆ evtStore()

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.

◆ 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

◆ findAndFillNextTT()

void LVL1::jFEXForwardElecAlgo::findAndFillNextTT ( jFEXForwardElecInfo & elCluster,
int neta,
int nphi )
private

Definition at line 143 of file jFEXForwardElecAlgo.cxx.

143 {
144 //determine direction for offsets (-1 : C-side, +1: A-side)
145 int direction = m_jfex < 3 ? -1 : +1;
146
147 std::vector<std::pair<int,int>> neighbours;
148 //eta/phi index offsets depend on the position of the seed the cluster is created from
149 //differentiate the (many) different cases:
150 if ( direction>0 ? neta < FEXAlgoSpaceDefs::jFEX_algoSpace_A_EMIE_eta - 1 // A-side condition
151 : neta > FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMB_start_eta) // C-side condition
152 { //Barrel
153 neighbours = { {neta , nphi+1},
154 {neta , nphi-1},
155 {neta+1, nphi },
156 {neta-1, nphi }
157 };
158 } else if ( direction>0 ? neta == FEXAlgoSpaceDefs::jFEX_algoSpace_A_EMIE_eta - 1
160 { //Barrel next to Endcap
161 neighbours = { {neta, nphi+1},
162 {neta, nphi-1},
163 {neta-direction, nphi},
164 {neta+direction, nphi/2} //boundary crossing into endcap -> reduced phi granularity
165 };
166 } else if ( direction>0 ? neta == FEXAlgoSpaceDefs::jFEX_algoSpace_A_EMIE_eta
168 { //Endcap next to Barrel
169 neighbours = { {neta, nphi+1},
170 {neta, nphi-1},
171 {neta+direction, nphi},
172 {neta-direction, 2*nphi+0}, //crossing into barrel region, higher phi granularity
173 {neta-direction, 2*nphi+1}, // -> consider both "touching" towers
174 };
176 : neta < FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMIE_end_eta - 1 && neta > FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMIE_start_eta )
177 { //Endcap
178 neighbours = { {neta , nphi+1},
179 {neta , nphi-1},
180 {neta+1, nphi },
181 {neta-1, nphi }
182 };
183 } else if ( direction>0 ? neta == FEXAlgoSpaceDefs::jFEX_algoSpace_A_FCAL_start_eta - 1
185 { //Endcap next to FCal
186 neighbours = { {neta, nphi+1},
187 {neta, nphi-1},
188 {neta-direction, nphi},
189 {neta+2*direction, nphi/2} //boundary crossing into FCal -> reduced phi granularity and skip first FCal bin
190 };
191 } else if ( direction>0 ? neta == FEXAlgoSpaceDefs::jFEX_algoSpace_A_FCAL_start_eta + 1 //first FCal bin must be skipped!
192 : neta == FEXAlgoSpaceDefs::jFEX_algoSpace_C_EMIE_start_eta - 2 ) //first FCal bin must be skipped!
193 { //FCal next to Endcap
194 //phi spacing in FCal is very wide, no longer consider adding towers in phi direction
195 neighbours = { {neta-2*direction, 2*nphi+0}, //boundary crossing into endcap, higher phi granularity
196 {neta-2*direction, 2*nphi+1}, // -> consider both "touching" towers
197 {neta+direction, nphi}
198 };
200 : neta < FEXAlgoSpaceDefs::jFEX_algoSpace_C_FCAL_end_eta - 2 && neta > FEXAlgoSpaceDefs::jFEX_algoSpace_C_FCAL_start_eta )
201 { //FCal
202 neighbours = { {neta+1, nphi},
203 {neta-1, nphi}
204 };
205 } else if ( direction>0 ? neta == FEXAlgoSpaceDefs::jFEX_algoSpace_A_FCAL_end_eta - 1
207 { //FCal, last eta bin
208 neighbours = { {neta-direction, nphi}
209 };
210 } else {
211 ATH_MSG_ERROR("Eta index " << neta << " (side: "<< (direction>0?"A":"C") << ") does not seem to belong to any valid seed region");
212 }
213
214 //iterate over neighbours, find most energetic one
215 for (const auto& candEtaPhi: neighbours) {
216 uint candID = m_jFEXalgoTowerID[candEtaPhi.second][candEtaPhi.first];
217 const auto [candTT_EtEM, candTT_EtHad] = getEtEmHad(candID);
218 if (candTT_EtEM > elCluster.getNextTTEtEM()) {
219 elCluster.setNextTTEtEM(candTT_EtEM);
220 elCluster.setNextTTID(candID);
221 elCluster.setNextTTSatEM(getEMSat(candID));
222 }
223 }
224
225 }
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.

◆ getEMSat()

bool LVL1::jFEXForwardElecAlgo::getEMSat ( unsigned int ttID)
private

Definition at line 90 of file jFEXForwardElecAlgo.cxx.

90 {
91 if(ttID == 0) {
92 return false;
93 }
94
95 const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(ttID);
96 return tmpTower->getEMSat();
97 }
SG::ReadHandle< jTowerContainer > m_jTowerContainer
bool getEMSat() const
Definition jTower.h:56

◆ getEtaPhi()

std::array< float, 2 > LVL1::jFEXForwardElecAlgo::getEtaPhi ( uint ttID)
overrideprivatevirtual

Implements LVL1::IjFEXForwardElecAlgo.

Definition at line 66 of file jFEXForwardElecAlgo.cxx.

66 {
67 if(ttID == 0) {
68 return {999,999};
69 }
70 const LVL1::jTower *tmpTower = m_jTowerContainer->findTower(ttID);
71 return {tmpTower->centreEta(),tmpTower->centrePhi()};
72 }
float centrePhi() const
Definition jTower.h:80
float centreEta() const
Definition jTower.h:79

◆ getEtEmHad()

std::array< int, 2 > LVL1::jFEXForwardElecAlgo::getEtEmHad ( uint ttID) const
overrideprivatevirtual

Implements LVL1::IjFEXForwardElecAlgo.

Definition at line 74 of file jFEXForwardElecAlgo.cxx.

74 {
75 if(ttID == 0) {
76 return {0,0};
77 }
78 int TT_EtEM = 0;
79 if(m_map_Etvalues_EM.find(ttID) != m_map_Etvalues_EM.end()) {
80 TT_EtEM = m_map_Etvalues_EM.at(ttID)[0];
81 }
82 int TT_EtHad = 0;
83 if(m_map_Etvalues_HAD.find(ttID) != m_map_Etvalues_HAD.end()) {
84 TT_EtHad = m_map_Etvalues_HAD.at(ttID)[0];
85 }
86
87 return {TT_EtEM, TT_EtHad};
88 }
std::unordered_map< int, std::vector< int > > m_map_Etvalues_EM
std::unordered_map< int, std::vector< int > > m_map_Etvalues_HAD

◆ initialize()

StatusCode LVL1::jFEXForwardElecAlgo::initialize ( )
overridevirtual

standard Athena-Algorithm method

Definition at line 36 of file jFEXForwardElecAlgo.cxx.

36 {
37 ATH_CHECK(m_jTowerContainerKey.initialize());
38
44
45 return StatusCode::SUCCESS;
46 }
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Property< std::string > m_Frac2MapStr
SG::ReadHandleKey< LVL1::jTowerContainer > m_jTowerContainerKey
Gaudi::Property< std::string > m_SearchGeTauStr
Gaudi::Property< std::string > m_SearchGTauStr
StatusCode ReadfromFile(const std::string &, std::unordered_map< unsigned int, std::vector< unsigned int > > &) const
Gaudi::Property< std::string > m_IsoMapStr
Gaudi::Property< std::string > m_Frac1MapStr
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGTauMap
std::unordered_map< unsigned int, std::vector< unsigned int > > m_SearchGeTauMap
static std::string find_calib_file(const std::string &logical_file_name)

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

Definition at line 39 of file IjFEXForwardElecAlgo.h.

40{
42}
static const InterfaceID IID_IjFEXForwardElecAlgo("LVL1::IjFEXForwardElecAlgo", 1, 0)

◆ isValidSeed()

bool LVL1::jFEXForwardElecAlgo::isValidSeed ( uint seedTTID) const
private

Definition at line 107 of file jFEXForwardElecAlgo.cxx.

107 {
108 auto [centreTT_EtEM,centreTT_EtHad] = getEtEmHad(seedTTID);
109 // check if seed has strictly more energy than its neighbours
110 {
111 auto it_seed_map = m_SearchGTauMap.find(seedTTID);
112 if(it_seed_map == m_SearchGTauMap.end()) {
113 ATH_MSG_ERROR("Could not find TT" << seedTTID << " in the seach (>) local maxima for tau/em file.");
114 return false;
115 }
116 for (const auto& gtt : it_seed_map->second ){
117 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
118 if(tmp_EtEM>=centreTT_EtEM) {
119 return false;
120 }
121 }
122 }
123
124 // check if seed has equal or more energy than its neighbours
125 {
126 auto it_seed_map = m_SearchGeTauMap.find(seedTTID);
127 if(it_seed_map == m_SearchGeTauMap.end()) {
128 ATH_MSG_ERROR("Could not find TT" << seedTTID << " in the seach (>=) local maxima for tau/em file.");
129 return false;
130 }
131 for (const auto& gtt : it_seed_map->second ){
132 auto [tmp_EtEM,tmp_EtHad] = getEtEmHad(gtt);
133 if( tmp_EtEM>centreTT_EtEM) {
134 return false;
135 }
136 }
137 }
138
139 return true;
140 }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

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

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

◆ ReadfromFile()

StatusCode LVL1::jFEXForwardElecAlgo::ReadfromFile ( const std::string & fileName,
std::unordered_map< unsigned int, std::vector< unsigned int > > & fillingMap ) const
private

Definition at line 351 of file jFEXForwardElecAlgo.cxx.

351 {
352 std::string myline;
353 //opening file with ifstream
354 std::ifstream myfile(fileName);
355 if ( !myfile.is_open() ){
356 ATH_MSG_ERROR("Could not open file:" << fileName);
357 return StatusCode::FAILURE;
358 }
359
360 //loading the mapping information
361 while ( std::getline (myfile, myline) ) {
362 //removing the header of the file (it is just information!)
363 if(myline[0] == '#') continue;
364
365 //Splitting myline in different substrings
366 std::stringstream oneLine(myline);
367
368 //reading elements
369 std::vector<unsigned int> elements;
370 std::string element;
371 while(std::getline(oneLine, element, ' '))
372 {
373 elements.push_back(std::stoi(element));
374 }
375
376 // We should have at least two elements! Central TT and (at least) itself
377 if(elements.size() < 1){
378 ATH_MSG_ERROR("Unexpected number of elemennts (<1 expected) in file: "<< fileName);
379 return StatusCode::FAILURE;
380 }
381
382 //Central TiggerTower
383 unsigned int TTID = elements.at(0);
384
385 // rest of TTs that need to be checked
386 elements.erase(elements.begin());
387 fillingMap[TTID] = std::move(elements);
388 }
389 myfile.close();
390
391 return StatusCode::SUCCESS;
392 }

◆ 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();
384 }
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)

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

◆ safetyTest()

StatusCode LVL1::jFEXForwardElecAlgo::safetyTest ( )
overridevirtual

Standard methods.

Implements LVL1::IjFEXForwardElecAlgo.

Definition at line 49 of file jFEXForwardElecAlgo.cxx.

49 {
50 m_jTowerContainer = SG::ReadHandle<jTowerContainer>(m_jTowerContainerKey);
51 if(! m_jTowerContainer.isValid()) {
52 ATH_MSG_ERROR("Could not retrieve jTowerContainer " << m_jTowerContainerKey.key());
53 return StatusCode::FAILURE;
54 }
55 return StatusCode::SUCCESS;
56 }

◆ setFPGAEnergy()

void LVL1::jFEXForwardElecAlgo::setFPGAEnergy ( std::unordered_map< int, std::vector< int > > etmapEM,
std::unordered_map< int, std::vector< int > > etmapHAD )
overridevirtual

Implements LVL1::IjFEXForwardElecAlgo.

Definition at line 99 of file jFEXForwardElecAlgo.cxx.

101 {
102 m_map_Etvalues_EM=std::move(etmapEM);
103 m_map_Etvalues_HAD=std::move(etmapHAD);
104 }

◆ setup()

void LVL1::jFEXForwardElecAlgo::setup ( int inputTable[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width],
int jfex,
int fpga )
overridevirtual

Implements LVL1::IjFEXForwardElecAlgo.

Definition at line 59 of file jFEXForwardElecAlgo.cxx.

59 {
60 std::copy(&inputTable[0][0], &inputTable[0][0] + (FEXAlgoSpaceDefs::jFEX_algoSpace_height*FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width), &m_jFEXalgoTowerID[0][0]);
61 m_jfex=jfex;
62 m_fpga=fpga;
63 }
static constexpr int jFEX_wide_algoSpace_width
static constexpr int jFEX_algoSpace_height

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_1stRingMap

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_1stRingMap
private

Definition at line 70 of file jFEXForwardElecAlgo.h.

◆ m_2PI

float LVL1::jFEXForwardElecAlgo::m_2PI = 2*M_PI
staticconstexprprivate

Definition at line 57 of file jFEXForwardElecAlgo.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_Edge_dR2

const int LVL1::jFEXForwardElecAlgo::m_Edge_dR2 = std::round( (std::pow(2*M_PI/32,2)) * 1e5 )
private

Definition at line 59 of file jFEXForwardElecAlgo.h.

◆ m_Edge_dR3

const int LVL1::jFEXForwardElecAlgo::m_Edge_dR3 = std::round( (std::pow(3*M_PI/32,2)) * 1e5 )
private

Definition at line 60 of file jFEXForwardElecAlgo.h.

◆ m_Edge_dR4

const int LVL1::jFEXForwardElecAlgo::m_Edge_dR4 = std::round( (std::pow(4*M_PI/32,2)) * 1e5 )
private

Definition at line 61 of file jFEXForwardElecAlgo.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_fpga

int LVL1::jFEXForwardElecAlgo::m_fpga
private

Definition at line 56 of file jFEXForwardElecAlgo.h.

◆ m_Frac1Map

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_Frac1Map
private

Definition at line 72 of file jFEXForwardElecAlgo.h.

◆ m_Frac1MapStr

Gaudi::Property<std::string> LVL1::jFEXForwardElecAlgo::m_Frac1MapStr {this, "Frac1Map", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_frac.dat", "Contains Trigger towers in FCal layer2 used for hadronic fraction 1 discriminant"}
private

Definition at line 64 of file jFEXForwardElecAlgo.h.

64{this, "Frac1Map", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_frac.dat", "Contains Trigger towers in FCal layer2 used for hadronic fraction 1 discriminant"};

◆ m_Frac2Map

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_Frac2Map
private

Definition at line 73 of file jFEXForwardElecAlgo.h.

◆ m_Frac2MapStr

Gaudi::Property<std::string> LVL1::jFEXForwardElecAlgo::m_Frac2MapStr {this, "Frac2Map", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_frac2.dat", "Contains Trigger towers in FCal layer3 used for hadronic fraction 2 discriminant"}
private

Definition at line 65 of file jFEXForwardElecAlgo.h.

65{this, "Frac2Map", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_frac2.dat", "Contains Trigger towers in FCal layer3 used for hadronic fraction 2 discriminant"};

◆ m_IsoMap

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_IsoMap
private

Definition at line 71 of file jFEXForwardElecAlgo.h.

◆ m_IsoMapStr

Gaudi::Property<std::string> LVL1::jFEXForwardElecAlgo::m_IsoMapStr {this, "IsoMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_iso.dat", "Contains Trigger towers in (forward) EM layer used for isolation"}
private

Definition at line 63 of file jFEXForwardElecAlgo.h.

63{this, "IsoMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_iso.dat", "Contains Trigger towers in (forward) EM layer used for isolation"};

◆ m_jfex

int LVL1::jFEXForwardElecAlgo::m_jfex
private

Definition at line 55 of file jFEXForwardElecAlgo.h.

◆ m_jFEXalgoTowerID

int LVL1::jFEXForwardElecAlgo::m_jFEXalgoTowerID[FEXAlgoSpaceDefs::jFEX_algoSpace_height][FEXAlgoSpaceDefs::jFEX_wide_algoSpace_width]
private

Definition at line 54 of file jFEXForwardElecAlgo.h.

◆ m_jTowerContainer

SG::ReadHandle<jTowerContainer> LVL1::jFEXForwardElecAlgo::m_jTowerContainer
private

Definition at line 51 of file jFEXForwardElecAlgo.h.

◆ m_jTowerContainerKey

SG::ReadHandleKey<LVL1::jTowerContainer> LVL1::jFEXForwardElecAlgo::m_jTowerContainerKey {this, "MyjTowers", "jTowerContainer", "jTower input container"}
private

Definition at line 50 of file jFEXForwardElecAlgo.h.

50{this, "MyjTowers", "jTowerContainer", "jTower input container"};

◆ m_map_Etvalues_EM

std::unordered_map<int,std::vector<int> > LVL1::jFEXForwardElecAlgo::m_map_Etvalues_EM
private

Definition at line 52 of file jFEXForwardElecAlgo.h.

◆ m_map_Etvalues_HAD

std::unordered_map<int,std::vector<int> > LVL1::jFEXForwardElecAlgo::m_map_Etvalues_HAD
private

Definition at line 53 of file jFEXForwardElecAlgo.h.

◆ m_SearchGeTauMap

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_SearchGeTauMap
private

Definition at line 75 of file jFEXForwardElecAlgo.h.

◆ m_SearchGeTauStr

Gaudi::Property<std::string> LVL1::jFEXForwardElecAlgo::m_SearchGeTauStr {this, "SearchGeTauMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_searchGeTau.dat", "Contains Trigger tower to find local max (greater or equal than)"}
private

Definition at line 67 of file jFEXForwardElecAlgo.h.

67{this, "SearchGeTauMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_searchGeTau.dat", "Contains Trigger tower to find local max (greater or equal than)"};

◆ m_SearchGTauMap

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_SearchGTauMap
private

Definition at line 74 of file jFEXForwardElecAlgo.h.

◆ m_SearchGTauStr

Gaudi::Property<std::string> LVL1::jFEXForwardElecAlgo::m_SearchGTauStr {this, "SearchGTauMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_searchGTau.dat" , "Contains Trigger tower to find local max (greater than)"}
private

Definition at line 66 of file jFEXForwardElecAlgo.h.

66{this, "SearchGTauMap", "Run3L1CaloSimulation/JetMaps/2024_04_09/jFEX_FWD_searchGTau.dat" , "Contains Trigger tower to find local max (greater than)"};

◆ m_SeedRingMap

std::unordered_map<unsigned int, std::vector<unsigned int> > LVL1::jFEXForwardElecAlgo::m_SeedRingMap
private

Definition at line 69 of file jFEXForwardElecAlgo.h.

◆ m_TT_Size_phi

float LVL1::jFEXForwardElecAlgo::m_TT_Size_phi = M_PI/32
staticconstexprprivate

Definition at line 58 of file jFEXForwardElecAlgo.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.


The documentation for this class was generated from the following files: