@@ -2334,14 +2334,6 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
23342334 continue ;
23352335 }
23362336
2337- collTable (collisionInfo.runNumber ,
2338- collisionInfo.globalBC ,
2339- collisionInfo.timestamp ,
2340- c.posX (), c.posY (), c.posZ (),
2341- c.covXX (), c.covYY (), c.covZZ (),
2342- c.collisionTime (), c.collisionTimeRes ());
2343- collisionIdRemapping[collisionIndex] = remappedCollisionIndex;
2344-
23452337 bool hasGoodOppositeSignMuonPair = false ;
23462338 std::vector<MuonPair> muonPairs;
23472339 getMuonPairs (collisionInfo, muonPairs);
@@ -2391,14 +2383,10 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
23912383 }
23922384
23932385 // loop over MCH tracks
2386+ int nMchTracksStored = 0 ;
23942387 for (const auto & mchIndex : collisionInfo.mchTracks ) {
23952388 auto const & mchTrack = muonTracks.rawIteratorAt (mchIndex);
23962389
2397- // skip tracks that have already been stored from another compatible collision
2398- if (muonTrackIdRemapping.contains (mchIndex)) {
2399- continue ;
2400- }
2401-
24022390 // skip tracks without associated collision (this should never be true here)
24032391 if (!mchTrack.has_collision ()) {
24042392 continue ;
@@ -2414,6 +2402,13 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
24142402 }
24152403 }
24162404
2405+ nMchTracksStored += 1 ;
2406+
2407+ // skip tracks that have already been stored from another compatible collision
2408+ if (muonTrackIdRemapping.contains (mchIndex)) {
2409+ continue ;
2410+ }
2411+
24172412 fwdTable (remappedCollisionIndex,
24182413 mchTrack.trackType (),
24192414 mchTrack.x (), mchTrack.y (), mchTrack.z (),
@@ -2494,6 +2489,17 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
24942489 }
24952490 }
24962491
2492+ if (nMchTracksStored < 1 ) {
2493+ continue ;
2494+ }
2495+
2496+ collTable (collisionInfo.runNumber ,
2497+ collisionInfo.globalBC ,
2498+ collisionInfo.timestamp ,
2499+ c.posX (), c.posY (), c.posZ (),
2500+ c.covXX (), c.covYY (), c.covZZ (),
2501+ c.collisionTime (), c.collisionTimeRes ());
2502+ collisionIdRemapping[collisionIndex] = remappedCollisionIndex;
24972503 remappedCollisionIndex += 1 ;
24982504 }
24992505
0 commit comments