 |
ATLAS Offline Software
|
#include <gFexTowerBuilder.h>
|
| gFexTowerBuilder (const std::string &name, ISvcLocator *svc) |
|
virtual StatusCode | initialize () override |
| Function initialising the algorithm. More...
|
|
virtual StatusCode | execute (const EventContext &) const override |
| Function executing the algorithm. More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
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 . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | ReadFibersfromFile (const std::string &) |
|
StatusCode | ReadTilefromFile (const std::string &) |
|
StatusCode | ReadSCfromFile (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> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 32 of file gFexTowerBuilder.h.
◆ StoreGateSvc_t
◆ gFexTowerBuilder()
LVL1::gFexTowerBuilder::gFexTowerBuilder |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svc |
|
) |
| |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LVL1::gFexTowerBuilder::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Function executing the algorithm.
Definition at line 57 of file gFexTowerBuilder.cxx.
61 if (!ScellContainer.isValid()) {
62 ATH_MSG_ERROR(
"Could not retrieve collection " << ScellContainer.key());
63 return StatusCode::FAILURE;
69 if (!triggerTowerContainer.isValid()) {
71 << triggerTowerContainer.key());
72 return StatusCode::FAILURE;
77 ATH_CHECK( gTowersContainer.record(std::make_unique<xAOD::gFexTowerContainer>(),
78 std::make_unique<xAOD::gFexTowerAuxContainer>()) );
79 ATH_MSG_DEBUG(
"Recorded gFexEmulatedTower container with key " << gTowersContainer.key());
81 if (ScellContainer->empty() || triggerTowerContainer->empty()) {
83 "Cannot fill gTowers here, at least one container is empty. "
84 "ScellContainer.size="
85 << ScellContainer->size()
86 <<
" or triggerTowerContainer.size=" << triggerTowerContainer->size());
87 return StatusCode::SUCCESS;
91 std::unordered_map<uint64_t, const CaloCell*> map_ScellID2ptr;
93 for (
const CaloCell* scell : *ScellContainer) {
95 map_ScellID2ptr[
ID] = scell;
99 std::unordered_map<uint32_t, const xAOD::TriggerTower*> map_TileID2ptr;
102 map_TileID2ptr[tower->coolId()] = tower;
105 unsigned int towerID =
key;
114 const std::unordered_map<uint32_t, std::vector<uint64_t> >*
119 auto it_TTower2SCells = (*ptr_TTower2Cells).find(towerID);
120 if (it_TTower2SCells == (*ptr_TTower2Cells).end()) {
122 <<
" not found on map m_map_TTower2SCells");
123 return StatusCode::FAILURE;
132 bool isConnected =
true;
133 for (
const auto& scellID : it_TTower2SCells->second) {
135 auto it_ScellID2ptr = map_ScellID2ptr.find(scellID);
138 if (scellID == 0xffffffffffffffff) {
144 std::string str_hex =
std::format(
"{:x}", scellID);
146 if (it_ScellID2ptr == map_ScellID2ptr.end()) {
150 <<
" not found in the CaloCellContainer, skipping");
154 const CaloCell* scell = it_ScellID2ptr->second;
157 (12.5 * std::cosh(scell->
eta())));
166 invalid &= isInvalid;
169 gTower_sat |= isSaturated;
185 total_et_encoded = 0;
187 total_et_encoded = 0;
189 total_et_encoded = 4095;
202 for (
auto const& TileTowerID : it_TTower2Tile->second) {
203 auto it_TileID2ptr = map_TileID2ptr.find(TileTowerID);
204 if (it_TileID2ptr == map_TileID2ptr.end()) {
207 <<
" not found in the xAOD::TriggerTower (map_TileID2ptr)");
212 unsigned int jepEt = tileTower->
jepET();
216 total_et_encoded = Tile_Et;
220 total_et_encoded = 0;
224 float total_et_encoded_flt = total_et_encoded;
226 unsigned int fpga_out = (towerID < 10000) ? 0 : (towerID < 20000) ? 1 : 2;
227 unsigned int iEta = 0;
228 unsigned int iPhi = 0;
230 gTowersContainer->push_back(std::make_unique<xAOD::gFexTower>());
232 total_et_encoded_flt, fpga_out,
233 gTower_sat, towerID);
236 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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()
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.
◆ filterPassed()
◆ initialize()
StatusCode LVL1::gFexTowerBuilder::initialize |
( |
| ) |
|
|
overridevirtual |
Function initialising the algorithm.
Definition at line 35 of file gFexTowerBuilder.cxx.
38 "Initializing L1CaloFEXAlgos/gFexEmulatedTowers algorithm with name: "
54 return StatusCode::SUCCESS;
◆ inputHandles()
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::gFexTowerBuilder::isBadSCellID |
( |
const std::string & |
ID | ) |
const |
|
private |
Definition at line 340 of file gFexTowerBuilder.cxx.
343 if (
ID.find(
"0x") == std::string::npos) {
346 <<
". Expecting hexadecimal number on the mapping file");
◆ isClonable()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ ReadFibersfromFile()
StatusCode LVL1::gFexTowerBuilder::ReadFibersfromFile |
( |
const std::string & |
fileName | ) |
|
|
private |
Definition at line 239 of file gFexTowerBuilder.cxx.
243 if (!
file.is_open()) {
245 return StatusCode::FAILURE;
251 if (
line[0] ==
'#')
continue;
254 std::stringstream oneLine(
line);
256 std::vector<float> elements;
258 while (std::getline(oneLine, element,
' ')) {
259 elements.push_back(std::stof(element));
265 if (elements.size() != 5) {
267 "Unexpected number of elements (5 expected) in file: " <<
fileName);
268 return StatusCode::FAILURE;
272 std::array<float, 4> aux_arr{{elements.at(1), elements.at(3),
273 elements.at(4), elements.at(2)}};
281 return StatusCode::SUCCESS;
◆ ReadSCfromFile()
StatusCode LVL1::gFexTowerBuilder::ReadSCfromFile |
( |
const std::string & |
fileName | ) |
|
|
private |
Definition at line 284 of file gFexTowerBuilder.cxx.
289 if (!
file.is_open()) {
291 return StatusCode::FAILURE;
298 std::vector<uint64_t> SCellvector;
306 std::stringstream oneSCellID(
line);
309 std::string substr =
"";
313 while (std::getline(oneSCellID, substr,
' ')) {
316 TTID = std::stoi(substr);
320 return StatusCode::FAILURE;
326 std::string scell_full =
327 (substr ==
"0xffffffffffffffff") ? substr : substr +
"00000000";
328 uint64_t scid_uint64 = std::strtoull(scell_full.c_str(),
nullptr, 0);
329 SCellvector.push_back(scid_uint64);
337 return StatusCode::SUCCESS;
◆ ReadTilefromFile()
StatusCode LVL1::gFexTowerBuilder::ReadTilefromFile |
( |
const std::string & |
fileName | ) |
|
|
private |
Definition at line 352 of file gFexTowerBuilder.cxx.
359 if (!myfile.is_open()) {
361 return StatusCode::FAILURE;
366 while (std::getline(myfile, myline)) {
368 std::vector<uint32_t> Tilevector;
371 myline.erase(myline.begin(),
372 std::find_if(myline.begin(), myline.end(),
373 [](
int ch) { return !std::isspace(ch); }));
374 if (myline[0] ==
'#')
378 std::stringstream oneTileID(myline);
381 std::string substr =
"";
385 while (std::getline(oneTileID, substr,
' ')) {
388 gTowerID = std::stoi(substr);
390 uint32_t tileid_uint32 = std::strtoul(substr.c_str(),
nullptr, 0);
391 Tilevector.push_back(tileid_uint32);
398 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
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.
◆ sysInitialize()
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 InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_apply_masking
Gaudi::Property<bool> LVL1::gFexTowerBuilder::m_apply_masking |
|
private |
Initial value:{this, "SCellMasking", true,
"Applies masking. Only use for data"}
Definition at line 65 of file gFexTowerBuilder.h.
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
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_FiberMapping
Gaudi::Property<std::string> LVL1::gFexTowerBuilder::m_FiberMapping |
|
private |
Initial value:{
this, "gFexFiberTowerMapping",
"Text file to convert from hardware fiber to eta-phi location"}
Definition at line 58 of file gFexTowerBuilder.h.
◆ m_Firm2Tower_map
std::unordered_map<unsigned int, std::array<float, 4> > LVL1::gFexTowerBuilder::m_Firm2Tower_map |
|
private |
◆ m_gFEX2Scellmapping
Gaudi::Property<std::string> LVL1::gFexTowerBuilder::m_gFEX2Scellmapping |
|
private |
Initial value:{
this, "gFEX2SCmapping",
"Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_scells_v1.txt",
"Text file to convert from simulation ID to SuperCell Identifier"}
Definition at line 72 of file gFexTowerBuilder.h.
◆ m_gFEX2Tilemapping
Gaudi::Property<std::string> LVL1::gFexTowerBuilder::m_gFEX2Tilemapping |
|
private |
Initial value:{
this, "gFEX2Tilemapping",
"Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_tile_v1.txt",
"Text file to convert from simulation ID to Tile Identifier"}
Definition at line 77 of file gFexTowerBuilder.h.
◆ m_gTowersWriteKey
Initial value:{
this, "gTowersWriteKey", "L1_gFexDataTowers",
"Write gFexEDM Trigger Tower container"}
Definition at line 53 of file gFexTowerBuilder.h.
◆ m_isDATA
Gaudi::Property<bool> LVL1::gFexTowerBuilder::m_isDATA |
|
private |
Initial value:{
this, "isDATA", true,
"Tells the algorithm if it is data. Used for xAOD::TriggerTower WARNING "
"due to the 0 supression"}
Definition at line 67 of file gFexTowerBuilder.h.
◆ m_map_TTower2SCells
std::unordered_map<uint32_t, std::vector<uint64_t> > LVL1::gFexTowerBuilder::m_map_TTower2SCells |
|
private |
◆ m_map_TTower2Tile
std::unordered_map<uint32_t, std::vector<uint32_t> > LVL1::gFexTowerBuilder::m_map_TTower2Tile |
|
private |
◆ m_SCellKey
Initial value:{this, "SCell", "SCell",
"SCell container"}
Definition at line 44 of file gFexTowerBuilder.h.
◆ m_triggerTowerKey
Initial value:{
this, "xODTriggerTowers", "xAODTriggerTowers",
"xAODTriggerTowers container"}
Definition at line 48 of file gFexTowerBuilder.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
static std::string find_calib_file(const std::string &logical_file_name)
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersWriteKey
Scalar phi() const
phi method
std::vector< Identifier > ID
Scalar eta() const
pseudorapidity method
static unsigned int compress(float Energy)
Compress data.
StatusCode ReadTilefromFile(const std::string &)
std::unordered_map< unsigned int, std::array< float, 4 > > m_Firm2Tower_map
float round(const float toRound, const unsigned int decimals)
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)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Gaudi::Property< std::string > m_gFEX2Tilemapping
std::unordered_map< uint32_t, std::vector< uint32_t > > m_map_TTower2Tile
virtual void setOwner(IDataHandleHolder *o)=0
double energy() const
get energy (data member)
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
Gaudi::Property< bool > m_isDATA
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Description of TriggerTower_v2.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
AthROOTErrorHandlerSvc * svc
uint16_t quality() const
get quality (data member)
StatusCode ReadSCfromFile(const std::string &)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StatusCode ReadFibersfromFile(const std::string &)
Gaudi::Property< std::string > m_FiberMapping
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCells
bool isBadSCellID(const std::string &) const
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
Gaudi::Property< bool > m_apply_masking
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
Gaudi::Property< std::string > m_gFEX2Scellmapping
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
setScale setgFexType iEta
uint8_t jepET() const
get jepET from peak of lut_jep
virtual double eta() const override final
get eta (through CaloDetDescrElement)