From 8999d47d1cc3764818c6407f33a18314da06b056 Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 7 Apr 2006 13:07:29 +0000 Subject: [PATCH] In MakeSegmentsPerStation() - protection against division by zero (Ivana) --- MUON/AliMUONTrackReconstructor.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/MUON/AliMUONTrackReconstructor.cxx b/MUON/AliMUONTrackReconstructor.cxx index 2b894b52203..398bd240264 100644 --- a/MUON/AliMUONTrackReconstructor.cxx +++ b/MUON/AliMUONTrackReconstructor.cxx @@ -856,11 +856,17 @@ void AliMUONTrackReconstructor::MakeSegmentsPerStation(Int_t Station) distNonBend = TMath::Abs(hit2Ptr->GetNonBendingCoor() - extNonBendCoor); if (last2st) { // bending slope - bendingSlope = (hit1Ptr->GetBendingCoor() - hit2Ptr->GetBendingCoor()) / - (hit1Ptr->GetZ() - hit2Ptr->GetZ()); - // absolute value of impact parameter - impactParam = - TMath::Abs(hit1Ptr->GetBendingCoor() - hit1Ptr->GetZ() * bendingSlope); + if ( hit1Ptr->GetZ() - hit2Ptr->GetZ() != 0.0 ) { + bendingSlope = (hit1Ptr->GetBendingCoor() - hit2Ptr->GetBendingCoor()) / + (hit1Ptr->GetZ() - hit2Ptr->GetZ()); + // absolute value of impact parameter + impactParam = + TMath::Abs(hit1Ptr->GetBendingCoor() - hit1Ptr->GetZ() * bendingSlope); + } + else { + AliWarning("hit1Ptr->GetZ() = hit2Ptr->GetZ(): impactParam set to maxImpactParam"); + impactParam = maxImpactParam; + } } // check for distances not too large, // and impact parameter not too big if stations downstream of the dipole. -- 2.43.0