]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrack.cxx
Additional protection in case of negative indexes. More investigation is needed
[u/mrichter/AliRoot.git] / MUON / AliMUONTrack.cxx
index 3090c1ee1a41c1b6df8728f8b76140d5979b1573..527ac5a232fde5d0cd8aef9a5fb8841773a00127 100644 (file)
@@ -78,10 +78,12 @@ AliMUONTrack::AliMUONTrack(AliMUONSegment* BegSegment, AliMUONSegment* EndSegmen
   // memory allocation for the TObjArray of pointers to reconstructed TrackHit's
   fTrackHitsPtr = new TObjArray(10);
   fNTrackHits = 0;
-  AddSegment(BegSegment); // add hits from BegSegment
-  AddSegment(EndSegment); // add hits from EndSegment
-  fTrackHitsPtr->Sort(); // sort TrackHits according to increasing Z
-  SetTrackParamAtVertex(); // set track parameters at vertex
+  if (BegSegment) { //AZ
+    AddSegment(BegSegment); // add hits from BegSegment
+    AddSegment(EndSegment); // add hits from EndSegment
+    fTrackHitsPtr->Sort(); // sort TrackHits according to increasing Z
+    SetTrackParamAtVertex(); // set track parameters at vertex
+  }
   fTrackParamAtHit = new TClonesArray("AliMUONTrackParam",10);
   fHitForRecAtHit = new TClonesArray("AliMUONHitForRec",10);
   // set fit conditions...