Skip to content

Commit b8c109d

Browse files
martenoledavidrohr
authored andcommitted
TRD additional configurable params
- deflection cut for tracklets disabled by default, needed until proper calibration available - some more comments in the code
1 parent 4ba1dff commit b8c109d

6 files changed

Lines changed: 20 additions & 15 deletions

File tree

DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ GPUdi() float Tracklet64::getUncalibratedY() const
189189
{
190190
int padLocal = getPositionBinSigned();
191191
int mcmCol = (getMCM() % constants::NMCMROBINCOL) + constants::NMCMROBINCOL * (getROB() % 2);
192+
// one pad column has 144 pads, the offset of -63 is the center of the first MCM in that column
193+
// which is connected to the pads -63 - 9 = -72 to -63 + 9 = -54
192194
float offset = -63.f + ((float)constants::NCOLMCM) * mcmCol;
193195
float padWidth = 0.635f + 0.03f * (getDetector() % constants::NLAYER);
194196
return (offset + padLocal * constants::GRANULARITYTRKLPOS) * padWidth;

Detectors/TRD/workflow/io/src/trd-digittracklet-writer-workflow.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "CommonUtils/ConfigurableParam.h"
1313
#include "Framework/CompletionPolicy.h"
1414
#include "Framework/ConfigParamSpec.h"
15-
#include "TRDWorkflowIO/TRDDigitReaderSpec.h"
1615
#include "TRDWorkflowIO/TRDTrackletWriterSpec.h"
1716
#include "TRDWorkflowIO/TRDDigitWriterSpec.h"
1817

Detectors/TRD/workflow/src/TRDGlobalTrackingSpec.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ void TRDGlobalTracking::fillMCTruthInfo(const TrackTRD& trk, o2::MCCompLabel lbl
192192

193193
void TRDGlobalTracking::fillTrackTriggerRecord(const std::vector<TrackTRD>& tracks, std::vector<TrackTriggerRecord>& trigRec, const gsl::span<const o2::trd::TriggerRecord>& trackletTrigRec) const
194194
{
195+
// after the tracking is done we assemble here a TrackTriggerRecord similar to the TriggerRecord
196+
// which for each TRD trigger stored the found tracks
195197
int currTrigRec = 0;
196198
int nTracksCurr = 0;
197199
int iTrackFirst = 0;
@@ -267,6 +269,7 @@ void TRDGlobalTracking::run(ProcessingContext& pc)
267269
if (mChainTracking->mIOPtrs.trdTrigRecMask[iTrig] == 0) {
268270
foundFilteredTrigger = true;
269271
}
272+
LOGF(DEBUG, "TRD trigger %i added with time %f", iTrig, mChainTracking->mIOPtrs.trdTriggerTimes[iTrig]);
270273
}
271274
if (!foundFilteredTrigger && mTrigRecFilter) {
272275
static bool warningSent = false;
@@ -295,7 +298,7 @@ void TRDGlobalTracking::run(ProcessingContext& pc)
295298
continue;
296299
}
297300
++nTracksLoadedITSTPC;
298-
LOGF(DEBUG, "Loaded ITS-TPC track %i with time %f", nTracksLoadedITSTPC, trkAttribs.mTime);
301+
LOGF(DEBUG, "Loaded ITS-TPC track %i with time %f. Window from %f to %f", nTracksLoadedITSTPC, trkAttribs.mTime, trkAttribs.mTime - trkAttribs.mTimeSubMax, trkAttribs.mTime + trkAttribs.mTimeAddMax);
299302
}
300303
// load TPC-only tracks
301304
for (int iTrk = 0; iTrk < mChainTracking->mIOPtrs.nOutputTracksTPCO2; ++iTrk) {
@@ -319,7 +322,7 @@ void TRDGlobalTracking::run(ProcessingContext& pc)
319322
continue;
320323
}
321324
++nTracksLoadedTPC;
322-
LOGF(DEBUG, "Loaded TPC track %i with time %f", nTracksLoadedTPC, trkAttribs.mTime);
325+
LOGF(DEBUG, "Loaded TPC track %i with time %f. Window from %f to %f", nTracksLoadedTPC, trkAttribs.mTime, trkAttribs.mTime - trkAttribs.mTimeSubMax, trkAttribs.mTime + trkAttribs.mTimeAddMax);
323326
}
324327
LOGF(INFO, "%i tracks are loaded into the TRD tracker. Out of those %i ITS-TPC tracks and %i TPC tracks", nTracksLoadedITSTPC + nTracksLoadedTPC, nTracksLoadedITSTPC, nTracksLoadedTPC);
325328

@@ -659,7 +662,7 @@ DataProcessorSpec getTRDGlobalTrackingSpec(bool useMC, GTrackID::mask_t src, boo
659662
outputs.emplace_back(o2::header::gDataOriginTRD, "MCLB_TPC_TRD", ss, Lifetime::Timeframe);
660663
}
661664
if (trigRecFilterActive) {
662-
LOG(ERROR) << "Matching to TPC-only tracks requested, but IR without ITS contribution are filtered out. This does not lead to a crash, but it deteriorates the matching efficiency.";
665+
LOG(INFO) << "Matching to TPC-only tracks requested, but IRs without ITS contribution are filtered out (used strict matching mode to constrain TPC tracks before matching to ITS)";
663666
}
664667
}
665668

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ AddOptionRTC(penaltyChi2, float, 13.f, "", 0, "Chi2 penalty for no available TRD
8787
AddOptionRTC(chi2StrictCut, float, 10.f, "", 0, "Chi2 cut for strict matching mode")
8888
AddOptionRTC(chi2SeparationCut, float, 2.5f, "", 0, "Minimum difference between chi2 of winner match and chi2 of second best match")
8989
AddOptionRTC(nSigmaTerrITSTPC, float, 4.f, "", 0, "Number of sigmas for ITS-TPC track time error estimate")
90+
AddOptionRTC(extraRoadY, float, 2.f, "", 0, "Addition to search road around track prolongation along Y in cm")
91+
AddOptionRTC(extraRoadZ, float, 0.f, "", 0, "Addition to search road around track prolongation along Z in cm")
92+
AddOptionRTC(applyDeflectionCut, unsigned char, 0, "", 0, "Set to 1 to enable tracklet selection based on deflection")
9093
AddOptionRTC(stopTrkAfterNMissLy, unsigned char, 6, "", 0, "Abandon track following after N layers without a TRD match")
9194
AddHelp("help", 'h')
9295
EndConfig()

GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void* GPUTRDTracker_t<TRDTRK, PROP>::SetPointersTracks(void* base)
102102
}
103103

104104
template <class TRDTRK, class PROP>
105-
GPUTRDTracker_t<TRDTRK, PROP>::GPUTRDTracker_t() : mR(nullptr), mIsInitialized(false), mGenerateSpacePoints(false), mProcessPerTimeFrame(false), mNAngleHistogramBins(25), mAngleHistogramRange(50), mMemoryPermanent(-1), mMemoryTracklets(-1), mMemoryTracks(-1), mNMaxCollisions(0), mNMaxTracks(0), mNMaxSpacePoints(0), mTracks(nullptr), mTrackAttribs(nullptr), mNCandidates(1), mNTracks(0), mNEvents(0), mMaxThreads(100), mTrackletIndexArray(nullptr), mHypothesis(nullptr), mCandidates(nullptr), mSpacePoints(nullptr), mGeo(nullptr), mRPhiA2(0), mRPhiB(0), mRPhiC2(0), mDyA2(0), mDyB(0), mDyC2(0), mAngleToDyA(0), mAngleToDyB(0), mAngleToDyC(0), mDebugOutput(false), mMaxEta(0.84f), mExtraRoadY(2.f), mRoadZ(18.f), mZCorrCoefNRC(1.4f), mTPCVdrift(2.58f), mDebug(new GPUTRDTrackerDebug<TRDTRK>())
105+
GPUTRDTracker_t<TRDTRK, PROP>::GPUTRDTracker_t() : mR(nullptr), mIsInitialized(false), mGenerateSpacePoints(false), mProcessPerTimeFrame(false), mNAngleHistogramBins(25), mAngleHistogramRange(50), mMemoryPermanent(-1), mMemoryTracklets(-1), mMemoryTracks(-1), mNMaxCollisions(0), mNMaxTracks(0), mNMaxSpacePoints(0), mTracks(nullptr), mTrackAttribs(nullptr), mNCandidates(1), mNTracks(0), mNEvents(0), mMaxThreads(100), mTrackletIndexArray(nullptr), mHypothesis(nullptr), mCandidates(nullptr), mSpacePoints(nullptr), mGeo(nullptr), mRPhiA2(0), mRPhiB(0), mRPhiC2(0), mDyA2(0), mDyB(0), mDyC2(0), mAngleToDyA(0), mAngleToDyB(0), mAngleToDyC(0), mDebugOutput(false), mMaxEta(0.84f), mRoadZ(18.f), mZCorrCoefNRC(1.4f), mTPCVdrift(2.58f), mDebug(new GPUTRDTrackerDebug<TRDTRK>())
106106
{
107107
//--------------------------------------------------------------------
108108
// Default constructor
@@ -650,9 +650,9 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
650650
}
651651

652652
// define search window
653-
roadY = 7.f * CAMath::Sqrt(trkWork->getSigmaY2() + 0.1f * 0.1f) + mExtraRoadY; // add constant to the road to account for uncertainty due to radial deviations (few mm)
653+
roadY = 7.f * CAMath::Sqrt(trkWork->getSigmaY2() + 0.1f * 0.1f) + Param().rec.trd.extraRoadY; // add constant to the road to account for uncertainty due to radial deviations (few mm)
654654
// roadZ = 7.f * CAMath::Sqrt(trkWork->getSigmaZ2() + 9.f * 9.f / 12.f); // take longest pad length
655-
roadZ = mRoadZ; // simply twice the longest pad length -> efficiency 99.996%
655+
roadZ = mRoadZ + Param().rec.trd.extraRoadZ; // simply twice the longest pad length -> efficiency 99.996%
656656
//
657657
if (CAMath::Abs(trkWork->getZ() + zShiftTrk) - roadZ >= zMaxTRD) {
658658
if (ENABLE_INFO) {
@@ -721,10 +721,11 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
721721
RecalcTrkltCov(tilt, trkWork->getSnp(), pad->GetRowSize(tracklets[trkltIdx].GetZbin()), trkltCovTmp);
722722
float chi2 = prop->getPredictedChi2(trkltPosTmpYZ, trkltCovTmp);
723723
// TODO cut on angular pull should be made stricter when proper v-drift calibration for the TRD tracklets is implemented
724-
if (chi2 < Param().rec.trd.maxChi2 && CAMath::Abs(GetAngularPull(spacePoints[trkltIdx].getDy(), trkWork->getSnp())) < 4) {
725-
Hypothesis hypo(trkWork->getNlayersFindable(), iCandidate, trkltIdx, trkWork->getChi2() + chi2);
726-
InsertHypothesis(hypo, nCurrHypothesis, hypothesisIdxOffset);
727-
} // end tracklet chi2 < Param().rec.trd.maxChi2
724+
if ((chi2 > Param().rec.trd.maxChi2) || (Param().rec.trd.applyDeflectionCut && CAMath::Abs(GetAngularPull(spacePoints[trkltIdx].getDy(), trkWork->getSnp())) > 4)) {
725+
continue;
726+
}
727+
Hypothesis hypo(trkWork->getNlayersFindable(), iCandidate, trkltIdx, trkWork->getChi2() + chi2);
728+
InsertHypothesis(hypo, nCurrHypothesis, hypothesisIdxOffset);
728729
} // end tracklet in window
729730
} // tracklet loop
730731
} // chamber loop

GPU/GPUTracking/TRDTracking/GPUTRDTracker.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,12 @@ class GPUTRDTracker_t : public GPUProcessor
139139
GPUd() void SetProcessPerTimeFrame(bool flag) { mProcessPerTimeFrame = flag; }
140140
GPUd() void EnableDebugOutput() { mDebugOutput = true; }
141141
GPUd() void SetMaxEta(float maxEta) { mMaxEta = maxEta; }
142-
GPUd() void SetExtraRoadY(float extraRoadY) { mExtraRoadY = extraRoadY; }
143142
GPUd() void SetRoadZ(float roadZ) { mRoadZ = roadZ; }
144143
GPUd() void SetTPCVdrift(float vDrift) { mTPCVdrift = vDrift; }
145144

146145
GPUd() bool GetIsDebugOutputOn() const { return mDebugOutput; }
147146
GPUd() float GetMaxEta() const { return mMaxEta; }
148147
GPUd() int GetNCandidates() const { return mNCandidates; }
149-
GPUd() float GetExtraRoadY() const { return mExtraRoadY; }
150148
GPUd() float GetRoadZ() const { return mRoadZ; }
151149

152150
// output
@@ -198,8 +196,7 @@ class GPUTRDTracker_t : public GPUProcessor
198196
/// ---- end error parametrization ----
199197
bool mDebugOutput; // store debug output
200198
static CONSTEXPR float sRadialOffset GPUCA_CPP11_INIT(= -0.1f); // due to (possible) mis-calibration of t0 -> will become obsolete when tracklet conversion is done outside of the tracker
201-
float mMaxEta; // TPC tracks with higher eta are ignored
202-
float mExtraRoadY; // addition to search road in r-phi to account for not exact radial match of tracklets and tracks in first iteration
199+
float mMaxEta; // TPC tracks with higher eta are ignored
203200
float mRoadZ; // in z, a constant search road is used
204201
float mZCorrCoefNRC; // tracklet z-position depends linearly on track dip angle
205202
float mTPCVdrift; // TPC drift velocity used for shifting TPC tracks along Z

0 commit comments

Comments
 (0)