Skip to content

Commit 0757bf5

Browse files
[Common] Use a member setter instead of ConfigurableParam for the side-based correction switch
O2ParamDef only declares the static sInstance member; defining it requires O2ParamImpl in a compiled .cxx, but TPCVDriftManager is a header-only library with none, so Instance() left an unresolved symbol for every consumer. Switch to a plain member + setter, as suggested in review; tasks using TPCVDriftManager can later expose this via their own Configurable. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent ec64032 commit 0757bf5

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

Common/Core/TPCVDriftManager.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#include <CCDB/BasicCCDBManager.h>
1616
#include <CommonConstants/LHCConstants.h>
17-
#include <CommonUtils/ConfigurableParam.h>
18-
#include <CommonUtils/ConfigurableParamHelper.h>
1917
#include <DataFormatsTPC/VDriftCorrFact.h>
2018
#include <Framework/DataTypes.h>
2119
#include <Framework/Logger.h>
@@ -28,15 +26,6 @@
2826
namespace o2::aod::common
2927
{
3028

31-
struct TPCVDriftManagerParam : public o2::conf::ConfigurableParamHelper<TPCVDriftManagerParam> {
32-
// Use the TPC side flags (with legacy-data fallback) instead of the tgl-sign-based correction.
33-
// Off by default so that existing analyses see no change in results until this is explicitly
34-
// enabled for testing.
35-
bool useSideBasedCorrection = false;
36-
37-
O2ParamDef(TPCVDriftManagerParam, "TPCVDriftManager");
38-
};
39-
4029
// Thin wrapper for vdrift ccdb queries should partially mirror VDriftHelper class.
4130
// Allows to move TPC standalone tracks under the assumption of a different
4231
// collision than the track is associated to.
@@ -48,6 +37,14 @@ class TPCVDriftManager
4837
mCCDB = ccdb;
4938
}
5039

40+
// Use the TPC side flags (with legacy-data fallback) instead of the tgl-sign-based correction.
41+
// Off by default so that existing analyses see no change in results until this is explicitly
42+
// enabled for testing. Tasks using TPCVDriftManager can expose this via their own Configurable.
43+
void setUseSideBasedCorrection(bool value) noexcept
44+
{
45+
mUseSideBasedCorrection = value;
46+
}
47+
5148
void update(uint64_t timestamp) noexcept
5249
{
5350
// Keep the object we already have if it is still valid for this timestamp.
@@ -143,7 +140,7 @@ class TPCVDriftManager
143140

144141
// impose new Z coordinate
145142
float zShift = 0.f;
146-
if (!TPCVDriftManagerParam::Instance().useSideBasedCorrection) {
143+
if (!mUseSideBasedCorrection) {
147144
// Legacy behaviour (default): infer the side from tgl alone.
148145
zShift = (track.getTgl() < 0.f) ? -dDrift : dDrift;
149146
} else {
@@ -206,6 +203,7 @@ class TPCVDriftManager
206203

207204
private:
208205
bool mValid{false};
206+
bool mUseSideBasedCorrection{false}; // off by default: preserves legacy tgl-sign behaviour
209207
// Factors
210208
float mTPCVDriftNS{0.f}; // drift velocity in cm/ns
211209

0 commit comments

Comments
 (0)