ATLAS Offline Software
jFexTower2SCellDecorator.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 // jFexTower2SCellDecorator - description:
7 // This reentrant algorithm is meant to decorate the FEX Towers (input data and simulation) with the corresponding matching set of SuperCell from LAr
8 // -------------------
9 // begin : 01 09 2022
10 // email : sergi.rodriguez@cern.ch
11 //***************************************************************************/
12 // EXAMPLE https://gitlab.cern.ch/atlas/athena/-/blob/release/22.0.91/Trigger/TrigAlgorithms/TrigLongLivedParticles/src/MuonCluster.h
13 
14 #ifndef L1CALO2SCELLDECORATORTOOL_H
15 #define L1CALO2SCELLDECORATORTOOL_H
16 
18 #include "AsgTools/ToolHandle.h"
22 
25 
28 
29 
30 
31 namespace LVL1 {
32 
34  public:
35  jFexTower2SCellDecorator(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  //Readhandle for Scell container
51  SG::ReadHandleKey < xAOD::jFexTowerContainer > m_jTowersReadKey {this,"jTowersReadKey" ,"L1_jFexDataTowers", "Read jFexEDM Trigger Tower container"};
52 
53  //WriteDecorHandle
54  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_SCellEtdecorKey { this, "SCellEtdecorKey" , m_jTowersReadKey, "SCellEt" , "SCell Et information of the jTower in MEV"};
55  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_SCellEtadecorKey { this, "SCellEtadecorKey" , m_jTowersReadKey, "SCellEta" , "SCell Eta information of the jTower"};
56  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_SCellPhidecorKey { this, "SCellPhidecorKey" , m_jTowersReadKey, "SCellPhi" , "SCell Phi information of the jTower"};
57  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_SCellIDdecorKey { this, "SCellIDdecorKey" , m_jTowersReadKey, "SCellID" , "SCell IDs information of the jTower"};
58  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_SCellMaskdecorKey { this, "SCellMaskdecorKey" , m_jTowersReadKey, "SCellMask" , "SCell masking information of the jTower"};
59  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_TileEtdecorKey { this, "TileEtdecorKey" , m_jTowersReadKey, "TileEt" , "Tile Tower Et information in Encoded from cpET"};
60  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_TileEtadecorKey { this, "TileEtadecorKey" , m_jTowersReadKey, "TileEta" , "Tile Tower Eta information of the jTower"};
61  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_TilePhidecorKey { this, "TilePhidecorKey" , m_jTowersReadKey, "TilePhi" , "Tile Tower Phi information of the jTower"};
62 
63  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_jtowerEtMeVdecorKey{ this, "jtowerEtMeVdecorKey", m_jTowersReadKey, "jtowerEtMeV" , "jFex Tower Et information in MeV"};
64  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_SCellEtMeVdecorKey { this, "SCellEtMeVdecorKey" , m_jTowersReadKey, "SCellEtMeV" , "SCell Et sum information in MeV"};
65  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_TileEtMeVdecorKey { this, "TileEtMeVdecorKey" , m_jTowersReadKey, "TileEtMeV" , "Tile Et information in MeV"};
66  SG::WriteDecorHandleKey<xAOD::jFexTowerContainer> m_jTowerEtdecorKey { this, "jTowerEtdecorKey" , m_jTowersReadKey, "emulated_jtowerEt" , "jFex Tower Et information. ENCODED!"};
67 
68 
69  //property for Masking
70  Gaudi::Property<bool> m_apply_masking {this, "SCellMasking", true , "Applies masking. Only use for data"};
71  Gaudi::Property<bool> m_save_extras {this, "ExtraInfo" , false, "Saves additional decorated information "};
72 
73  //property for jFEX mapping
74  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"};
75  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"};
76 
77  StatusCode ReadSCfromFile(const std::string& );
78  StatusCode ReadTilefromFile(const std::string& );
79  bool isBadSCellID(const std::string&) const;
80 
81  bool m_save_emulated_var = true;
82 
83  std::unordered_map< uint32_t, std::vector<uint64_t> > m_map_TTower2SCellsEM;
84  std::unordered_map< uint32_t, std::vector<uint64_t> > m_map_TTower2SCellsHAD;
85  std::unordered_map< uint32_t, std::tuple<uint32_t,float,float> > m_map_TTower2Tile;
86 
87 };
88 }
89 #endif
LVL1::jFexTower2SCellDecorator::m_SCellKey
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
Definition: jFexTower2SCellDecorator.h:45
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:384
jFexTowerContainer.h
LVL1::jFexTower2SCellDecorator::m_jFEX2Scellmapping
Gaudi::Property< std::string > m_jFEX2Scellmapping
Definition: jFexTower2SCellDecorator.h:74
LVL1::jFexTower2SCellDecorator::m_SCellMaskdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_SCellMaskdecorKey
Definition: jFexTower2SCellDecorator.h:58
LVL1::jFexTower2SCellDecorator::m_map_TTower2SCellsEM
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCellsEM
Definition: jFexTower2SCellDecorator.h:83
LVL1::jFexTower2SCellDecorator::isBadSCellID
bool isBadSCellID(const std::string &) const
Definition: jFexTower2SCellDecorator.cxx:367
TriggerTowerContainer.h
LVL1::jFexTower2SCellDecorator::m_TileEtadecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_TileEtadecorKey
Definition: jFexTower2SCellDecorator.h:60
LVL1::jFexTower2SCellDecorator::m_jTowersReadKey
SG::ReadHandleKey< xAOD::jFexTowerContainer > m_jTowersReadKey
Definition: jFexTower2SCellDecorator.h:51
SG::ReadHandleKey< CaloCellContainer >
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::jFexTower2SCellDecorator::m_save_extras
Gaudi::Property< bool > m_save_extras
Definition: jFexTower2SCellDecorator.h:71
LVL1::jFexTower2SCellDecorator::m_map_TTower2Tile
std::unordered_map< uint32_t, std::tuple< uint32_t, float, float > > m_map_TTower2Tile
Definition: jFexTower2SCellDecorator.h:85
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
LVL1::jFexTower2SCellDecorator::jFexTower2SCellDecorator
jFexTower2SCellDecorator(const std::string &name, ISvcLocator *svc)
Definition: jFexTower2SCellDecorator.cxx:47
LVL1::jFexTower2SCellDecorator::m_save_emulated_var
bool m_save_emulated_var
Definition: jFexTower2SCellDecorator.h:81
LVL1::jFexTower2SCellDecorator::m_TileEtdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_TileEtdecorKey
Definition: jFexTower2SCellDecorator.h:59
LVL1::jFexTower2SCellDecorator::m_TileEtMeVdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_TileEtMeVdecorKey
Definition: jFexTower2SCellDecorator.h:65
LVL1::jFexTower2SCellDecorator::m_SCellEtMeVdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_SCellEtMeVdecorKey
Definition: jFexTower2SCellDecorator.h:64
LVL1::jFexTower2SCellDecorator::execute
virtual StatusCode execute(const EventContext &) const override
Function executing the algorithm.
Definition: jFexTower2SCellDecorator.cxx:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
WriteDecorHandle.h
Handle class for adding a decoration to an object.
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
LVL1::jFexTower2SCellDecorator::m_SCellEtdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_SCellEtdecorKey
Definition: jFexTower2SCellDecorator.h:54
LVL1::jFexTower2SCellDecorator::ReadSCfromFile
StatusCode ReadSCfromFile(const std::string &)
Definition: jFexTower2SCellDecorator.cxx:304
TrigConf::name
Definition: HLTChainList.h:35
AthReentrantAlgorithm.h
PathResolver.h
LVL1::jFexTower2SCellDecorator::m_apply_masking
Gaudi::Property< bool > m_apply_masking
Definition: jFexTower2SCellDecorator.h:70
CaloCellContainer.h
LVL1::jFexTower2SCellDecorator::m_map_TTower2SCellsHAD
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCellsHAD
Definition: jFexTower2SCellDecorator.h:84
LVL1::jFexTower2SCellDecorator::m_SCellPhidecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_SCellPhidecorKey
Definition: jFexTower2SCellDecorator.h:56
LVL1::jFexTower2SCellDecorator::ReadTilefromFile
StatusCode ReadTilefromFile(const std::string &)
Definition: jFexTower2SCellDecorator.cxx:380
LVL1::jFexTower2SCellDecorator::m_jtowerEtMeVdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_jtowerEtMeVdecorKey
Definition: jFexTower2SCellDecorator.h:63
jFexTowerAuxContainer.h
LVL1::jFexTower2SCellDecorator::m_TilePhidecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_TilePhidecorKey
Definition: jFexTower2SCellDecorator.h:61
LVL1::jFexTower2SCellDecorator::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition: jFexTower2SCellDecorator.cxx:49
LVL1::jFexTower2SCellDecorator::m_SCellEtadecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_SCellEtadecorKey
Definition: jFexTower2SCellDecorator.h:55
ToolHandle.h
LVL1::jFexTower2SCellDecorator::m_triggerTowerKey
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
Definition: jFexTower2SCellDecorator.h:48
LVL1::jFexTower2SCellDecorator
Definition: jFexTower2SCellDecorator.h:33
LVL1::jFexTower2SCellDecorator::m_jFEX2Tilemapping
Gaudi::Property< std::string > m_jFEX2Tilemapping
Definition: jFexTower2SCellDecorator.h:75
LVL1::jFexTower2SCellDecorator::m_SCellIDdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_SCellIDdecorKey
Definition: jFexTower2SCellDecorator.h:57
LVL1::jFexTower2SCellDecorator::m_jTowerEtdecorKey
SG::WriteDecorHandleKey< xAOD::jFexTowerContainer > m_jTowerEtdecorKey
Definition: jFexTower2SCellDecorator.h:66