From d86ed84c7ebcbc3ea66a49cc4379d65054e5663f Mon Sep 17 00:00:00 2001 From: abercuci Date: Mon, 16 Feb 2009 09:31:30 +0000 Subject: [PATCH 1/1] fix Savannah bug 46980 --- TRD/AliTRDseedV1.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TRD/AliTRDseedV1.cxx b/TRD/AliTRDseedV1.cxx index 3e47d55750a..caa076758c8 100644 --- a/TRD/AliTRDseedV1.cxx +++ b/TRD/AliTRDseedV1.cxx @@ -828,15 +828,16 @@ Bool_t AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber, Bool_t tilt) SetExB(); // calculate dx for time bins in the drift region (calibration aware) - Int_t irp = 0; Float_t x[2]; Int_t tb[2]; + Int_t irp = 0; Float_t x[2]={0., 0.}; Int_t tb[2] = {0, 0}; for (Int_t it = t0; it < AliTRDtrackerV1::GetNTimeBins(); it++) { if(!fClusters[it]) continue; x[irp] = fClusters[it]->GetX(); tb[irp] = it; irp++; if(irp==2) break; - } - fdX = (x[1] - x[0]) / (tb[0] - tb[1]); + } + Int_t dtb = tb[1] - tb[0]; + fdX = dtb ? (x[0] - x[1]) / dtb : 0.15; // update X0 from the clusters (calibration/alignment aware) TODO remove dependence on x0 !! for (Int_t it = 0; it < AliTRDtrackerV1::GetNTimeBins(); it++) { -- 2.43.0