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

#include <gFexTower2SCellDecorator.h>

Inheritance diagram for LVL1::gFexTower2SCellDecorator:
Collaboration diagram for LVL1::gFexTower2SCellDecorator:

Public Member Functions

 gFexTower2SCellDecorator (const std::string &name, ISvcLocator *svc)
virtual StatusCode initialize () override
 Function initialising the algorithm.
virtual StatusCode execute (const EventContext &) const override
 Function executing the algorithm.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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 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

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

StatusCode ReadSCfromFile (const std::string &)
StatusCode ReadTilefromFile (const std::string &)
bool isBadSCellID (const std::string &) 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< CaloCellContainerm_SCellKey {this, "SCell", "SCell", "SCell container"}
SG::ReadHandleKey< xAOD::TriggerTowerContainerm_triggerTowerKey {this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers container"}
const std::string m_ReadKey_name = "L1_gFexDataTowers"
SG::ReadHandleKey< xAOD::gFexTowerContainerm_gTowersReadKey {this,"gTowersReadKey" ,"L1_gFexDataTowers", "Read gFex EDM Trigger Tower container"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gSCellEtdecorKey { this, "gSCellEtdecorKey" , "L1_gFexDataTowers.SCellEt" , "SCell Et information of the gTower"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gSCellEtadecorKey { this, "gSCellEtadecorKey" , "L1_gFexDataTowers.SCellEta" , "SCell Eta information of the gTower"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gSCellPhidecorKey { this, "gSCellPhidecorKey" , "L1_gFexDataTowers.SCellPhi" , "SCell Phi information of the gTower"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gSCellIDdecorKey { this, "gSCellIDdecorKey" , "L1_gFexDataTowers.SCellID" , "SCell IDs information of the gTower"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gSCellSampledecorKey { this, "gSCellSampledecorKey", "L1_gFexDataTowers.SCellSample" , "SCell Samples information of the gTower"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gtowerEtMeVdecorKey { this, "gtowerEtMeVdecorKey" , "L1_gFexDataTowers.gtowerEtMeV" , "gFex Tower Et information in MeV"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gTowerEtdecorKey { this, "gTowerEtdecorKey" , "L1_gFexDataTowers.SCSumEncoded" , "SCell sum Et. ENCODED!"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gTileEtMeVdecorKey { this, "gTileEtMeVdecorKey" , "L1_gFexDataTowers.TileEt" , "Tile Tower Et information in Encoded from jepET"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gTileEtadecorKey { this, "gTileEtadecorKey" , "L1_gFexDataTowers.TileEta" , "Tile Tower Eta information in MeV"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gTilePhidecorKey { this, "gTilePhidecorKey" , "L1_gFexDataTowers.TilePhi" , "Tile Tower Phi information in MeV"}
SG::WriteDecorHandleKey< xAOD::gFexTowerContainerm_gTileIDdecorKey { this, "gTileIDdecorKey" , "L1_gFexDataTowers.TileID" , "Tile Tower ID information"}
Gaudi::Property< std::string > m_gFEX2Scellmapping {this, "gFEX2SCmapping" , "L1CaloFEXByteStream/gFEX_maps/2023_02_23/gfexSuperCellMap.txt" , "Text file to convert from simulation ID to SuperCell Identifier"}
Gaudi::Property< std::string > m_gFEX2Tilemapping {this, "gFEX2Tilemapping", "L1CaloFEXByteStream/gFEX_maps/2023_02_23/gfexTileMap.txt", "Text file to convert from simulation ID to Tile Identifier"}
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCells
std::unordered_map< uint32_t, std::vector< uint32_t > > m_map_TTower2Tile
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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

Detailed Description

Definition at line 26 of file gFexTower2SCellDecorator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ gFexTower2SCellDecorator()

LVL1::gFexTower2SCellDecorator::gFexTower2SCellDecorator ( const std::string & name,
ISvcLocator * svc )

Definition at line 28 of file gFexTower2SCellDecorator.cxx.

28: AthReentrantAlgorithm(name, svc){}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LVL1::gFexTower2SCellDecorator::execute ( const EventContext & ctx) const
overridevirtual

Function executing the algorithm.

Definition at line 55 of file gFexTower2SCellDecorator.cxx.

55 {
56
57 //Reading the Scell container
58 SG::ReadHandle<CaloCellContainer> ScellContainer(m_SCellKey, ctx);
59 if(!ScellContainer.isValid()) {
60 ATH_MSG_FATAL("Could not retrieve collection " << ScellContainer.key() );
61 return StatusCode::FAILURE;
62 }
63
64 // Reading the TriggerTower container
65 SG::ReadHandle<xAOD::TriggerTowerContainer> triggerTowerContainer(m_triggerTowerKey, ctx);
66 if(!triggerTowerContainer.isValid()) {
67 ATH_MSG_FATAL("Could not retrieve collection " << triggerTowerContainer.key() );
68 return StatusCode::FAILURE;
69 }
70
71 //Reading the gTower container
72 SG::ReadHandle<xAOD::gFexTowerContainer> gTowerContainer(m_gTowersReadKey, ctx);
73 if(!gTowerContainer.isValid()) {
74 ATH_MSG_FATAL("Could not retrieve collection " << gTowerContainer.key() );
75 return StatusCode::FAILURE;
76 }
77
78 if(ScellContainer->empty() || triggerTowerContainer->empty() || gTowerContainer->empty() ){
79 ATH_MSG_WARNING("Nothing to decorate here, at least one container is empty. ScellContainer.size="<<ScellContainer->size() << " or gTowerContainer.size=" << gTowerContainer->size() << " or triggerTowerContainer.size=" << triggerTowerContainer->size() );
80 return StatusCode::SUCCESS;
81 }
82
83 // building Scell ID pointers
84 std::unordered_map< uint64_t, const CaloCell*> map_ScellID2ptr;
85
86 for(const CaloCell* scell : *ScellContainer){
87 const uint64_t ID = scell->ID().get_compact();
88 map_ScellID2ptr[ID] = scell;
89 }
90
91 // building Tile ID pointers
92 std::unordered_map< uint32_t, const xAOD::TriggerTower*> map_TileID2ptr;
93
94 for(const xAOD::TriggerTower* tower : *triggerTowerContainer){
95
96 // keeping just
97 if(std::abs(tower->eta())>1.5 || tower->sampling()!=1) continue;
98 map_TileID2ptr[tower->coolId()]=tower;
99 }
100
101 //Setup Decorator Handlers
102 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<float> > gTowerSCellEt (m_gSCellEtdecorKey , ctx);
103 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<float> > gTowerSCellEta (m_gSCellEtadecorKey , ctx);
104 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<float> > gTowerSCellPhi (m_gSCellPhidecorKey , ctx);
105 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<int> > gTowerSCellID (m_gSCellIDdecorKey , ctx);
106 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<int> > gTowerSCellSample(m_gSCellSampledecorKey , ctx);
107 SG::WriteDecorHandle<xAOD::gFexTowerContainer, int > gTowerEtMeV (m_gtowerEtMeVdecorKey , ctx);
108 SG::WriteDecorHandle<xAOD::gFexTowerContainer, int > gTowerSCEtEncoded(m_gTowerEtdecorKey , ctx);
109 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<int> > gTowerTileEt (m_gTileEtMeVdecorKey , ctx);
110 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<int> > gTowerTileID (m_gTileEtMeVdecorKey , ctx);
111 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<float> > gTowerTileEta (m_gTileEtadecorKey , ctx);
112 SG::WriteDecorHandle<xAOD::gFexTowerContainer, std::vector<float> > gTowerTilePhi (m_gTilePhidecorKey , ctx);
113
114 //looping over the gTowers to decorate them
115 for(const xAOD::gFexTower* gTower : *gTowerContainer){
116
117 uint32_t gFexID = gTower->gFEXtowerID();
118 uint16_t gFexEt = gTower->towerEt();
119 uint16_t scSumEtEncoded = 0;
120
121 std::vector<float> scEt;
122 std::vector<float> scEta;
123 std::vector<float> scPhi;
124 std::vector<int> scID;
125 std::vector<int> scSample;
126
127 std::vector<int> TileEt;
128 std::vector<float> TileEta;
129 std::vector<float> TilePhi;
130 std::vector<int> TileID;
131
132 //check that the gFEX Tower ID exists in the map
133 auto it_TTower2SCells = (m_map_TTower2SCells).find(gFexID);
134 if(it_TTower2SCells == (m_map_TTower2SCells).end()) {
135 ATH_MSG_ERROR("ID: "<<gFexID<< " not found on map m_map_TTower2SCells");
136 return StatusCode::FAILURE;
137 }
138
139 for (auto const& SCellID : it_TTower2SCells->second ) {
140
141 //check that the SCell Identifier exists in the map
142 auto it_ScellID2ptr = map_ScellID2ptr.find(SCellID);
143 if(it_ScellID2ptr == map_ScellID2ptr.end()) {
144 ATH_MSG_WARNING("Scell ID: 0x"<<std::hex<<(SCellID >> 32)<<std::dec<< " not found on map map_ScellID2ptr");
145
146 scEt.push_back(-9999);
147 scEta.push_back(-99);
148 scPhi.push_back(-99);
149 // bit shifting to get only a 32 bit number
150 scID.push_back( SCellID >> 32 );
151 scSample.push_back(-99);
152
153 }
154
155 else{
156
157 const CaloCell* myCell = it_ScellID2ptr->second;
158 float et = myCell->et();
159 const CaloSampling::CaloSample sample = (myCell)->caloDDE()->getSampling();
160
161
162 // The following is to check if any SuperCells from data are permanently masked, and if so the masking is applied
163 int prov = (myCell)->provenance();
164 int SCprov = prov&0xFFF;
165 bool isMasked = (SCprov&0x80)==0x80;//prov looks like 0000 0000 1000 0000 if the cell is masked
166 if (isMasked) et=0;
167
168 scEt.push_back(et);
169 scEta.push_back(myCell->eta());
170 scPhi.push_back(myCell->phi());
171 // bit shifting to get only a 32 bit number
172 scID.push_back( SCellID >> 32 );
173 scSample.push_back(sample);
174
175 }
176 }
177
178 //emulated encoded Et
179 float tmpSCellEt = 0;
180 for(const auto& tmpet : scEt){
181 tmpSCellEt += tmpet;
182 }
183
184 scSumEtEncoded = gFEXCompression::compress( tmpSCellEt );
185
186 // Decorating the tower with the corresponding information
187 gTowerSCellEt (*gTower) = std::move(scEt);
188 gTowerSCellEta (*gTower) = std::move(scEta);
189 gTowerSCellPhi (*gTower) = std::move(scPhi);
190 gTowerSCellID (*gTower) = std::move(scID);
191 gTowerSCellSample (*gTower) = std::move(scSample);
192 gTowerEtMeV (*gTower) = gFexEt * 200;
193 gTowerSCEtEncoded (*gTower) = scSumEtEncoded;
194
195
196 auto it_TTower2Tile = (m_map_TTower2Tile).find(gFexID);
197 //check that the gFEX Tower ID exists in the map
198 if(it_TTower2Tile == (m_map_TTower2Tile).end()) {
199 continue;
200 }
201
202 for (auto const& TileTowerID : it_TTower2Tile->second ) {
203
204 //check that the Tile Identifier exists in the map
205 auto it_TileID2ptr = map_TileID2ptr.find(TileTowerID);
206 if(it_TileID2ptr == map_TileID2ptr.end()) {
207
208 ATH_MSG_WARNING("Tile ID: "<<TileID<<std::dec<< " not found on map map_TileID2ptr");
209
210 TileEt.push_back(-9999);
211 TileEta.push_back(-99);
212 TilePhi.push_back(-99);
213 TileID.push_back(-99);
214 }
215 else{
216
217 const xAOD::TriggerTower* tileTower = it_TileID2ptr->second;
218 TileEt.push_back(tileTower->jepET()*1000); //1000 is the Tile energy resolution
219 TileEta.push_back(tileTower->eta());
220 float phi = tileTower->phi() < M_PI ? tileTower->phi() : tileTower->phi()-2*M_PI;
221 TilePhi.push_back(phi);
222 TileID.push_back(TileTowerID);
223
224 }
225
226
227 }
228
229
230 // Decorating the tower with the corresponding information
231 gTowerTileEt (*gTower) = std::move(TileEt);
232 gTowerTileID (*gTower) = std::move(TileID);
233 gTowerTileEta (*gTower) = std::move(TileEta);
234 gTowerTilePhi (*gTower) = std::move(TilePhi);
235 }
236
237 // Return gracefully
238 return StatusCode::SUCCESS;
239}
#define M_PI
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(x)
std::vector< Identifier > ID
float et(const xAOD::jFexSRJetRoI *j)
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition CaloCell.h:375
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition CaloCell.h:382
virtual double et() const override final
get et
Definition CaloCell.h:423
static unsigned int compress(float Energy)
Compress data.
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gTileEtadecorKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gtowerEtMeVdecorKey
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCells
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gSCellPhidecorKey
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
std::unordered_map< uint32_t, std::vector< uint32_t > > m_map_TTower2Tile
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gSCellEtadecorKey
SG::ReadHandleKey< xAOD::gFexTowerContainer > m_gTowersReadKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gSCellSampledecorKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gSCellEtdecorKey
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gTilePhidecorKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gTowerEtdecorKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gTileEtMeVdecorKey
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gSCellIDdecorKey
uint8_t jepET() const
get jepET from peak of lut_jep
virtual double eta() const final
The pseudorapidity ( ) of the particle.
virtual double phi() const final
The azimuthal angle ( ) of the particle.
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
gFexTower_v1 gFexTower
Define the latest version of the TriggerTower class.
Definition gFexTower.h:15
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.
setWord1 uint16_t
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode LVL1::gFexTower2SCellDecorator::initialize ( )
overridevirtual

Function initialising the algorithm.

Definition at line 30 of file gFexTower2SCellDecorator.cxx.

30 {
31 ATH_MSG_INFO( "L1CaloFEXTools/gFexTower2SCellDecorator::initialize()");
32 ATH_CHECK( m_SCellKey.initialize() );
33 ATH_CHECK( m_triggerTowerKey.initialize() );
34 ATH_CHECK( m_gTowersReadKey.initialize() );
35 ATH_CHECK( m_gSCellEtdecorKey.initialize() );
36 ATH_CHECK( m_gSCellEtadecorKey.initialize() );
37 ATH_CHECK( m_gSCellPhidecorKey.initialize() );
38 ATH_CHECK( m_gSCellIDdecorKey.initialize() );
39 ATH_CHECK( m_gSCellSampledecorKey.initialize() );
40 ATH_CHECK( m_gtowerEtMeVdecorKey.initialize() );
41 ATH_CHECK( m_gTowerEtdecorKey.initialize() );
42 ATH_CHECK( m_gTileEtMeVdecorKey.initialize() );
43 ATH_CHECK( m_gTileEtadecorKey.initialize() );
44 ATH_CHECK( m_gTilePhidecorKey.initialize() );
45 ATH_CHECK( m_gTileIDdecorKey.initialize() );
46
47
48 //Reading from CVMFS Trigger Tower and their corresponding SCell ID
51
52 return StatusCode::SUCCESS;
53}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
SG::WriteDecorHandleKey< xAOD::gFexTowerContainer > m_gTileIDdecorKey
Gaudi::Property< std::string > m_gFEX2Scellmapping
Gaudi::Property< std::string > m_gFEX2Tilemapping
StatusCode ReadTilefromFile(const std::string &)
StatusCode ReadSCfromFile(const std::string &)
static std::string find_calib_file(const std::string &logical_file_name)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isBadSCellID()

bool LVL1::gFexTower2SCellDecorator::isBadSCellID ( const std::string & ID) const
private

Definition at line 302 of file gFexTower2SCellDecorator.cxx.

302 {
303
304 // does it start with "0x"?, if so then is a GOOD SCell ID!
305 if (ID.find("0x") == std::string::npos) {
306 ATH_MSG_ERROR("Invalid SuperCell ID " << ID << ". Expecting hexadecimal number on the mapping file");
307 return true;
308 }
309 return false;
310}

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ ReadSCfromFile()

StatusCode LVL1::gFexTower2SCellDecorator::ReadSCfromFile ( const std::string & fileName)
private

Definition at line 242 of file gFexTower2SCellDecorator.cxx.

242 {
243
244 std::string myline;
245 //open file with ifstream
246 std::ifstream myfile(fileName);
247
248 if ( !myfile.is_open() ){
249 ATH_MSG_FATAL("Could not open file:" << fileName);
250 return StatusCode::FAILURE;
251 }
252
253 //loading the mapping information into an unordered_map <Fex Tower ID, vector of SCell IDs>
254 while ( std::getline (myfile, myline) ) {
255 std::vector<uint64_t> SCellvector;
256 SCellvector.clear();
257
258 //removing the header of the file (it is just information!)
259 myline.erase(myline.begin(), std::find_if(myline.begin(), myline.end(), [](int ch) {
260 return !std::isspace(ch);
261 }));
262 if(myline[0] == '#') continue;
263
264 //Splitting myline in different substrings
265 std::stringstream oneSCellID(myline);
266
267 //reading elements
268 std::string substr = "";
269 int TTID = 0;
270 int elem = 0;
271
272 while(std::getline(oneSCellID, substr, ' '))
273 {
274 ++elem;
275 if(elem == 1){
276 TTID = std::stoi(substr);
277 }
278 else{
279 //Check if it looks like a SCell Identifier
280 if(isBadSCellID(substr)){
281 return StatusCode::FAILURE;
282 }
283
284 // converts hex number to unsigned long long int
285 uint64_t scid_uint64 = std::strtoull(substr.c_str(), nullptr, 0);
286
287 //empty slots are filled with 0xffffffffffffffff
288 if(scid_uint64 == 0xffffffffffffffff) continue;
289
290 SCellvector.push_back(scid_uint64);
291 }
292 }
293
294 m_map_TTower2SCells[TTID] = std::move(SCellvector);
295
296 }
297 myfile.close();
298
299 return StatusCode::SUCCESS;
300}
bool isBadSCellID(const std::string &) const

◆ ReadTilefromFile()

StatusCode LVL1::gFexTower2SCellDecorator::ReadTilefromFile ( const std::string & fileName)
private

Definition at line 313 of file gFexTower2SCellDecorator.cxx.

313 {
314
315 std::string myline;
316
317 //openning file with ifstream
318 std::ifstream myfile(fileName);
319
320 if ( !myfile.is_open() ){
321 ATH_MSG_FATAL("Could not open file:" << fileName);
322 return StatusCode::FAILURE;
323 }
324
325 //loading the mapping information into an unordered_map <Fex Tower ID, vector of SCell IDs>
326 while ( std::getline (myfile, myline) ) {
327
328 std::vector<uint32_t> Tilevector;
329 Tilevector.clear();
330 //removing the header of the file
331 myline.erase(myline.begin(), std::find_if(myline.begin(), myline.end(), [](int ch) {
332 return !std::isspace(ch);
333 }));
334 if(myline[0] == '#') continue;
335
336 //Splitting myline in different substrings
337 std::stringstream oneTileID(myline);
338
339 //reading elements
340 std::string substr = "";
341 int gTowerID = 0;
342 int elem = 0;
343
344 while(std::getline(oneTileID, substr, ' ')){
345 ++elem;
346 if(elem == 1){
347 gTowerID = std::stoi(substr);
348 }
349 else{
350 uint32_t tileid_uint32 = std::strtoul(substr.c_str(), nullptr, 0);
351 Tilevector.push_back(tileid_uint32);
352 }
353 }
354
355 m_map_TTower2Tile[gTowerID] = std::move(Tilevector);
356
357 }
358 myfile.close();
359
360 return StatusCode::SUCCESS;
361}

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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 }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_gFEX2Scellmapping

Gaudi::Property<std::string> LVL1::gFexTower2SCellDecorator::m_gFEX2Scellmapping {this, "gFEX2SCmapping" , "L1CaloFEXByteStream/gFEX_maps/2023_02_23/gfexSuperCellMap.txt" , "Text file to convert from simulation ID to SuperCell Identifier"}
private

Definition at line 63 of file gFexTower2SCellDecorator.h.

63{this, "gFEX2SCmapping" , "L1CaloFEXByteStream/gFEX_maps/2023_02_23/gfexSuperCellMap.txt" , "Text file to convert from simulation ID to SuperCell Identifier"};

◆ m_gFEX2Tilemapping

Gaudi::Property<std::string> LVL1::gFexTower2SCellDecorator::m_gFEX2Tilemapping {this, "gFEX2Tilemapping", "L1CaloFEXByteStream/gFEX_maps/2023_02_23/gfexTileMap.txt", "Text file to convert from simulation ID to Tile Identifier"}
private

Definition at line 64 of file gFexTower2SCellDecorator.h.

64{this, "gFEX2Tilemapping", "L1CaloFEXByteStream/gFEX_maps/2023_02_23/gfexTileMap.txt", "Text file to convert from simulation ID to Tile Identifier"};

◆ m_gSCellEtadecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gSCellEtadecorKey { this, "gSCellEtadecorKey" , "L1_gFexDataTowers.SCellEta" , "SCell Eta information of the gTower"}
private

Definition at line 50 of file gFexTower2SCellDecorator.h.

50{ this, "gSCellEtadecorKey" , "L1_gFexDataTowers.SCellEta" , "SCell Eta information of the gTower"};

◆ m_gSCellEtdecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gSCellEtdecorKey { this, "gSCellEtdecorKey" , "L1_gFexDataTowers.SCellEt" , "SCell Et information of the gTower"}
private

Definition at line 49 of file gFexTower2SCellDecorator.h.

49{ this, "gSCellEtdecorKey" , "L1_gFexDataTowers.SCellEt" , "SCell Et information of the gTower"};

◆ m_gSCellIDdecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gSCellIDdecorKey { this, "gSCellIDdecorKey" , "L1_gFexDataTowers.SCellID" , "SCell IDs information of the gTower"}
private

Definition at line 52 of file gFexTower2SCellDecorator.h.

52{ this, "gSCellIDdecorKey" , "L1_gFexDataTowers.SCellID" , "SCell IDs information of the gTower"};

◆ m_gSCellPhidecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gSCellPhidecorKey { this, "gSCellPhidecorKey" , "L1_gFexDataTowers.SCellPhi" , "SCell Phi information of the gTower"}
private

Definition at line 51 of file gFexTower2SCellDecorator.h.

51{ this, "gSCellPhidecorKey" , "L1_gFexDataTowers.SCellPhi" , "SCell Phi information of the gTower"};

◆ m_gSCellSampledecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gSCellSampledecorKey { this, "gSCellSampledecorKey", "L1_gFexDataTowers.SCellSample" , "SCell Samples information of the gTower"}
private

Definition at line 53 of file gFexTower2SCellDecorator.h.

53{ this, "gSCellSampledecorKey", "L1_gFexDataTowers.SCellSample" , "SCell Samples information of the gTower"};

◆ m_gTileEtadecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gTileEtadecorKey { this, "gTileEtadecorKey" , "L1_gFexDataTowers.TileEta" , "Tile Tower Eta information in MeV"}
private

Definition at line 57 of file gFexTower2SCellDecorator.h.

57{ this, "gTileEtadecorKey" , "L1_gFexDataTowers.TileEta" , "Tile Tower Eta information in MeV"};

◆ m_gTileEtMeVdecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gTileEtMeVdecorKey { this, "gTileEtMeVdecorKey" , "L1_gFexDataTowers.TileEt" , "Tile Tower Et information in Encoded from jepET"}
private

Definition at line 56 of file gFexTower2SCellDecorator.h.

56{ this, "gTileEtMeVdecorKey" , "L1_gFexDataTowers.TileEt" , "Tile Tower Et information in Encoded from jepET"};

◆ m_gTileIDdecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gTileIDdecorKey { this, "gTileIDdecorKey" , "L1_gFexDataTowers.TileID" , "Tile Tower ID information"}
private

Definition at line 59 of file gFexTower2SCellDecorator.h.

59{ this, "gTileIDdecorKey" , "L1_gFexDataTowers.TileID" , "Tile Tower ID information"};

◆ m_gTilePhidecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gTilePhidecorKey { this, "gTilePhidecorKey" , "L1_gFexDataTowers.TilePhi" , "Tile Tower Phi information in MeV"}
private

Definition at line 58 of file gFexTower2SCellDecorator.h.

58{ this, "gTilePhidecorKey" , "L1_gFexDataTowers.TilePhi" , "Tile Tower Phi information in MeV"};

◆ m_gTowerEtdecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gTowerEtdecorKey { this, "gTowerEtdecorKey" , "L1_gFexDataTowers.SCSumEncoded" , "SCell sum Et. ENCODED!"}
private

Definition at line 55 of file gFexTower2SCellDecorator.h.

55{ this, "gTowerEtdecorKey" , "L1_gFexDataTowers.SCSumEncoded" , "SCell sum Et. ENCODED!"};

◆ m_gtowerEtMeVdecorKey

SG::WriteDecorHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTower2SCellDecorator::m_gtowerEtMeVdecorKey { this, "gtowerEtMeVdecorKey" , "L1_gFexDataTowers.gtowerEtMeV" , "gFex Tower Et information in MeV"}
private

Definition at line 54 of file gFexTower2SCellDecorator.h.

54{ this, "gtowerEtMeVdecorKey" , "L1_gFexDataTowers.gtowerEtMeV" , "gFex Tower Et information in MeV"};

◆ m_gTowersReadKey

SG::ReadHandleKey< xAOD::gFexTowerContainer > LVL1::gFexTower2SCellDecorator::m_gTowersReadKey {this,"gTowersReadKey" ,"L1_gFexDataTowers", "Read gFex EDM Trigger Tower container"}
private

Definition at line 46 of file gFexTower2SCellDecorator.h.

46{this,"gTowersReadKey" ,"L1_gFexDataTowers", "Read gFex EDM Trigger Tower container"};

◆ m_map_TTower2SCells

std::unordered_map< uint32_t, std::vector<uint64_t> > LVL1::gFexTower2SCellDecorator::m_map_TTower2SCells
private

Definition at line 70 of file gFexTower2SCellDecorator.h.

◆ m_map_TTower2Tile

std::unordered_map< uint32_t, std::vector<uint32_t> > LVL1::gFexTower2SCellDecorator::m_map_TTower2Tile
private

Definition at line 71 of file gFexTower2SCellDecorator.h.

◆ m_ReadKey_name

const std::string LVL1::gFexTower2SCellDecorator::m_ReadKey_name = "L1_gFexDataTowers"
private

Definition at line 43 of file gFexTower2SCellDecorator.h.

◆ m_SCellKey

SG::ReadHandleKey<CaloCellContainer> LVL1::gFexTower2SCellDecorator::m_SCellKey {this, "SCell", "SCell", "SCell container"}
private

Definition at line 38 of file gFexTower2SCellDecorator.h.

38{this, "SCell", "SCell", "SCell container"};

◆ m_triggerTowerKey

SG::ReadHandleKey<xAOD::TriggerTowerContainer> LVL1::gFexTower2SCellDecorator::m_triggerTowerKey {this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers container"}
private

Definition at line 41 of file gFexTower2SCellDecorator.h.

41{this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers container"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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