84#include "TRestSummaryProcess.h"
123 SetName(this->ClassName());
124 SetTitle(
"Default config");
173 Int_t nEntries = GetFullAnalysisTree()->GetEntries();
174 Double_t startTime =
fRunInfo->GetStartTimestamp();
175 Double_t endTime =
fRunInfo->GetEndTimestamp();
177 fMeanRate = nEntries / (endTime - startTime);
185 for (
auto const& x :
fRMS) {
253 RESTMetadata << x.first <<
" average:" << x.second <<
RESTendl;
255 if (a.X() != -1 && a.Y() != -1)
256 RESTMetadata <<
" range : (" << a.X() <<
", " << a.Y() <<
")" <<
RESTendl;
258 for (
auto const& x :
fRMS) {
260 RESTMetadata << x.first <<
" RMS:" << x.second <<
RESTendl;
262 if (a.X() != -1 && a.Y() != -1)
263 RESTMetadata <<
" range : (" << a.X() <<
", " << a.Y() <<
")" <<
RESTendl;
267 RESTMetadata << x.first <<
" Maximum:" << x.second <<
RESTendl;
269 if (a.X() != -1 && a.Y() != -1)
270 RESTMetadata <<
" range : (" << a.X() <<
", " << a.Y() <<
")" <<
RESTendl;
274 RESTMetadata << x.first <<
" Minimum:" << x.second <<
RESTendl;
276 if (a.X() != -1 && a.Y() != -1)
277 RESTMetadata <<
" range : (" << a.X() <<
", " << a.Y() <<
")" <<
RESTendl;
Double_t GetObservableMaximum(const TString &obsName, Double_t xLow=-1, Double_t xHigh=-1)
It returns the maximum value of obsName considering the given range. If no range is given the full hi...
Double_t GetObservableAverage(const TString &obsName, Double_t xLow=-1, Double_t xHigh=-1)
It returns the average of the observable considering the given range. If no range is given the full h...
Double_t GetObservableRMS(const TString &obsName, Double_t xLow=-1, Double_t xHigh=-1)
It returns the RMS of the observable considering the given range. If no range is given the full histo...
Double_t GetObservableMinimum(const TString &obsName, Double_t xLow=-1, Double_t xHigh=-1)
It returns the minimum value of obsName considering the given range. If no range is given the full hi...
void BeginPrintProcess()
[name, cut range]
TRestRun * fRunInfo
< Pointer to TRestRun object where to find metadata.
A base class for any REST event.
@ REST_Info
+show most of the information for each steps
A process to define basic data members to serve as a metadata summary in a data processing chain.
void EndProcess() override
Function to use when all events have been processed.
std::map< TString, TVector2 > fMinimumRange
If defined it will set the range where minimum is calculated.
std::map< TString, TVector2 > fMaximumRange
If defined it will set the range where maximum is calculated.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
Double_t fMeanRate
The mean rate during the run, calculated as the final number of entries in the run.
void InitFromConfigFile() override
Function reading input parameters from the RML TRestSummaryProcess section.
void Initialize() override
Function to initialize input/output event members and define the section name and library version.
TRestEvent * fEvent
The event pointer is not used in this process.
Double_t fMeanRateSigma
The mean rate sigma calculated as the square root of the corresponding mean rate counts.
std::map< TString, TVector2 > fRMSRange
If defined it will set the range where RMS is calculated.
std::map< TString, TVector2 > fAverageRange
If defined it will set the range where average is calculated.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
TRestSummaryProcess()
Default constructor.
std::map< TString, Double_t > fMaximum
It will register the maximum value of an existing analyisTree observable.
void InitProcess() override
Function to use in initialization of process members before starting to process the event.
std::map< TString, Double_t > fAverage
It will register the average of an existing analyisTree observable.
~TRestSummaryProcess()
Default destructor.
std::map< TString, Double_t > fRMS
It will register the RMS of an existing analysisTree observable.
std::map< TString, Double_t > fMinimum
It will register the minimum value of an existing analyisTree observable.
TVector2 StringTo2DVector(std::string in)
Gets a 2D-vector from a string.