Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing metadata retrieval from entries that contain chidren at TRestRun and TRestProcessRunner #265

Merged
merged 6 commits into from
Jul 13, 2022
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