Skip to content
Snippets Groups Projects
Commit 7154c397 authored by Administrator's avatar Administrator
Browse files

Fix crashes in analysis tree converter

Add protections when tracking and/or track matching delivers strange results.
parent 506ae170
No related branches found
No related tags found
1 merge request!1577Fix crashes in analysis tree converter
Pipeline #26395 failed
......@@ -266,6 +266,11 @@ void CbmFsdHitsConverter::ProcessData(CbmEvent* event)
if ((bestMatchedIndex >= 0) && (bestChi2 > fsdgtrack_minChi2_) && (bestChi2 < fsdgtrack_maxChi2_)) {
const auto trackIndex = event ? event->GetIndex(ECbmDataType::kGlobalTrack, bestMatchedIndex) : bestMatchedIndex;
if (trackIndex > cbm_global_tracks_->GetEntriesFast()) {
LOG(error) << "Trying to access element " << trackIndex << " which is out ot the global track array of size"
<< cbm_global_tracks_->GetEntriesFast();
continue;
}
const auto* globalTrack = static_cast<const CbmGlobalTrack*>(cbm_global_tracks_->At(trackIndex));
FairTrackParam param_last = *(globalTrack->GetParamLast());
FairTrackParam param_fsd = ExtrapolateGtrack(hitZ, param_last);
......
......@@ -248,7 +248,7 @@ void CbmStsTracksConverter::MapTracks(CbmEvent* event)
CbmTrackMatchNew* match {nullptr};
int file_id {0}, event_id {0};
if (event && event->GetMatch()->GetNofLinks() > 0) {
if (event && event->GetMatch() && event->GetMatch()->GetNofLinks() > 0) {
file_id = event->GetMatch()->GetMatchedLink().GetFile();
event_id = event->GetMatch()->GetMatchedLink().GetEntry();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment