diff --git a/ROOTUtils/PluginSaver.cc b/ROOTUtils/PluginSaver.cc index 4da407d..4e5a0b8 100644 --- a/ROOTUtils/PluginSaver.cc +++ b/ROOTUtils/PluginSaver.cc @@ -30,7 +30,7 @@ void PluginSaver::buildPlugins() { printf("Plugin '%s' missing from input file; skipped.\n", pnm.c_str()); continue; } - PB->second->makePlugin(this, inflname); + PB->second->makePlugin(this); } } else { /// construct all plugins diff --git a/ROOTUtils/PluginSaver.hh b/ROOTUtils/PluginSaver.hh index 7909136..a527a6a 100644 --- a/ROOTUtils/PluginSaver.hh +++ b/ROOTUtils/PluginSaver.hh @@ -14,7 +14,7 @@ class PluginBuilder { public: /// instantiate plugin SegmentSaver - virtual void makePlugin(OutputManager* pnt, const string& inflName = "") = 0; + virtual void makePlugin(SegmentSaver* pnt) = 0; SegmentSaver* thePlugin = NULL; ///< instantiated plugin (not memory managed here) }; diff --git a/ROOTUtils/SegmentSaver.cc b/ROOTUtils/SegmentSaver.cc index dc0a199..cb0bd3c 100644 --- a/ROOTUtils/SegmentSaver.cc +++ b/ROOTUtils/SegmentSaver.cc @@ -33,9 +33,13 @@ OutputManager(nm,pnt), ignoreMissingHistos(false), inflname(inflName), isCalcula dirIn = fIn->GetDirectory(""); inflAge = fileAge(inflname); printf("Loading data from %s [%.1f hours old]...\n",inflname.c_str(),inflAge/3600.); + } else { // try sub-directory of parent if file not specified + auto PSS = dynamic_cast(pnt); + if(PSS && PSS->dirIn) { + dirIn = PSS->dirIn->GetDirectory(nm.c_str()); + if(!dirIn) dirIn = PSS->dirIn; // fallback for backwards compatibility prior to subdirectories + } } - auto PSS = dynamic_cast(pnt); - if(PSS && PSS->dirIn) dirIn = PSS->dirIn->GetDirectory(nm.c_str()); } SegmentSaver::~SegmentSaver() {