ATLAS Offline Software
Loading...
Searching...
No Matches
FlowElementsInConeTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// FlowElementsInConeTool
7//
8// (c) ATLAS software
10
11//<<<<<< INCLUDES >>>>>>
13
14namespace xAOD {
15
16 //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>>
17
18 FlowElementsInConeTool::FlowElementsInConeTool (const std::string& type, const std::string& name, const IInterface* parent)
19 : AthAlgTool(type, name, parent)
20 {
21 declareInterface<IFlowElementsInConeTool>(this);
22 }
23
25
26 //<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>>
27
29 ATH_CHECK(m_pfokey.initialize());
30 return StatusCode::SUCCESS;
31 }
32
34 return StatusCode::SUCCESS;
35 }
36
39 {
40 const std::string tableName = name() + "LookUpTable";
41 SG::ReadHandle<LookUpTable> rh (tableName);
42 if (rh.isValid())
43 return &*rh;
44
45
47 if( !pfos.isValid() ) {
48 ATH_MSG_WARNING("Unable to open pflow container with key " << m_pfokey.key());
49 return nullptr;
50 }
51 auto lut = std::make_unique<LookUpTable>();
52 lut->init(*pfos);
53 SG::WriteHandle<LookUpTable> wh (tableName);
54 return wh.put (std::move (lut), true);
55 }
56
57 bool FlowElementsInConeTool::particlesInCone( float eta, float phi, float dr, std::vector<const FlowElement*>& output ) const {
58
60 const LookUpTable* lut = getTable();
61 return lut->iParticlesInCone( eta, phi, dr, output );
62 }
63}// 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?
FlowElementsInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
StatusCode initialize() override
initialize
IParticlesLookUpTable< FlowElement > LookUpTable
SG::ReadHandleKey< FlowElementContainer > m_pfokey
to retrieve pflow objects
const LookUpTable * getTable() const
StatusCode finalize() override
finalize
bool particlesInCone(float eta, float phi, float dr, std::vector< const FlowElement * > &output) const override
IFlowElementsInConeTool interface.
~FlowElementsInConeTool(void)
destructor
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.