Additional prrotection
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Apr 2006 15:31:02 +0000 (15:31 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Apr 2006 15:31:02 +0000 (15:31 +0000)
ITS/AliITStrackerV2.cxx

index b0f285c..9f40d65 100644 (file)
@@ -1053,9 +1053,17 @@ void AliITStrackerV2::UseClusters(const AliKalmanTrack *t, Int_t from) const {
   //--------------------------------------------------------------------
   AliTracker::UseClusters(t,from);
 
-  AliITSRecPoint *c=(AliITSRecPoint *)GetCluster(t->GetClusterIndex(0));
+  Int_t clusterIndex = t->GetClusterIndex(0);
+  AliITSRecPoint *c= 0x0;
+
+  if (clusterIndex>-1)
+    c = (AliITSRecPoint *)GetCluster(clusterIndex);
   if (c && c->GetSigmaZ2()>0.1) c->UnUse();
-  c=(AliITSRecPoint *)GetCluster(t->GetClusterIndex(1));
+
+  c = 0x0;
+  clusterIndex = t->GetClusterIndex(1);
+  if (clusterIndex>-1)
+    c=(AliITSRecPoint *)GetCluster(clusterIndex);
   if (c && c->GetSigmaZ2()>0.1) c->UnUse();
 
 }