Skip to content

Commit 82f5ed7

Browse files
authored
Allow for using only last trigger validity in postprocessing (#2541)
Closes QC-1281.
1 parent 01ca4aa commit 82f5ed7

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

Framework/include/QualityControl/PostProcessingConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct PostProcessingConfig : public o2::quality_control::core::UserCodeConfig {
4343
core::Activity activity;
4444
bool matchAnyRunNumber = false;
4545
bool critical;
46+
bool validityFromLastTriggerOnly = false;
4647
};
4748

4849
} // namespace o2::quality_control::postprocessing

Framework/src/PostProcessingConfig.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ PostProcessingConfig::PostProcessingConfig(const std::string& id, const boost::p
6767
customParameters.set(key, value.get_value<std::string>());
6868
}
6969
}
70+
validityFromLastTriggerOnly = ppTree.get<bool>("validityFromLastTriggerOnly", false);
7071
}
7172

7273
} // namespace o2::quality_control::postprocessing

Framework/src/PostProcessingRunner.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ void PostProcessingRunner::reset()
251251

252252
void PostProcessingRunner::updateValidity(const Trigger& trigger)
253253
{
254+
if (mTaskConfig.validityFromLastTriggerOnly) {
255+
mActivity.mValidity = gInvalidValidityInterval;
256+
}
257+
254258
if (trigger == TriggerType::UserOrControl) {
255259
// we ignore it, because it would not make sense to use current time in tracking objects from the past,
256260
// especially in asynchronous postprocessing

doc/Advanced.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,14 +1878,20 @@ declared inside in the "postprocessing" path. Please also refer to [the Post-pro
18781878
"moduleName": "QcSkeleton", "": "Library name. It can be found in CMakeLists of the detector module.",
18791879
"detectorName": "TST", "": "3-letter code of the detector.",
18801880
"initTrigger": [ "", "List of initialization triggers",
1881-
"startofrun", "", "An example of an init trigger"
1881+
"userorcontrol", "", "An example of an init trigger"
18821882
],
18831883
"updateTrigger": [ "", "List of update triggers",
18841884
"10min", "", "An example of an update trigger"
18851885
],
18861886
"stopTrigger": [ "", "List of stop triggers",
1887-
"endofrun", "", "An example of a stop trigger"
1888-
]
1887+
"userorcontrol", "", "An example of a stop trigger"
1888+
],
1889+
"validityFromLastTriggerOnly": "false", "": "If true, the output objects will use validity of the last trigger,",
1890+
"": "otherwise a union of all triggers' validity is used by default.",
1891+
"sourceRepo": { "": "It allows to specify a different repository for the input objects.",
1892+
"implementation": "CCDB",
1893+
"host": "another-test.cern.ch:8080"
1894+
}
18891895
}
18901896
}
18911897
}

doc/PostProcessing.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ Each of the three methods can be invoked by one or more triggers. Below are list
164164
pass and run.
165165
* `"once"` - Once - triggers only first time it is checked
166166
* `"always"` - Always - triggers each time it is checked
167+
* `"userorcontrol"` - triggers when upon corresponding START and STOP state transitions. This is the recommended trigger for `initTrigger` and `stopTrigger`.
167168

168169
#### Using different databases
169170

@@ -189,6 +190,23 @@ The destination repository is always the global one defined in the global config
189190
}
190191
```
191192

193+
#### Output object validity
194+
195+
By default, the objects published by post-processing tasks use narrowest validity which contains all past triggers (except of `userorcontrol`).
196+
In other words, a trend's validity covers all of the input objects' validity.
197+
198+
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:
199+
200+
```
201+
"postprocessing": {
202+
"MyPostProcessingTaskID": {
203+
...
204+
"validityFromLastTriggerOnly": "true", "": "false by default"
205+
...
206+
}
207+
...
208+
```
209+
192210
### Running it
193211

194212
The post-processing tasks can be run in three ways. First uses the usual `o2-qc` executable which relies on DPL and

0 commit comments

Comments
 (0)