ATLAS Offline Software
TrackParticleBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  TrackParticleBase.h - Description
7  -------------------
8  authors : Edward.Moyse@cern.ch (based on TrackParticleBase from andreas.wildauer@cern.ch, fredrik.akesson@cern.ch)
9 
10  Adding the TrackInfo to be stored at the AOD level: 2009-1-29
11  author: Kirill.Prokofiev@cern.ch
12 
13  ***************************************************************************/
14 #ifndef TRKPARTICLEBASE_TRKTRACKPARTICLEBASE_H
15 #define TRKPARTICLEBASE_TRKTRACKPARTICLEBASE_H
16 
17 // includes for datamembers
18 #include "AthLinks/ElementLink.h"
19 #include "TrkTrack/TrackCollection.h" // typedef
20 #include "VxVertex/VxContainer.h" // typedef
22 
23 #include "TrkTrack/Track.h" // no forward declare for now because needed in cast
24 #include <vector>
25 #include "TrkParameters/TrackParameters.h" // no forward declare for now because needed in cast
26 #include "TrkTrack/TrackInfo.h" // no forward declaration: we are storing the value
27 
28 
29 class MsgStream;
31 
32 namespace Trk
33 {
35 
36  class VxCandidate;
37  class TrackSummary;
38  class FitQuality;
39 
41  {
42  public:
43 
47 
65  TrackParticleBase( const Track* trk,
67  const VxCandidate* vxCandidate,
68  const TrackSummary* trkSummary,
69  std::vector<const TrackParameters*>& parameters,
70  const TrackParameters* definingParameter,
71  const FitQuality* fitQuality);
72 
74  const Trk::TrackParticleOrigin trkPrtOrigin,
75  const ElementLink<VxContainer>& vxCandidate,
76  std::unique_ptr<Trk::TrackSummary> trkSummary,
77  // passes ownership of elements.
78  std::vector<const Trk::TrackParameters*>&& parameters,
79  std::unique_ptr<Trk::FitQuality> fitQuality,
80  const TrackInfo& info);
81 
84 
88 
90  virtual ~TrackParticleBase();
91 
96  double charge() const;
97 
101  const Track* originalTrack() const;
102 
105  const VxCandidate* reconstructedVertex() const;
106 
108 
113 
117  const TrackParameters& definingParameters() const;
118 
124  const std::vector<const TrackParameters*>& trackParameters() const;
125 
131 
134  const TrackSummary* trackSummary() const;
135 
139  const FitQuality * fitQuality() const;
140 
144  const Perigee* perigee() const;
145 
146  void setStorableObject(const TrackCollection* trackColl);
147  void setStorableObject(const VxContainer* vxColl);
148  void setTrackLink ( const TrackCollection * cont, const Track * track);
149 
151  virtual MsgStream& dump( MsgStream& out ) const ;
152  virtual std::ostream& dump( std::ostream& out ) const ;
153 
157  const TrackInfo& info() const;
158 
159  protected:
160  friend class ::TrackParticleBaseCnv_p1;
161 
165 
171 
173  std::vector<const TrackParameters*> m_trackParameters;
174 
177 
180 
181 
187 
188  };
189 
193  MsgStream& operator << ( MsgStream& sl, const TrackParticleBase& trackParticleBase);
194 
198  std::ostream& operator << ( std::ostream& sl, const TrackParticleBase& trackParticleBase);
199 
200  inline double TrackParticleBase::charge(void) const
201  {
202  return definingParameters().charge();
203  }
204 
206  {
207  if (m_originalTrack.isValid()){
208  return *m_originalTrack;
209  }
210  return nullptr;
211 
212  }
213 
214  inline
216  {
217  if (m_elVxCandidate.isValid()) {
218  return *m_elVxCandidate;
219  }
220 
221  return nullptr;
222 
223  }
224 
226  {
227  return m_elVxCandidate;
228  }
229 
231  {
232  return &m_originalTrack;
233  }
234 
236  return m_trackParticleOrigin;
237  }
238 
240  return *( m_trackParameters.back() );
241  }
242 
243  inline const std::vector<const TrackParameters*>& TrackParticleBase::trackParameters() const {
244  return m_trackParameters;
245  }
246 
248  return m_trackSummary;
249  }
250 
253  }
254 
257  }
258 
260  return m_fitQuality;
261  }
262 
263  inline const Perigee* TrackParticleBase::perigee() const
264  {
265  return dynamic_cast<const Perigee*>( &(definingParameters()) );
266  }
267 
268  inline
270  {
272 }
274  }
275 
276  inline const TrackInfo& TrackParticleBase::info() const
277  {
278  return m_trackInfo;
279  }
280 
281 }
282 
283 #endif
TrackParticleBaseCnv_p1
Convertor for Trk::TrackParticleBase.
Definition: TrackParticleBaseCnv_p1.h:37
Trk::TrackParticleBase::particleOriginType
TrackParticleOrigin particleOriginType() const
Get the particle origin type.
Definition: TrackParticleBase.h:235
Trk::TrackParticleBase::operator=
TrackParticleBase & operator=(const TrackParticleBase &)
Assignement operator.
Definition: TrackParticleBase.cxx:116
Trk::TrackInfo
Contains information about the 'fitter' of this track.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:32
Trk::TrackParticleBase::charge
double charge() const
Return charge of the particle.
Definition: TrackParticleBase.h:200
Trk::TrackParticleBase::reconstructedVertexLink
const ElementLink< VxContainer > & reconstructedVertexLink() const
Definition: TrackParticleBase.h:225
TrackParameters.h
Trk::TrackParticleBase::setStorableObject
void setStorableObject(const TrackCollection *trackColl)
Definition: TrackParticleBase.h:251
Trk::ParametersBase::charge
double charge() const
Returns the charge.
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::VertexType
VertexType
Definition: VertexType.h:25
Trk::TrackParticleBase::trackSummary
const TrackSummary * trackSummary() const
accessor function for TrackSummary.
Definition: TrackParticleBase.h:247
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::TrackParticleBase::dump
virtual MsgStream & dump(MsgStream &out) const
Dump methods to be used by the overloaded stream operator (inheritance!)
Definition: TrackParticleBase.cxx:190
Track.h
Trk::TrackParticleBase
Definition: TrackParticleBase.h:41
Trk::TrackParticleBase::~TrackParticleBase
virtual ~TrackParticleBase()
Destructor.
Definition: TrackParticleBase.cxx:176
Trk::TrackParticleBase::setTrackLink
void setTrackLink(const TrackCollection *cont, const Track *track)
Definition: TrackParticleBase.h:269
Trk::TrackParticleBase::trackElementLink
const ElementLink< TrackCollection > * trackElementLink() const
Return the ElementLink to the Track.
Definition: TrackParticleBase.h:230
Trk::TrackParticleBase::m_elVxCandidate
ElementLink< VxContainer > m_elVxCandidate
ElementLink to a VxCandidate.
Definition: TrackParticleBase.h:170
TrackCollection.h
Trk::TrackParticleBase::TrackParticleBase
TrackParticleBase()
Constructor 0 standard constructor which sets everything to 0, needed for persistency.
Definition: TrackParticleBase.cxx:19
Trk::TrackParticleBase::fitQuality
const FitQuality * fitQuality() const
accessor function for FitQuality.
Definition: TrackParticleBase.h:259
Trk::TrackParticleOrigin
VertexType TrackParticleOrigin
Definition: TrackParticleBase.h:34
VxContainer.h
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Trk::ParametersBase
Definition: ParametersBase.h:55
VxContainer
Definition: VxContainer.h:28
DataVector< Trk::Track >
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackParticleBase::reconstructedVertex
const VxCandidate * reconstructedVertex() const
Get a pointer to the primary vertex.
Definition: TrackParticleBase.h:215
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
TrackInfo.h
Trk::TrackParticleBase::trackParameters
const std::vector< const TrackParameters * > & trackParameters() const
Returns the track parameters.
Definition: TrackParticleBase.h:243
xAOD::vertexType
vertexType
Definition: Vertex_v1.cxx:166
VertexType.h
Trk::TrackParticleBase::m_fitQuality
const FitQuality * m_fitQuality
the fit quality of this TrackParticle.
Definition: TrackParticleBase.h:179
Trk::TrackParticleBase::m_trackInfo
TrackInfo m_trackInfo
This is a class which stores the identity of where the track was created, fitted,...
Definition: TrackParticleBase.h:186
Trk::TrackParticleBase::m_trackParameters
std::vector< const TrackParameters * > m_trackParameters
DataVector of TrackParameters stored inside this TrackParticle.
Definition: TrackParticleBase.h:173
Trk::TrackParticleBase::m_trackSummary
const TrackSummary * m_trackSummary
the summary of this TrackParticle.
Definition: TrackParticleBase.h:176
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::VxCandidate
Definition: VxCandidate.h:27
Trk::TrackParticleBase::m_originalTrack
ElementLink< TrackCollection > m_originalTrack
ElementLink to the Track used to create this TrackParticleBase object Before writing to disk,...
Definition: TrackParticleBase.h:164
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::TrackParticleBase::definingParameters
const TrackParameters & definingParameters() const
Returns the 'defining' parameter of this TrackParticle.
Definition: TrackParticleBase.h:239
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::TrackParticleBase::perigee
const Perigee * perigee() const
Attempts to cast the definingParameters() to Perigee.
Definition: TrackParticleBase.h:263
Trk::TrackParticleBase::m_trackParticleOrigin
TrackParticleOrigin m_trackParticleOrigin
specifies the origin type of the particle (prim.vertex, ...)
Definition: TrackParticleBase.h:167
Trk::TrackParticleBase::originalTrack
const Track * originalTrack() const
Return pointer to associated track.
Definition: TrackParticleBase.h:205
Trk::TrackParticleBase::info
const TrackInfo & info() const
returns the info of the track.
Definition: TrackParticleBase.h:276