ATLAS Offline Software
Loading...
Searching...
No Matches
eFexTOBSuperCellDecorator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5//***************************************************************************
6// eFexTOBSuperCellDecorator - description
7// -------------------
8// This algorithm decorates the eFEX TOBs with the SuperCells Energies - suitable info for ML
9//
10// begin : 26 09 2023
11// email : panagiotis.bellos@cern.ch
12//***************************************************************************/
15
16namespace LVL1 {
17
18 eFexTOBSuperCellDecorator::eFexTOBSuperCellDecorator(const std::string& name, ISvcLocator* svc) : AthAlgorithm(name, svc){}
19
21 ATH_MSG_INFO( "L1CaloFEXTools/eFexTOBSuperCellDecorator::initialize()");
22
23 // initialise read and decorator write handles
24 ATH_CHECK( m_eFEXegEDMContainerKey.initialize() );
25 ATH_CHECK( m_eFEXtauEDMContainerKey.initialize() );
26
27 ATH_CHECK( m_SCEtVec_ele.initialize() );
28 ATH_CHECK( m_SCEtVec_tau.initialize() );
29
30 // Retrieve the TOB ET sum tool
31 ATH_CHECK( m_eFEXTOBEtTool.retrieve() );
32
33 return StatusCode::SUCCESS;
34 }
35
37
38 // read the TOB containers
40 if (!eFEXegEDMContainerObj.isValid()) {
41 ATH_MSG_ERROR("Failed to retrieve EDM collection: "<<m_eFEXegEDMContainerKey);
42 return StatusCode::SUCCESS;
43 }
44 const xAOD::eFexEMRoIContainer* emEDMConstPtr = eFEXegEDMContainerObj.cptr();
45
47 if (!eFEXtauEDMContainerObj.isValid()) {
48 ATH_MSG_ERROR("Failed to retrieve tau EDM collection: "<<m_eFEXtauEDMContainerKey);
49 return StatusCode::SUCCESS;
50 }
51 const xAOD::eFexTauRoIContainer* tauEDMConstPtr = eFEXtauEDMContainerObj.cptr();
52
53 //Setup EM Decorator Handlers
55
57
58 std::vector<unsigned int > ClusterCellETs; //
59
61 for ( const xAOD::eFexEMRoI* emRoI : *emEDMConstPtr ){
62
63 float eta = emRoI->eta();
64 float phi = emRoI->phi();
65
66 ATH_CHECK( m_eFEXTOBEtTool->getTOBCellEnergies(eta, phi, ClusterCellETs));
67
68 SCEt_e (*emRoI) = ClusterCellETs;
69 ClusterCellETs.clear();
70 }
71
72 //looping over Tau TOB to decorate them
73 for ( const xAOD::eFexTauRoI* tauRoI : *tauEDMConstPtr ){
74
75 float eta = tauRoI->eta();
76 float phi = tauRoI->phi();
77
78 ATH_CHECK( m_eFEXTOBEtTool->getTOBCellEnergies(eta, phi, ClusterCellETs));
79
80 SCEt_t (*tauRoI) = ClusterCellETs;
81 ClusterCellETs.clear();
82 }
83
84 // Return gracefully
85 return StatusCode::SUCCESS;
86 }
87}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ToolHandle< eFEXTOBEtTool > m_eFEXTOBEtTool
eFexTOBSuperCellDecorator(const std::string &name, ISvcLocator *svc)
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFEXtauEDMContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFEXegEDMContainerKey
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_SCEtVec_ele
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_SCEtVec_tau
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Handle class for adding a decoration to an object.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
eFexEMRoIContainer_v1 eFexEMRoIContainer
eFexEMRoI_v1 eFexEMRoI
Define the latest version of the eFexEMRoI class.
Definition eFexEMRoI.h:17
eFexTauRoIContainer_v1 eFexTauRoIContainer
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.
Definition eFexTauRoI.h:16