ATLAS Offline Software
Loading...
Searching...
No Matches
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
15namespace xAODMaker {
16
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
35 StatusCode JetRoICnvTool::convert( const LVL1_ROI* aod,
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
#define ATH_MSG_WARNING(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
Top level AOD object storing LVL1 RoIs.
Definition LVL1_ROI.h:43
const jets_type & getJetROIs() const
Get all the jet RoIs in the event.
Definition LVL1_ROI.h:67
JetRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::JetRoIContainer *xaod) override
Function that fills an existing xAOD::JetRoIContainer.
void setEt8x8(float value)
Set the energy deposited in a 0.8x0.8 area around the RoI.
void setEt6x6(float value)
Set the energy deposited in a 0.6x0.6 area around the RoI.
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
Definition JetRoI_v2.cxx:72
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
Definition JetRoI_v2.cxx:19
void setEt4x4(float value)
Set the energy deposited in a 0.4x0.4 area around the RoI.
JetRoIContainer_v2 JetRoIContainer
JetRoI_v2 JetRoI
Definition JetRoI.h:16