11#include "TRestTrackPointLikeAnalysisProcess.h"
17TRestTrackPointLikeAnalysisProcess::TRestTrackPointLikeAnalysisProcess() {
Initialize(); }
19TRestTrackPointLikeAnalysisProcess::TRestTrackPointLikeAnalysisProcess(
const char* configFilename) {
25TRestTrackPointLikeAnalysisProcess::~TRestTrackPointLikeAnalysisProcess() {}
27void TRestTrackPointLikeAnalysisProcess::LoadDefaultConfig() { SetTitle(
"Default config"); }
33 fTrackEvent =
nullptr;
36void TRestTrackPointLikeAnalysisProcess::LoadConfig(
string configFilename) {
47 Int_t nTracks = fTrackEvent->GetNumberOfTracks();
48 Int_t nTotalHits = fTrackEvent->GetTotalHits();
50 Double_t totEnergy = 0;
51 Double_t maxTrackEnergy = 0;
53 Double_t totLength = 0;
54 Double_t maxTrackLength = 0;
56 Int_t maxNumberHits = 0;
60 for (
int tck = 0; tck < fTrackEvent->GetNumberOfTracks(); tck++) {
61 Double_t trackEnergy = fTrackEvent->GetTrack(tck)->GetEnergy();
62 if (trackEnergy > maxTrackEnergy) {
63 maxTrackEnergy = trackEnergy;
66 totEnergy += trackEnergy;
68 Double_t trackLength = fTrackEvent->GetTrack(tck)->GetTrackLength();
69 if (trackLength > maxTrackLength) maxTrackLength = trackLength;
70 totLength += trackLength;
72 Int_t numberHits = fTrackEvent->GetTrack(tck)->GetVolumeHits()->GetNumberOfHits();
73 if (numberHits > maxNumberHits) maxNumberHits = numberHits;
77 Double_t maxClusterSize = 0;
79 for (
unsigned int cl = 0; cl < fTrackEvent->GetTrack(maxIndex)->GetVolumeHits()->GetNumberOfHits();
81 Double_t clusterSize = fTrackEvent->GetTrack(maxIndex)->GetVolumeHits()->GetClusterSize(cl);
82 if (clusterSize > maxClusterSize) maxClusterSize = clusterSize;
83 totSize += clusterSize;
86 Double_t clusterEnergyBalance = maxTrackEnergy / totEnergy;
87 Double_t clusterLengthBalance = maxTrackLength / totLength;
88 Double_t hitsBalance = maxNumberHits / nTotalHits;
89 Double_t clusterSizeBalance = maxClusterSize / totSize;
void SetObservableValue(const std::string &name, const T &value)
Set observable value for AnalysisTree.
A base class for any REST event.
void EndProcess() override
To be executed at the end of the run (outside event loop)
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
Process one event.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void Initialize() override
Making default settings.
void InitProcess() override
To be executed at the beginning of the run (outside event loop)