Skip to content

Commit 0cd2dd7

Browse files
TPC VDrift: hold refVdrift constant
1 parent f2a59e7 commit 0cd2dd7

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

DataFormats/Detectors/TPC/include/DataFormatsTPC/VDriftCorrFact.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,12 @@ struct VDriftCorrFact {
4242
float getTimeOffset() const { return refTimeOffset + timeOffsetCorr; }
4343

4444
// renormalize VDrift reference and correction either to provided new reference (if >0) or to correction 1 wrt current reference
45-
void normalize(float newVRef = 0.f, float tp = 0.f)
45+
void normalize(float newVRef = 0.f)
4646
{
4747
float normVDrift = newVRef;
4848
if (newVRef == 0.f) {
4949
normVDrift = refVDrift * corrFact;
5050
newVRef = normVDrift;
51-
if ((tp > 0) && (refTP > 0)) {
52-
// linear scaling based on relative change of T/P
53-
normVDrift *= refTP / tp;
54-
refTP = tp; // update reference T/P
55-
}
5651
}
5752
float fact = refVDrift / normVDrift;
5853
refVDrift = newVRef;
@@ -74,6 +69,18 @@ struct VDriftCorrFact {
7469
}
7570
}
7671

72+
// scale the drift velocity with the relative change of T/P wrt the reference T/P
73+
// The scaling is folded into the correction factor, keeping refVDrift constant
74+
void normalizeTP(float tp)
75+
{
76+
if ((tp > 0) && (refTP > 0)) {
77+
const float scale = tp / refTP;
78+
corrFact *= scale;
79+
corrFactErr *= scale;
80+
refTP = tp;
81+
}
82+
}
83+
7784
ClassDefNV(VDriftCorrFact, 3);
7885
};
7986

Detectors/TPC/calibration/src/VDriftHelper.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void VDriftHelper::extractCCDBInputs(ProcessingContext& pc, bool laser, bool its
165165
}
166166
if (mIsTPScalingPossible) {
167167
mUpdated = true;
168-
vd.normalize(0, tp);
168+
vd.normalizeTP(tp); // keep refVDrift constant, fold the T/P scaling into the correction factor
169169
if (vd.creationTime == saveVD.creationTime) {
170170
LOGP(info, "VDriftHelper: Scaling VDrift from {} to {} with T/P from {} to {}", saveVD.getVDrift(), vd.getVDrift(), saveVD.refTP, vd.refTP);
171171
} else {

0 commit comments

Comments
 (0)