93#include "TRestTrackLineAnalysisProcess.h"
95#include "TRestTrackReductionProcess.h"
135 for (
int t = 0; t <
fTrackEvent->GetNumberOfTracks(); t++)
141 TVector3 orig = TVector3(0, 0, 0), end = TVector3(0, 0, 0);
142 Double_t length = -1;
143 Double_t angle = -10;
144 bool downwards =
true;
145 Double_t trackEnergyX = 0, trackEnergyY = 0;
146 Double_t trackBalanceX = 0, trackBalanceY = 0, trackBalance = 0, relZ = 0;
150 if (fLineAnaMethod ==
"3D") {
153 if (fLineAnaMethod !=
"default") {
155 <<
"Line analysis method " << fLineAnaMethod
156 <<
" is not implemented, supported methods are: default and 3D. Falling back to default."
162 RESTDebug <<
"Origin: " << orig.X() <<
" y: " << orig.Y() <<
" z: " << orig.Z() <<
RESTendl;
163 RESTDebug <<
"End : " << end.X() <<
" y: " << end.Y() <<
" z: " << end.Z() <<
RESTendl;
166 double dX = (orig.X() - end.X());
167 double dY = (orig.Y() - end.Y());
168 double dZ = (orig.Z() - end.Z());
169 length = TMath::Sqrt(dX * dX + dY * dY + dZ * dZ);
170 angle = TMath::ACos(dZ / length);
173 RESTDebug <<
"Track length " << length <<
" angle: " << angle <<
RESTendl;
175 trackEnergyX = tckX->GetEnergy();
176 trackEnergyY = tckY->GetEnergy();
178 if (trackEnergyX > 0) trackBalanceX = trackEnergyX /
fTrackEvent->GetEnergy(
"X");
179 if (trackEnergyY > 0) trackBalanceY = trackEnergyY /
fTrackEvent->GetEnergy(
"Y");
180 if (trackEnergyX > 0 && trackEnergyY > 0)
186 Double_t trackEnergy = trackEnergyX + trackEnergyY;
204 if (!tckX || !tckY)
return nullptr;
207 tckX->SetParentID(tckX->GetTrackID());
212 tckY->SetParentID(tckY->GetTrackID());
void SetObservableValue(const std::string &name, const T &value)
Set observable value for AnalysisTree.
A base class for any REST event.
TRestVolumeHits GetMaxTrackBoundaries3D(TVector3 &orig, TVector3 &end)
This function retrieves the origin and the end track positions based after the reconstruction of a 3D...
Double_t GetMaxTrackRelativeZ()
Function to calculate the relative Z of the most energetic track to crosscheck if the track is upward...
void GetMaxTrackBoundaries(TVector3 &orig, TVector3 &end)
This function retreive the origin and the end of the track based on the most energetic hit....
A process to identify and extrack origin and end of a track assuming a linear track.
void InitProcess() override
Process initialization. Nothing to do...
void Initialize() override
Function to initialize input/output event members and define the section name.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestTrackEvent * fTrackEvent
A pointer to the input event Track Event.
~TRestTrackLineAnalysisProcess()
Default destructor.
void EndProcess() override
Function to include required actions after all events have been processed. Nothing to do....
TRestTrackEvent * fOutTrackEvent
A pointer to the output event Track event.
TRestTrackLineAnalysisProcess()
Default constructor.