Skip to content

Commit a79506a

Browse files
committed
update t0 value
1 parent 9d8d276 commit a79506a

8 files changed

Lines changed: 25 additions & 20 deletions

File tree

‎Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void BarrelAlignmentSpec::init(InitContext& ic)
186186
mTRDTransformer->setApplyXOR();
187187
}
188188
auto prevShift = mTRDTransformer->isShiftApplied();
189-
if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) {
189+
if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get<bool>("apply-shift")) {
190190
// apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data
191191
mTRDTransformer->setApplyShift(false);
192192
}
@@ -365,6 +365,7 @@ DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_
365365
bool loadTPCCalib = false;
366366
Options opts{
367367
ConfigParamSpec{"apply-xor", o2::framework::VariantType::Bool, false, {"flip the 8-th bit of slope and position (for processing TRD CTFs from 2021 pilot beam)"}},
368+
ConfigParamSpec{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift for the TRD in data (never applied in MC)"}},
368369
ConfigParamSpec{"allow-afterburner-tracks", VariantType::Bool, false, {"allow using ITS-TPC afterburner tracks"}},
369370
ConfigParamSpec{"ignore-ccdb-alignment", VariantType::Bool, false, {"do not aplly CCDB alignment to ideal geometry"}},
370371
ConfigParamSpec{"initial-params-file", VariantType::String, "", {"initial parameters file"}},

‎Detectors/TRD/base/src/TrackletTransformer.cxx‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ float TrackletTransformer::calculateDy(int detector, int slope, const PadPlane*
6262
float TrackletTransformer::calibrateX(double x) const
6363
{
6464
// Hard-coded value will be replaced once t0 calibration is available from CCDB
65-
//float t0Correction = -0.279;
66-
//return x += t0Correction;
67-
return x;
65+
float t0Correction = -0.230;
66+
return x += t0Correction;
6867
}
6968

7069
std::array<float, 3> TrackletTransformer::transformL2T(int detector, std::array<double, 3> point) const
@@ -106,17 +105,12 @@ CalibratedTracklet TrackletTransformer::transformTracklet(Tracklet64 tracklet, b
106105
float x = mGeo->cdrHght() - 0.5;
107106
float y = tracklet.getUncalibratedY(mApplyShift);
108107
float z = calculateZ(padrow, padPlane);
108+
109+
//LOGF(info, "apply shift: %d", mApplyShift);
109110

110111
float dy = calculateDy(detector, slope, padPlane);
111112

112113
float calibratedX = calibrateX(x);
113-
114-
// calibrate y using t0 and raw slope in pad per timebin
115-
//float t0 = -1.8; // in time bins
116-
float t0 = -2.79/mCalVdriftExB->getVdrift(detector); // in time bins
117-
y -= t0 * tracklet.getSlopeFloat() * mGeo->getPadPlane(tracklet.getDetector())->getWidthIPad();
118-
119-
LOGF(info, "vdrift: %f old: %f %f new1: %f %f new2: %f %f diff: %f slope wo corr: %f %f slope with corr: %f", mCalVdriftExB->getVdrift(detector), x - 0.279, tracklet.getUncalibratedY(mApplyShift), x, y, x - 0.279, y-dy*0.279/3, y-dy*0.279/3-tracklet.getUncalibratedY(mApplyShift), tracklet.getSlopeFloat(), slope * ((mGeo->cdrHght() / mCalVdriftExB->getVdrift(detector)) * 10.) * mGeo->getPadPlane(tracklet.getDetector())->getWidthIPad() * GRANULARITYTRKLSLOPE / ADDBITSHIFTSLOPE, dy);
120114

121115
if (trackingFrame) {
122116
std::array<float, 3> sectorSpacePoint = transformL2T(detector, std::array<double, 3>{calibratedX, y, z});

‎Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct TRDSimParams : public o2::conf::ConfigurableParamHelper<TRDSimParams> {
4141
int trf = 0; // Sampled TRF function. 0: default TRF, 1: TRF described in TRF TDR, 2: No TRF, 3: Landau dist as TRF (parameters specified below)
4242
float trf_landau_mu = 0.; // Mu of the Landau distribution used to describe TRF
4343
float trf_landau_sigma = .03; // Sigma of the Landau distribution used to describe TRF
44-
float t0 = -0.130; // Time delay before start of amplification peak, in us
44+
float t0 = -0.170; // Time delay before start of amplification peak, in us
4545
O2ParamDef(TRDSimParams, "TRDSimParams");
4646
};
4747

‎Detectors/TRD/simulation/src/Digitizer.cxx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,15 @@ bool Digitizer::convertHits(const int det, const std::vector<Hit>& hits, SignalC
275275
continue;
276276
}
277277
}
278+
279+
if (hit.GetTrackID() < 20) LOGF(info, "pos before ExB: %f, drift length: %f, locX: %f, trackId: %d", locCd, absDriftLength, locT, hit.GetTrackID());
278280

279281
// Apply E x B effects
280282
if (mSimParam.isExBOn()) {
281283
// minus sign is necessary to be compatible with how Vdrift and ExB are calibrated
282284
locCd = locCd - TMath::Tan(calExBDetValue) * driftLength;
283285
}
286+
284287
// The electron position after diffusion and ExB in pad coordinates.
285288
rowE = padPlane->getPadRowNumberROC(locRd);
286289
if (rowE < 0) {
@@ -294,6 +297,9 @@ bool Digitizer::convertHits(const int det, const std::vector<Hit>& hits, SignalC
294297
continue;
295298
}
296299
const double colOffset = padPlane->getPadColOffset(colE, locCd + offsetTilt);
300+
301+
if (hit.GetTrackID() < 20) LOGF(info, "pos after ExB: %f %d, offset: %f tilt: %f", locCd, colE, colOffset, offsetTilt);
302+
297303
// Convert the position to drift time [mus], using either constant drift velocity or
298304
// time structure of drift cells (non-isochronity, GARFIELD calculation).
299305
// Also add absolute time of hits to take pile-up events into account properly
@@ -372,12 +378,14 @@ bool Digitizer::convertHits(const int det, const std::vector<Hit>& hits, SignalC
372378
const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1;
373379
const double crossTalk = mSimParam.ctOn() ? mSimParam.crossTalk(t) : 0;
374380
currentSignal[tb] += padSignal[pad] * (timeResponse + crossTalk);
381+
if (hit.GetTrackID() < 20) LOGF(info, "0, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse + crossTalk), currentSignal[tb]);
375382
} // end of loop time bins
376383
} else {
377384
for (int tb = firstTimeBin; tb < lastTimeBin; ++tb) {
378385
const double t = (tb - timeBinTruncated) / mSamplingRate + timeOffset;
379386
const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1;
380387
currentSignal[tb] += padSignal[pad] * timeResponse;
388+
if (hit.GetTrackID() < 20) LOGF(info, "1, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse), currentSignal[tb]);
381389
} // end of loop time bins
382390
}
383391
} // end of loop over pads

‎Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class TRDGlobalTrackingQC : public Task
5757
if (!mTPCavailable) {
5858
mQC.disablePID();
5959
}
60-
if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) {
60+
if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get<bool>("apply-shift")) {
6161
// apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data
6262
mQC.setApplyShift(false);
6363
}
@@ -153,7 +153,7 @@ DataProcessorSpec getTRDGlobalTrackingQCSpec(o2::dataformats::GlobalTrackID::mas
153153
dataRequest->inputs,
154154
outputs,
155155
AlgorithmSpec{adaptFromTask<TRDGlobalTrackingQC>(dataRequest, ggRequest, isTPCavailable, src)},
156-
Options{}};
156+
Options{{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}};
157157
}
158158

159159
template <typename T>

‎Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class PuseHeightDevice : public o2::framework::Task
4343
if (ic.options().get<bool>("enable-root-output")) {
4444
mPulseHeight->createOutputFile();
4545
}
46-
if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) {
46+
if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get<bool>("apply-shift")) {
4747
// apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data
4848
mPulseHeight->setApplyShift(false);
4949
}
@@ -129,7 +129,8 @@ DataProcessorSpec getTRDPulseHeightSpec(GID::mask_t src, bool digitsFromReader)
129129
outputs,
130130
AlgorithmSpec{adaptFromTask<o2::trd::PuseHeightDevice>(dataRequest)},
131131
Options{
132-
{"enable-root-output", VariantType::Bool, false, {"output PH and debug data to root file"}}}};
132+
{"enable-root-output", VariantType::Bool, false, {"output PH and debug data to root file"}},
133+
{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}};
133134
}
134135
} // namespace framework
135136
} // namespace o2

‎Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void TRDTrackletTransformerSpec::init(o2::framework::InitContext& ic)
3535
if (ic.options().get<bool>("apply-xor")) {
3636
mTransformer.setApplyXOR();
3737
}
38-
if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) {
38+
if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get<bool>("apply-shift")) {
3939
// apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data
4040
mTransformer.setApplyShift(false);
4141
}
@@ -174,7 +174,8 @@ o2::framework::DataProcessorSpec getTRDTrackletTransformerSpec(bool trigRecFilte
174174
outputs,
175175
AlgorithmSpec{adaptFromTask<TRDTrackletTransformerSpec>(dataRequest, ggRequest, trigRecFilterActive)},
176176
Options{
177-
{"apply-xor", o2::framework::VariantType::Bool, false, {"flip the 8-th bit of slope and position (for processing CTFs from 2021 pilot beam)"}}}};
177+
{"apply-xor", o2::framework::VariantType::Bool, false, {"flip the 8-th bit of slope and position (for processing CTFs from 2021 pilot beam)"}},
178+
{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}};
178179
}
179180

180181
} //end namespace trd

‎Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class TRDTrackBasedCalibDevice : public Task
6262
void TRDTrackBasedCalibDevice::init(InitContext& ic)
6363
{
6464
o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest);
65-
if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) {
65+
if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get<bool>("apply-shift")) {
6666
// apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data
6767
mCalibrator.setApplyShift(false);
6868
}
@@ -182,7 +182,7 @@ DataProcessorSpec getTRDTrackBasedCalibSpec(o2::dataformats::GlobalTrackID::mask
182182
inputs,
183183
outputs,
184184
AlgorithmSpec{adaptFromTask<TRDTrackBasedCalibDevice>(dataRequest, ggRequest, vdexb, gain)},
185-
Options{}};
185+
Options{{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}};
186186
}
187187

188188
} // namespace trd

0 commit comments

Comments
 (0)