ATLAS Offline Software
Loading...
Searching...
No Matches
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"
17
18namespace 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}
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:
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_ClusterSCellEtSumsDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_WstotDenDec
ToolHandle< eFEXTOBEtTool > m_eFEXTOBEtTool
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REMHadDec
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFEXtauEDMContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFEXegEDMContainerKey
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RhadHadDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_WstotNumDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RetaCoreDec
virtual StatusCode execute()
virtual StatusCode initialize()
eFexTOBDecorator(const std::string &name, ISvcLocator *svc)
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REnvDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RetaEnvDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RhadEMDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REMCoreDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_RCoreDec
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