Skip to content

Commit bb8c0f3

Browse files
committed
Protect against out of bounds
1 parent 260e694 commit bb8c0f3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Common/TableProducer/PID/pidTPC.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ struct tpcPid {
435435
}
436436

437437
float nSigma = -999.f;
438+
int multTPC = 0;
439+
if(trk.has_collision()){
440+
auto collision = collisions.rawIteratorAt(trk.collisionId());
441+
multTPC = collision.multTPC();
442+
}
438443
float bg = trk.tpcInnerParam() / o2::track::pid_constants::sMasses[pid]; // estimated beta-gamma for network cutoff
439444
if (useNetworkCorrection && speciesNetworkFlags[pid] && trk.has_collision() && bg > networkBetaGammaCutoff) {
440445

@@ -457,7 +462,7 @@ struct tpcPid {
457462
LOGF(fatal, "Network output-dimensions incompatible!");
458463
}
459464
} else {
460-
nSigma = response->GetNumberOfSigmaMCTuned(collisions.iteratorAt(trk.collisionId()), trk, pid, tpcSignal);
465+
nSigma = response->GetNumberOfSigmaMCTunedAtMultiplicity(multTPC, trk, pid, tpcSignal);
461466
}
462467
if (flagFull)
463468
tableFull(expSigma, nSigma);

0 commit comments

Comments
 (0)