@@ -55,14 +55,15 @@ static bool splitObjectPath(const std::string& fullPath, std::string& path, std:
5555
5656static std::shared_ptr<MonitorObject> getMOFromRun (repository::DatabaseInterface* qcdb, const std::string& fullPath, uint32_t run, Activity activity)
5757{
58+ ILOG (Info, Devel) << " Loading object '" << fullPath << " ' for reference run '" << run << " ' and activity " << activity << ENDM ;
5859 uint64_t timeStamp = 0 ;
5960 activity.mId = run;
6061 const auto filterMetadata = activity_helpers::asDatabaseMetadata (activity, false );
6162 const auto objectValidity = qcdb->getLatestObjectValidity (activity.mProvenance + " /" + fullPath, filterMetadata);
6263 if (objectValidity.isValid ()) {
6364 timeStamp = objectValidity.getMax () - 1 ;
6465 } else {
65- ILOG (Warning, Devel) << " Could not find the object '" << fullPath << " ' for run " << activity.mId << ENDM ;
66+ ILOG (Warning, Devel) << " Could not find the object '" << fullPath << " ' for reference run " << activity.mId << ENDM ;
6667 return nullptr ;
6768 }
6869
@@ -135,16 +136,33 @@ void ReferenceComparatorTask::configure(const boost::property_tree::ptree& confi
135136
136137// _________________________________________________________________________________________
137138
138- void ReferenceComparatorTask::initialize (quality_control::postprocessing::Trigger t, framework::ServiceRegistryRef services)
139+ static std::string getCustomParameter (const o2::quality_control::core::CustomParameters& customParameters, const std::string& key, const Activity& activity, const std::string& defaultValue)
140+ {
141+ std::string value;
142+ auto valueOptional = customParameters.atOptional (key, activity);
143+ if (valueOptional.has_value ()) {
144+ value = valueOptional.value ();
145+ } else {
146+ value = customParameters.atOptional (key).value_or (defaultValue);
147+ }
148+
149+ return value;
150+ }
151+
152+ // _________________________________________________________________________________________
153+
154+ void ReferenceComparatorTask::initialize (quality_control::postprocessing::Trigger trigger, framework::ServiceRegistryRef services)
139155{
140156 // reset all existing objects
141157 mPlotNames .clear ();
142158 mReferencePlots .clear ();
143159 mHistograms .clear ();
144160
145161 auto & qcdb = services.get <repository::DatabaseInterface>();
146- mNotOlderThan = std::stoi (mCustomParameters .atOptional (" notOlderThan" ).value_or (" 120" ));
147- mReferenceRun = std::stoi (mCustomParameters .atOptional (" referenceRun" ).value_or (" 0" ));
162+ mNotOlderThan = std::stoi (getCustomParameter (mCustomParameters , " notOlderThan" , trigger.activity , " 120" ));
163+ mReferenceRun = std::stoi (getCustomParameter (mCustomParameters , " referenceRun" , trigger.activity , " 0" ));
164+
165+ ILOG (Info, Devel) << " Reference run set to '" << mReferenceRun << " ' for activity " << trigger.activity << ENDM ;
148166
149167 // load and initialize the input groups
150168 for (auto group : mConfig .dataGroups ) {
@@ -156,7 +174,7 @@ void ReferenceComparatorTask::initialize(quality_control::postprocessing::Trigge
156174 auto fullOutPath = group.outputPath + " /" + path;
157175
158176 // retrieve the reference MO
159- auto referencePlot = getReferencePlot (qcdb, fullRefPath, t .activity );
177+ auto referencePlot = getReferencePlot (qcdb, fullRefPath, trigger .activity );
160178 if (!referencePlot) {
161179 continue ;
162180 }
0 commit comments