ATLAS Offline Software
EnergySumRoICnvTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Gaudi/Athena include(s):
8 
9 // EDM include(s):
13 
14 // Local include(s):
15 #include "EnergySumRoICnvTool.h"
16 
17 namespace xAODMaker {
18 
20  const std::string& name,
21  const IInterface* parent )
22  : AthAlgTool( type, name, parent ) {
23 
24  // Declare the interface(s) provided by the tool:
25  declareInterface< IEnergySumRoICnvTool >( this );
26  }
27 
38  xAOD::EnergySumRoI* xaod ) {
39 
40  // If there is no RoI to convert:
41  if( aod->getEnergySumROIs().empty() ) {
42  ATH_MSG_WARNING( "No EnergySum RoI received on the input" );
43  return StatusCode::SUCCESS;
44  }
45 
46  // A sanity check on the input:
47  if( aod->getEnergySumROIs().size() != 1 ) {
48  ATH_MSG_WARNING( "There is supposed ot be exactly one EnergySum RoI "
49  "in the event." );
50  ATH_MSG_WARNING( "Instead received "
51  << aod->getEnergySumROIs().size() );
52  }
53 
54  // Convert the one RoI:
55  const EnergySum_ROI& roi = aod->getEnergySumROIs()[ 0 ];
56  xaod->initialize( roi.getROIWord0(), roi.getROIWord1(), roi.getROIWord2(),
57  roi.getEnergyX(), roi.getEnergyY(), roi.getEnergyT() );
58  for( size_t i = 0; i < roi.getThresholds().size(); ++i ) {
59  xaod->addThreshold( roi.getThresholds()[ i ] );
60  }
61 
62  // Return gracefully:
63  return StatusCode::SUCCESS;
64  }
65 
66 } // namespace xAODMaker
EnergySum_ROI
Energy-Sum RoI class for analysis.
Definition: EnergySum_ROI.h:25
EnergySum_ROI::getThresholds
const thresholds_type & getThresholds() const
Return the names of the passed threshodlds.
Definition: EnergySum_ROI.h:80
xAODMaker::EnergySumRoICnvTool::convert
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::EnergySumRoI *xaod) override
Function that fills an existing xAOD::EnergySumRoI.
Definition: EnergySumRoICnvTool.cxx:37
EnergySum_ROI::getEnergyT
float getEnergyT() const
Return the deposited total transverse energy.
Definition: EnergySum_ROI.h:58
xAODMaker::EnergySumRoICnvTool::EnergySumRoICnvTool
EnergySumRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: EnergySumRoICnvTool.cxx:19
EnergySum_ROI::getEnergyY
float getEnergyY() const
Return the total energy deposited in the Y direction.
Definition: EnergySum_ROI.h:56
xAODMaker
Definition: StoreGateSvc.h:72
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1_ROI.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
EnergySum_ROI::getROIWord1
uint32_t getROIWord1() const
Return the second RoI word produced by the L1Calo hardware.
Definition: EnergySum_ROI.h:49
EnergySum_ROI::getROIWord0
uint32_t getROIWord0() const
Return the first RoI word produced by the L1Calo hardware.
Definition: EnergySum_ROI.h:47
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LVL1_ROI::getEnergySumROIs
const energysums_type & getEnergySumROIs() const
Get all the energy sum RoIs in the event.
Definition: LVL1_ROI.h:71
errorcheck.h
Helpers for checking error return status codes and reporting errors.
EnergySum_ROI::getEnergyX
float getEnergyX() const
Return the total energy deposited in the X direction.
Definition: EnergySum_ROI.h:54
EnergySumRoICnvTool.h
EnergySum_ROI::getROIWord2
uint32_t getROIWord2() const
Return the third RoI word produced by the L1Calo hardware.
Definition: EnergySum_ROI.h:51
xAOD::EnergySumRoI_v2::initialize
void initialize(uint32_t roiword0, uint32_t roiword1, uint32_t roiword2, float energyX, float energyY, float energyT)
Initialise the object with its most important properties from a single RoI.
Definition: EnergySumRoI_v2.cxx:25
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EnergySumRoI_v2::addThreshold
void addThreshold(const std::string &name)
Add a new threshold that was passed.
Definition: EnergySumRoI_v2.cxx:157
AthAlgTool
Definition: AthAlgTool.h:26
EnergySum_ROI.h
xAOD::EnergySumRoI_v2
Class describing a LVL1 energy-sum "RoI".
Definition: EnergySumRoI_v2.h:35
EnergySumRoI.h