Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
Track.h
Go to the documentation of this file.
1
8#ifndef PANDORA_TRACK_H
9#define PANDORA_TRACK_H 1
10
12#include "Pandora/StatusCodes.h"
13
14namespace pandora
15{
16
17template<typename T> class InputObjectManager;
18template<typename T, typename S> class PandoraObjectFactory;
19
20//------------------------------------------------------------------------------------------------------------------------------------------
21
25class Track
26{
27public:
33 float GetD0() const;
34
40 float GetZ0() const;
41
47 int GetParticleId() const;
48
54 int GetCharge() const;
55
61 float GetMass() const;
62
68 const CartesianVector &GetMomentumAtDca() const;
69
75 float GetEnergyAtDca() const;
76
82 const TrackState &GetTrackStateAtStart() const;
83
89 const TrackState &GetTrackStateAtEnd() const;
90
97
103 float GetTimeAtCalorimeter() const;
104
110 bool ReachesCalorimeter() const;
111
117 bool IsProjectedToEndCap() const;
118
124 bool CanFormPfo() const;
125
131 bool CanFormClusterlessPfo() const;
132
138 bool HasAssociatedCluster() const;
139
145 const Cluster *GetAssociatedCluster() const;
146
153
159 const void *GetParentAddress() const;
160
166 const TrackList &GetParentList() const;
167
173 const TrackList &GetSiblingList() const;
174
180 const TrackList &GetDaughterList() const;
181
187 bool IsAvailable() const;
188
196 bool operator< (const Track &rhs) const;
197
198protected:
204 Track(const object_creation::Track::Parameters &parameters);
205
209 virtual ~Track();
210
216 void SetMCParticleWeightMap(const MCParticleWeightMap &mcParticleWeightMap);
217
221 void RemoveMCParticles();
222
228 StatusCode SetAssociatedCluster(const Cluster *const pCluster);
229
235 StatusCode RemoveAssociatedCluster(const Cluster *const pCluster);
236
242 StatusCode AddParent(const Track *const pTrack);
243
249 StatusCode AddDaughter(const Track *const pTrack);
250
256 StatusCode AddSibling(const Track *const pTrack);
257
263 void SetAvailability(bool isAvailable);
264
265 const float m_d0;
266 const float m_z0;
267 const int m_particleId;
268 const int m_charge;
269 const float m_mass;
271 const float m_energyAtDca;
278 const bool m_canFormPfo;
282 const void *m_pParentAddress;
287
288 friend class TrackManager;
289 friend class InputObjectManager<Track>;
291};
292
293//------------------------------------------------------------------------------------------------------------------------------------------
294
295inline float Track::GetD0() const
296{
297 return m_d0;
298}
299
300//------------------------------------------------------------------------------------------------------------------------------------------
301
302inline float Track::GetZ0() const
303{
304 return m_z0;
305}
306
307//------------------------------------------------------------------------------------------------------------------------------------------
308
309inline int Track::GetParticleId() const
310{
311 return m_particleId;
312}
313
314//------------------------------------------------------------------------------------------------------------------------------------------
315
316inline int Track::GetCharge() const
317{
318 return m_charge;
319}
320
321//------------------------------------------------------------------------------------------------------------------------------------------
322
323inline float Track::GetMass() const
324{
325 return m_mass;
326}
327
328//------------------------------------------------------------------------------------------------------------------------------------------
329
331{
332 return m_momentumAtDca;
333}
334
335//------------------------------------------------------------------------------------------------------------------------------------------
336
337inline float Track::GetEnergyAtDca() const
338{
339 return m_energyAtDca;
340}
341
342//------------------------------------------------------------------------------------------------------------------------------------------
343
345{
346 return m_trackStateAtStart;
347}
348
349//------------------------------------------------------------------------------------------------------------------------------------------
350
352{
353 return m_trackStateAtEnd;
354}
355
356//------------------------------------------------------------------------------------------------------------------------------------------
357
362
363//------------------------------------------------------------------------------------------------------------------------------------------
364
365inline float Track::GetTimeAtCalorimeter() const
366{
367 return m_timeAtCalorimeter;
368}
369
370//------------------------------------------------------------------------------------------------------------------------------------------
371
372inline bool Track::ReachesCalorimeter() const
373{
375}
376
377//------------------------------------------------------------------------------------------------------------------------------------------
378
379inline bool Track::IsProjectedToEndCap() const
380{
382}
383
384//------------------------------------------------------------------------------------------------------------------------------------------
385
386inline bool Track::CanFormPfo() const
387{
388 return m_canFormPfo;
389}
390
391//------------------------------------------------------------------------------------------------------------------------------------------
392
394{
396}
397
398//------------------------------------------------------------------------------------------------------------------------------------------
399
401{
402 return (nullptr != m_pAssociatedCluster);
403}
404
405//------------------------------------------------------------------------------------------------------------------------------------------
406
411
412//------------------------------------------------------------------------------------------------------------------------------------------
413
414inline const void *Track::GetParentAddress() const
415{
416 return m_pParentAddress;
417}
418
419//------------------------------------------------------------------------------------------------------------------------------------------
420
421inline const TrackList &Track::GetParentList() const
422{
423 return m_parentTrackList;
424}
425
426//------------------------------------------------------------------------------------------------------------------------------------------
427
428inline const TrackList &Track::GetSiblingList() const
429{
430 return m_siblingTrackList;
431}
432
433//------------------------------------------------------------------------------------------------------------------------------------------
434
436{
437 return m_daughterTrackList;
438}
439
440//------------------------------------------------------------------------------------------------------------------------------------------
441
442inline bool Track::IsAvailable() const
443{
444 return m_isAvailable;
445}
446
447//------------------------------------------------------------------------------------------------------------------------------------------
448
449inline void Track::SetAvailability(bool isAvailable)
450{
451 m_isAvailable = isAvailable;
452}
453
454} // namespace pandora
455
456#endif // #ifndef PANDORA_TRACK_H
Header file for pandora object creation classes.
Header file defining status codes and relevant preprocessor macros.
CartesianVector class.
Cluster class.
Definition Cluster.h:31
InputObjectManager class.
PandoraObjectFactory class.
Track class.
Definition Track.h:26
bool CanFormClusterlessPfo() const
Whether track should form a pfo, even if it has no associated cluster.
Definition Track.h:393
MCParticleWeightMap m_mcParticleWeightMap
The mc particle weight map.
Definition Track.h:281
float GetZ0() const
Get the z coordinate at the 2D distance of closest approach.
Definition Track.h:302
const TrackState & GetTrackStateAtStart() const
Get the track state at the start of the track.
Definition Track.h:344
StatusCode SetAssociatedCluster(const Cluster *const pCluster)
Set the cluster associated with the track.
Definition Track.cc:95
void SetMCParticleWeightMap(const MCParticleWeightMap &mcParticleWeightMap)
Set the mc particles associated with the track.
Definition Track.cc:81
float GetEnergyAtDca() const
Get the track energy at the 2D distance of closest approach.
Definition Track.h:337
const int m_charge
The charge of the tracked particle.
Definition Track.h:268
bool ReachesCalorimeter() const
Whether the track reaches the calorimeter.
Definition Track.h:372
const float m_d0
The 2D impact parameter wrt (0,0), units mm.
Definition Track.h:265
bool IsProjectedToEndCap() const
Whether the calorimeter projection is to an endcap.
Definition Track.h:379
bool HasAssociatedCluster() const
Whether the track has an associated cluster.
Definition Track.h:400
const void * m_pParentAddress
The address of the parent track in the user framework.
Definition Track.h:282
StatusCode AddSibling(const Track *const pTrack)
Add a sibling track to the sibling track list.
Definition Track.cc:148
const bool m_isProjectedToEndCap
Whether the calorimeter projection is to an endcap.
Definition Track.h:277
bool operator<(const Track &rhs) const
operator< sorting by position at calorimeter, then energy at the 2D distance of closest approach
Definition Track.cc:27
const CartesianVector & GetMomentumAtDca() const
Get the track momentum at the 2D distance of closest approach.
Definition Track.h:330
int GetParticleId() const
Get the PDG code of the tracked particle.
Definition Track.h:309
const float m_energyAtDca
The track energy at the 2D distance of closest approach, units GeV.
Definition Track.h:271
const TrackState & GetTrackStateAtEnd() const
Get the track state at the end of the track.
Definition Track.h:351
const float m_timeAtCalorimeter
The (sometimes projected) time at the calorimeter, units ns.
Definition Track.h:275
const Cluster * GetAssociatedCluster() const
Get address of the cluster associated with the track.
Definition Track.cc:17
const float m_z0
The z coordinate at the 2D distance of closest approach, units mm.
Definition Track.h:266
const CartesianVector m_momentumAtDca
The momentum vector at the 2D distance of closest approach, units GeV.
Definition Track.h:270
const TrackList & GetParentList() const
Get the parent track list.
Definition Track.h:421
void RemoveMCParticles()
Remove the mc particles associated with the track.
Definition Track.cc:88
StatusCode AddDaughter(const Track *const pTrack)
Add a daughter track to the daughter track list.
Definition Track.cc:134
bool IsAvailable() const
Whether the track is available to be added to a particle flow object.
Definition Track.h:442
const TrackState m_trackStateAtStart
The track state at the start of the track, units mm and GeV.
Definition Track.h:272
const bool m_canFormPfo
Whether track should form a pfo, if it has an associated cluster.
Definition Track.h:278
virtual ~Track()
Destructor.
Definition Track.cc:75
float GetTimeAtCalorimeter() const
Get the (sometimes projected) time at the calorimeter.
Definition Track.h:365
void SetAvailability(bool isAvailable)
Set availability of track to be added to a particle flow object.
Definition Track.h:449
StatusCode RemoveAssociatedCluster(const Cluster *const pCluster)
Remove the association with a cluster.
Definition Track.cc:109
const TrackState m_trackStateAtCalorimeter
The (sometimes projected) track state at the calorimeter, units mm and GeV.
Definition Track.h:274
bool CanFormPfo() const
Whether track should form a pfo, if it has an associated cluster.
Definition Track.h:386
int GetCharge() const
Get the charge of the tracked particle.
Definition Track.h:316
const float m_mass
The mass of the tracked particle, units GeV.
Definition Track.h:269
TrackList m_siblingTrackList
The list of sibling track addresses.
Definition Track.h:284
float GetD0() const
Get the 2D impact parameter wrt (0,0)
Definition Track.h:295
const TrackState m_trackStateAtEnd
The track state at the end of the track, units mm and GeV.
Definition Track.h:273
const int m_particleId
The PDG code of the tracked particle.
Definition Track.h:267
const TrackList & GetDaughterList() const
Get the daughter track list.
Definition Track.h:435
StatusCode AddParent(const Track *const pTrack)
Add a parent track to the parent track list.
Definition Track.cc:120
TrackList m_parentTrackList
The list of parent track addresses.
Definition Track.h:283
const TrackState & GetTrackStateAtCalorimeter() const
Get the (sometimes projected) track state at the calorimeter.
Definition Track.h:358
float GetMass() const
Get the mass of the tracked particle, units GeV.
Definition Track.h:323
const MCParticleWeightMap & GetMCParticleWeightMap() const
Get mc particle weight map for the track.
Definition Track.h:407
const TrackList & GetSiblingList() const
Get the sibling track list.
Definition Track.h:428
const void * GetParentAddress() const
Get the address of the parent track in the user framework.
Definition Track.h:414
bool m_isAvailable
Whether the track is available to be added to a particle flow object.
Definition Track.h:286
TrackList m_daughterTrackList
The list of daughter track addresses.
Definition Track.h:285
const Cluster * m_pAssociatedCluster
The address of an associated cluster.
Definition Track.h:280
const bool m_canFormClusterlessPfo
Whether track should form a pfo, even if it has no associated cluster.
Definition Track.h:279
const bool m_reachesCalorimeter
Whether the track actually reaches the calorimeter.
Definition Track.h:276
TrackManager class.
TrackState class.
Definition TrackState.h:22
std::unordered_map< const MCParticle *, float > MCParticleWeightMap
MANAGED_CONTAINER< const Track * > TrackList
StatusCode
The StatusCode enum.