diff --git a/Framework/include/QualityControl/PostProcessingConfig.h b/Framework/include/QualityControl/PostProcessingConfig.h index 88a13d2e62..dce1d23a0f 100644 --- a/Framework/include/QualityControl/PostProcessingConfig.h +++ b/Framework/include/QualityControl/PostProcessingConfig.h @@ -43,6 +43,7 @@ struct PostProcessingConfig : public o2::quality_control::core::UserCodeConfig { core::Activity activity; bool matchAnyRunNumber = false; bool critical; + bool validityFromLastTriggerOnly = false; }; } // namespace o2::quality_control::postprocessing diff --git a/Framework/src/PostProcessingConfig.cxx b/Framework/src/PostProcessingConfig.cxx index 3c33ffda16..7bf029cd80 100644 --- a/Framework/src/PostProcessingConfig.cxx +++ b/Framework/src/PostProcessingConfig.cxx @@ -67,6 +67,7 @@ PostProcessingConfig::PostProcessingConfig(const std::string& id, const boost::p customParameters.set(key, value.get_value()); } } + validityFromLastTriggerOnly = ppTree.get("validityFromLastTriggerOnly", false); } } // namespace o2::quality_control::postprocessing diff --git a/Framework/src/PostProcessingRunner.cxx b/Framework/src/PostProcessingRunner.cxx index d54cb50c24..2d7e10d273 100644 --- a/Framework/src/PostProcessingRunner.cxx +++ b/Framework/src/PostProcessingRunner.cxx @@ -251,6 +251,10 @@ void PostProcessingRunner::reset() void PostProcessingRunner::updateValidity(const Trigger& trigger) { + if (mTaskConfig.validityFromLastTriggerOnly) { + mActivity.mValidity = gInvalidValidityInterval; + } + if (trigger == TriggerType::UserOrControl) { // we ignore it, because it would not make sense to use current time in tracking objects from the past, // especially in asynchronous postprocessing diff --git a/doc/Advanced.md b/doc/Advanced.md index d71fd959a2..b627baa6bc 100644 --- a/doc/Advanced.md +++ b/doc/Advanced.md @@ -1879,14 +1879,20 @@ declared inside in the "postprocessing" path. Please also refer to [the Post-pro "moduleName": "QcSkeleton", "": "Library name. It can be found in CMakeLists of the detector module.", "detectorName": "TST", "": "3-letter code of the detector.", "initTrigger": [ "", "List of initialization triggers", - "startofrun", "", "An example of an init trigger" + "userorcontrol", "", "An example of an init trigger" ], "updateTrigger": [ "", "List of update triggers", "10min", "", "An example of an update trigger" ], "stopTrigger": [ "", "List of stop triggers", - "endofrun", "", "An example of a stop trigger" - ] + "userorcontrol", "", "An example of a stop trigger" + ], + "validityFromLastTriggerOnly": "false", "": "If true, the output objects will use validity of the last trigger,", + "": "otherwise a union of all triggers' validity is used by default.", + "sourceRepo": { "": "It allows to specify a different repository for the input objects.", + "implementation": "CCDB", + "host": "another-test.cern.ch:8080" + } } } } diff --git a/doc/PostProcessing.md b/doc/PostProcessing.md index b137e1f0cd..83aa08b5e4 100644 --- a/doc/PostProcessing.md +++ b/doc/PostProcessing.md @@ -164,6 +164,7 @@ Each of the three methods can be invoked by one or more triggers. Below are list pass and run. * `"once"` - Once - triggers only first time it is checked * `"always"` - Always - triggers each time it is checked +* `"userorcontrol"` - triggers when upon corresponding START and STOP state transitions. This is the recommended trigger for `initTrigger` and `stopTrigger`. #### Using different databases @@ -189,6 +190,23 @@ The destination repository is always the global one defined in the global config } ``` +#### Output object validity + +By default, the objects published by post-processing tasks use narrowest validity which contains all past triggers (except of `userorcontrol`). +In other words, a trend's validity covers all of the input objects' validity. + +If a post-processing task is not used for trending, but e.g. to decorate or correlate some moving window objects while preserving their validity, one can set the `validityFromLastTriggerOnly` parameter: + +``` + "postprocessing": { + "MyPostProcessingTaskID": { + ... + "validityFromLastTriggerOnly": "true", "": "false by default" + ... + } + ... +``` + ### Running it The post-processing tasks can be run in three ways. First uses the usual `o2-qc` executable which relies on DPL and