Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions source/framework/core/inc/TRestRun.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ class TRestRun : public TRestMetadata {
int fEventIndexCounter = 0; //!
bool fHangUpEndFile = false; //!
bool fFromRML = false; //!

void InitFromConfigFile();

private:
string ReplaceMetadataMember(const string instr);

public:
/// REST run class
void Initialize();
void InitFromConfigFile();

// file operation
void OpenInputFile(int i);
Expand Down Expand Up @@ -239,7 +241,7 @@ class TRestRun : public TRestMetadata {

// Construtor & Destructor
TRestRun();
TRestRun(string rootfilename);
TRestRun(string filename);
~TRestRun();

ClassDef(TRestRun, 4);
Expand Down
13 changes: 10 additions & 3 deletions source/framework/core/src/TRestRun.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ ClassImp(TRestRun);

TRestRun::TRestRun() { Initialize(); }

TRestRun::TRestRun(string rootfilename) {
Initialize();
OpenInputFile(rootfilename);
TRestRun::TRestRun(string filename) {
if (filename.find(".root") != string::npos) {
Initialize();
OpenInputFile(filename);
} else if (filename.find(".rml") != string::npos) {
Initialize();
LoadConfigFromFile(filename);
} else {
ferr << "TRestRun::TRestRun(): input file error!" << endl;
}
}

TRestRun::~TRestRun() {
Expand Down