]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCTrackHitsV2.cxx
Correction in Binaries().
[u/mrichter/AliRoot.git] / TPC / AliTPCTrackHitsV2.cxx
index b8011380a5e200325c41611c84e7597e76bc83b2..54c98fc47bf000d79a80c341e4497801ca74b439 100644 (file)
 
 /*
 $Log$
+Revision 1.6  2002/10/14 14:57:43  hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
+Revision 1.4.6.1  2002/07/26 12:12:55  alibrary
+Updating VirtualMC
+
+Revision 1.5  2002/07/25 16:56:52  hristov
+fSize set to zero in Clear(). The size of the array is checked in First() (M.Ivanov)
+
+Revision 1.4  2002/03/01 10:19:06  hristov
+Additional protection (M.Ivanov)
+
 Revision 1.1  2002/01/21 17:14:21  kowal2
 New track hits using root containers.
 
@@ -62,7 +74,7 @@ New track hits using root containers.
 #include "TClonesArray.h"    
 #include "AliTPC.h"
 
-#include <iostream.h>
+#include <Riostream.h>
 
 
 
@@ -344,6 +356,7 @@ void AliTPCTrackHitsV2::Clear()
 {
   //
   //clear object  
+  fSize = 0;
   if (fArray){
     for (Int_t i=0;i<fArray->GetEntriesFast();i++){
       AliTrackHitsParamV2 * par = (AliTrackHitsParamV2 *)fArray->UncheckedAt(i);
@@ -507,7 +520,11 @@ Bool_t AliTPCTrackHitsV2::FlushHitStack(Bool_t force)
       ratio = TMath::Sqrt(1.+ dfi2+ ddz2);  
     }
 
-    Double_t dl = fStep*(Short_t)TMath::Nint(dr*ratio/fStep);  
+    //    Double_t dl = fStep*(Short_t)TMath::Nint(dr*ratio/fStep);   //MI change 
+    Double_t dl = dr*ratio/fStep;
+    if (TMath::Abs(dl)>32765) dl =0;
+    dl = fStep * Short_t(TMath::Nint(dl));
+
     dr = dl/ratio; 
     oldr+=dr;
     //calculate precission
@@ -614,6 +631,12 @@ Bool_t AliTPCTrackHitsV2::First()
   //
   //set Current hit for the first hit
   //
+
+  if (fArray->GetSize()<=0) {
+    fCurrentHit->fStatus = kFALSE;
+    return kFALSE;
+  }
+
   AliTrackHitsParamV2 *param = (AliTrackHitsParamV2 *)fArray->At(0);
   if (!fHit) fHit = new AliTPChit;
   if (!(param) ) {