]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCFast.cxx
There was a problem when the destructor was called, and some problem
[u/mrichter/AliRoot.git] / TPC / AliTPCFast.cxx
index c4f3c09db3e4f6597529b1b41bb960f6c41ac4a1..ff9d5d9ae73e6cb88dd12da0f9ec8365d83a1bf4 100644 (file)
 #include <TParticle.h>
 #include <TVector.h>
 #include <TRandom.h>
+#include <TTree.h>
 
 #include "AliRunLoader.h"
+#include "AliLoader.h"
 #include "AliRun.h"
 #include "AliMC.h"
 #include "AliTPC.h"
@@ -130,9 +132,10 @@ void AliTPCFast::Hits2Clusters(AliRunLoader* runLoader) const
   //---------------------------------------------------------------
   
   TTree *tH = loader->TreeH();
-  if (tH == 0x0)
+  if (tH == 0x0){
     AliFatal("Can not find TreeH in folder");
-
+    return;
+  }
   tpc->SetTreeAddress();
   
   Stat_t ntracks = tH->GetEntries();
@@ -389,9 +392,10 @@ void AliTPCFast::Hits2ExactClustersSector(AliRunLoader* runLoader,
   //---------------------------------------------------------------
   
   TTree *tH = loader->TreeH();
-  if (tH == 0x0)
+  if (tH == 0x0){
     AliFatal("Can not find TreeH in folder");
-
+    return;
+  }
   tpc->SetTreeAddress();
 
   Stat_t ntracks = tH->GetEntries();
@@ -453,23 +457,23 @@ void AliTPCFast::Hits2ExactClustersSector(AliRunLoader* runLoader,
          Float_t sumxz=0;
          Float_t sumx2z=0;
          Float_t sumq=0;
-         for (Int_t index=0;index<currentIndex;index++){
-           Float_t x,x2,x3,x4;
-           x=x2=x3=x4=xxx(index*4);
-           x2*=x;
+         for (Int_t cindex=0;cindex<currentIndex;cindex++){
+           Float_t x1,x2,x3,x4;
+           x1=x2=x3=x4=xxx(cindex*4);
+           x2*=x1;
            x3*=x2;
            x4*=x3;
-           sumx+=x;
+           sumx+=x1;
            sumx2+=x2;
            sumx3+=x3;
            sumx4+=x4;
-           sumy+=xxx(index*4+1);
-           sumxy+=xxx(index*4+1)*x;
-           sumx2y+=xxx(index*4+1)*x2;
-           sumz+=xxx(index*4+2);
-           sumxz+=xxx(index*4+2)*x;
-           sumx2z+=xxx(index*4+2)*x2;   
-           sumq+=xxx(index*4+3);
+           sumy+=xxx(cindex*4+1);
+           sumxy+=xxx(cindex*4+1)*x1;
+           sumx2y+=xxx(cindex*4+1)*x2;
+           sumz+=xxx(cindex*4+2);
+           sumxz+=xxx(cindex*4+2)*x1;
+           sumx2z+=xxx(cindex*4+2)*x2;  
+           sumq+=xxx(cindex*4+3);
          }
          Float_t det=currentIndex*(sumx2*sumx4-sumx3*sumx3)-sumx*(sumx*sumx4-sumx2*sumx3)+
            sumx2*(sumx*sumx3-sumx2*sumx2);