ATLAS Offline Software
Loading...
Searching...
No Matches
JetEtRoICnvTool.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// EDM include(s):
10
11// Local include(s):
12#include "JetEtRoICnvTool.h"
13
14namespace xAODMaker {
15
17 const std::string& name,
18 const IInterface* parent )
19 : AthAlgTool( type, name, parent ) {
20
21 // Declare the interface(s) provided by the tool:
22 declareInterface< IJetEtRoICnvTool >( this );
23 }
24
34 StatusCode JetEtRoICnvTool::convert( const LVL1_ROI* aod,
35 xAOD::JetEtRoI* xaod ) {
36
37 // If there is no RoI to convert:
38 if( aod->getJetEtROIs().empty() ) {
39 // This happens unfortunately. Let's discuss with L1Calo about how
40 // we should handle this...
41 ATH_MSG_DEBUG( "No JetEt RoI received on the input" );
42 return StatusCode::SUCCESS;
43 }
44
45 // Another sanity check on the input:
46 if( aod->getJetEtROIs().size() != 1 ) {
47 ATH_MSG_WARNING( "There is supposed ot be exactly one JetEt RoI "
48 "in the event." );
49 ATH_MSG_WARNING( "Instead received "
50 << aod->getJetEtROIs().size() );
51 }
52
53 // Convert the one RoI:
54 const JetET_ROI& roi = aod->getJetEtROIs()[ 0 ];
55 xaod->setRoIWord( roi.getROIWord() );
56 for( size_t i = 0; i < roi.getThresholds().size(); ++i ) {
57 xaod->addThreshold( roi.getThresholds()[ i ] );
58 }
59
60 // Return gracefully:
61 return StatusCode::SUCCESS;
62 }
63
64} // namespace xAODMaker
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Energy-Sum RoI class for analysis.
Definition JetET_ROI.h:25
const thresholds_type & getThresholds() const
Return the names of the passed threshodlds.
Definition JetET_ROI.h:46
uint32_t getROIWord() const
Return the RoI word produced by the L1Calo hardware.
Definition JetET_ROI.h:41
Top level AOD object storing LVL1 RoIs.
Definition LVL1_ROI.h:43
const jetets_type & getJetEtROIs() const
Get all the jet-ET RoIs in the event.
Definition LVL1_ROI.h:69
JetEtRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::JetEtRoI *xaod) override
Function that fills an existing xAOD::JetEtRoI.
void addThreshold(const std::string &name)
Add a new threshold that was passed.
void setRoIWord(uint32_t value)
Set the RoI word describing the JetET thresholds passed.