23#ifndef RestCore_TRestMySQLToAnalysisProcess
24#define RestCore_TRestMySQLToAnalysisProcess
26#include "TRestEventProcess.h"
74 std::vector<std::vector<Double_t> >
fDBdata;
100 void LoadConfig(
const std::string& configFilename,
const std::string& name =
"");
A base class for any REST event process.
A base class for any REST event.
This process connects to a SQL database and adds new observables inside the analysis tree.
std::vector< TString > fAnaTreeVariables
The name of the varibles will be renamed to these values in the analysisTree.
void LoadDefaultConfig()
Function to load the default config in absence of RML input.
const char * GetProcessName() const override
Returns the name of this process.
Double_t fSampling
Defines the internal sampling of the retrieved data for quick access.
std::string fDBServerName
The host indentification name or IP.
void InitFromConfigFile() override
Function reading input parameters from the RML TRestMySQLToAnalysisProcess section.
Double_t GetDBValueAtTimestamp(Int_t index, Double_t timestamp)
This method will retrieve the given data field component, specified by the argument index at the give...
std::string BuildQueryString()
Dedicated method to help building the SQL query string.
ClassDefOverride(TRestMySQLToAnalysisProcess, 2)
If new members are added, removed or modified in this class version number must be increased!
Double_t fStartTimestamp
Stores the start timestamp used to extract the SQL data.
TRestEvent * fEvent
A pointer to the event data.
std::string fDBTable
The database table.
std::vector< Double_t > fMinValues
The minimum value of the corresponding extracted field variable.
TRestEventProcess * Maker()
Returns a new instance of this class.
void InitProcess() override
Function to use in initialization of process members before starting to process the event.
std::string fDBName
The database name.
void FillDBArrays()
This method is the one accessing the SQL database and filling the internal arrays with data that will...
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
void PrintMetadata() override
It prints out basic information of the SQL database used to generate the analysis tree observables....
void Initialize() override
Function to initialize input/output event members and define the section name and library version.
TRestMySQLToAnalysisProcess()
Default constructor.
~TRestMySQLToAnalysisProcess()
Default destructor.
Double_t fEndTimestamp
Stores the end timestamp used to extract the SQL data.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
void LoadConfig(const std::string &configFilename, const std::string &name="")
Function to load the configuration from an external configuration file.
Bool_t fCheckSQL
A boolean to output a warning message just once inside the process.
std::vector< Double_t > fMaxValues
The maximum value of the corresponding extracted field variable.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.
Bool_t fDataBaseExists
It will be true in case the database found some entries for the timestamp range.
std::string fDBUserName
The database username.
std::vector< std::vector< Double_t > > fDBdata
A matrix containing extracted SQL data with fixed time bin.
std::string fDBUserPass
The database user password.
std::vector< TString > fSQLVariables
The name of the entries defined by user that will be retrieved at the SQL database.