From 2f2c7bc6754e842f4aea80ff45fce880ca04e2a5 Mon Sep 17 00:00:00 2001 From: Bohdan Dudar Date: Fri, 21 Oct 2022 18:22:13 +0200 Subject: [PATCH 1/2] Fix seg. fault when there is not enough hits to calculate the track length --- Tracking/TrackLength/src/TrackLengthProcessor.cc | 8 ++++++++ Tracking/TrackLength/src/TrackLengthUtils.cc | 1 + 2 files changed, 9 insertions(+) diff --git a/Tracking/TrackLength/src/TrackLengthProcessor.cc b/Tracking/TrackLength/src/TrackLengthProcessor.cc index 7c207598..3b8214a1 100644 --- a/Tracking/TrackLength/src/TrackLengthProcessor.cc +++ b/Tracking/TrackLength/src/TrackLengthProcessor.cc @@ -85,6 +85,14 @@ void TrackLengthProcessor::processEvent(EVENT::LCEvent * evt){ double trackLengthToEcal = 0.; double harmonicMomToEcal = 0.; int nTrackStates = trackStates.size(); + streamlog_out(DEBUG9)<<"PFO has "< results{0., 0., 0., 0.}; + pidHandler.setParticleID(pfo , 0, 0, 0., algoID, results); + continue; + } + //exclude last track state at the ECal for( int j=1; j < nTrackStates-1; ++j ){ //we check which track length formula to use diff --git a/Tracking/TrackLength/src/TrackLengthUtils.cc b/Tracking/TrackLength/src/TrackLengthUtils.cc index 7ca4a2fc..78989d45 100644 --- a/Tracking/TrackLength/src/TrackLengthUtils.cc +++ b/Tracking/TrackLength/src/TrackLengthUtils.cc @@ -122,6 +122,7 @@ std::vector TrackLengthUtils::getSubTracks(EVENT::Track* track){ std::vector TrackLengthUtils::getTrackStatesPerHit(std::vector tracks, MarlinTrk::IMarlinTrkSystem* trkSystem, double bField){ vector trackStatesPerHit; int nTracks = tracks.size(); + streamlog_out(DEBUG8)<<"PFO has "< hits = track->getTrackerHits(); From 855dc396c23ec94d726addbae70751fb20e6054a Mon Sep 17 00:00:00 2001 From: Bohdan Dudar Date: Fri, 21 Oct 2022 18:35:33 +0200 Subject: [PATCH 2/2] Add debug output --- Tracking/TrackLength/src/TrackLengthUtils.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/Tracking/TrackLength/src/TrackLengthUtils.cc b/Tracking/TrackLength/src/TrackLengthUtils.cc index 78989d45..1a07f562 100644 --- a/Tracking/TrackLength/src/TrackLengthUtils.cc +++ b/Tracking/TrackLength/src/TrackLengthUtils.cc @@ -126,6 +126,7 @@ std::vector TrackLengthUtils::getTrackStatesPerHit(std::ve for(int i=0; i hits = track->getTrackerHits(); + streamlog_out(DEBUG8)<<"Subtrack "<