ATLAS Offline Software
Loading...
Searching...
No Matches
PFlowObjectsInConeTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6// PFlowObjectsInConeTool
7//
8// (c) ATLAS software
10
11//<<<<<< INCLUDES >>>>>>
13#include "PFlowUtils/PFODefs.h"
14
15namespace xAOD {
16
17 //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>>
18
19 PFlowObjectsInConeTool::PFlowObjectsInConeTool (const std::string& type, const std::string& name, const IInterface* parent)
20 : AthAlgTool(type, name, parent)
21 {
22 declareInterface<IPFlowObjectsInConeTool>(this);
23 }
24
26
27 //<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>>
28
30 ATH_CHECK(m_pfokey.initialize());
31 return StatusCode::SUCCESS;
32 }
33
35 return StatusCode::SUCCESS;
36 }
37
40 {
41 const std::string tableName = name() + "LookUpTable";
42 SG::ReadHandle<LookUpTable> rh (tableName);
43 if (rh.isValid())
44 return &*rh;
45
46
48 if( !pfos.isValid() ) {
49 ATH_MSG_WARNING("Unable to open pflow container with key " << m_pfokey.key());
50 return nullptr;
51 }
52 auto lut = std::make_unique<LookUpTable>();
53 lut->init(*pfos);
54 SG::WriteHandle<LookUpTable> wh (tableName);
55 return wh.put (std::move (lut), true);
56 }
57
58 bool PFlowObjectsInConeTool::particlesInCone( float eta, float phi, float dr, std::vector<const PFO*>& output ) const {
59
61 const LookUpTable* lut = getTable();
62 return lut->iParticlesInCone( eta, phi, dr, output );
63 }
64}// end of namespace
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const LookUpTable * getTable() const
PFlowObjectsInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
bool particlesInCone(float eta, float phi, float dr, std::vector< const PFO * > &output) const override
IPFlowObjectsInConeTool interface.
StatusCode initialize() override
initialize
IParticlesLookUpTable< PFO > LookUpTable
~PFlowObjectsInConeTool(void)
destructor
StatusCode finalize() override
finalize
SG::ReadHandleKey< PFOContainer > m_pfokey
to retrieve pflow objects
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.