ATLAS Offline Software
jFexEmulatedTowers.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // jFexEmulatedTowers - description:
7 // This reentrant algorithm is meant to build the jFEX Towers from LAr and Tile containers
8 // -------------------
9 // begin : 01 11 2022
10 // email : sergi.rodriguez@cern.ch
11 //***************************************************************************/
12 
13 
14 #ifndef JFEXEMULATEDTOWERS_H
15 #define JFEXEMULATEDTOWERS_H
16 
18 #include "AsgTools/ToolHandle.h"
22 
25 
28 
29 
30 
31 namespace LVL1 {
32 
34  public:
35  jFexEmulatedTowers(const std::string& name, ISvcLocator* svc);
36 
38  virtual StatusCode initialize() override;
40  virtual StatusCode execute( const EventContext& ) const override;
41 
42  private:
43  // ------------------------- Properties --------------------------------------
44  //Readhandle for Scell container
45  SG::ReadHandleKey<CaloCellContainer> m_SCellKey {this, "SCell", "SCell", "SCell container"};
46 
47  //Readhandle for TriggerTower container
48  SG::ReadHandleKey<xAOD::TriggerTowerContainer> m_triggerTowerKey {this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers container"};
49 
50  //Writehhanlde for EmulatedTowers container
51  SG::WriteHandleKey < xAOD::jFexTowerContainer > m_jTowersWriteKey {this,"jTowersWriteKey" ,"L1_jFexEmulatedTowers", "Write jFexEDM Trigger Tower container"};
52 
53  // FiberMapping property required by the interface
54  Gaudi::Property<std::string> m_FiberMapping {this, "jFexTowerMapping", PathResolver::find_calib_file("L1CaloFEXByteStream/2023-08-01/jFexTowerMap.txt"), "Text file to convert from hardware fiber to eta-phi location"};
55 
56  //property for jFEX mapping
57  Gaudi::Property<bool> m_apply_masking {this, "SCellMasking", true, "Applies masking. Only use for data"};
58  Gaudi::Property<bool> m_isDATA {this, "isDATA" , true, "Tells the algorithm if it is data. Used for xAOD::TriggerTower WARNING due to the 0 supresion"};
59  Gaudi::Property<bool> m_doThinning {this, "DoThinning" , true, "Remove overlapped towers. Only FPGA Core region is saved"};
60 
61  //property for jFEX mapping
62  Gaudi::Property<std::string> m_jFEX2Scellmapping {this, "jFEX2SCmapping" , PathResolver::find_calib_file("L1CaloFEXByteStream/2022-10-19/jfex_SCID.txt") , "Text file to convert from simulation ID to SuperCell Identifier"};
63  Gaudi::Property<std::string> m_jFEX2Tilemapping {this, "jFEX2Tilemapping", PathResolver::find_calib_file("L1CaloFEXByteStream/2022-10-19/jfex_TileID.txt"), "Text file to convert from simulation ID to Tile Identifier"};
64 
65 
66  // Read mapping fucntions
67  StatusCode ReadFibersfromFile(const std::string& );
68  StatusCode ReadSCfromFile (const std::string& );
69  StatusCode ReadTilefromFile (const std::string& );
70  bool isBadSCellID(const std::string&) const;
71 
72  std::unordered_map< uint32_t, std::vector<uint64_t> > m_map_TTower2SCellsEM;
73  std::unordered_map< uint32_t, std::vector<uint64_t> > m_map_TTower2SCellsHAD;
74  std::unordered_map< uint32_t, std::tuple<uint32_t,float,float> > m_map_TTower2Tile;
75 
76  // hash the index into one integer in the format 0xJFCCT (hexadecimal)
77  constexpr static unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int channel, unsigned int tower);
78  std::unordered_map<unsigned int, std::array<float,6> > m_Firm2Tower_map;
79 
80 };
81 }
82 #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:384
LVL1::jFexEmulatedTowers::execute
virtual StatusCode execute(const EventContext &) const override
Function executing the algorithm.
Definition: jFexEmulatedTowers.cxx:53
jFexTowerContainer.h
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TriggerTowerContainer.h
LVL1::jFexEmulatedTowers::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition: jFexEmulatedTowers.cxx:31
LVL1::jFexEmulatedTowers::m_jFEX2Scellmapping
Gaudi::Property< std::string > m_jFEX2Scellmapping
Definition: jFexEmulatedTowers.h:62
LVL1::jFexEmulatedTowers::ReadTilefromFile
StatusCode ReadTilefromFile(const std::string &)
Definition: jFexEmulatedTowers.cxx:345
SG::ReadHandleKey< CaloCellContainer >
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::jFexEmulatedTowers::isBadSCellID
bool isBadSCellID(const std::string &) const
Definition: jFexEmulatedTowers.cxx:332
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
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
LVL1::jFexEmulatedTowers::jFexEmulatedTowers
jFexEmulatedTowers(const std::string &name, ISvcLocator *svc)
Definition: jFexEmulatedTowers.cxx:29
LVL1::jFexEmulatedTowers::m_Firm2Tower_map
std::unordered_map< unsigned int, std::array< float, 6 > > m_Firm2Tower_map
Definition: jFexEmulatedTowers.h:78
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
LVL1::jFexEmulatedTowers::m_jTowersWriteKey
SG::WriteHandleKey< xAOD::jFexTowerContainer > m_jTowersWriteKey
Definition: jFexEmulatedTowers.h:51
TrigConf::name
Definition: HLTChainList.h:35
LVL1::jFexEmulatedTowers
Definition: jFexEmulatedTowers.h:33
LVL1::jFexEmulatedTowers::m_map_TTower2SCellsHAD
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCellsHAD
Definition: jFexEmulatedTowers.h:73
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
PathResolver.h
LVL1::jFexEmulatedTowers::m_map_TTower2SCellsEM
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCellsEM
Definition: jFexEmulatedTowers.h:72
LVL1::jFexEmulatedTowers::m_triggerTowerKey
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
Definition: jFexEmulatedTowers.h:48
CaloCellContainer.h
LVL1::jFexEmulatedTowers::m_SCellKey
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
Definition: jFexEmulatedTowers.h:45
LVL1::jFexEmulatedTowers::m_jFEX2Tilemapping
Gaudi::Property< std::string > m_jFEX2Tilemapping
Definition: jFexEmulatedTowers.h:63
LVL1::jFexEmulatedTowers::ReadSCfromFile
StatusCode ReadSCfromFile(const std::string &)
Definition: jFexEmulatedTowers.cxx:268
jFexTowerAuxContainer.h
LVL1::jFexEmulatedTowers::m_apply_masking
Gaudi::Property< bool > m_apply_masking
Definition: jFexEmulatedTowers.h:57
LVL1::jFexEmulatedTowers::m_isDATA
Gaudi::Property< bool > m_isDATA
Definition: jFexEmulatedTowers.h:58
LVL1::jFexEmulatedTowers::ReadFibersfromFile
StatusCode ReadFibersfromFile(const std::string &)
Definition: jFexEmulatedTowers.cxx:214
ToolHandle.h
LVL1::jFexEmulatedTowers::m_map_TTower2Tile
std::unordered_map< uint32_t, std::tuple< uint32_t, float, float > > m_map_TTower2Tile
Definition: jFexEmulatedTowers.h:74
LVL1::jFexEmulatedTowers::m_FiberMapping
Gaudi::Property< std::string > m_FiberMapping
Definition: jFexEmulatedTowers.h:54
LVL1::jFexEmulatedTowers::m_doThinning
Gaudi::Property< bool > m_doThinning
Definition: jFexEmulatedTowers.h:59
LVL1::jFexEmulatedTowers::mapIndex
constexpr static unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int channel, unsigned int tower)
Definition: jFexEmulatedTowers.cxx:263