ATLAS Offline Software
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):
10 #include "xAODTrigger/EmTauRoI.h"
11 
12 // Local include(s):
13 #include "EmTauRoICnvTool.h"
14 
15 namespace 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 
37  xAOD::EmTauRoIContainer* xaod ) {
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
EmTau_ROI.h
EmTauRoI.h
xAODMaker
Definition: StoreGateSvc.h:72
xAOD::EmTauRoI_v2::initialize
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
Definition: EmTauRoI_v2.cxx:22
xAOD::EmTauRoI_v2::addThreshold
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
Definition: EmTauRoI_v2.cxx:99
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::EmTauRoI_v2::setEmIsol
void setEmIsol(float value)
Set the EM calorimeter isolation (outer ring of EM towers)
xAOD::EmTauRoI
EmTauRoI_v2 EmTauRoI
Definition: EmTauRoI.h:16
xAODMaker::EmTauRoICnvTool::convert
virtual StatusCode convert(const LVL1_ROI *aod, xAOD::EmTauRoIContainer *xaod) override
Function that fills an existing xAOD::EmTauRoIContainer.
Definition: EmTauRoICnvTool.cxx:36
xAOD::EmTauRoI_v2::setEmClus
void setEmClus(float value)
Set the deposited ET from the "EM cluster".
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::EmTauRoI_v2
Class describing a LVL1 em/tau region of interest.
Definition: EmTauRoI_v2.h:35
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1_ROI.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::EmTauRoI_v2::setHadIsol
void setHadIsol(float value)
Set the hadron calorimeter isolation (outer ring of had towers)
xAOD::EmTauRoI_v2::setTauClus
void setTauClus(float value)
Set the deposited ET from the "tau cluster".
xAOD::EmTauRoI_v2::setHadCore
void setHadCore(float value)
Set the ET deposited in the inner hadronic isolation region.
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:221
EmTauRoICnvTool.h
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
EmTauRoIContainer.h
xAODMaker::EmTauRoICnvTool::EmTauRoICnvTool
EmTauRoICnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: EmTauRoICnvTool.cxx:17
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1_ROI::getEmTauROIs
const emtaus_type & getEmTauROIs() const
Get all the em/tau RoIs in the event.
Definition: LVL1_ROI.h:65
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::EmTauRoI_v2::setCore
void setCore(float value)
Set the ET of the RoI Core cluster (2x2 towers, EM+Had)
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.