ATLAS Offline Software
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):
9 #include "xAODTrigger/JetEtRoI.h"
10 
11 // Local include(s):
12 #include "JetEtRoICnvTool.h"
13 
14 namespace 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 
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
xAODMaker::JetEtRoICnvTool::convert
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::JetEtRoI *xaod) override
Function that fills an existing xAOD::JetEtRoI.
Definition: JetEtRoICnvTool.cxx:34
JetET_ROI::getROIWord
uint32_t getROIWord() const
Return the RoI word produced by the L1Calo hardware.
Definition: JetET_ROI.h:41
JetET_ROI
Energy-Sum RoI class for analysis.
Definition: JetET_ROI.h:25
xAODMaker
Definition: StoreGateSvc.h:72
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:92
JetEtRoICnvTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::JetEtRoI_v1::setRoIWord
void setRoIWord(uint32_t value)
Set the RoI word describing the JetET thresholds passed.
xAOD::JetEtRoI_v1
Class describing a LVL1 jet-ET "RoI".
Definition: JetEtRoI_v1.h:35
LVL1_ROI.h
xAODMaker::JetEtRoICnvTool::JetEtRoICnvTool
JetEtRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: JetEtRoICnvTool.cxx:16
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1_ROI::getJetEtROIs
const jetets_type & getJetEtROIs() const
Get all the jet-ET RoIs in the event.
Definition: LVL1_ROI.h:69
JetEtRoI.h
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
JetET_ROI.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
JetET_ROI::getThresholds
const thresholds_type & getThresholds() const
Return the names of the passed threshodlds.
Definition: JetET_ROI.h:46
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::JetEtRoI_v1::addThreshold
void addThreshold(const std::string &name)
Add a new threshold that was passed.
AthAlgTool
Definition: AthAlgTool.h:26