1#ifndef RestCore_TRestProcessRunner
2#define RestCore_TRestProcessRunner
7#include "TRestAnalysisTree.h"
9#include "TRestEventProcess.h"
10#include "TRestMetadata.h"
12#include "TRestTools.h"
14#define TIME_MEASUREMENT
39 std::vector<TRestThread*> fThreads;
41 TFile* fOutputDataFile;
46 ProcStatus fProcStatus;
53 Bool_t fValidateObservables;
54 Bool_t fSortOutputEvents;
55 Bool_t fInputAnalysisStorage;
56 Bool_t fInputEventStorage;
57 Bool_t fOutputEventStorage;
58 Bool_t fOutputAnalysisStorage;
62 Int_t fEventsToProcess;
63 Int_t fProcessedEvents;
65 Long64_t fFileSplitSize;
66 Int_t fFileCompression;
67 std::map<std::string, std::string> fProcessInfo;
78 TiXmlElement* e =
fElement->FirstChildElement();
79 while (e !=
nullptr) {
80 std::string value = e->Value();
81 if (value ==
"variable" || value ==
"myParameter" || value ==
"constant") {
82 e = e->NextSiblingElement();
86 e = e->NextSiblingElement();
92 Int_t
ReadConfig(
const std::string& keydeclare, TiXmlElement* e);
116 TFile* GetOutputDataFile() {
return fOutputDataFile; }
117 std::string GetProcInfo(std::string infoname) {
118 return fProcessInfo[infoname] ==
"" ? infoname : fProcessInfo[infoname];
120 inline int GetNThreads()
const {
return fThreadNumber; }
121 inline int GetNProcesses()
const {
return fProcessNumber; }
122 inline int GetNProcessedEvents()
const {
return fProcessedEvents; }
123 double GetReadingSpeed();
125 inline ProcStatus GetStatus()
const {
return fProcStatus; }
126 inline Long64_t GetFileSplitSize()
const {
return fFileSplitSize; }
129 TRestProcessRunner();
130 ~TRestProcessRunner();
132 ClassDefOverride(TRestProcessRunner, 7);
REST core data-saving helper based on TTree.
A base class for any REST event process.
A base class for any REST event.
Managing applications and executing tasks.
TString fOutputDataFileName
the TFile pointer being used
void ReadProcInfo()
Create a process info list which used called by TRestRun::FormFormat().
void PrintProcessedEvents(Int_t rateE)
Print number of events processed, file read speed, ETA and a progress bar.
void ResetRunTimes()
Reset running time count to 0.
void BeginOfInit()
Reads information from rml config file.
Int_t ReadConfig(const std::string &keydeclare, TiXmlElement *e)
method to deal with iterated child elements
void MergeOutputFile()
Calls TRestRun::MergeOutputFile() to merge the main file with process's tmp file.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
void RunProcess()
The main executer of event process.
void EndOfInit()
Ending of the startup procedure.
TRestEventProcess * InstantiateProcess(TString type, TiXmlElement *ele)
InstantiateProcess in sequential start up.
void PauseMenu()
A pause menu providing some functions during the process.
void Initialize() override
REST run class.
std::string MakeProgressBar(int progress100, int length=100)
Make a string of progress bar with given length and percentage.
void WriteProcessesMetadata(TFile *destination=nullptr)
Write process metadata to the requested file, or fOutputDataFile by default.
Int_t GetNextevtFunc(TRestEvent *targetevt, TRestAnalysisTree *targettree)
Get next event and copy it to the address of targetevt.
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
Bool_t fUseTestRun
Number of files being split.
void FillThreadEventFunc(TRestThread *t)
Calling back the FillEvent() method in TRestThread.
void ConfigOutputFile()
Forming an output file.
Data provider and manager in REST.
Threaded worker of a process chain.