Skip to content

Commit e123cbc

Browse files
committed
Improve propagationServiceV2
* Make sure all the CCDB related objects get retrieved via the new table mechanism. * No need anymore for a centralised CCDBLoader object * Get rid of all BasicCCDBManager instances
1 parent e405b62 commit e123cbc

8 files changed

Lines changed: 332 additions & 86 deletions

File tree

Common/Core/TPCVDriftManager.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,27 @@ class TPCVDriftManager
6363
LOGP(info, "Updated VDrift for timestamp {} with vdrift={:.7f} (cm/ns)", mVD->creationTime, mTPCVDriftNS);
6464
}
6565

66+
// Adopts a drift correction obtained elsewhere, typically straight from the
67+
// aod::TpcCalibCCDBObjects column, so no CCDB manager is involved at all.
68+
void update(const o2::tpc::VDriftCorrFact& vd) noexcept
69+
{
70+
if (mVD == &vd) { // same object as last time, nothing to recompute
71+
return;
72+
}
73+
if (vd.firstTime < 0 || vd.lastTime < 0) {
74+
LOGP(error, "Got invalid VDriftCorrFact created at {}", vd.creationTime);
75+
mValid = false;
76+
return;
77+
}
78+
mVD = &vd;
79+
80+
// TODO account for laser calib
81+
82+
mTPCVDriftNS = mVD->refVDrift * mVD->corrFact * 1e-3;
83+
mValid = true;
84+
LOGP(info, "Updated VDrift for timestamp {} with vdrift={:.7f} (cm/ns)", mVD->creationTime, mTPCVDriftNS);
85+
}
86+
6687
template <typename BCs, typename Collisions, typename Collision, typename TrackExtra, typename Track>
6788
[[nodiscard]] bool moveTPCTrack(const Collision& col, const TrackExtra& trackExtra, Track& track) noexcept
6889
{

Common/DataModel/GloCCDBObjects.h

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,21 @@
3333
/// `DECLARE_SOA_TIMESTAMPED_TABLE` with the relevant subset of columns from
3434
/// the `o2::aod::ccdbGlo` namespace rather than joining `aod::GloCCDBObjects`.
3535
///
36-
/// Note: MatLayerCylSet is intentionally omitted — it requires
37-
/// `MatLayerCylSet::rectifyPtrFromFile()` after deserialisation, which the
38-
/// CCDB column mechanism does not perform.
36+
/// The material LUT lives in `aod::GeomCCDBObjects` rather than here: it belongs to
37+
/// the geometry/material family, whose validity is essentially static, and keeping it
38+
/// out means joining `aod::GloCCDBObjects` does not drag in a multi-hundred-MB object
39+
/// nobody asked for. Join whichever tables you need — the duplicated `aod::Timestamps`
40+
/// is deduplicated:
41+
/// \code
42+
/// using BCsWithLUT = soa::Join<aod::BCsWithTimestamps, aod::GeomCCDBObjects>;
43+
/// // rectifyPtrFromFile() is applied by the column's finaliser, so the
44+
/// // object handed back is ready to use; the task only has to (re)install it.
45+
/// auto* lut = &bcs.begin().matLUT();
46+
/// if (lut != mLastLUT) {
47+
/// o2::base::Propagator::Instance()->setMatLUT(lut);
48+
/// mLastLUT = lut;
49+
/// }
50+
/// \endcode
3951

4052
#ifndef COMMON_DATAMODEL_GLOCCDBOBJECTS_H_
4153
#define COMMON_DATAMODEL_GLOCCDBOBJECTS_H_
@@ -44,6 +56,7 @@
4456
#include <DataFormatsParameters/GRPECSObject.h>
4557
#include <DataFormatsParameters/GRPLHCIFData.h>
4658
#include <DataFormatsParameters/GRPMagField.h>
59+
#include <DetectorsBase/MatLayerCylSet.h>
4760
#include <Framework/ASoA.h>
4861
#include <Framework/AnalysisDataModel.h>
4962

@@ -55,11 +68,31 @@ DECLARE_SOA_CCDB_COLUMN(GRPMagField, grpMagField, o2::parameters::GRPMagField, "
5568
DECLARE_SOA_CCDB_COLUMN(MeanVertex, meanVertex, o2::dataformats::MeanVertexObject, "GLO/Calib/MeanVertex"); //!
5669
DECLARE_SOA_CCDB_COLUMN(GRPECSObject, grpECS, o2::parameters::GRPECSObject, "GLO/Config/GRPECS"); //!
5770
DECLARE_SOA_CCDB_COLUMN(GRPLHCIFData, grpLHCIF, o2::parameters::GRPLHCIFData, "GLO/Config/GRPLHCIF"); //!
71+
72+
/// The material LUT is a FlatObject: straight out of the ROOT streamer its internal
73+
/// pointers are unfixed and its voxel lookup is unbuilt, so it is finalised with
74+
/// MatLayerCylSet::rectifyPtrFromFile() before ever being handed to a task.
75+
DECLARE_SOA_CCDB_COLUMN_FULL(MatLUT, "fMatLUT", matLUT, o2::base::MatLayerCylSet, "GLO/Param/MatLUT", //!
76+
[](o2::base::MatLayerCylSet* lut) { return o2::base::MatLayerCylSet::rectifyPtrFromFile(lut); });
5877
} // namespace ccdbGlo
5978

6079
/// Full table — join with aod::BCsWithTimestamps to obtain all four objects.
6180
DECLARE_SOA_TIMESTAMPED_TABLE(GloCCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp, 1, "GLOCCDBOBJ", //!
6281
ccdbGlo::GRPMagField, ccdbGlo::MeanVertex, ccdbGlo::GRPECSObject, ccdbGlo::GRPLHCIFData);
82+
83+
/// Geometry and material description: objects which describe where the detector material
84+
/// is, and which share an essentially static interval of validity. Kept apart from the GRP
85+
/// family above, which changes per run (and, for GRPMagField, per timeframe).
86+
/// The aligned/ideal geometry and the per-detector alignment objects belong here too when
87+
/// they get columns; see GRPGeomRequest in O2 (GLO/Config/GeometryAligned, GLO/Config/Geometry,
88+
/// <DET>/Calib/Align) for the family.
89+
/// Join it alongside aod::GloCCDBObjects when a task needs both — the duplicated
90+
/// aod::Timestamps is deduplicated when the joined table's originals are merged.
91+
/// Uniform in the run number: the geometry/material description does not change within a
92+
/// run, so the fetcher queries once per distinct run rather than once per BC.
93+
DECLARE_SOA_UNIFORM_TABLE(GeomCCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp,
94+
aod::BCs, o2::aod::bc::RunNumber, 1, "GEOMCCDBOBJ", //!
95+
ccdbGlo::MatLUT);
6396
} // namespace o2::aod
6497

6598
#endif // COMMON_DATAMODEL_GLOCCDBOBJECTS_H_

Common/DataModel/TpcCCDBObjects.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file TpcCCDBObjects.h
13+
/// \brief Declarative CCDB columns for TPC calibration objects.
14+
///
15+
/// Unlike the geometry/material family in GloCCDBObjects.h, the drift velocity
16+
/// genuinely varies within a run, so the table keeps the default uniformity — one
17+
/// object per distinct timestamp — rather than collapsing per run.
18+
///
19+
/// Usage:
20+
/// \code
21+
/// using BCsWithVDrift = soa::Join<aod::BCsWithTimestamps, aod::TpcCalibCCDBObjects>;
22+
/// vdriftManager.update(bc.vdriftTgl());
23+
/// \endcode
24+
25+
#ifndef COMMON_DATAMODEL_TPCCCDBOBJECTS_H_
26+
#define COMMON_DATAMODEL_TPCCCDBOBJECTS_H_
27+
28+
#include <DataFormatsTPC/VDriftCorrFact.h>
29+
#include <Framework/ASoA.h>
30+
#include <Framework/AnalysisDataModel.h>
31+
32+
namespace o2::aod
33+
{
34+
namespace ccdbTpc
35+
{
36+
DECLARE_SOA_CCDB_COLUMN(VDriftTgl, vdriftTgl, o2::tpc::VDriftCorrFact, "TPC/Calib/VDriftTgl"); //!
37+
} // namespace ccdbTpc
38+
39+
DECLARE_SOA_TIMESTAMPED_TABLE(TpcCalibCCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp, 1, "TPCCALIBCCDB", //!
40+
ccdbTpc::VDriftTgl);
41+
} // namespace o2::aod
42+
43+
#endif // COMMON_DATAMODEL_TPCCCDBOBJECTS_H_
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file TrackTunerCCDBObjects.h
13+
/// \brief Declarative CCDB columns for the TrackTuner DCA / Q-over-pt calibrations.
14+
///
15+
/// The DCA calibration is published under a different path per data-taking period, so
16+
/// the column declares a uniformity-value-to-path mapping rather than a single path:
17+
/// the fetcher picks the entry whose run range contains the row's run number. This
18+
/// replaces TrackTuner::getPathInputFileAutomaticFromCCDB(), whose run ranges these are.
19+
/// A run matching no range is a fatal error, as it was before — there is deliberately no
20+
/// fallback entry, since silently using another period's calibration is worse than stopping.
21+
///
22+
/// The ranges are the column's *default*; the whole mapping can be replaced at runtime
23+
/// through the "ccdb:fTrackTunerDca" option, so adding a period need not be a code change.
24+
25+
#ifndef COMMON_DATAMODEL_TRACKTUNERCCDBOBJECTS_H_
26+
#define COMMON_DATAMODEL_TRACKTUNERCCDBOBJECTS_H_
27+
28+
#include <Framework/ASoA.h>
29+
#include <Framework/AnalysisDataModel.h>
30+
31+
#include <TList.h>
32+
33+
namespace o2::aod
34+
{
35+
namespace ccdbTrackTuner
36+
{
37+
DECLARE_SOA_CCDB_COLUMN(TrackTunerDca, trackTunerDca, TList, //!
38+
"520259-529691=Users/m/mfaggin/test/inputsTrackTuner/pp2023/pass4/vsPhi;"
39+
"534998-543113=Users/m/mfaggin/test/inputsTrackTuner/pp2023/pass4/vsPhi;"
40+
"529397-529418=Users/m/mfaggin/test/inputsTrackTuner/PbPb2023/apass4/vsPhi;"
41+
"543437-545367=Users/m/mfaggin/test/inputsTrackTuner/PbPb2023/apass4/vsPhi;"
42+
"549559-558807=Users/m/mfaggin/test/inputsTrackTuner/pp2024/pass1_minBias/vsPhi;"
43+
"564356-564445=Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25ae;"
44+
"564468-564472=Users/m/mfaggin/test/inputsTrackTuner/OO/LHC25af;"
45+
"559348-559387=Users/m/mfaggin/test/inputsTrackTuner/pp2024/ppRef/polarity_positive;"
46+
"559408-559456=Users/m/mfaggin/test/inputsTrackTuner/pp2024/ppRef/polarity_negative");
47+
48+
DECLARE_SOA_CCDB_COLUMN(TrackTunerQOverPt, trackTunerQOverPt, TList, //!
49+
"Users/h/hsharma/qOverPtGraphs");
50+
} // namespace ccdbTrackTuner
51+
52+
/// Uniform in the run number: one calibration per data-taking period, so the fetcher
53+
/// resolves the path and queries once per distinct run rather than once per BC.
54+
DECLARE_SOA_UNIFORM_TABLE(TrackTunerCCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp,
55+
aod::BCs, o2::aod::bc::RunNumber, 1, "TRKTUNERCCDB", //!
56+
ccdbTrackTuner::TrackTunerDca, ccdbTrackTuner::TrackTunerQOverPt);
57+
} // namespace o2::aod
58+
59+
#endif // COMMON_DATAMODEL_TRACKTUNERCCDBOBJECTS_H_

0 commit comments

Comments
 (0)