REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestTrack.h
1
18
19#ifndef RestCore_TRestTrack
20#define RestCore_TRestTrack
21
22#include <TObject.h>
23#include <TRestVolumeHits.h>
24#include <TVector3.h>
25
26#include <iostream>
27
29 protected:
30 Int_t fTrackID;
31 Int_t fParentID;
32 Double_t fTrackEnergy;
33 Double_t fTrackLength;
34
35 // Hit volumes
37
38 public:
39 void Initialize();
40
41 // Setters
42 void SetTrackID(Int_t sID) { fTrackID = sID; }
43 void SetParentID(Int_t pID) { fParentID = pID; }
44
45 void SetVolumeHits(TRestVolumeHits hits);
46 void RemoveVolumeHits();
47
48 Bool_t isXY() { return (&fVolumeHits)->areXY(); }
49 Bool_t isXZ() { return (&fVolumeHits)->areXZ(); }
50 Bool_t isYZ() { return (&fVolumeHits)->areYZ(); }
51 Bool_t isXYZ() { return (&fVolumeHits)->areXYZ(); }
52
53 // Getters
54 inline Int_t GetTrackID() const { return fTrackID; }
55 inline Int_t GetParentID() const { return fParentID; }
56 inline Double_t GetEnergy() const { return fTrackEnergy; }
57 inline Double_t GetTrackEnergy() const { return fTrackEnergy; }
58
59 Double_t GetLength(Bool_t update = true) { return GetTrackLength(update); }
60 Double_t GetTrackLength(Bool_t update = true) {
62 return fTrackLength;
63 }
64
65 inline Double_t GetMaximumDistance() const { return fVolumeHits.GetMaximumHitDistance(); }
66 inline Double_t GetMaximumDistance2() const { return fVolumeHits.GetMaximumHitDistance2(); }
67 inline Double_t GetVolume() const { return fVolumeHits.GetMaximumHitDistance2(); }
68
69 inline TVector3 GetMeanPosition() const { return fVolumeHits.GetMeanPosition(); }
70
71 TRestVolumeHits* GetVolumeHits() { return &fVolumeHits; }
72 TRestHits* GetHits() { return (TRestHits*)&fVolumeHits; }
73 inline Int_t GetNumberOfHits() { return GetVolumeHits()->GetNumberOfHits(); }
74
75 void PrintTrack(Bool_t fullInfo = true);
76
77 void GetBoundaries(TVector3& orig, TVector3& end);
78
79 // Constructor
80 TRestTrack();
81 // Destructor
83
84 ClassDef(TRestTrack, 3);
85};
86#endif
It saves a 3-coordinate position and an energy for each punctual deposition.
Definition: TRestHits.h:39
TVector3 GetMeanPosition() const
It calculates the mean position weighting with the energy of the hits. Each coordinate is calculated ...
Definition: TRestHits.cxx:658
Double_t GetTotalDistance() const
It determines the distance required to travel from the first to the last hit adding all the distances...
Definition: TRestHits.cxx:1192
Double_t GetMaximumHitDistance() const
It returns the maximum distance between 2-hits.
Definition: TRestHits.cxx:1352
Double_t GetMaximumHitDistance2() const
It returns the maximum squared distance between 2-hits.
Definition: TRestHits.cxx:1366
Int_t fTrackID
Track ID.
Definition: TRestTrack.h:30
Double_t fTrackEnergy
Total energy of the track.
Definition: TRestTrack.h:32
void GetBoundaries(TVector3 &orig, TVector3 &end)
This function retreive the origin and the end of a single track based on the most energetic hit....
Definition: TRestTrack.cxx:60
Double_t fTrackLength
Total length of the track.
Definition: TRestTrack.h:33
Int_t fParentID
Parent ID.
Definition: TRestTrack.h:31
TRestVolumeHits fVolumeHits
Hit volumes that define a track.
Definition: TRestTrack.h:36