Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions PWGDQ/Tasks/muonGlobalAlignment.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2334,14 +2334,6 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
continue;
}

collTable(collisionInfo.runNumber,
collisionInfo.globalBC,
collisionInfo.timestamp,
c.posX(), c.posY(), c.posZ(),
c.covXX(), c.covYY(), c.covZZ(),
c.collisionTime(), c.collisionTimeRes());
collisionIdRemapping[collisionIndex] = remappedCollisionIndex;

bool hasGoodOppositeSignMuonPair = false;
std::vector<MuonPair> muonPairs;
getMuonPairs(collisionInfo, muonPairs);
Expand Down Expand Up @@ -2391,14 +2383,10 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
}

// loop over MCH tracks
int nMchTracksStored = 0;
for (const auto& mchIndex : collisionInfo.mchTracks) {
auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex);

// skip tracks that have already been stored from another compatible collision
if (muonTrackIdRemapping.contains(mchIndex)) {
continue;
}

// skip tracks without associated collision (this should never be true here)
if (!mchTrack.has_collision()) {
continue;
Expand All @@ -2414,6 +2402,13 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
}
}

nMchTracksStored += 1;

// skip tracks that have already been stored from another compatible collision
if (muonTrackIdRemapping.contains(mchIndex)) {
continue;
}

fwdTable(remappedCollisionIndex,
mchTrack.trackType(),
mchTrack.x(), mchTrack.y(), mchTrack.z(),
Expand Down Expand Up @@ -2494,6 +2489,17 @@ struct MuonGlobalAlignment { // o2-linter: disable=name/workflow-file,name/struc
}
}

if (nMchTracksStored < 1) {
continue;
}

collTable(collisionInfo.runNumber,
collisionInfo.globalBC,
collisionInfo.timestamp,
c.posX(), c.posY(), c.posZ(),
c.covXX(), c.covYY(), c.covZZ(),
c.collisionTime(), c.collisionTimeRes());
collisionIdRemapping[collisionIndex] = remappedCollisionIndex;
remappedCollisionIndex += 1;
}

Expand Down
Loading