ATLAS Offline Software
Loading...
Searching...
No Matches
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
17namespace 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
37 StatusCode EnergySumRoICnvTool::convert( const LVL1_ROI* aod,
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
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Energy-Sum RoI class for analysis.
const thresholds_type & getThresholds() const
Return the names of the passed threshodlds.
float getEnergyY() const
Return the total energy deposited in the Y direction.
uint32_t getROIWord1() const
Return the second RoI word produced by the L1Calo hardware.
float getEnergyT() const
Return the deposited total transverse energy.
uint32_t getROIWord0() const
Return the first RoI word produced by the L1Calo hardware.
uint32_t getROIWord2() const
Return the third RoI word produced by the L1Calo hardware.
float getEnergyX() const
Return the total energy deposited in the X direction.
Top level AOD object storing LVL1 RoIs.
Definition LVL1_ROI.h:43
const energysums_type & getEnergySumROIs() const
Get all the energy sum RoIs in the event.
Definition LVL1_ROI.h:71
EnergySumRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::EnergySumRoI *xaod) override
Function that fills an existing xAOD::EnergySumRoI.
void addThreshold(const std::string &name)
Add a new threshold that was passed.
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.
EnergySumRoI_v2 EnergySumRoI