ATLAS Offline Software
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 >>>>>>
12 #include "PFlowObjectsInConeTool.h"
13 #include "PFlowUtils/PFODefs.h"
14 
15 namespace xAOD {
16 
17  //<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>>
18 
19  PFlowObjectsInConeTool::PFlowObjectsInConeTool (const std::string& type, const std::string& name, const IInterface* 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
xAOD::PFlowObjectsInConeTool::m_pfokey
SG::ReadHandleKey< PFOContainer > m_pfokey
to retrieve pflow objects
Definition: PFlowObjectsInConeTool.h:43
PFlowObjectsInConeTool.h
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::PFlowObjectsInConeTool::~PFlowObjectsInConeTool
~PFlowObjectsInConeTool(void)
destructor
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition: ITkPixQCoreEncodingLUT.h:19
PFODefs.h
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
parseDir.wh
wh
Definition: parseDir.py:46
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
merge.output
output
Definition: merge.py:17
xAOD::PFlowObjectsInConeTool::initialize
StatusCode initialize() override
initialize
Definition: PFlowObjectsInConeTool.cxx:29
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::IParticlesLookUpTable
2D look up table for iParticles
Definition: IParticlesLookUpTable.h:17
xAOD::PFlowObjectsInConeTool::getTable
const LookUpTable * getTable() const
Definition: PFlowObjectsInConeTool.cxx:39
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::PFlowObjectsInConeTool::finalize
StatusCode finalize() override
finalize
Definition: PFlowObjectsInConeTool.cxx:34
xAOD::PFlowObjectsInConeTool::PFlowObjectsInConeTool
PFlowObjectsInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition: PFlowObjectsInConeTool.cxx:19
xAOD::PFlowObjectsInConeTool::particlesInCone
bool particlesInCone(float eta, float phi, float dr, std::vector< const PFO * > &output) const override
IPFlowObjectsInConeTool interface.
Definition: PFlowObjectsInConeTool.cxx:58