Skip to content

Commit a0910bf

Browse files
committed
update documentation
1 parent 6a331c0 commit a0910bf

2 files changed

Lines changed: 24 additions & 15 deletions

File tree

Detectors/Base/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,24 @@ and the method `GRPGeomRequest::instance()->checkUpdates(pc)` is called in the b
2525
```cpp
2626
class MyTask {
2727
public:
28-
MyTask(std::shared_ptr<GRPGeomRequest> req, ...)
29-
{
30-
GRPGeomRequest::instance()->setRequest(req);
28+
MyTask(std::shared_ptr<GRPGeomRequest> req, ...) : mCCDBReq(req) {
29+
}
30+
void init(o2::framework::InitContext& ic) {
31+
GRPGeomHelper::instance()->setRequest(req);
3132
...
3233
}
3334
void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
3435
{
35-
GRPGeomRequest::instance()->finaliseCCDB(matcher, obj);
36+
GRPGeomHelper::instance()->finaliseCCDB(matcher, obj);
3637
...
3738
}
3839
void run(ProcessingContext& pc)
3940
{
40-
GRPGeomRequest::instance()->checkUpdates(pc);
41+
GRPGeomHelper::instance()->checkUpdates(pc);
4142
...
4243
}
44+
protected:
45+
std::shared_ptr<GRPGeomRequest> mCCDBReq;
4346
};
4447
```
4548

Detectors/Calibration/README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ The calibration flow of O2 foresees that every calibration device (expected to a
99
## TimeSlotCalibration<Input, Container>
1010
Each calibration device (to be run in a workflow) has to derive from `o2::calibration::TimeSlotCalibration`, which is a templated class that takes as types the Input type (i.e. the object to be processed, coming from the upstream device) and the Container type (i.e. the object that will contain the calibration data per TimeSlot). Each calibration device has to be configured with the following parameters:
1111

12-
```cpp
13-
tf-per-slot : default length of a TiemSlot in TFs (will be widened in case of too little statistics). If this is set to `std::numeric_limits<long>::max()`, then there will be
14-
only 1 slot at a time, valid till infinity.
15-
updateInterval : to be used together with `tf-per-slot = std::numeric_limits<long>::max()`: it allows to try to finalize the slot (and produce calibration) when the `updateInterval`
16-
has passed. Note that this is an approximation (as explained in the code) due to the fact that TFs will come asynchronously (not ordered in time).
17-
max-delay : maximum arrival delay of a TF with respect to the most recent one processed; units in number of TimeSlots; if beyond this, the TF will be considered too old, and discarded.
18-
If `tf-per-slot == std::numeric_limits<long>::max()`, or `updateAtTheEndOfRunOnly == true`, its value is irrelevant.
19-
updateAtTheEndOfRunOnly : to tell the TimeCalibration to finalize the slots and prepare the CCDB entries only at the end of the run.
20-
```
12+
`tf-per-slot` : default length of a TiemSlot in TFs (will be widened in case of too little statistics). If this is set to `o2::calibration::INFINITE_TF`, then there will be only 1 slot at a time, valid till infinity. Value 0 is reserved for a special mode: a single slot w/o explicit boundaries is
13+
filled until the requested statistics is reached. Once `hasEnoughData` return true, the slot will be closed with really seen min/max TFs and new one will be created with lower boundary equal the end of the previous slot.
14+
The slot duration can be also set via methods `setSlotLengthInSeconds(int s)` or `setSlotLengthInOrbits(int n)`, which will be internally converted (and rounded) to the number of TFs at the 1st TF processing (when the NHBF per orbit will be available from the GRPECS).
15+
16+
`updateInterval` : to be used together with `tf-per-slot = o2::calibration::INFINITE_TF`: it allows to try to finalize the slot (and produce calibration) when the `updateInterval` has passed. Note that this is an approximation (as explained in the code) due to the fact that TFs will come asynchronously (not ordered in time).
17+
18+
`max-delay` : maximum arrival delay of a TF with respect to the most recent one processed; units in number of TimeSlots; if beyond this, the TF will be considered too old, and discarded.
19+
If `tf-per-slot == o2::calibration::INFINITE_TF`, or `updateAtTheEndOfRunOnly == true`, its value is irrelevant.
20+
21+
`updateAtTheEndOfRunOnly` : to tell the TimeCalibration to finalize the slots and prepare the CCDB entries only at the end of the run.
22+
2123
Example for the options above:
2224
`tf-per-slot = 20`
2325
`max-delay = 3`
@@ -31,7 +33,7 @@ Each calibration device has to implement the following methods:
3133

3234
`void finalizeSlot(o2::calibration::TimeSlot<Container>& slot)` : method to process the calibration data accumulated in each TimeSlot;
3335

34-
`o2::calibration::TimeSlot<Container>& slot emplaceNewSlot(bool front, uint64_t tstart, uint64_t tend` : method to creata a new TimeSlot; this is specific to the calibration procedure as it instantiates the detector-calibration-specific object.
36+
`o2::calibration::TimeSlot<Container>& slot emplaceNewSlot(bool front, TFType tstart, TFType tend)` : method to creata a new TimeSlot; this is specific to the calibration procedure as it instantiates the detector-calibration-specific object.
3537

3638
See e.g. LHCClockCalibrator.h/cxx in AliceO2/Detectors/TOF/calibration/include/TOFCalibration/LHCClockCalibrator.h and AliceO2/Detectors/TOF/calibration/srcLHCClockCalibrator.cxx
3739

@@ -51,6 +53,8 @@ If provided, this latter method will be used.
5153

5254
See e.g. LHCClockCalibrator.h/cxx in AliceO2/Detectors/TOF/calibration/include/TOFCalibration/LHCClockCalibrator.h and AliceO2/Detectors/TOF/calibration/srcLHCClockCalibrator.cxx
5355

56+
The Slot provides a generic methods to access its boundaries: `getTFStart()` and `getTFEnd()` in terms of TF counter (as assigned by the DataDistribution) and `getStartTimeMS()`, `getEndTimeMS()` for the absolute time stamp in milleseconds.
57+
5458
## detector-specific-calibrator-workflow
5559

5660
Each calibration will need to be implemented in the form of a workflow, whose options should include those for the calibration device itself (`tf-per-slot` and `max-delay`, see above).
@@ -68,6 +72,8 @@ output.snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, "TOF_LHCph
6872
output.snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TOF_LHCphase", i}, w); // root-serialized
6973
```
7074
75+
Note that in order to access the absolute time of the slot boundaries, one should subscribe to CTP orbit reset time object (at least) via GRPGeomHelper class.
76+
7177
See e.g. AliceO2/Detectors/TOF/calibration/testWorkflow/LHCClockCalibratorSpec.h, AliceO2/Detectors/TOF/calibration/testWorkflow/lhc-clockphase-workflow.cxx
7278
7379
## ccdb-populator-workflow

0 commit comments

Comments
 (0)