+Bool_t AliITStrackerMI::ComputeRoad(AliITStrackMI* track,Int_t ilayer,Int_t idet,Double_t &zmin,Double_t &zmax,Double_t &ymin,Double_t &ymax) const {
+ //--------------------------------------------------------------------
+ // This function computes the rectangular road for this track
+ //--------------------------------------------------------------------
+
+
+ AliITSdetector &det = fgLayers[ilayer].GetDetector(idet);
+ // take into account the misalignment: propagate track to misaligned detector plane
+ if (!track->Propagate(det.GetPhi(),det.GetRmisal())) return kFALSE;
+
+ Double_t dz=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadZ()*
+ TMath::Sqrt(track->GetSigmaZ2() +
+ AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
+ AliITSReconstructor::GetRecoParam()->GetNSigmaZLayerForRoadZ()*
+ AliITSReconstructor::GetRecoParam()->GetSigmaZ2(ilayer));
+ Double_t dy=AliITSReconstructor::GetRecoParam()->GetNSigmaRoadY()*
+ TMath::Sqrt(track->GetSigmaY2() +
+ AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
+ AliITSReconstructor::GetRecoParam()->GetNSigmaYLayerForRoadY()*
+ AliITSReconstructor::GetRecoParam()->GetSigmaY2(ilayer));
+
+ // track at boundary between detectors, enlarge road
+ Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidth();
+ if ( (track->GetY()-dy < det.GetYmin()+boundaryWidth) ||
+ (track->GetY()+dy > det.GetYmax()-boundaryWidth) ||
+ (track->GetZ()-dz < det.GetZmin()+boundaryWidth) ||
+ (track->GetZ()+dz > det.GetZmax()-boundaryWidth) ) {
+ Float_t tgl = TMath::Abs(track->GetTgl());
+ if (tgl > 1.) tgl=1.;
+ Double_t deltaXNeighbDets=AliITSRecoParam::GetDeltaXNeighbDets();
+ dz = TMath::Sqrt(dz*dz+deltaXNeighbDets*deltaXNeighbDets*tgl*tgl);
+ Float_t snp = TMath::Abs(track->GetSnp());
+ if (snp > AliITSReconstructor::GetRecoParam()->GetMaxSnp()) return kFALSE;
+ dy = TMath::Sqrt(dy*dy+deltaXNeighbDets*deltaXNeighbDets*snp*snp);
+ } // boundary
+
+ // add to the road a term (up to 2-3 mm) to deal with misalignments
+ dy = TMath::Sqrt(dy*dy + AliITSReconstructor::GetRecoParam()->GetRoadMisal()*AliITSReconstructor::GetRecoParam()->GetRoadMisal());
+ dz = TMath::Sqrt(dz*dz + AliITSReconstructor::GetRecoParam()->GetRoadMisal()*AliITSReconstructor::GetRecoParam()->GetRoadMisal());
+
+ Double_t r = fgLayers[ilayer].GetR();
+ zmin = track->GetZ() - dz;
+ zmax = track->GetZ() + dz;
+ ymin = track->GetY() + r*det.GetPhi() - dy;
+ ymax = track->GetY() + r*det.GetPhi() + dy;
+
+ // bring track back to idead detector plane
+ if (!track->Propagate(det.GetPhi(),det.GetR())) return kFALSE;
+
+ return kTRUE;
+}
+//------------------------------------------------------------------------