ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParticlePerigeePairAtOOAssociationTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
13
14
22
23
24namespace D3PD {
25
26
34 (const std::string& type,
35 const std::string& name,
36 const IInterface* parent)
37 : Base (type, name, parent),
38 m_assocGetter (this)
39{
40 declareProperty ("AssocGetter", m_assocGetter,
41 "Getter for the association object.");
42}
43
44
49{
50 CHECK( Base::initialize() );
51 if (!m_assocGetter.empty()) {
52 CHECK( m_assocGetter.retrieve() );
53 CHECK( m_assocGetter->configureD3PD<TrackParticleAssocs> () );
54 }
55 return StatusCode::SUCCESS;
56}
57
58
67 (const Rec::TrackParticle& track)
68{
69 const Rec::TrackParticle& oldtrack = findOldtrack (track);
70 return new D3PD::PerigeePair (track.perigee(), oldtrack.perigee());
71}
72
73
82 (const xAOD::TrackParticle& track)
83{
85 orig ("originalTrackParticle");
86 if (!orig.isAvailable(track) || !orig(track).isValid())
87 return 0;
88
89 return new D3PD::PerigeePair (&track.perigeeParameters(),
90 &(*orig(track))->perigeeParameters());
91}
92
93
103
104
110 (const Rec::TrackParticle& track)
111{
112 if (track.info().trackFitter() != Trk::TrackInfo::GaussianSumFilter)
113 return track;
114
116 if (!assocs) {
117 REPORT_MESSAGE (MSG::WARNING) << "Can't find GSF track association.";
118 return track;
119 }
120
123 const Rec::TrackParticle* ret = 0;
124 if (beg != end && beg.isValid())
125 ret = dynamic_cast<const Rec::TrackParticle*> (*beg);
126 m_assocGetter->releaseObject (assocs);
127 if (!ret) {
128 REPORT_MESSAGE (MSG::WARNING)
129 << "Can't find original track for GSF refitted track.";
130 return track;
131 }
132
133 return *ret;
134}
135
136
137} // namespace D3PD
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
#define CHECK(...)
Evaluate an expression and check for errors.
Abstract interface to get an object to put in the tuple.
Associate from a TrackParticle to the default Perigees for both itself and the original track (if it ...
asso_iterator beginAssociation(const object_type *objectPointer) const
begin iterator for associations
asso_iterator endAssociation(const object_type *objectPointer) const
end iterator for associations
const Rec::TrackParticle & findOldtrack(const Rec::TrackParticle &track)
Find the original track corresponding to a possibly refitted track.
virtual void releaseObject(const D3PD::PerigeePair *p)
Release an object retrieved from the association.
virtual const D3PD::PerigeePair * get(const Rec::TrackParticle &p)
Return the target object.
virtual StatusCode initialize()
Standard Gaudi initialize method.
SingleAssociationTool< Types< Rec::TrackParticle, xAOD::TrackParticle >, D3PD::PerigeePair > Base
TrackParticlePerigeePairAtOOAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
ToolHandle< IObjGetterTool > m_assocGetter
Property: Getter for the association object.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
@ GaussianSumFilter
Tracks from Gaussian Sum Filter.
const Perigee * perigee() const
Attempts to cast the definingParameters() to Perigee.
Block filler tool for noisy FEB information.
TrackParticle_v1 TrackParticle
Reference the current persistent version: