ATLAS Offline Software
gFexTowerBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // gFexTowerBuilder - description
7 // -------------------
8 // Builds a gFexTowerContainer from CaloCellContainer (for supercells)
9 // TriggerTowerContainer (for ppm tile towers)
10 // Information about SCellContainer objects are in:
11 // - https://gitlab.cern.ch/atlas/athena/-/blob/22.0/Calorimeter/CaloEvent/CaloEvent/CaloCell.h
12 //
13 // begin : 22 04 2025
14 // email : jared.little@cern.ch
15 //***************************************************************************/
16 
17 #ifndef gFexTowerBuilder_H
18 #define gFexTowerBuilder_H
19 
20 #include "AsgTools/ToolHandle.h"
29 
30 namespace LVL1 {
31 
33  public:
34  gFexTowerBuilder(const std::string& name, ISvcLocator* svc);
35 
37  virtual StatusCode initialize() override;
39  virtual StatusCode execute(const EventContext&) const override;
40 
41  private:
42  // ------------------------- Properties --------------------------------------
43  // Readhandle for Scell container
45  "SCell container"};
46 
47  // Readhandle for TriggerTower container
49  this, "xODTriggerTowers", "xAODTriggerTowers",
50  "xAODTriggerTowers container"};
51 
52  // Writehandle for EmulatedTowers container
54  this, "gTowersWriteKey", "L1_gFexDataTowers",
55  "Write gFexEDM Trigger Tower container"};
56 
57  // FiberMapping property required by the interface
58  Gaudi::Property<std::string> m_FiberMapping{
59  this, "gFexFiberTowerMapping",
60  // PathResolver::find_calib_file("L1CaloFEXAlgos/gFexFibrTowerMap.txt"),
61  PathResolver::find_calib_file("Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gFex_gCaloTowerMap_weighted_v1.txt"),
62  "Text file to convert from hardware fiber to eta-phi location"};
63 
64  // property for gFEX mapping
65  Gaudi::Property<bool> m_apply_masking{this, "SCellMasking", true,
66  "Applies masking. Only use for data"};
67  Gaudi::Property<bool> m_isDATA{
68  this, "isDATA", true,
69  "Tells the algorithm if it is data. Used for xAOD::TriggerTower WARNING "
70  "due to the 0 supression"};
71 
72  Gaudi::Property<std::string> m_gFEX2Scellmapping{
73  this, "gFEX2SCmapping",
74  "Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_scells_v1.txt",
75  "Text file to convert from simulation ID to SuperCell Identifier"};
76 
77  Gaudi::Property<std::string> m_gFEX2Tilemapping{
78  this, "gFEX2Tilemapping",
79  "Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_tile_v1.txt",
80  "Text file to convert from simulation ID to Tile Identifier"};
81 
82 
83  // Read mapping functions
84  StatusCode ReadFibersfromFile(const std::string&);
85  StatusCode ReadTilefromFile(const std::string&);
86  StatusCode ReadSCfromFile(const std::string&);
87 
88  bool isBadSCellID(const std::string&) const;
89 
90  std::unordered_map<uint32_t, std::vector<uint64_t> > m_map_TTower2SCells;
91  std::unordered_map<uint32_t, std::vector<uint32_t> > m_map_TTower2Tile;
92 
93  std::unordered_map<unsigned int, std::array<float, 4> > m_Firm2Tower_map;
94 
95  };
96 } // namespace LVL1
97 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:235
gFexTowerContainer.h
LVL1::gFexTowerBuilder::m_gTowersWriteKey
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersWriteKey
Definition: gFexTowerBuilder.h:53
LVL1::gFexTowerBuilder::ReadTilefromFile
StatusCode ReadTilefromFile(const std::string &)
Definition: gFexTowerBuilder.cxx:352
LVL1::gFexTowerBuilder::m_Firm2Tower_map
std::unordered_map< unsigned int, std::array< float, 4 > > m_Firm2Tower_map
Definition: gFexTowerBuilder.h:93
TriggerTowerContainer.h
LVL1::gFexTowerBuilder::m_gFEX2Tilemapping
Gaudi::Property< std::string > m_gFEX2Tilemapping
Definition: gFexTowerBuilder.h:77
SG::ReadHandleKey< CaloCellContainer >
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::gFexTowerBuilder::m_map_TTower2Tile
std::unordered_map< uint32_t, std::vector< uint32_t > > m_map_TTower2Tile
Definition: gFexTowerBuilder.h:91
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
LVL1::gFexTowerBuilder::m_triggerTowerKey
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
Definition: gFexTowerBuilder.h:48
LVL1::gFexTowerBuilder::m_isDATA
Gaudi::Property< bool > m_isDATA
Definition: gFexTowerBuilder.h:67
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
TrigConf::name
Definition: HLTChainList.h:35
LVL1::gFexTowerBuilder::ReadSCfromFile
StatusCode ReadSCfromFile(const std::string &)
Definition: gFexTowerBuilder.cxx:284
AthReentrantAlgorithm.h
LVL1::gFexTowerBuilder::ReadFibersfromFile
StatusCode ReadFibersfromFile(const std::string &)
Definition: gFexTowerBuilder.cxx:239
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
LVL1::gFexTowerBuilder::m_FiberMapping
Gaudi::Property< std::string > m_FiberMapping
Definition: gFexTowerBuilder.h:58
PathResolver.h
gFexTowerAuxContainer.h
LVL1::gFexTowerBuilder::m_map_TTower2SCells
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCells
Definition: gFexTowerBuilder.h:90
LVL1::gFexTowerBuilder::gFexTowerBuilder
gFexTowerBuilder(const std::string &name, ISvcLocator *svc)
Definition: gFexTowerBuilder.cxx:32
CaloCellContainer.h
LVL1::gFexTowerBuilder::isBadSCellID
bool isBadSCellID(const std::string &) const
Definition: gFexTowerBuilder.cxx:340
LVL1::gFexTowerBuilder::execute
virtual StatusCode execute(const EventContext &) const override
Function executing the algorithm.
Definition: gFexTowerBuilder.cxx:57
LVL1::gFexTowerBuilder::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition: gFexTowerBuilder.cxx:35
LVL1::gFexTowerBuilder::m_SCellKey
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
Definition: gFexTowerBuilder.h:44
LVL1::gFexTowerBuilder::m_apply_masking
Gaudi::Property< bool > m_apply_masking
Definition: gFexTowerBuilder.h:65
LVL1::gFexTowerBuilder
Definition: gFexTowerBuilder.h:32
LVL1::gFexTowerBuilder::m_gFEX2Scellmapping
Gaudi::Property< std::string > m_gFEX2Scellmapping
Definition: gFexTowerBuilder.h:72
ToolHandle.h