ATLAS Offline Software
eFexTOBDecorator.cxx
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 // eFexTOBDecorator - description
7 // -------------------
8 // This algorithm decorates the eFEX TOBs with jet descriminant variables and, for the EM TOBs, with the cluster layer supercell Et sums
9 // recalculated from input data using the eFEXTOBEtTool
10 // All values are in 25 MeV counts
11 //
12 // begin : 03 02 2022
13 // email : paul.daniel.thompson@cern.ch
14 //***************************************************************************/
15 #include "eFexTOBDecorator.h"
16 #include "L1CaloFEXSim/eFEXegTOB.h"
17 
18 namespace LVL1 {
19 
20  eFexTOBDecorator::eFexTOBDecorator(const std::string& name, ISvcLocator* svc) : AthAlgorithm(name, svc){}
21 
23  ATH_MSG_INFO( "L1CaloFEXTools/eFexTOBDecorator::initialize()");
24 
25  // initialise read and decorator write handles
26  ATH_CHECK( m_eFEXegEDMContainerKey.initialize() );
27  ATH_CHECK( m_eFEXtauEDMContainerKey.initialize() );
28 
29  ATH_CHECK( m_RetaCoreDec.initialize() );
30  ATH_CHECK( m_RetaEnvDec.initialize() );
31  ATH_CHECK( m_RhadEMDec.initialize() );
32  ATH_CHECK( m_RhadHadDec.initialize() );
33  ATH_CHECK( m_WstotDenDec.initialize() );
34  ATH_CHECK( m_WstotNumDec.initialize() );
35 
36  ATH_CHECK( m_ClusterSCellEtSumsDec.initialize() );
37 
38  ATH_CHECK( m_RCoreDec.initialize() );
39  ATH_CHECK( m_REnvDec.initialize() );
40  ATH_CHECK( m_REMCoreDec.initialize() );
41  ATH_CHECK( m_REMHadDec.initialize() );
42 
43  // Retrieve the TOB ET sum tool
44  ATH_CHECK( m_eFEXTOBEtTool.retrieve() );
45 
46  return StatusCode::SUCCESS;
47  }
48 
50 
51  // read the TOB containers
53  if (!eFEXegEDMContainerObj.isValid()) {
54  ATH_MSG_ERROR("Failed to retrieve EDM collection");
55  return StatusCode::SUCCESS;
56  }
57  const xAOD::eFexEMRoIContainer* emEDMConstPtr = eFEXegEDMContainerObj.cptr();
58 
60  if (!eFEXtauEDMContainerObj.isValid()) {
61  ATH_MSG_ERROR("Failed to retrieve tau EDM collection");
62  return StatusCode::SUCCESS;
63  }
64  const xAOD::eFexTauRoIContainer* tauEDMConstPtr = eFEXtauEDMContainerObj.cptr();
65 
66  //Setup EM Decorator Handlers
73 
75 
76  //looping over EM TOB to decorate them
77  for ( const xAOD::eFexEMRoI* emRoI : *emEDMConstPtr ){
78 
79  float eta = emRoI->eta();
80  float phi = emRoI->phi();
81  int seed = emRoI->seed();
82  int UnD = emRoI->UpNotDown();
83  std::vector<unsigned int> ClusterCellETs;
84  std::vector<unsigned int> RetaSums;
85  std::vector<unsigned int> RhadSums;
86  std::vector<unsigned int> WstotSums;
87 
88  ATH_CHECK( m_eFEXTOBEtTool->getegSums(eta, phi, seed, UnD, ClusterCellETs, RetaSums, RhadSums, WstotSums) );
89 
90  RetaCoreDec (*emRoI) = RetaSums[0];
91  RetaEnvDec (*emRoI) = RetaSums[1];
92  RhadEMDec (*emRoI) = RhadSums[0];
93  RhadHadDec (*emRoI) = RhadSums[1];
94  WstotDenDec (*emRoI) = WstotSums[0];
95  WstotNumDec (*emRoI) = WstotSums[1];
96 
97  ClusterSCellEtSumsDec (*emRoI) = std::move(ClusterCellETs);
98  }
99 
100  //Setup Tau Decorator Handlers
105 
106  //looping over Tau TOB to decorate them
107  for ( const xAOD::eFexTauRoI* tauRoI : *tauEDMConstPtr ){
108 
109  float eta = tauRoI->eta();
110  float phi = tauRoI->phi();
111  int seed = tauRoI->seed();
112  int UnD = tauRoI->upNotDown();
113  std::vector<unsigned int> RcoreSums;
114  std::vector<unsigned int> RemSums;
115 
116  ATH_CHECK( m_eFEXTOBEtTool->gettauSums(eta, phi, seed, UnD, RcoreSums, RemSums) );
117 
118  RCoreDec (*tauRoI) = RcoreSums[0];
119  REnvDec (*tauRoI) = RcoreSums[1];
120  REMCoreDec (*tauRoI) = RemSums[0];
121  REMHadDec (*tauRoI) = RemSums[1];
122  }
123 
124  // Return gracefully
125  return StatusCode::SUCCESS;
126  }
127 
128 }
LVL1::eFexTOBDecorator::m_RhadHadDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RhadHadDec
Definition: eFexTOBDecorator.h:46
LVL1::eFexTOBDecorator::m_RetaEnvDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RetaEnvDec
Definition: eFexTOBDecorator.h:44
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eFexTOBDecorator.h
LVL1::eFexTOBDecorator::eFexTOBDecorator
eFexTOBDecorator(const std::string &name, ISvcLocator *svc)
Definition: eFexTOBDecorator.cxx:20
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
LVL1::eFexTOBDecorator::m_eFEXTOBEtTool
ToolHandle< eFEXTOBEtTool > m_eFEXTOBEtTool
Definition: eFexTOBDecorator.h:58
LVL1::eFexTOBDecorator::m_RCoreDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_RCoreDec
Definition: eFexTOBDecorator.h:53
xAOD::eFexEMRoI_v1
Class describing a LVL1 eFEX EM region of interest.
Definition: eFexEMRoI_v1.h:33
LVL1::eFexTOBDecorator::execute
virtual StatusCode execute()
Definition: eFexTOBDecorator.cxx:49
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFexTOBDecorator::m_WstotNumDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_WstotNumDec
Definition: eFexTOBDecorator.h:48
LVL1::eFexTOBDecorator::m_RetaCoreDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RetaCoreDec
Definition: eFexTOBDecorator.h:43
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::eFexTOBDecorator::m_eFEXegEDMContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFEXegEDMContainerKey
Definition: eFexTOBDecorator.h:39
LVL1::eFexTOBDecorator::m_REnvDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REnvDec
Definition: eFexTOBDecorator.h:54
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::eFexTOBDecorator::m_REMCoreDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REMCoreDec
Definition: eFexTOBDecorator.h:55
LVL1::eFexTOBDecorator::initialize
virtual StatusCode initialize()
Definition: eFexTOBDecorator.cxx:22
LVL1::eFexTOBDecorator::m_REMHadDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REMHadDec
Definition: eFexTOBDecorator.h:56
LVL1::eFexTOBDecorator::m_ClusterSCellEtSumsDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_ClusterSCellEtSumsDec
Definition: eFexTOBDecorator.h:50
LVL1::eFexTOBDecorator::m_RhadEMDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RhadEMDec
Definition: eFexTOBDecorator.h:45
LVL1::eFexTOBDecorator::m_eFEXtauEDMContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFEXtauEDMContainerKey
Definition: eFexTOBDecorator.h:40
LVL1::eFexTOBDecorator::m_WstotDenDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_WstotDenDec
Definition: eFexTOBDecorator.h:47