19 #include "TRestTrack.h"
25 TRestTrack::TRestTrack() {
29 TRestTrack::~TRestTrack() {
33 void TRestTrack::Initialize() {
38 fVolumeHits.RemoveHits();
43 fTrackEnergy = hits.GetTotalEnergy();
47 void TRestTrack::RemoveVolumeHits() {
48 fVolumeHits.RemoveHits();
61 const int nHits = fVolumeHits.GetNumberOfHits();
65 for (
int i = 0; i < nHits; i++) {
66 double en = fVolumeHits.GetEnergy(i);
73 TVector3 maxPos = fVolumeHits.GetPosition(maxBin);
75 TVector3 pos0 = fVolumeHits.GetPosition(0);
76 TVector3 posE = fVolumeHits.GetPosition(nHits - 1);
78 const double maxToFirst = (pos0 - maxPos).Mag();
79 const double maxToLast = (posE - maxPos).Mag();
81 if (maxToFirst < maxToLast) {
90 void TRestTrack::PrintTrack(Bool_t fullInfo) {
91 Double_t x = GetMeanPosition().X();
92 Double_t y = GetMeanPosition().Y();
93 Double_t z = GetMeanPosition().Z();
95 cout <<
"Track ID : " << fTrackID <<
" Parent ID : " << fParentID;
97 if (isXY()) cout <<
" is XY " << endl;
98 if (isXZ()) cout <<
" is XZ " << endl;
99 if (isYZ()) cout <<
" is YZ " << endl;
100 if (isXYZ()) cout <<
" is XYZ " << endl;
101 cout <<
"Energy : " << fTrackEnergy << endl;
102 cout <<
"Length : " << fTrackLength << endl;
103 cout <<
"Mean position : ( " << x <<
" , " << y <<
" , " << z <<
" ) " << endl;
104 cout <<
"Number of track hits : " << fVolumeHits.GetNumberOfHits() << endl;
105 cout <<
"----------------------------------------" << endl;
108 fVolumeHits.PrintHits();
109 cout <<
"----------------------------------------" << endl;
Double_t GetTotalDistance() const
It determines the distance required to travel from the first to the last hit adding all the distances...
void GetBoundaries(TVector3 &orig, TVector3 &end)
This function retreive the origin and the end of a single track based on the most energetic hit....