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"
15 
16 namespace LVL1 {
17 
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 }
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
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:36
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::eFexTOBSuperCellDecorator::m_eFEXTOBEtTool
ToolHandle< eFEXTOBEtTool > m_eFEXTOBEtTool
Definition: eFexTOBSuperCellDecorator.h:47
LVL1::eFexTOBSuperCellDecorator::initialize
virtual StatusCode initialize()
Definition: eFexTOBSuperCellDecorator.cxx:20
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:18
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