ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticlesInConeTool.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// TrackParticlesInConeTool
7//
8// (c) ATLAS software
10
12
13namespace xAOD {
14
15 TrackParticlesInConeTool::TrackParticlesInConeTool (const std::string& type, const std::string& name, const IInterface* parent)
16 : AthAlgTool(type, name, parent)
17 {
18 declareInterface<ITrackParticlesInConeTool>(this);
19 }
20
22
25 return StatusCode::SUCCESS;
26 }
27
29 return StatusCode::SUCCESS;
30 }
31
34 {
35 const std::string tableName = name() + "LookUpTable";
36 SG::ReadHandle<LookUpTable> rh (tableName);
37 if (rh.isValid())
38 return &*rh;
39
41 if( !indetTrackParticles.isValid() ) {
42 ATH_MSG_ERROR("Could not open the TrackParticle container with key "
44 return nullptr;
45 }
46 auto lut = std::make_unique<LookUpTable>();
47 lut->init(*indetTrackParticles);
48 SG::WriteHandle<LookUpTable> wh (tableName);
49 return wh.put (std::move (lut), true);
50 }
51
52 bool TrackParticlesInConeTool::particlesInCone( float eta, float phi, float dr, std::vector< const TrackParticle*>& output ) const {
53
55 const LookUpTable* lut = getTable();
56 return lut->iParticlesInCone( eta, phi, dr, output );
57 }
58} // end of namespace
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(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?
TrackParticlesInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
virtual bool particlesInCone(float eta, float phi, float dr, std::vector< const TrackParticle * > &output) const override
ITrackParticlesInConeTool interface.
virtual StatusCode finalize() override
finalize
SG::ReadHandleKey< TrackParticleContainer > m_indetTrackParticleLocation
ID track collection name.
IParticlesLookUpTable< TrackParticle > LookUpTable
virtual StatusCode initialize() override
initialize
virtual ~TrackParticlesInConeTool(void)
destructor
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.