ATLAS Offline Software
JetRoICnvTool.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 #include "xAODTrigger/JetRoI.h"
11 
12 // Local include(s):
13 #include "JetRoICnvTool.h"
14 
15 namespace xAODMaker {
16 
17  JetRoICnvTool::JetRoICnvTool( const std::string& type,
18  const std::string& name,
19  const IInterface* parent )
20  : AthAlgTool( type, name, parent ) {
21 
22  // Declare the interface(s) provided by the tool:
23  declareInterface< IJetRoICnvTool >( this );
24  }
25 
36  xAOD::JetRoIContainer* xaod ) {
37 
38  // A small sanity check. The output container should really be empty...
39  if( !xaod->empty() ) {
40  ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
41  << xaod->size() << ")" );
42  }
43 
44  // Loop over the AOD objects:
45  LVL1_ROI::jets_type::const_iterator aod_itr = aod->getJetROIs().begin();
46  LVL1_ROI::jets_type::const_iterator aod_end = aod->getJetROIs().end();
47  for( ; aod_itr != aod_end; ++aod_itr ) {
48 
49  // Add a new jet RoI object to the output:
50  xAOD::JetRoI* roi = new xAOD::JetRoI();
51  xaod->push_back( roi );
52 
53  // Now fill it with data:
54  roi->initialize( aod_itr->getROIWord(),
55  aod_itr->getEta(), aod_itr->getPhi() );
56  roi->setEt4x4( aod_itr->getET4x4() );
57  roi->setEt6x6( aod_itr->getET6x6() );
58  roi->setEt8x8( aod_itr->getET8x8() );
59  for( size_t i = 0; i < aod_itr->getThresholdNames().size(); ++i ) {
60  roi->addThreshold( aod_itr->getThresholdNames()[ i ],
61  aod_itr->getThresholdValues()[ i ] );
62  }
63  }
64 
65  // Return gracefully:
66  return StatusCode::SUCCESS;
67  }
68 
69 } // namespace xAODMaker
xAODMaker::JetRoICnvTool::convert
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::JetRoIContainer *xaod) override
Function that fills an existing xAOD::JetRoIContainer.
Definition: JetRoICnvTool.cxx:35
xAOD::JetRoI_v2::initialize
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
Definition: JetRoI_v2.cxx:19
xAODMaker
Definition: StoreGateSvc.h:72
LVL1_ROI::getJetROIs
const jets_type & getJetROIs() const
Get all the jet RoIs in the event.
Definition: LVL1_ROI.h:67
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAODMaker::JetRoICnvTool::JetRoICnvTool
JetRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: JetRoICnvTool.cxx:17
lumiFormat.i
int i
Definition: lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::JetRoI
JetRoI_v2 JetRoI
Definition: JetRoI.h:16
LVL1_ROI.h
xAOD::JetRoI_v2::setEt8x8
void setEt8x8(float value)
Set the energy deposited in a 0.8x0.8 area around the RoI.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JetRoIContainer.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::JetRoI_v2
Class describing a LVL1 jet region of interest.
Definition: JetRoI_v2.h:35
xAOD::JetRoI_v2::setEt6x6
void setEt6x6(float value)
Set the energy deposited in a 0.6x0.6 area around the RoI.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
JetRoI.h
JetRoICnvTool.h
xAOD::JetRoI_v2::addThreshold
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
Definition: JetRoI_v2.cxx:72
xAOD::JetRoI_v2::setEt4x4
void setEt4x4(float value)
Set the energy deposited in a 0.4x0.4 area around the RoI.
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Jet_ROI.h