Skip to content

Commit 7803bcf

Browse files
Cosmics: load the ITS tracks of legs with an ITS part
With --track-sources containing ITS-TPC (or another source with ITS) but not ITS, the matcher's winner refit and the cluster collector read the ITS track of such a leg (getITSTrack, its cluster references), which was neither requested nor read: segfault in refitWinner, then in the collector; without an ITS road there was also no ITS cluster reader (invalid workflow). The ITS tracks and clusters are now requested and read for these legs, without making standalone ITS tracks legs (seed sources unchanged). TPC-only legs (physics-v1 in async) are not affected. PbPb 567939, 4 TFs, --track-sources TPC,ITS-TPC: all TFs processed with and without the ITS road (crash before), no ITS-only legs (seeds 23318 vs 26345 with ITS as legs); TPC-only legs: unchanged, no ITS track reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e95db4d commit 7803bcf

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎Detectors/GlobalTrackingWorkflow/include/GlobalTrackingWorkflow/CosmicsMatchingSpec.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ namespace globaltracking
2424
{
2525

2626
/// create a processor spec
27+
/// ITS tracks needed by legs with an ITS part (their refit and ITS clusters) if ITS tracks are no legs themselves
28+
o2::dataformats::GlobalTrackID::mask_t getLegITSSources(o2::dataformats::GlobalTrackID::mask_t src);
29+
2730
/// srcPVContributors plus the parent matches needed to resolve their single-detector parts (RecoContainer::getSingleDetectorRefs)
2831
o2::dataformats::GlobalTrackID::mask_t addPVContributorParents(o2::dataformats::GlobalTrackID::mask_t srcPVContributors);
2932

‎Detectors/GlobalTrackingWorkflow/src/CosmicsClusterCollectorSpec.cxx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#include "Framework/DataProcessorSpec.h"
6666
#include "Framework/DeviceSpec.h"
6767
#include "GlobalTrackingWorkflow/CosmicsClusterCollectorSpec.h"
68+
#include "GlobalTrackingWorkflow/CosmicsMatchingSpec.h"
6869
#include "DataFormatsGlobalTracking/RecoContainer.h"
6970
#include "DataFormatsGlobalTracking/TrackCosmicsExtended.h"
7071
#include "ReconstructionDataFormats/TrackCosmics.h"
@@ -1610,6 +1611,7 @@ DataProcessorSpec getCosmicsClusterCollectorSpec(GTrackID::mask_t src, bool useM
16101611
auto dataRequest = std::make_shared<DataRequest>();
16111612
dataRequest->setITSPerLayer(itsStag);
16121613
dataRequest->requestTracks(src, false);
1614+
dataRequest->requestTracks(getLegITSSources(src), false); // the ITS clusters of legs with an ITS part are read through their ITS track
16131615
dataRequest->requestClusters(src, false);
16141616
if (roadDets[DetID::ITS]) {
16151617
dataRequest->requestITSClusters(false);

‎Detectors/GlobalTrackingWorkflow/src/CosmicsMatchingSpec.cxx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ void CosmicsMatchingSpec::endOfStream(EndOfStreamContext& ec)
187187
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
188188
}
189189

190+
GTrackID::mask_t getLegITSSources(GTrackID::mask_t src)
191+
{
192+
return GTrackID::includesDet(o2::detectors::DetID::ITS, src) ? GTrackID::getSourceMask(GTrackID::ITS) & ~src : GTrackID::mask_t{};
193+
}
194+
190195
GTrackID::mask_t addPVContributorParents(GTrackID::mask_t srcPVContributors)
191196
{
192197
auto src = srcPVContributors;
@@ -213,6 +218,7 @@ DataProcessorSpec getCosmicsMatchingSpec(GTrackID::mask_t src, bool usePV, bool
213218
dataRequest->setITSPerLayer(itsStag);
214219

215220
dataRequest->requestTracks(src, useMC);
221+
dataRequest->requestTracks(getLegITSSources(src), false); // the refit of legs with an ITS part reads their ITS track
216222
dataRequest->requestClusters(src, false); // no MC labels for clusters needed for refit only
217223
if (useTOFClusters) {
218224
dataRequest->requestTOFClusters(false); // TOF flight pairs of the candidate pairs (MatchCosmicsParams::tofFlightSelection)

‎Detectors/GlobalTrackingWorkflow/src/cosmics-match-workflow.cxx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
118118
src = src | GID::getSourcesMask("CTP");
119119
}
120120

121-
GID::mask_t srcCl = src;
121+
// legs with an ITS part need the ITS tracks and clusters for their refit, also if standalone ITS tracks are no legs (not added to src)
122+
const GID::mask_t srcITS = o2::globaltracking::getLegITSSources(src);
123+
GID::mask_t srcCl = src | srcITS;
122124
const bool useTOFClusters = o2::globaltracking::MatchCosmicsParams::Instance().tofFlightSelection;
123125
if (useTOFClusters) {
124126
srcCl |= GID::getSourceMask(GID::TOF);
@@ -151,7 +153,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
151153
specs.emplace_back(o2::globaltracking::getCosmicsClusterCollectorSpec(src, useMC, doStag, roadDets));
152154
}
153155

154-
o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCl, src | srcPVLoaded, src | srcPVLoaded, useMC, dummy); // clusters MC is not needed
156+
o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCl, src | srcPVLoaded | srcITS, src | srcPVLoaded | srcITS, useMC, dummy); // clusters MC is not needed
155157
if (usePV) {
156158
o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, useMC); // P-vertex is always needed
157159
}

0 commit comments

Comments
 (0)