Skip to content

Commit 450ddce

Browse files
committed
Fix problematic access of collisions iterator if -1, improvement pending
1 parent 7262e64 commit 450ddce

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Common/TableProducer/PID/pidTPC.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ struct tpcPid {
457457
LOGF(fatal, "Network output-dimensions incompatible!");
458458
}
459459
} else {
460-
nSigma = response->GetNumberOfSigmaMCTuned(collisions.iteratorAt(trk.collisionId()), trk, pid, tpcSignal);
460+
nSigma = response->GetNumberOfSigmaMCTuned(collisions.iteratorAt(trk.collisionId()), 1, trk, pid, tpcSignal);
461461
}
462462
if (flagFull)
463463
tableFull(expSigma, nSigma);

Common/TableProducer/PID/pidTPCModule.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ class pidTPCModule
544544

545545
// faster counting
546546
for (const auto& track : tracks) {
547-
if (track.hasTPC()) {
548-
if (track.collisionId() > -1) {
547+
if(track.hasTPC()){
548+
if(track.collisionId()>-1){
549549
pidmults[track.collisionId()]++;
550550
}
551551
totalTPCtracks++;
@@ -725,8 +725,12 @@ class pidTPCModule
725725
products.tableTuneOnData(mcTunedTPCSignal);
726726
}
727727

728-
auto makePidTablesDefault = [&trk, &tpcSignalToEvaluatePID, &cols, &pidmults, &network_prediction, &count_tracks, &tracksForNet_size, this](const int flagFull, auto& tableFull, const int flagTiny, auto& tableTiny, const o2::track::PID::ID pid) {
729-
makePidTables(flagFull, tableFull, flagTiny, tableTiny, pid, tpcSignalToEvaluatePID, trk, cols, pidmults[trk.collisionId()], network_prediction, count_tracks, tracksForNet_size);
728+
int multTPCtoUse = 1;
729+
if(trk.has_collision()){
730+
multTPCtoUse = pidmults[trk.collisionId()];
731+
}
732+
auto makePidTablesDefault = [&trk, &tpcSignalToEvaluatePID, &cols, &multTPCtoUse, &network_prediction, &count_tracks, &tracksForNet_size, this](const int flagFull, auto& tableFull, const int flagTiny, auto& tableTiny, const o2::track::PID::ID pid) {
733+
makePidTables(flagFull, tableFull, flagTiny, tableTiny, pid, tpcSignalToEvaluatePID, trk, cols, multTPCtoUse, network_prediction, count_tracks, tracksForNet_size);
730734
};
731735

732736
makePidTablesDefault(pidTPCopts.pidFullEl, products.tablePIDFullEl, pidTPCopts.pidTinyEl, products.tablePIDTinyEl, o2::track::PID::Electron);

0 commit comments

Comments
 (0)