ATLAS Offline Software
Loading...
Searching...
No Matches
EmTauRoICnvTool.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):
11
12// Local include(s):
13#include "EmTauRoICnvTool.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< IEmTauRoICnvTool >( this );
24 }
25
26
36 StatusCode EmTauRoICnvTool::convert( const LVL1_ROI* aod,
38
39 // A small sanity check. The output container should really be empty...
40 if( !xaod->empty() ) {
41 ATH_MSG_WARNING( "The output xAOD container is not empty (size=="
42 << xaod->size() << ")" );
43 }
44
45 // Loop over the AOD objects:
46 LVL1_ROI::emtaus_type::const_iterator aod_itr = aod->getEmTauROIs().begin();
47 LVL1_ROI::emtaus_type::const_iterator aod_end = aod->getEmTauROIs().end();
48 for( ; aod_itr != aod_end; ++aod_itr ) {
49
50 // Add a new em/tau RoI object to the output:
51 xAOD::EmTauRoI* roi = new xAOD::EmTauRoI();
52 xaod->push_back( roi );
53
54 // Now fill it with data:
55 roi->initialize( aod_itr->getROIWord(),
56 aod_itr->getEta(), aod_itr->getPhi() );
57 roi->setCore( aod_itr->getCore() );
58 roi->setEmClus( aod_itr->getEMClus() );
59 roi->setTauClus( aod_itr->getTauClus() );
60 roi->setEmIsol( aod_itr->getEMIsol() );
61 roi->setHadIsol( aod_itr->getHadIsol() );
62 roi->setHadCore( aod_itr->getHadCore() );
63 for( size_t i = 0; i < aod_itr->getThresholdNames().size(); ++i ) {
64 roi->addThreshold( aod_itr->getThresholdNames()[ i ],
65 aod_itr->getThresholdValues()[ i ] );
66 }
67 }
68
69 // Return gracefully:
70 return StatusCode::SUCCESS;
71 }
72
73} // 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 emtaus_type & getEmTauROIs() const
Get all the em/tau RoIs in the event.
Definition LVL1_ROI.h:65
EmTauRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::EmTauRoIContainer *xaod) override
Function that fills an existing xAOD::EmTauRoIContainer.
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
void setTauClus(float value)
Set the deposited ET from the "tau cluster".
void setCore(float value)
Set the ET of the RoI Core cluster (2x2 towers, EM+Had)
void setHadCore(float value)
Set the ET deposited in the inner hadronic isolation region.
void setEmClus(float value)
Set the deposited ET from the "EM cluster".
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
void setEmIsol(float value)
Set the EM calorimeter isolation (outer ring of EM towers)
void setHadIsol(float value)
Set the hadron calorimeter isolation (outer ring of had towers)
EmTauRoIContainer_v2 EmTauRoIContainer
EmTauRoI_v2 EmTauRoI
Definition EmTauRoI.h:16