Add protection agains mismatch in number of ESD friends
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2012 08:29:25 +0000 (08:29 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2012 08:29:25 +0000 (08:29 +0000)
TRD/AliTRDCalibTask.cxx

index d6605a2..1a7aed5 100644 (file)
@@ -727,7 +727,9 @@ void AliTRDCalibTask::UserExec(Option_t *)
     ULong_t status = fkEsdTrack->GetStatus(); 
     if(status&(AliESDtrack::kTPCout)) ++nbtrackTPC;
     
-    fFriendTrack = fESDfriend->GetTrack(itrk);
+    // Fix suggested by Alex
+    //fFriendTrack = fESDfriend->GetTrack(itrk);
+    fFriendTrack = (fESDfriend->GetNumberOfTracks()>itrk)?fESDfriend->GetTrack(itrk):NULL;
     if(!fFriendTrack)  {
       //printf("No friend track %d\n",itrk);
       continue;