]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
AliToyMCEventGenerator would crash if a sector only gets one space point (TSpline3...
authorhljunggr <hljunggr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Jun 2013 08:18:17 +0000 (08:18 +0000)
committerhljunggr <hljunggr@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Jun 2013 08:18:17 +0000 (08:18 +0000)
TPC/Upgrade/AliToyMCEventGenerator.cxx

index 7a31f6de89121d49be8eb0525ab4991c6c79901e..4e10745b5c0da2bfc2fa6e1d67179eaa5139861f 100644 (file)
@@ -284,8 +284,19 @@ void AliToyMCEventGenerator::ConvertTrackPointsToLocalClusters(AliTrackPointArra
       grXZ=(TGraph*)arrGraphsXZ.At(sec);
       if (!grXY) continue;
 
-      splXY=new TSpline3("splXY",grXY);
-      splXZ=new TSpline3("splXZ",grXZ);
+      if(grXY->GetN()>1 && grXZ->GetN()>1) { //causes segmentation violation if N==1
+               splXY=new TSpline3("splXY",grXY);
+       splXZ=new TSpline3("splXZ",grXZ);
+      }
+      else {
+       //TODO: make a cluster also in the sector w only one space point?
+       continue;
+       // Double_t tempX=0., tempY = 0., tempZ = 0.;
+       
+       // grXY->GetPoint(0,tempX,localY);
+       // grXZ->GetPoint(0,tempX,localZ);
+      }
+
     }
     secOld=sec;