REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestManager.h
1 #ifndef RestCore_TRestManager
2 #define RestCore_TRestManager
3 
4 #include <TApplication.h>
5 #include <TObject.h>
6 #include <TROOT.h>
7 
8 #include <iostream>
9 
10 #include "TRestAnalysisPlot.h"
11 #include "TRestMetadata.h"
12 #include "TRestProcessRunner.h"
13 #include "TRestRun.h"
14 
16 class TRestManager : public TRestMetadata {
17  private:
19  std::vector<TRestMetadata*> fMetaObjects;
20 
21  public:
22  void Initialize() override;
23  void InitFromConfigFile() override {
24  if (fElement != nullptr) {
25  TiXmlElement* e = fElement->FirstChildElement();
26  while (e != nullptr) {
27  std::string value = e->Value();
28  if (value == "variable" || value == "myParameter" || value == "constant") {
29  e = e->NextSiblingElement();
30  continue;
31  }
32  ReadConfig((std::string)e->Value(), e);
33  e = e->NextSiblingElement();
34  }
35  }
36  }
37  int LoadSectionMetadata() override;
38  Int_t ReadConfig(std::string keydeclare, TiXmlElement* e);
39 
40  void InitFromTask(std::string taskName, std::vector<std::string> arguments);
41 
42  // void LaunchTasks();
43 
44  void PrintMetadata() override;
45 
46  TRestProcessRunner* GetProcessRunner() {
47  return (TRestProcessRunner*)GetMetadataClass("TRestProcessRunner");
48  }
49  TRestRun* GetRunInfo() { return (TRestRun*)GetMetadataClass("TRestRun"); }
50  TRestAnalysisPlot* GetAnaPlot() { return (TRestAnalysisPlot*)GetMetadataClass("TRestAnalysisPlot"); }
51 
52  TRestMetadata* GetMetadata(std::string name);
53  TRestMetadata* GetMetadataClass(std::string type);
54 
55  TRestManager();
56  ~TRestManager();
57 
60 };
61 
62 #endif
Managing applications and executing tasks.
Definition: TRestManager.h:16
TRestMetadata * GetMetadataClass(std::string type)
Get the application metadata class, according to the type.
void Initialize() override
Set the class name as section name during initialization.
int LoadSectionMetadata() override
This method does some preparation of xml section.
std::vector< TRestMetadata * > fMetaObjects
app-like metadata objects
Definition: TRestManager.h:19
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
Definition: TRestManager.h:23
Int_t ReadConfig(std::string keydeclare, TiXmlElement *e)
Respond to the input xml element.
void PrintMetadata() override
PrintMetadata of this class.
ClassDefOverride(TRestManager, 1)
Call CINT to generate streamers for this class.
TRestMetadata * GetMetadata(std::string name)
Get the application metadata class, according to the name.
A base class for any REST metadata class.
Definition: TRestMetadata.h:74
TiXmlElement * fElement
Saving the sectional element together with global element.
Running the processes efficiently with fantastic display.
Data provider and manager in REST.
Definition: TRestRun.h:18