ATLAS Offline Software
Loading...
Searching...
No Matches
jFexEmulatedTowers.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// 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"
24
27
31
34
35namespace LVL1 {
36
38 public:
39 jFexEmulatedTowers(const std::string& name, ISvcLocator* svc);
40
42 virtual StatusCode initialize() override;
44 virtual StatusCode execute( const EventContext& ) const override;
45
46 private:
47 // ------------------------- Properties --------------------------------------
48 //Readhandle for Scell container
49 SG::ReadHandleKey<CaloCellContainer> m_SCellKey {this, "SCell", "SCell", "SCell container"};
50
51 //Readhandle for TriggerTower container
52 SG::ReadHandleKey<xAOD::TriggerTowerContainer> m_triggerTowerKey {this, "xODTriggerTowers", "xAODTriggerTowers", "xAODTriggerTowers container"};
53
54 //Writehandle for EmulatedTowers container
55 SG::WriteHandleKey < xAOD::jFexTowerContainer > m_jTowersWriteKey {this,"jTowersWriteKey" ,"L1_jFexEmulatedTowers", "Write jFexEDM Trigger Tower container"};
56
57 // FiberMapping property required by the interface
58 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"};
59
60 //property for jFEX mapping
61 Gaudi::Property<bool> m_apply_masking {this, "SCellMasking", true, "Applies masking. Only use for data"};
62 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"};
63 Gaudi::Property<bool> m_doThinning {this, "DoThinning" , true, "Remove overlapped towers. Only FPGA Core region is saved"};
64
65 //property for jFEX mapping
66 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"};
67 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"};
68
69
70 // Read mapping fucntions
71 StatusCode ReadFibersfromFile(const std::string& );
72 StatusCode ReadSCfromFile (const std::string& );
73 StatusCode ReadTilefromFile (const std::string& );
74 bool isBadSCellID(const std::string&) const;
75
76 std::unordered_map< uint32_t, std::vector<uint64_t> > m_map_TTower2SCellsEM;
77 std::unordered_map< uint32_t, std::vector<uint64_t> > m_map_TTower2SCellsHAD;
78 std::unordered_map< uint32_t, std::tuple<uint32_t,float,float> > m_map_TTower2Tile;
79
80 // hash the index into one integer in the format 0xJFCCT (hexadecimal)
81 constexpr static unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int channel, unsigned int tower);
82 std::unordered_map<unsigned int, std::array<float,6> > m_Firm2Tower_map;
83
84 // Code below concerns decorating the towers with offline energy sum
85 // ReadHandle for offline cells
86 SG::ReadHandleKey<CaloCellContainer> m_CaloCellKey {this, "CaloCell", "", "Calo Cell container, supply AllCalo to activate"};
87 // SCell to offline LAr cell mapping tool
88 ToolHandle<ICaloSuperCellIDTool> m_scellIdTool{this, "CaloSuperCellIDTool", "", "Offline / SuperCell ID mapping tool"};
89 // and for finding the Cell
91
92 // read the offline energy decoration from the xAODTriggerTowers for the Tile
93 SG::ReadDecorHandleKey<xAOD::TriggerTowerContainer> m_readTileOfflineDecorKey { this, "TileOfflineETKey", m_triggerTowerKey, "", "decoration of offline energy from Tile Towers" };
94
95 // decoration write handles
96 SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_caloCellSumETdecorKey {this, "CaloCellSumEtdecorKey", m_jTowersWriteKey, "", "Offline Calo Cell Et information of the jTower in MeV"};
97 SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_jtowerEtMeVdecorKey{ this, "jtowerEtMeVdecorKey", m_jTowersWriteKey, "jtowerEtMeV", "jFex Tower Et in MeV"};
98 SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_jtowerEtTimingMeVdecorKey{ this, "jtowerEtTimingMeVdecorKey", m_jTowersWriteKey, "jtowerEtTimingMeV", "jFex Tower Et, after timing cut, in MeV"};
99
100
101};
102}
103#endif
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
Gaudi::Property< bool > m_isDATA
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_caloCellSumETdecorKey
SG::ReadHandleKey< CaloCellContainer > m_CaloCellKey
{map index, {IDsimulation,eta,phi,source,iEta,iPhi}}
jFexEmulatedTowers(const std::string &name, ISvcLocator *svc)
static constexpr unsigned int mapIndex(unsigned int jfex, unsigned int fpga, unsigned int channel, unsigned int tower)
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
SG::ReadDecorHandleKey< xAOD::TriggerTowerContainer > m_readTileOfflineDecorKey
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCellsEM
std::unordered_map< unsigned int, std::array< float, 6 > > m_Firm2Tower_map
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_jtowerEtMeVdecorKey
const CaloCell_ID * m_caloCellIdHelper
Gaudi::Property< std::string > m_jFEX2Scellmapping
SG::WriteHandleKey< xAOD::jFexTowerContainer > m_jTowersWriteKey
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCellsHAD
StatusCode ReadSCfromFile(const std::string &)
virtual StatusCode execute(const EventContext &) const override
Function executing the algorithm.
Gaudi::Property< bool > m_apply_masking
virtual StatusCode initialize() override
Function initialising the algorithm.
StatusCode ReadFibersfromFile(const std::string &)
Gaudi::Property< std::string > m_FiberMapping
Gaudi::Property< std::string > m_jFEX2Tilemapping
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_jtowerEtTimingMeVdecorKey
ToolHandle< ICaloSuperCellIDTool > m_scellIdTool
bool isBadSCellID(const std::string &) const
Gaudi::Property< bool > m_doThinning
std::unordered_map< uint32_t, std::tuple< uint32_t, float, float > > m_map_TTower2Tile
StatusCode ReadTilefromFile(const std::string &)
static std::string find_calib_file(const std::string &logical_file_name)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...