55 #include "TRestDetectorHitsGaussAnalysisProcess.h"
83 LoadConfig(configFilename);
90 delete fInputHitsEvent;
91 delete fOutputHitsEvent;
98 SetName(this->ClassName());
99 SetTitle(
"Default config");
115 if (LoadConfigFromFile(configFilename, name)) LoadDefaultConfig();
132 SetSectionName(this->ClassName());
133 SetLibraryVersion(LIBRARY_VERSION);
136 fInputHitsEvent =
nullptr;
149 TRestHits* hits = fInputHitsEvent->GetHits();
151 for (
unsigned int n = 0; n < hits->GetNumberOfHits(); n++) {
152 Double_t eDep = hits->GetEnergy(n);
154 Double_t x = hits->GetX(n);
155 Double_t y = hits->GetY(n);
156 Double_t z = hits->GetZ(n);
158 auto time = hits->GetTime(n);
159 auto type = hits->GetType(n);
161 fOutputHitsEvent->AddHit(x, y, z, eDep, time, type);
164 Double_t gausSigmaX = fOutputHitsEvent->GetGaussSigmaX(fError, fNHitsMin);
165 Double_t gausSigmaY = fOutputHitsEvent->GetGaussSigmaY(fError, fNHitsMin);
166 Double_t gausSigmaZ = fOutputHitsEvent->GetGaussSigmaZ(fError, fNHitsMin);
167 Double_t xy2SigmaGaus = (gausSigmaX == -1. || gausSigmaY == -1.)
169 : (gausSigmaX * gausSigmaX) + (gausSigmaY * gausSigmaY);
170 Double_t xySigmaBalanceGaus = (gausSigmaX == -1. || gausSigmaY == -1.)
172 : (gausSigmaX - gausSigmaY) / (gausSigmaX + gausSigmaY);
174 if (hits->GetNumberOfHits() > 30 && xy2SigmaGaus < 0.05)
175 RESTDebug <<
string(
"Event ID: ") << to_string(fInputHitsEvent->GetID()) << string(
"||") << RESTendl;
177 SetObservableValue(
"xSigmaGaus", gausSigmaX);
178 SetObservableValue(
"ySigmaGaus", gausSigmaY);
179 SetObservableValue(
"zSigmaGaus", gausSigmaZ);
180 SetObservableValue(
"xy2SigmaGaus", xy2SigmaGaus);
181 SetObservableValue(
"xySigmaBalanceGaus", xySigmaBalanceGaus);
186 fOutputHitsEvent->PrintEvent();
191 return fOutputHitsEvent;
202 RESTMetadata <<
"Pitch (mm) : " << fPitch << RESTendl;
203 RESTMetadata <<
"Error (ADC) : " << fError << RESTendl;
204 RESTMetadata <<
"Minimum number of hits to apply correction : " << fNHitsMin << RESTendl;
An analysis REST process to extract valuable information from Hits type of data performing gaussian f...
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestDetectorHitsGaussAnalysisProcess()
Default constructor.
void InitProcess() override
Function to use in initialization of process members before starting to process the event.
~TRestDetectorHitsGaussAnalysisProcess()
Default destructor.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
void Initialize() override
Function to initialize input/output event members and define the section name and library version.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
A base class for any REST event.
It saves a 3-coordinate position and an energy for each punctual deposition.
@ REST_Extreme
show everything
@ REST_Debug
+show the defined debug messages
Int_t GetChar(std::string hint="Press a KEY to continue ...")
Helps to pause the program, printing a message before pausing.