Skip to content

Commit 8c91c95

Browse files
committed
Add a central table for common CCDB Objects
1 parent d3c69b4 commit 8c91c95

3 files changed

Lines changed: 74 additions & 47 deletions

File tree

Common/DataModel/GloCCDBObjects.h

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Copyright 2019-2020 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 GloCCDBObjects.h
13+
/// \brief Declarative CCDB columns for the most-commonly needed GLO/ objects.
14+
///
15+
/// Provides a single shared timestamped table (`aod::GloCCDBObjects`) that
16+
/// tasks can join with `aod::BCsWithTimestamps` to obtain the four GLO/
17+
/// calibration objects without using `Service<BasicCCDBManager>`.
18+
///
19+
/// Usage:
20+
/// \code
21+
/// #include "Common/DataModel/GloCCDBObjects.h"
22+
/// // ...
23+
/// using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::GloCCDBObjects>;
24+
/// void process(MyBCs const& bcs) {
25+
/// const auto& grpmag = bcs.begin().grpMagField();
26+
/// const auto& meanvtx = bcs.begin().meanVertex();
27+
/// const auto& grpecs = bcs.begin().grpECS();
28+
/// const auto& grplhcif= bcs.begin().grpLHCIF();
29+
/// }
30+
/// \endcode
31+
///
32+
/// If you need only a subset of the four objects, declare your own
33+
/// `DECLARE_SOA_TIMESTAMPED_TABLE` with the relevant subset of columns from
34+
/// the `o2::aod::glo` namespace rather than joining `aod::GloCCDBObjects`.
35+
///
36+
/// Note: MatLayerCylSet is intentionally omitted — it requires
37+
/// `MatLayerCylSet::rectifyPtrFromFile()` after deserialisation, which the
38+
/// CCDB column mechanism does not perform.
39+
40+
#ifndef COMMON_DATAMODEL_GLOCCDBOBJECTS_H_
41+
#define COMMON_DATAMODEL_GLOCCDBOBJECTS_H_
42+
43+
#include <DataFormatsCalibration/MeanVertexObject.h>
44+
#include <DataFormatsParameters/GRPECSObject.h>
45+
#include <DataFormatsParameters/GRPLHCIFData.h>
46+
#include <DataFormatsParameters/GRPMagField.h>
47+
#include <Framework/ASoA.h>
48+
#include <Framework/AnalysisDataModel.h>
49+
50+
namespace o2::aod
51+
{
52+
namespace glo
53+
{
54+
DECLARE_SOA_CCDB_COLUMN(GRPMagField, grpMagField, o2::parameters::GRPMagField, "GLO/Config/GRPMagField"); //!
55+
DECLARE_SOA_CCDB_COLUMN(MeanVertex, meanVertex, o2::dataformats::MeanVertexObject, "GLO/Calib/MeanVertex"); //!
56+
DECLARE_SOA_CCDB_COLUMN(GRPECSObject, grpECS, o2::parameters::GRPECSObject, "GLO/Config/GRPECS"); //!
57+
DECLARE_SOA_CCDB_COLUMN(GRPLHCIFData, grpLHCIF, o2::parameters::GRPLHCIFData, "GLO/Config/GRPLHCIF"); //!
58+
} // namespace glo
59+
60+
/// Full table — join with aod::BCsWithTimestamps to obtain all four objects.
61+
DECLARE_SOA_TIMESTAMPED_TABLE(GloCCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp, 1, "GLOCCDBOBJ", //!
62+
glo::GRPMagField, glo::MeanVertex, glo::GRPECSObject, glo::GRPLHCIFData);
63+
} // namespace o2::aod
64+
65+
#endif // COMMON_DATAMODEL_GLOCCDBOBJECTS_H_

Common/TableProducer/propagationServiceV2.cxx

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file propagationServiceV2.cxx
13-
/// \brief V2: GRPMagField and MeanVertexObject migrated to declarative CCDB columns.
13+
/// \brief V2: GRPMagField and MeanVertexObject sourced from aod::GloCCDBObjects declarative CCDB table.
1414
/// \author ALICE
1515

1616
//===============================================================
@@ -26,14 +26,13 @@
2626
#include "PWGLF/Utils/strangenessBuilderModule.h"
2727

2828
#include "Common/DataModel/EventSelection.h"
29+
#include "Common/DataModel/GloCCDBObjects.h"
2930
#include "Common/DataModel/PIDResponseTPC.h"
3031
#include "Common/Tools/StandardCCDBLoader.h"
3132
#include "Common/Tools/TrackPropagationModule.h"
3233
#include "Common/Tools/TrackTuner.h"
3334

3435
#include <CCDB/BasicCCDBManager.h>
35-
#include <DataFormatsCalibration/MeanVertexObject.h>
36-
#include <DataFormatsParameters/GRPMagField.h>
3736
#include <DetectorsBase/MatLayerCylSet.h>
3837
#include <DetectorsBase/Propagator.h>
3938
#include <Framework/ASoA.h>
@@ -49,25 +48,6 @@
4948

5049
#include <string>
5150

52-
// Declarative CCDB columns for GRPMagField and MeanVertexObject.
53-
// MatLayerCylSet is intentionally excluded: it requires
54-
// MatLayerCylSet::rectifyPtrFromFile() after deserialisation, a type-specific
55-
// fixup the CCDB column mechanism does not perform. It continues to be fetched
56-
// via Service<BasicCCDBManager> below.
57-
// strangenessBuilderModule uses ccdb->instance() for V-drift management
58-
// (excluded from migration per recipe).
59-
namespace o2::aod
60-
{
61-
namespace propsvcv2
62-
{
63-
DECLARE_SOA_CCDB_COLUMN(GRPMagField, grpMagField, o2::parameters::GRPMagField, "GLO/Config/GRPMagField"); //!
64-
DECLARE_SOA_CCDB_COLUMN(MeanVertex, meanVertex, o2::dataformats::MeanVertexObject, "GLO/Calib/MeanVertex"); //!
65-
} // namespace propsvcv2
66-
67-
DECLARE_SOA_TIMESTAMPED_TABLE(PropSvcV2CCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp, 1, "PROPSVCV2CC", //!
68-
propsvcv2::GRPMagField, propsvcv2::MeanVertex);
69-
} // namespace o2::aod
70-
7151
using namespace o2;
7252
using namespace o2::framework;
7353

@@ -98,8 +78,8 @@ struct propagationServiceV2 {
9878

9979
// Declarative CCDB path overrides (replace grpmagPath / mVtxPath in StandardCCDBLoaderConfigurables)
10080
// Option names: "ccdb:fGRPMagField" and "ccdb:fMeanVertex" respectively.
101-
ConfigurableCCDBPath<o2::aod::propsvcv2::GRPMagField> grpmagPath;
102-
ConfigurableCCDBPath<o2::aod::propsvcv2::MeanVertex> mVtxPath;
81+
ConfigurableCCDBPath<o2::aod::glo::GRPMagField> grpmagPath;
82+
ConfigurableCCDBPath<o2::aod::glo::MeanVertex> mVtxPath;
10383

10484
// boilerplate: strangeness builder stuff
10585
o2::pwglf::strangenessbuilder::products products;
@@ -117,7 +97,7 @@ struct propagationServiceV2 {
11797
o2::common::TrackPropagationConfigurables trackPropagationConfigurables;
11898
o2::common::TrackPropagationModule trackPropagation;
11999

120-
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::PropSvcV2CCDBObjects>;
100+
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::GloCCDBObjects>;
121101

122102
// registry
123103
HistogramRegistry histos{"histos"};

Common/TableProducer/trackPropagationV2.cxx

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
#include "Common/Core/TableHelper.h"
1818
#include "Common/Core/trackUtilities.h"
19+
#include "Common/DataModel/GloCCDBObjects.h"
1920
#include "Common/DataModel/TrackSelectionTables.h"
2021
#include "Common/Tools/TrackTuner.h"
2122

2223
#include <CCDB/BasicCCDBManager.h>
23-
#include <DataFormatsCalibration/MeanVertexObject.h>
24-
#include <DataFormatsParameters/GRPMagField.h>
2524
#include <DetectorsBase/MatLayerCylSet.h>
2625
#include <DetectorsBase/Propagator.h>
2726
#include <Framework/ASoA.h>
@@ -48,23 +47,6 @@
4847
#include <cmath>
4948
#include <string>
5049

51-
// Declarative CCDB columns for GRPMagField and MeanVertexObject.
52-
// MatLayerCylSet is intentionally excluded: it requires
53-
// MatLayerCylSet::rectifyPtrFromFile() after deserialisation, a type-specific
54-
// fixup the CCDB column mechanism does not perform. It continues to be fetched
55-
// via Service<BasicCCDBManager> below.
56-
namespace o2::aod
57-
{
58-
namespace trackpropv2
59-
{
60-
DECLARE_SOA_CCDB_COLUMN(GRPMagField, grpMagField, o2::parameters::GRPMagField, "GLO/Config/GRPMagField"); //!
61-
DECLARE_SOA_CCDB_COLUMN(MeanVertex, meanVertex, o2::dataformats::MeanVertexObject, "GLO/Calib/MeanVertex"); //!
62-
} // namespace trackpropv2
63-
64-
DECLARE_SOA_TIMESTAMPED_TABLE(TrackPropV2CCDBObjects, aod::Timestamps, o2::aod::timestamp::Timestamp, 1, "TRKPROPV2CC", //!
65-
trackpropv2::GRPMagField, trackpropv2::MeanVertex);
66-
} // namespace o2::aod
67-
6850
using namespace o2;
6951
using namespace o2::framework;
7052

@@ -99,8 +81,8 @@ struct TrackPropagationV2 {
9981
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
10082
// Declarative CCDB path overrides — replace the old grpmagPath / mVtxPath Configurables.
10183
// Option names: "ccdb:fGRPMagField" and "ccdb:fMeanVertex" respectively.
102-
ConfigurableCCDBPath<o2::aod::trackpropv2::GRPMagField> grpmagPath;
103-
ConfigurableCCDBPath<o2::aod::trackpropv2::MeanVertex> mVtxPath;
84+
ConfigurableCCDBPath<o2::aod::glo::GRPMagField> grpmagPath;
85+
ConfigurableCCDBPath<o2::aod::glo::MeanVertex> mVtxPath;
10486

10587
// for TrackTuner only (MC smearing)
10688
Configurable<bool> useTrackTuner{"useTrackTuner", false, "Apply track tuner corrections to MC"};
@@ -111,7 +93,7 @@ struct TrackPropagationV2 {
11193
OutputObj<TH1D> trackTunedTracks{TH1D("trackTunedTracks", "", 1, 0.5, 1.5), OutputObjHandlingPolicy::AnalysisObject};
11294

11395
using TracksIUWithMc = soa::Join<aod::StoredTracksIU, aod::McTrackLabels, aod::TracksCovIU>;
114-
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::TrackPropV2CCDBObjects>;
96+
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::GloCCDBObjects>;
11597

11698
HistogramRegistry registry{"registry"};
11799

0 commit comments

Comments
 (0)