File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -59,13 +59,15 @@ class TRestRun : public TRestMetadata {
5959 int fEventIndexCounter = 0 ; // !
6060 bool fHangUpEndFile = false ; // !
6161 bool fFromRML = false ; // !
62+
63+ void InitFromConfigFile ();
64+
6265 private:
6366 string ReplaceMetadataMember (const string instr);
6467
6568 public:
6669 // / REST run class
6770 void Initialize ();
68- void InitFromConfigFile ();
6971
7072 // file operation
7173 void OpenInputFile (int i);
@@ -239,7 +241,7 @@ class TRestRun : public TRestMetadata {
239241
240242 // Construtor & Destructor
241243 TRestRun ();
242- TRestRun (string rootfilename );
244+ TRestRun (string filename );
243245 ~TRestRun ();
244246
245247 ClassDef (TRestRun, 4 );
Original file line number Diff line number Diff line change @@ -38,9 +38,16 @@ ClassImp(TRestRun);
3838
3939TRestRun::TRestRun () { Initialize (); }
4040
41- TRestRun::TRestRun (string rootfilename) {
42- Initialize ();
43- OpenInputFile (rootfilename);
41+ TRestRun::TRestRun (string filename) {
42+ if (filename.find (" .root" ) != string::npos) {
43+ Initialize ();
44+ OpenInputFile (filename);
45+ } else if (filename.find (" .rml" ) != string::npos) {
46+ Initialize ();
47+ LoadConfigFromFile (filename);
48+ } else {
49+ ferr << " TRestRun::TRestRun(): input file error!" << endl;
50+ }
4451}
4552
4653TRestRun::~TRestRun () {
You can’t perform that action at this time.
0 commit comments