ATLAS Offline Software
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 //***************************************************************************/
14 #include "L1CaloFEXSim/eFEXegTOB.h"
16 
17 namespace LVL1 {
18 
20 
22  ATH_MSG_INFO( "L1CaloFEXTools/eFexTOBSuperCellDecorator::initialize()");
23 
24  // initialise read and decorator write handles
25  ATH_CHECK( m_eFEXegEDMContainerKey.initialize() );
26  ATH_CHECK( m_eFEXtauEDMContainerKey.initialize() );
27 
28  ATH_CHECK( m_SCEtVec_ele.initialize() );
29  ATH_CHECK( m_SCEtVec_tau.initialize() );
30 
31  // Retrieve the TOB ET sum tool
32  ATH_CHECK( m_eFEXTOBEtTool.retrieve() );
33 
34  return StatusCode::SUCCESS;
35  }
36 
38 
39  // read the TOB containers
41  if (!eFEXegEDMContainerObj.isValid()) {
42  ATH_MSG_ERROR("Failed to retrieve EDM collection: "<<m_eFEXegEDMContainerKey);
43  return StatusCode::SUCCESS;
44  }
45  const xAOD::eFexEMRoIContainer* emEDMConstPtr = eFEXegEDMContainerObj.cptr();
46 
48  if (!eFEXtauEDMContainerObj.isValid()) {
49  ATH_MSG_ERROR("Failed to retrieve tau EDM collection: "<<m_eFEXtauEDMContainerKey);
50  return StatusCode::SUCCESS;
51  }
52  const xAOD::eFexTauRoIContainer* tauEDMConstPtr = eFEXtauEDMContainerObj.cptr();
53 
54  //Setup EM Decorator Handlers
56 
58 
59  std::vector<unsigned int > ClusterCellETs; //
60 
62  for ( const xAOD::eFexEMRoI* emRoI : *emEDMConstPtr ){
63 
64  float eta = emRoI->eta();
65  float phi = emRoI->phi();
66 
67  ATH_CHECK( m_eFEXTOBEtTool->getTOBCellEnergies(eta, phi, ClusterCellETs));
68 
69  SCEt_e (*emRoI) = ClusterCellETs;
70  ClusterCellETs.clear();
71  }
72 
73  //looping over Tau TOB to decorate them
74  for ( const xAOD::eFexTauRoI* tauRoI : *tauEDMConstPtr ){
75 
76  float eta = tauRoI->eta();
77  float phi = tauRoI->phi();
78 
79  ATH_CHECK( m_eFEXTOBEtTool->getTOBCellEnergies(eta, phi, ClusterCellETs));
80 
81  SCEt_t (*tauRoI) = ClusterCellETs;
82  ClusterCellETs.clear();
83  }
84 
85  // Return gracefully
86  return StatusCode::SUCCESS;
87  }
88 }
LVL1::eFexTOBSuperCellDecorator::m_eFEXTOBEtTool
ToolHandle< IeFEXTOBEtTool > m_eFEXTOBEtTool
Definition: eFexTOBSuperCellDecorator.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
eFexTOBSuperCellDecorator.h
xAOD::eFexEMRoI_v1
Class describing a LVL1 eFEX EM region of interest.
Definition: eFexEMRoI_v1.h:33
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFexTOBSuperCellDecorator::m_eFEXegEDMContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFEXegEDMContainerKey
Definition: eFexTOBSuperCellDecorator.h:39
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::eFexTauRoI_v1
Class describing a LVL1 eFEX tau region of interest.
Definition: eFexTauRoI_v1.h:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
LVL1::eFexTOBSuperCellDecorator::execute
virtual StatusCode execute()
Definition: eFexTOBSuperCellDecorator.cxx:37
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::eFexTOBSuperCellDecorator::initialize
virtual StatusCode initialize()
Definition: eFexTOBSuperCellDecorator.cxx:21
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
eFEXegTOB.h
AthAlgorithm
Definition: AthAlgorithm.h:47
TrigConf::name
Definition: HLTChainList.h:35
LVL1::eFexTOBSuperCellDecorator::eFexTOBSuperCellDecorator
eFexTOBSuperCellDecorator(const std::string &name, ISvcLocator *svc)
Definition: eFexTOBSuperCellDecorator.cxx:19
LVL1::eFexTOBSuperCellDecorator::m_eFEXtauEDMContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFEXtauEDMContainerKey
Definition: eFexTOBSuperCellDecorator.h:40
LVL1::eFexTOBSuperCellDecorator::m_SCEtVec_ele
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_SCEtVec_ele
Definition: eFexTOBSuperCellDecorator.h:43
LVL1::eFexTOBSuperCellDecorator::m_SCEtVec_tau
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_SCEtVec_tau
Definition: eFexTOBSuperCellDecorator.h:44
eFEXtauAlgo.h