From 9d8d276b7ee484d9cce52d2a0417393d4cfb80ef Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Tue, 3 Nov 2026 13:03:42 +0100 Subject: [PATCH 1/6] test t0 in tracklet transformer --- Detectors/TRD/base/src/TrackletTransformer.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Detectors/TRD/base/src/TrackletTransformer.cxx b/Detectors/TRD/base/src/TrackletTransformer.cxx index 7f9976b8ce714..9b0f14887b50a 100644 --- a/Detectors/TRD/base/src/TrackletTransformer.cxx +++ b/Detectors/TRD/base/src/TrackletTransformer.cxx @@ -62,8 +62,9 @@ float TrackletTransformer::calculateDy(int detector, int slope, const PadPlane* float TrackletTransformer::calibrateX(double x) const { // Hard-coded value will be replaced once t0 calibration is available from CCDB - float t0Correction = -0.279; - return x += t0Correction; + //float t0Correction = -0.279; + //return x += t0Correction; + return x; } std::array TrackletTransformer::transformL2T(int detector, std::array point) const @@ -109,8 +110,14 @@ CalibratedTracklet TrackletTransformer::transformTracklet(Tracklet64 tracklet, b float dy = calculateDy(detector, slope, padPlane); float calibratedX = calibrateX(x); + + // calibrate y using t0 and raw slope in pad per timebin + //float t0 = -1.8; // in time bins + float t0 = -2.79/mCalVdriftExB->getVdrift(detector); // in time bins + y -= t0 * tracklet.getSlopeFloat() * mGeo->getPadPlane(tracklet.getDetector())->getWidthIPad(); + + 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); - // NOTE: Correction to y position based on x calibration NOT YET implemented. Need t0. if (trackingFrame) { std::array sectorSpacePoint = transformL2T(detector, std::array{calibratedX, y, z}); LOG(debug) << "x: " << sectorSpacePoint[0] << " | " From a79506a822f3613e0f72ae223a0f469ba6fa2fc7 Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Thu, 5 Nov 2026 16:46:30 +0100 Subject: [PATCH 2/6] update t0 value --- .../Align/Workflow/src/BarrelAlignmentSpec.cxx | 3 ++- Detectors/TRD/base/src/TrackletTransformer.cxx | 14 ++++---------- .../include/TRDSimulation/TRDSimParams.h | 2 +- Detectors/TRD/simulation/src/Digitizer.cxx | 8 ++++++++ .../include/TRDWorkflow/TRDGlobalTrackingQCSpec.h | 4 ++-- .../include/TRDWorkflow/TRDPulseHeightSpec.h | 5 +++-- .../workflow/src/TRDTrackletTransformerSpec.cxx | 5 +++-- Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx | 4 ++-- 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx b/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx index 06762b926346f..9c99bfbd4aeea 100644 --- a/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx +++ b/Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx @@ -186,7 +186,7 @@ void BarrelAlignmentSpec::init(InitContext& ic) mTRDTransformer->setApplyXOR(); } auto prevShift = mTRDTransformer->isShiftApplied(); - if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { + if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mTRDTransformer->setApplyShift(false); } @@ -365,6 +365,7 @@ DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_ bool loadTPCCalib = false; Options opts{ 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)"}}, + ConfigParamSpec{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift for the TRD in data (never applied in MC)"}}, ConfigParamSpec{"allow-afterburner-tracks", VariantType::Bool, false, {"allow using ITS-TPC afterburner tracks"}}, ConfigParamSpec{"ignore-ccdb-alignment", VariantType::Bool, false, {"do not aplly CCDB alignment to ideal geometry"}}, ConfigParamSpec{"initial-params-file", VariantType::String, "", {"initial parameters file"}}, diff --git a/Detectors/TRD/base/src/TrackletTransformer.cxx b/Detectors/TRD/base/src/TrackletTransformer.cxx index 9b0f14887b50a..882997ef9a0a5 100644 --- a/Detectors/TRD/base/src/TrackletTransformer.cxx +++ b/Detectors/TRD/base/src/TrackletTransformer.cxx @@ -62,9 +62,8 @@ float TrackletTransformer::calculateDy(int detector, int slope, const PadPlane* float TrackletTransformer::calibrateX(double x) const { // Hard-coded value will be replaced once t0 calibration is available from CCDB - //float t0Correction = -0.279; - //return x += t0Correction; - return x; + float t0Correction = -0.230; + return x += t0Correction; } std::array TrackletTransformer::transformL2T(int detector, std::array point) const @@ -106,17 +105,12 @@ CalibratedTracklet TrackletTransformer::transformTracklet(Tracklet64 tracklet, b float x = mGeo->cdrHght() - 0.5; float y = tracklet.getUncalibratedY(mApplyShift); float z = calculateZ(padrow, padPlane); + + //LOGF(info, "apply shift: %d", mApplyShift); float dy = calculateDy(detector, slope, padPlane); float calibratedX = calibrateX(x); - - // calibrate y using t0 and raw slope in pad per timebin - //float t0 = -1.8; // in time bins - float t0 = -2.79/mCalVdriftExB->getVdrift(detector); // in time bins - y -= t0 * tracklet.getSlopeFloat() * mGeo->getPadPlane(tracklet.getDetector())->getWidthIPad(); - - 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); if (trackingFrame) { std::array sectorSpacePoint = transformL2T(detector, std::array{calibratedX, y, z}); diff --git a/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h b/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h index 6243361cbc162..7c2043b3278b6 100644 --- a/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h +++ b/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h @@ -41,7 +41,7 @@ struct TRDSimParams : public o2::conf::ConfigurableParamHelper { 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) float trf_landau_mu = 0.; // Mu of the Landau distribution used to describe TRF float trf_landau_sigma = .03; // Sigma of the Landau distribution used to describe TRF - float t0 = -0.130; // Time delay before start of amplification peak, in us + float t0 = -0.170; // Time delay before start of amplification peak, in us O2ParamDef(TRDSimParams, "TRDSimParams"); }; diff --git a/Detectors/TRD/simulation/src/Digitizer.cxx b/Detectors/TRD/simulation/src/Digitizer.cxx index 024938f48e13c..2e32a86bff2f4 100644 --- a/Detectors/TRD/simulation/src/Digitizer.cxx +++ b/Detectors/TRD/simulation/src/Digitizer.cxx @@ -275,12 +275,15 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC continue; } } + + if (hit.GetTrackID() < 20) LOGF(info, "pos before ExB: %f, drift length: %f, locX: %f, trackId: %d", locCd, absDriftLength, locT, hit.GetTrackID()); // Apply E x B effects if (mSimParam.isExBOn()) { // minus sign is necessary to be compatible with how Vdrift and ExB are calibrated locCd = locCd - TMath::Tan(calExBDetValue) * driftLength; } + // The electron position after diffusion and ExB in pad coordinates. rowE = padPlane->getPadRowNumberROC(locRd); if (rowE < 0) { @@ -294,6 +297,9 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC continue; } const double colOffset = padPlane->getPadColOffset(colE, locCd + offsetTilt); + + if (hit.GetTrackID() < 20) LOGF(info, "pos after ExB: %f %d, offset: %f tilt: %f", locCd, colE, colOffset, offsetTilt); + // Convert the position to drift time [mus], using either constant drift velocity or // time structure of drift cells (non-isochronity, GARFIELD calculation). // 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& hits, SignalC const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1; const double crossTalk = mSimParam.ctOn() ? mSimParam.crossTalk(t) : 0; currentSignal[tb] += padSignal[pad] * (timeResponse + crossTalk); + if (hit.GetTrackID() < 20) LOGF(info, "0, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse + crossTalk), currentSignal[tb]); } // end of loop time bins } else { for (int tb = firstTimeBin; tb < lastTimeBin; ++tb) { const double t = (tb - timeBinTruncated) / mSamplingRate + timeOffset; const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1; currentSignal[tb] += padSignal[pad] * timeResponse; + if (hit.GetTrackID() < 20) LOGF(info, "1, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse), currentSignal[tb]); } // end of loop time bins } } // end of loop over pads diff --git a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h index fc86d197f4df5..80df0b8f4646e 100644 --- a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h +++ b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h @@ -57,7 +57,7 @@ class TRDGlobalTrackingQC : public Task if (!mTPCavailable) { mQC.disablePID(); } - if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { + if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mQC.setApplyShift(false); } @@ -153,7 +153,7 @@ DataProcessorSpec getTRDGlobalTrackingQCSpec(o2::dataformats::GlobalTrackID::mas dataRequest->inputs, outputs, AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, isTPCavailable, src)}, - Options{}}; + Options{{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; } template diff --git a/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h b/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h index be00e478608ec..bff02f231bad3 100644 --- a/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h +++ b/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h @@ -43,7 +43,7 @@ class PuseHeightDevice : public o2::framework::Task if (ic.options().get("enable-root-output")) { mPulseHeight->createOutputFile(); } - if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { + if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mPulseHeight->setApplyShift(false); } @@ -129,7 +129,8 @@ DataProcessorSpec getTRDPulseHeightSpec(GID::mask_t src, bool digitsFromReader) outputs, AlgorithmSpec{adaptFromTask(dataRequest)}, Options{ - {"enable-root-output", VariantType::Bool, false, {"output PH and debug data to root file"}}}}; + {"enable-root-output", VariantType::Bool, false, {"output PH and debug data to root file"}}, + {"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; } } // namespace framework } // namespace o2 diff --git a/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx b/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx index 77668ab96a9fd..b573f23a2c99a 100644 --- a/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx @@ -35,7 +35,7 @@ void TRDTrackletTransformerSpec::init(o2::framework::InitContext& ic) if (ic.options().get("apply-xor")) { mTransformer.setApplyXOR(); } - if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { + if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mTransformer.setApplyShift(false); } @@ -174,7 +174,8 @@ o2::framework::DataProcessorSpec getTRDTrackletTransformerSpec(bool trigRecFilte outputs, AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, trigRecFilterActive)}, Options{ - {"apply-xor", o2::framework::VariantType::Bool, false, {"flip the 8-th bit of slope and position (for processing CTFs from 2021 pilot beam)"}}}}; + {"apply-xor", o2::framework::VariantType::Bool, false, {"flip the 8-th bit of slope and position (for processing CTFs from 2021 pilot beam)"}}, + {"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; } } //end namespace trd diff --git a/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx b/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx index 8451d62bfff31..64d397f3e0121 100644 --- a/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx +++ b/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx @@ -62,7 +62,7 @@ class TRDTrackBasedCalibDevice : public Task void TRDTrackBasedCalibDevice::init(InitContext& ic) { o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest); - if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { + if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mCalibrator.setApplyShift(false); } @@ -182,7 +182,7 @@ DataProcessorSpec getTRDTrackBasedCalibSpec(o2::dataformats::GlobalTrackID::mask inputs, outputs, AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, vdexb, gain)}, - Options{}}; + Options{{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; } } // namespace trd From 9796e4a512cf5312e8b4cf3603d3c43fe2efbc3d Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Wed, 11 Nov 2026 12:23:53 +0100 Subject: [PATCH 3/6] possibility to apply shift and small improvement to pile-up correction --- Detectors/TRD/base/src/TrackletTransformer.cxx | 4 +--- Detectors/TRD/calibration/src/TrackBasedCalib.cxx | 4 ++-- Detectors/TRD/qc/src/Tracking.cxx | 12 ++++++++---- .../simulation/include/TRDSimulation/TRDSimParams.h | 2 +- .../include/TRDWorkflow/TRDGlobalTrackingQCSpec.h | 5 ++--- .../include/TRDWorkflow/TRDGlobalTrackingSpec.h | 1 + .../include/TRDWorkflow/TRDPulseHeightSpec.h | 5 ++--- Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx | 6 +++++- .../TRD/workflow/src/TRDTrackletTransformerSpec.cxx | 5 +++-- Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx | 4 ++-- GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx | 12 ++++++++++-- 11 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Detectors/TRD/base/src/TrackletTransformer.cxx b/Detectors/TRD/base/src/TrackletTransformer.cxx index 882997ef9a0a5..9526ad22feb27 100644 --- a/Detectors/TRD/base/src/TrackletTransformer.cxx +++ b/Detectors/TRD/base/src/TrackletTransformer.cxx @@ -61,7 +61,7 @@ float TrackletTransformer::calculateDy(int detector, int slope, const PadPlane* float TrackletTransformer::calibrateX(double x) const { - // Hard-coded value will be replaced once t0 calibration is available from CCDB + // Hard-coded value since t0 is rather stable as a function of time float t0Correction = -0.230; return x += t0Correction; } @@ -105,8 +105,6 @@ CalibratedTracklet TrackletTransformer::transformTracklet(Tracklet64 tracklet, b float x = mGeo->cdrHght() - 0.5; float y = tracklet.getUncalibratedY(mApplyShift); float z = calculateZ(padrow, padPlane); - - //LOGF(info, "apply shift: %d", mApplyShift); float dy = calculateDy(detector, slope, padPlane); diff --git a/Detectors/TRD/calibration/src/TrackBasedCalib.cxx b/Detectors/TRD/calibration/src/TrackBasedCalib.cxx index eeb0baba87bde..97f311b3715ad 100644 --- a/Detectors/TRD/calibration/src/TrackBasedCalib.cxx +++ b/Detectors/TRD/calibration/src/TrackBasedCalib.cxx @@ -165,10 +165,10 @@ int TrackBasedCalib::filldEdx(gsl::span& tracks, bool isTPCTRD) float localGainCorr = 1.; if (mLocalGain) { - localGainCorr = mLocalGain->getValue(trkltDet, tracklet.getPadCol(mApplyShift), tracklet.getPadRow()); + localGainCorr = mLocalGain->getValue(trkltDet, tracklet.getPadCol(false), tracklet.getPadRow()); } if (TMath::Abs(localGainCorr) < 0.0001f) { - LOGP(warn, "Invalid localGainCorr {} for det {}, pad col {}, pad row {}", localGainCorr, trkltDet, tracklet.getPadCol(mApplyShift), tracklet.getPadRow()); + LOGP(warn, "Invalid localGainCorr {} for det {}, pad col {}, pad row {}", localGainCorr, trkltDet, tracklet.getPadCol(false), tracklet.getPadRow()); continue; } diff --git a/Detectors/TRD/qc/src/Tracking.cxx b/Detectors/TRD/qc/src/Tracking.cxx index 65d0ccf9a71bc..c708e2e5c7a32 100644 --- a/Detectors/TRD/qc/src/Tracking.cxx +++ b/Detectors/TRD/qc/src/Tracking.cxx @@ -85,6 +85,7 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) // Find most probable BCs and RMS for pile-up correction and error. Same BC is assumed for all tracklets float tCorrPileUp = 0.; + float tCorrPileUp_weightedMean = 0.; float tErrPileUp2 = 0; float maxProb = 0.f; // The uncertainty is the RMS wrt the default correction of all possible corrections weighted by their probability @@ -117,6 +118,7 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) sumCorr += probBC * deltaBC; sumCorr2 += probBC * deltaBC * deltaBC; sumProb += probBC; + tCorrPileUp_weightedMean -= probBC*deltaBC; if (probBC > maxProb) { maxProb = probBC; tCorrPileUp = -deltaBC; @@ -124,6 +126,7 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) } if (sumProb > 1e-6) { tErrPileUp2 = sumCorr2 / sumProb - 2 * tCorrPileUp * sumCorr / sumProb + tCorrPileUp * tCorrPileUp; + tCorrPileUp_weightedMean /= sumProb; } for (int iLayer = 0; iLayer < NLAYER; ++iLayer) { @@ -158,7 +161,8 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) // conversion from slope in pad per time bin to slope in cm per BC = tracklets[trkltIdx].getSlopeFloat() * padWidth / BCperTimeBin float slopeFactor = mTrackletsRaw[trkltId].getSlopeFloat() * pad->getWidthIPad() / 4.f; - float yCorrPileUp = tCorrPileUp * slopeFactor; + //float yCorrPileUp = tCorrPileUp * slopeFactor; + float yCorrPileUp = tCorrPileUp_weightedMean * slopeFactor; float yAddErrPileUp2 = tErrPileUp2 * slopeFactor * slopeFactor; float yPosCorrUp = mTrackletsCalib[trkltId].getY() - tiltCorrUp + yCorrPileUp; @@ -184,7 +188,7 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) // \sqrt{ (dx/dx)^2 + (dy/dx)^2 + (dz/dx)^2} auto tphi = trk.getSnp() / std::sqrt((1.f - trk.getSnp()) * (1.f + trk.getSnp())); auto trackletLength = std::sqrt(1.f + tphi * tphi + trk.getTgl() * trk.getTgl()); - auto cor = mLocalGain.getValue(tracklet.getHCID() / 2, tracklet.getPadCol(mApplyShift), tracklet.getPadRow()) * trackletLength; + auto cor = mLocalGain.getValue(tracklet.getHCID() / 2, tracklet.getPadCol(false), tracklet.getPadRow()) * trackletLength; float q0{tracklet.getQ0() / cor}, q1{tracklet.getQ1() / cor}, q2{tracklet.getQ2() / cor}; // z-row merging @@ -193,9 +197,9 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) if (tracklet.getTrackletWord() == trklt.getTrackletWord()) { // skip original tracklet continue; } - if (std::abs(tracklet.getPadCol(mApplyShift) - trklt.getPadCol(mApplyShift)) <= 1 && std::abs(tracklet.getPadRow() - trklt.getPadRow()) == 1) { + if (std::abs(tracklet.getPadCol(false) - trklt.getPadCol(false)) <= 1 && std::abs(tracklet.getPadRow() - trklt.getPadRow()) == 1) { // Add charge information - auto cor = mLocalGain.getValue(trklt.getHCID() / 2, trklt.getPadCol(mApplyShift), trklt.getPadRow()) * trackletLength; + auto cor = mLocalGain.getValue(trklt.getHCID() / 2, trklt.getPadCol(false), trklt.getPadRow()) * trackletLength; q0 += trklt.getQ0() / cor; q1 += trklt.getQ1() / cor; q2 += trklt.getQ2() / cor; diff --git a/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h b/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h index 7c2043b3278b6..37b59b6ab8071 100644 --- a/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h +++ b/Detectors/TRD/simulation/include/TRDSimulation/TRDSimParams.h @@ -38,7 +38,7 @@ struct TRDSimParams : public o2::conf::ConfigurableParamHelper { bool doTR = true; ///< switch for transition radiation SimParam::GasMixture gas = SimParam::GasMixture::Xenon; ///< the gas mixture in the TRD // TRF parameters - 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) + int trf = 1; // Sampled TRF function. 0: default TRF, 1: TRF described in TRF TDR, 2: No TRF, 3: Landau dist as TRF (parameters specified below) float trf_landau_mu = 0.; // Mu of the Landau distribution used to describe TRF float trf_landau_sigma = .03; // Sigma of the Landau distribution used to describe TRF float t0 = -0.170; // Time delay before start of amplification peak, in us diff --git a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h index 80df0b8f4646e..dd10d663ba064 100644 --- a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h +++ b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingQCSpec.h @@ -57,7 +57,7 @@ class TRDGlobalTrackingQC : public Task if (!mTPCavailable) { mQC.disablePID(); } - if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { + if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mQC.setApplyShift(false); } @@ -152,8 +152,7 @@ DataProcessorSpec getTRDGlobalTrackingQCSpec(o2::dataformats::GlobalTrackID::mas "trd-tracking-qc", dataRequest->inputs, outputs, - AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, isTPCavailable, src)}, - Options{{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; + AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, isTPCavailable, src)}}; } template diff --git a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h index 8f83b98c4f075..c05f72424562f 100644 --- a/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h +++ b/Detectors/TRD/workflow/include/TRDWorkflow/TRDGlobalTrackingSpec.h @@ -82,6 +82,7 @@ class TRDGlobalTracking : public o2::framework::Task float mTPCVdrift{2.58f}; ///< TPC drift velocity (for shifting TPC tracks along Z) float mTPCTDriftOffset{0.f}; ///< TPC drift time additive offset int32_t mTCorrPileUp{0}; ///< most probable correction in number of BCs due to pile-up in TRD + int32_t mTCorrPileUp_weightedMean{0}; ///< average correction in number of BCs due to pile-up in TRD float mTErrPileUp2{0.f}; ///< error on correction in number of BCs due to pile-up in TRD std::shared_ptr mDataRequest; ///< seeding input (TPC-only, ITS-TPC or both) std::shared_ptr mGGCCDBRequest; diff --git a/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h b/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h index bff02f231bad3..be00e478608ec 100644 --- a/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h +++ b/Detectors/TRD/workflow/include/TRDWorkflow/TRDPulseHeightSpec.h @@ -43,7 +43,7 @@ class PuseHeightDevice : public o2::framework::Task if (ic.options().get("enable-root-output")) { mPulseHeight->createOutputFile(); } - if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { + if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mPulseHeight->setApplyShift(false); } @@ -129,8 +129,7 @@ DataProcessorSpec getTRDPulseHeightSpec(GID::mask_t src, bool digitsFromReader) outputs, AlgorithmSpec{adaptFromTask(dataRequest)}, Options{ - {"enable-root-output", VariantType::Bool, false, {"output PH and debug data to root file"}}, - {"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; + {"enable-root-output", VariantType::Bool, false, {"output PH and debug data to root file"}}}}; } } // namespace framework } // namespace o2 diff --git a/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx b/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx index 4cbe5ca7a3609..63d074bb7c56a 100644 --- a/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx @@ -542,6 +542,7 @@ void TRDGlobalTracking::run(ProcessingContext& pc) float sumCorr = 0.f; float sumCorr2 = 0.f; float sumProb = 0.f; + mTCorrPileUp_weightedMean = 0.f; for (int iBC = 0; iBC < mTriggeredBCFT0.size(); iBC++) { int deltaBC = roundf(mTriggeredBCFT0[iBC] - mChainTracking->mIOPtrs.trdTriggerTimes[trdTrack.getCollisionId()] / o2::constants::lhc::LHCBunchSpacingMUS); if (deltaBC <= mRecoParam.getPileUpRangeBefore() || deltaBC >= mRecoParam.getPileUpRangeAfter()) { @@ -565,6 +566,7 @@ void TRDGlobalTracking::run(ProcessingContext& pc) sumCorr += probBC * deltaBC; sumCorr2 += probBC * deltaBC * deltaBC; sumProb += probBC; + mTCorrPileUp_weightedMean -= deltaBC * probBC; if (probBC > maxProb) { maxProb = probBC; mTCorrPileUp = -deltaBC; @@ -572,6 +574,7 @@ void TRDGlobalTracking::run(ProcessingContext& pc) } if (sumProb > 1e-6) { mTErrPileUp2 = sumCorr2 / sumProb - 2 * mTCorrPileUp * sumCorr / sumProb + mTCorrPileUp * mTCorrPileUp; + mTCorrPileUp_weightedMean /= sumProb; } nTrackletsAttached += trdTrack.getNtracklets(); @@ -926,7 +929,8 @@ bool TRDGlobalTracking::refitTRDTrack(TrackTRD& trk, float& chi2, bool inwards, // conversion from slope in pad per time bin to slope in cm per BC = tracklets[trkltIdx].getSlopeFloat() * padWidth / BCperTimeBin float slopeFactor = mTrackletsRaw[trkltId].getSlopeFloat() * pad->getWidthIPad() / 4.f; - float yCorrPileUp = mTCorrPileUp * slopeFactor; + //float yCorrPileUp = mTCorrPileUp * slopeFactor; + float yCorrPileUp = mTCorrPileUp_weightedMean * slopeFactor; float yAddErrPileUp2 = mTErrPileUp2 * slopeFactor * slopeFactor; float yPosCorrUp = mTrackletsCalib[trkltId].getY() - tiltCorrUp + yCorrPileUp; diff --git a/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx b/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx index b573f23a2c99a..3bac06b1b260f 100644 --- a/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDTrackletTransformerSpec.cxx @@ -35,7 +35,8 @@ void TRDTrackletTransformerSpec::init(o2::framework::InitContext& ic) if (ic.options().get("apply-xor")) { mTransformer.setApplyXOR(); } - if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { + if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || ic.options().get("disable-shift")) { + LOGF(info, "TRD pad shift is not applied"); // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mTransformer.setApplyShift(false); } @@ -175,7 +176,7 @@ o2::framework::DataProcessorSpec getTRDTrackletTransformerSpec(bool trigRecFilte AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, trigRecFilterActive)}, Options{ {"apply-xor", o2::framework::VariantType::Bool, false, {"flip the 8-th bit of slope and position (for processing CTFs from 2021 pilot beam)"}}, - {"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; + {"disable-shift", o2::framework::VariantType::Bool, false, {"whether we apply the one pad shift in data (always disabled in MC)"}}}}; } } //end namespace trd diff --git a/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx b/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx index 64d397f3e0121..8451d62bfff31 100644 --- a/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx +++ b/Detectors/TRD/workflow/src/TrackBasedCalibSpec.cxx @@ -62,7 +62,7 @@ class TRDTrackBasedCalibDevice : public Task void TRDTrackBasedCalibDevice::init(InitContext& ic) { o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest); - if ((getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) || !ic.options().get("apply-shift")) { + if (getenv("ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv("ALIEN_JDL_LPMPRODUCTIONTYPE"), "MC") == 0) { // apply artificial pad shift in case non-ideal alignment is used to compensate for shift in current alignment from real data mCalibrator.setApplyShift(false); } @@ -182,7 +182,7 @@ DataProcessorSpec getTRDTrackBasedCalibSpec(o2::dataformats::GlobalTrackID::mask inputs, outputs, AlgorithmSpec{adaptFromTask(dataRequest, ggRequest, vdexb, gain)}, - Options{{"apply-shift", o2::framework::VariantType::Bool, true, {"whether we apply the one pad shift in data (never applied in MC)"}}}}; + Options{}}; } } // namespace trd diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx index 64724886373c3..48668c004a2ae 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx @@ -615,6 +615,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK // contrary to the assumption when tracklet is reconstructed, so we cancel this extrapolation. // The correction is extracted from the most probable trigger. There is also an additional error depending on all the compatible triggers float yCorrPileUp = 0.f; + float yCorrPileUp_weightedMean = 0.f; float yAddErrPileUp2 = 0.f; // additional zshiftTrk for TPC only tracks due to pile-up float zShiftTrkPileUp = 0.f; @@ -632,6 +633,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK sumCorr += probBC * slopeFactor * deltaBC; sumCorr2 += probBC * slopeFactor * deltaBC * slopeFactor * deltaBC; sumProb += probBC; + yCorrPileUp_weightedMean -= slopeFactor * deltaBC * probBC; if (probBC > maxProb) { maxProb = probBC; yCorrPileUp = -slopeFactor * deltaBC; @@ -640,6 +642,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK } if (sumProb > 1e-6f) { yAddErrPileUp2 = sumCorr2 / sumProb - 2 * yCorrPileUp * sumCorr / sumProb + yCorrPileUp * yCorrPileUp; + yCorrPileUp_weightedMean /= sumProb; } } @@ -649,7 +652,8 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK // correction for mean z position of tracklet (is not the center of the pad if track eta != 0) float zPosCorr = spacePoints[trkltIdx].getZ() + mRecoParam->getZCorrCoeffNRC() * trkWork->getTgl(); - float yPosCorr = spacePoints[trkltIdx].getY() - tiltCorr + yCorrPileUp; + //float yPosCorr = spacePoints[trkltIdx].getY() - tiltCorr + yCorrPileUp; + float yPosCorr = spacePoints[trkltIdx].getY() - tiltCorr + yCorrPileUp_weightedMean; zPosCorr -= zShiftTrk + zShiftTrkPileUp; // shift tracklet instead of track in order to avoid having to do a re-fit for each collision // Correction of y position based on angular pull @@ -808,6 +812,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK // contrary to the assumption when tracklet is reconstructed, so we cancel this extrapolation. // The correction is extracted from the most probable trigger. There is also an additional error depending on all the compatible triggers float yCorrPileUp = 0.f; + float yCorrPileUp_weightedMean = 0.f; float yAddErrPileUp2 = 0.f; float zShiftTrkPileUp = 0.f; if (nIdxBCMax - nIdxBCMin >= 2) { @@ -824,6 +829,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK sumCorr += probBC * slopeFactor * deltaBC; sumCorr2 += probBC * slopeFactor * deltaBC * slopeFactor * deltaBC; sumProb += probBC; + yCorrPileUp_weightedMean -= slopeFactor * deltaBC * probBC; if (probBC > maxProb) { maxProb = probBC; yCorrPileUp = -slopeFactor * deltaBC; @@ -832,11 +838,13 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK } if (sumProb > 1e-6f) { yAddErrPileUp2 = sumCorr2 / sumProb - 2 * yCorrPileUp * sumCorr / sumProb + yCorrPileUp * yCorrPileUp; + yCorrPileUp_weightedMean /= sumProb; } } zPosCorrUp -= zShiftTrkPileUp; - yPosCorrUp += yCorrPileUp; + //yPosCorrUp += yCorrPileUp; + yPosCorrUp += yCorrPileUp_weightedMean; const auto currDet = tracklets[mHypothesis[iUpdate + hypothesisIdxOffset].mTrackletId].GetDetector(); int nTrackletsChamber = mTrackletIndexArray[trkltIdxOffset + currDet + 1] - mTrackletIndexArray[trkltIdxOffset + currDet]; From e57b474905d72cfb172a109888ccb65ca0b0cdce Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Wed, 11 Nov 2026 12:25:32 +0100 Subject: [PATCH 4/6] clang format --- Detectors/TRD/qc/src/Tracking.cxx | 4 ++-- Detectors/TRD/simulation/src/Digitizer.cxx | 20 +++++++++++-------- .../workflow/src/TRDGlobalTrackingSpec.cxx | 2 +- GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Detectors/TRD/qc/src/Tracking.cxx b/Detectors/TRD/qc/src/Tracking.cxx index c708e2e5c7a32..639fe10e5c4a0 100644 --- a/Detectors/TRD/qc/src/Tracking.cxx +++ b/Detectors/TRD/qc/src/Tracking.cxx @@ -118,7 +118,7 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) sumCorr += probBC * deltaBC; sumCorr2 += probBC * deltaBC * deltaBC; sumProb += probBC; - tCorrPileUp_weightedMean -= probBC*deltaBC; + tCorrPileUp_weightedMean -= probBC * deltaBC; if (probBC > maxProb) { maxProb = probBC; tCorrPileUp = -deltaBC; @@ -161,7 +161,7 @@ void Tracking::checkTrack(const TrackTRD& trkTrd, bool isTPCTRD) // conversion from slope in pad per time bin to slope in cm per BC = tracklets[trkltIdx].getSlopeFloat() * padWidth / BCperTimeBin float slopeFactor = mTrackletsRaw[trkltId].getSlopeFloat() * pad->getWidthIPad() / 4.f; - //float yCorrPileUp = tCorrPileUp * slopeFactor; + // float yCorrPileUp = tCorrPileUp * slopeFactor; float yCorrPileUp = tCorrPileUp_weightedMean * slopeFactor; float yAddErrPileUp2 = tErrPileUp2 * slopeFactor * slopeFactor; float yPosCorrUp = mTrackletsCalib[trkltId].getY() - tiltCorrUp + yCorrPileUp; diff --git a/Detectors/TRD/simulation/src/Digitizer.cxx b/Detectors/TRD/simulation/src/Digitizer.cxx index 2e32a86bff2f4..7c70130f83cd0 100644 --- a/Detectors/TRD/simulation/src/Digitizer.cxx +++ b/Detectors/TRD/simulation/src/Digitizer.cxx @@ -275,15 +275,16 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC continue; } } - - if (hit.GetTrackID() < 20) LOGF(info, "pos before ExB: %f, drift length: %f, locX: %f, trackId: %d", locCd, absDriftLength, locT, hit.GetTrackID()); + + if (hit.GetTrackID() < 20) + LOGF(info, "pos before ExB: %f, drift length: %f, locX: %f, trackId: %d", locCd, absDriftLength, locT, hit.GetTrackID()); // Apply E x B effects if (mSimParam.isExBOn()) { // minus sign is necessary to be compatible with how Vdrift and ExB are calibrated locCd = locCd - TMath::Tan(calExBDetValue) * driftLength; } - + // The electron position after diffusion and ExB in pad coordinates. rowE = padPlane->getPadRowNumberROC(locRd); if (rowE < 0) { @@ -297,9 +298,10 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC continue; } const double colOffset = padPlane->getPadColOffset(colE, locCd + offsetTilt); - - if (hit.GetTrackID() < 20) LOGF(info, "pos after ExB: %f %d, offset: %f tilt: %f", locCd, colE, colOffset, offsetTilt); - + + if (hit.GetTrackID() < 20) + LOGF(info, "pos after ExB: %f %d, offset: %f tilt: %f", locCd, colE, colOffset, offsetTilt); + // Convert the position to drift time [mus], using either constant drift velocity or // time structure of drift cells (non-isochronity, GARFIELD calculation). // Also add absolute time of hits to take pile-up events into account properly @@ -378,14 +380,16 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1; const double crossTalk = mSimParam.ctOn() ? mSimParam.crossTalk(t) : 0; currentSignal[tb] += padSignal[pad] * (timeResponse + crossTalk); - if (hit.GetTrackID() < 20) LOGF(info, "0, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse + crossTalk), currentSignal[tb]); + if (hit.GetTrackID() < 20) + LOGF(info, "0, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse + crossTalk), currentSignal[tb]); } // end of loop time bins } else { for (int tb = firstTimeBin; tb < lastTimeBin; ++tb) { const double t = (tb - timeBinTruncated) / mSamplingRate + timeOffset; const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1; currentSignal[tb] += padSignal[pad] * timeResponse; - if (hit.GetTrackID() < 20) LOGF(info, "1, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse), currentSignal[tb]); + if (hit.GetTrackID() < 20) + LOGF(info, "1, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse), currentSignal[tb]); } // end of loop time bins } } // end of loop over pads diff --git a/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx b/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx index 63d074bb7c56a..abe00e3a5f508 100644 --- a/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx +++ b/Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx @@ -929,7 +929,7 @@ bool TRDGlobalTracking::refitTRDTrack(TrackTRD& trk, float& chi2, bool inwards, // conversion from slope in pad per time bin to slope in cm per BC = tracklets[trkltIdx].getSlopeFloat() * padWidth / BCperTimeBin float slopeFactor = mTrackletsRaw[trkltId].getSlopeFloat() * pad->getWidthIPad() / 4.f; - //float yCorrPileUp = mTCorrPileUp * slopeFactor; + // float yCorrPileUp = mTCorrPileUp * slopeFactor; float yCorrPileUp = mTCorrPileUp_weightedMean * slopeFactor; float yAddErrPileUp2 = mTErrPileUp2 * slopeFactor * slopeFactor; float yPosCorrUp = mTrackletsCalib[trkltId].getY() - tiltCorrUp + yCorrPileUp; diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx index 48668c004a2ae..50e2aa192e3c9 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx @@ -652,7 +652,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK // correction for mean z position of tracklet (is not the center of the pad if track eta != 0) float zPosCorr = spacePoints[trkltIdx].getZ() + mRecoParam->getZCorrCoeffNRC() * trkWork->getTgl(); - //float yPosCorr = spacePoints[trkltIdx].getY() - tiltCorr + yCorrPileUp; + // float yPosCorr = spacePoints[trkltIdx].getY() - tiltCorr + yCorrPileUp; float yPosCorr = spacePoints[trkltIdx].getY() - tiltCorr + yCorrPileUp_weightedMean; zPosCorr -= zShiftTrk + zShiftTrkPileUp; // shift tracklet instead of track in order to avoid having to do a re-fit for each collision @@ -843,7 +843,7 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK } zPosCorrUp -= zShiftTrkPileUp; - //yPosCorrUp += yCorrPileUp; + // yPosCorrUp += yCorrPileUp; yPosCorrUp += yCorrPileUp_weightedMean; const auto currDet = tracklets[mHypothesis[iUpdate + hypothesisIdxOffset].mTrackletId].GetDetector(); From 27b445887743476e59dd9419fcce386945e6f47d Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Wed, 11 Nov 2026 14:49:08 +0100 Subject: [PATCH 5/6] remove logging --- Detectors/TRD/simulation/src/Digitizer.cxx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Detectors/TRD/simulation/src/Digitizer.cxx b/Detectors/TRD/simulation/src/Digitizer.cxx index 7c70130f83cd0..918cc3fc6ca31 100644 --- a/Detectors/TRD/simulation/src/Digitizer.cxx +++ b/Detectors/TRD/simulation/src/Digitizer.cxx @@ -276,9 +276,6 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC } } - if (hit.GetTrackID() < 20) - LOGF(info, "pos before ExB: %f, drift length: %f, locX: %f, trackId: %d", locCd, absDriftLength, locT, hit.GetTrackID()); - // Apply E x B effects if (mSimParam.isExBOn()) { // minus sign is necessary to be compatible with how Vdrift and ExB are calibrated @@ -299,9 +296,6 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC } const double colOffset = padPlane->getPadColOffset(colE, locCd + offsetTilt); - if (hit.GetTrackID() < 20) - LOGF(info, "pos after ExB: %f %d, offset: %f tilt: %f", locCd, colE, colOffset, offsetTilt); - // Convert the position to drift time [mus], using either constant drift velocity or // time structure of drift cells (non-isochronity, GARFIELD calculation). // Also add absolute time of hits to take pile-up events into account properly @@ -380,16 +374,12 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1; const double crossTalk = mSimParam.ctOn() ? mSimParam.crossTalk(t) : 0; currentSignal[tb] += padSignal[pad] * (timeResponse + crossTalk); - if (hit.GetTrackID() < 20) - LOGF(info, "0, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse + crossTalk), currentSignal[tb]); } // end of loop time bins } else { for (int tb = firstTimeBin; tb < lastTimeBin; ++tb) { const double t = (tb - timeBinTruncated) / mSamplingRate + timeOffset; const double timeResponse = mSimParam.trfOn() ? mSimParam.timeResponse(t) : 1; currentSignal[tb] += padSignal[pad] * timeResponse; - if (hit.GetTrackID() < 20) - LOGF(info, "1, time bin: %d, pad: %d, signal: %f, totalSignal: %f", tb, pad, padSignal[pad] * (timeResponse), currentSignal[tb]); } // end of loop time bins } } // end of loop over pads From b08f0cea0aff051717d0c43503be91a819572e06 Mon Sep 17 00:00:00 2001 From: Gauthier Legras Date: Wed, 11 Nov 2026 15:44:46 +0100 Subject: [PATCH 6/6] dummy commit --- Detectors/TRD/simulation/src/Digitizer.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/Detectors/TRD/simulation/src/Digitizer.cxx b/Detectors/TRD/simulation/src/Digitizer.cxx index 918cc3fc6ca31..024938f48e13c 100644 --- a/Detectors/TRD/simulation/src/Digitizer.cxx +++ b/Detectors/TRD/simulation/src/Digitizer.cxx @@ -281,7 +281,6 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC // minus sign is necessary to be compatible with how Vdrift and ExB are calibrated locCd = locCd - TMath::Tan(calExBDetValue) * driftLength; } - // The electron position after diffusion and ExB in pad coordinates. rowE = padPlane->getPadRowNumberROC(locRd); if (rowE < 0) { @@ -295,7 +294,6 @@ bool Digitizer::convertHits(const int det, const std::vector& hits, SignalC continue; } const double colOffset = padPlane->getPadColOffset(colE, locCd + offsetTilt); - // Convert the position to drift time [mus], using either constant drift velocity or // time structure of drift cells (non-isochronity, GARFIELD calculation). // Also add absolute time of hits to take pile-up events into account properly