ATLAS Offline Software
eFexTOBDecorator.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 // 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"
18 
19 namespace LVL1 {
20 
21  eFexTOBDecorator::eFexTOBDecorator(const std::string& name, ISvcLocator* svc) : AthAlgorithm(name, svc){}
22 
24  ATH_MSG_INFO( "L1CaloFEXTools/eFexTOBDecorator::initialize()");
25 
26  // initialise read and decorator write handles
27  ATH_CHECK( m_eFEXegEDMContainerKey.initialize() );
28  ATH_CHECK( m_eFEXtauEDMContainerKey.initialize() );
29 
30  ATH_CHECK( m_RetaCoreDec.initialize() );
31  ATH_CHECK( m_RetaEnvDec.initialize() );
32  ATH_CHECK( m_RhadEMDec.initialize() );
33  ATH_CHECK( m_RhadHadDec.initialize() );
34  ATH_CHECK( m_WstotDenDec.initialize() );
35  ATH_CHECK( m_WstotNumDec.initialize() );
36 
37  ATH_CHECK( m_ClusterSCellEtSumsDec.initialize() );
38 
39  ATH_CHECK( m_RCoreDec.initialize() );
40  ATH_CHECK( m_REnvDec.initialize() );
41  ATH_CHECK( m_REMCoreDec.initialize() );
42  ATH_CHECK( m_REMHadDec.initialize() );
43 
44  // Retrieve the TOB ET sum tool
45  ATH_CHECK( m_eFEXTOBEtTool.retrieve() );
46 
47  return StatusCode::SUCCESS;
48  }
49 
51 
52  // read the TOB containers
54  if (!eFEXegEDMContainerObj.isValid()) {
55  ATH_MSG_ERROR("Failed to retrieve EDM collection");
56  return StatusCode::SUCCESS;
57  }
58  const xAOD::eFexEMRoIContainer* emEDMConstPtr = eFEXegEDMContainerObj.cptr();
59 
61  if (!eFEXtauEDMContainerObj.isValid()) {
62  ATH_MSG_ERROR("Failed to retrieve tau EDM collection");
63  return StatusCode::SUCCESS;
64  }
65  const xAOD::eFexTauRoIContainer* tauEDMConstPtr = eFEXtauEDMContainerObj.cptr();
66 
67  //Setup EM Decorator Handlers
74 
76 
77  //looping over EM TOB to decorate them
78  for ( const xAOD::eFexEMRoI* emRoI : *emEDMConstPtr ){
79 
80  float eta = emRoI->eta();
81  float phi = emRoI->phi();
82  int seed = emRoI->seed();
83  int UnD = emRoI->UpNotDown();
84  std::vector<unsigned int> ClusterCellETs;
85  std::vector<unsigned int> RetaSums;
86  std::vector<unsigned int> RhadSums;
87  std::vector<unsigned int> WstotSums;
88 
89  ATH_CHECK( m_eFEXTOBEtTool->getegSums(eta, phi, seed, UnD, ClusterCellETs, RetaSums, RhadSums, WstotSums) );
90 
91  RetaCoreDec (*emRoI) = RetaSums[0];
92  RetaEnvDec (*emRoI) = RetaSums[1];
93  RhadEMDec (*emRoI) = RhadSums[0];
94  RhadHadDec (*emRoI) = RhadSums[1];
95  WstotDenDec (*emRoI) = WstotSums[0];
96  WstotNumDec (*emRoI) = WstotSums[1];
97 
98  ClusterSCellEtSumsDec (*emRoI) = ClusterCellETs;
99  }
100 
101  //Setup Tau Decorator Handlers
106 
107  //looping over Tau TOB to decorate them
108  for ( const xAOD::eFexTauRoI* tauRoI : *tauEDMConstPtr ){
109 
110  float eta = tauRoI->eta();
111  float phi = tauRoI->phi();
112  int seed = tauRoI->seed();
113  int UnD = tauRoI->upNotDown();
114  std::vector<unsigned int> RcoreSums;
115  std::vector<unsigned int> RemSums;
116 
117  ATH_CHECK( m_eFEXTOBEtTool->gettauSums(eta, phi, seed, UnD, RcoreSums, RemSums) );
118 
119  RCoreDec (*tauRoI) = RcoreSums[0];
120  REnvDec (*tauRoI) = RcoreSums[1];
121  REMCoreDec (*tauRoI) = RemSums[0];
122  REMHadDec (*tauRoI) = RemSums[1];
123  }
124 
125  // Return gracefully
126  return StatusCode::SUCCESS;
127  }
128 
129 }
LVL1::eFexTOBDecorator::m_RhadHadDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RhadHadDec
Definition: eFexTOBDecorator.h:49
LVL1::eFexTOBDecorator::m_RetaEnvDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RetaEnvDec
Definition: eFexTOBDecorator.h:47
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:21
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LVL1::eFexTOBDecorator::m_RCoreDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_RCoreDec
Definition: eFexTOBDecorator.h:56
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:50
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:51
LVL1::eFexTOBDecorator::m_RetaCoreDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RetaCoreDec
Definition: eFexTOBDecorator.h:46
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:42
LVL1::eFexTOBDecorator::m_REnvDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REnvDec
Definition: eFexTOBDecorator.h:57
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
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:58
LVL1::eFexTOBDecorator::initialize
virtual StatusCode initialize()
Definition: eFexTOBDecorator.cxx:23
LVL1::eFexTOBDecorator::m_REMHadDec
SG::WriteDecorHandleKey< xAOD::eFexTauRoIContainer > m_REMHadDec
Definition: eFexTOBDecorator.h:59
LVL1::eFexTOBDecorator::m_eFEXTOBEtTool
ToolHandle< IeFEXTOBEtTool > m_eFEXTOBEtTool
Definition: eFexTOBDecorator.h:61
LVL1::eFexTOBDecorator::m_ClusterSCellEtSumsDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_ClusterSCellEtSumsDec
Definition: eFexTOBDecorator.h:53
LVL1::eFexTOBDecorator::m_RhadEMDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_RhadEMDec
Definition: eFexTOBDecorator.h:48
LVL1::eFexTOBDecorator::m_eFEXtauEDMContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFEXtauEDMContainerKey
Definition: eFexTOBDecorator.h:43
LVL1::eFexTOBDecorator::m_WstotDenDec
SG::WriteDecorHandleKey< xAOD::eFexEMRoIContainer > m_WstotDenDec
Definition: eFexTOBDecorator.h:50
eFEXtauAlgo.h