Skip to content

Commit

Permalink
Merge pull request #265 from rest-for-physics/jgalan_metadata_fixes
Browse files Browse the repository at this point in the history
Fixing metadata retrieval from entries that contain chidren at TRestRun and TRestProcessRunner
  • Loading branch information
jgalan authored Jul 13, 2022
2 parents 0829d5f + 43506a4 commit f6874df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion source/framework/core/src/TRestMetadata.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,11 @@ TRestMetadata* TRestMetadata::InstantiateChildMetadata(int index, std::string pa
if (pattern == "" || xmlChild.find(pattern) != string::npos) {
if (count == index) {
TClass* c = TClass::GetClass(xmlChild.c_str());
if (c) // this means we have the metadata class was found
if (c) // this means that the metadata class was found
{
TRestMetadata* md = (TRestMetadata*)c->New();
if (!md) return nullptr;
md->SetConfigFile(fConfigFileName);
TiXmlElement* rootEle = GetElementFromFile(fConfigFileName);
TiXmlElement* Global = GetElement("globals", rootEle);
md->LoadConfigFromElement(paraele, Global, {});
Expand Down
6 changes: 2 additions & 4 deletions source/framework/core/src/TRestProcessRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include "unistd.h"
#endif // !WIN32



std::mutex mutex_write;

using namespace std;
Expand Down Expand Up @@ -689,8 +687,7 @@ void TRestProcessRunner::PauseMenu() {
fProcStatus = kNormal;
RESTInfo << "Continue processing..." << RESTendl;

#endif // WIN32

#endif // WIN32

break;
} else if (b == 'n') {
Expand Down Expand Up @@ -1019,6 +1016,7 @@ TRestEventProcess* TRestProcessRunner::InstantiateProcess(TString type, TiXmlEle
TRestEventProcess* pc = REST_Reflection::Assembly((string)type);
if (pc == nullptr) return nullptr;

pc->SetConfigFile(fConfigFileName);
pc->SetRunInfo(this->fRunInfo);
pc->SetHostmgr(fHostmgr);
pc->SetObservableValidation(fValidateObservables);
Expand Down
1 change: 1 addition & 0 deletions source/framework/core/src/TRestRun.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ void TRestRun::InitFromConfigFile() {
e = e->NextSiblingElement();
continue;
}
meta->SetConfigFile(fConfigFileName);
meta->SetHostmgr(fHostmgr);
fMetadata.push_back(meta);
meta->LoadConfigFromElement(e, fElementGlobal);
Expand Down

0 comments on commit f6874df

Please sign in to comment.