- fix for TRD on-line track matching with tracks having TPCrefit but not TPCout ...
[u/mrichter/AliRoot.git] / TRD / AliTRDonlineTrackMatching.cxx
index 021018ea3c3f1ed430be9df6e70c0f9d92a63c7a..24df6914c77a1d26c7917c09ffb3df208fbfcbb1 100644 (file)
@@ -661,7 +661,14 @@ Int_t AliTRDonlineTrackMatching::EstimateTrackDistance(AliESDtrack *esd_track, A
       }
       Double_t n[3] = {n0[0]/n_len, n0[1]/n_len, n0[2]/n_len}; // normal vector of plane
 
-      AliExternalTrackParam *outerTPC = new AliExternalTrackParam(*(esd_track->GetOuterParam()));
+      const AliExternalTrackParam *trackParam = esd_track->GetOuterParam();
+      if (!trackParam) {
+       trackParam = esd_track->GetInnerParam();
+       if (!trackParam)
+         trackParam = esd_track;
+      }
+
+      AliExternalTrackParam *outerTPC = new AliExternalTrackParam(*trackParam);
       Bool_t isects = TrackPlaneIntersect(outerTPC, layer_ref_global2, n, mag); // find intersection point between track and TRD layer
       delete outerTPC;
       outerTPC = NULL;