]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCFast.cxx
Removing obsolete macros
[u/mrichter/AliRoot.git] / TPC / AliTPCFast.cxx
index 7d800a98698ecae86c6fdd2fcd2189029a9a99d1..98ea578412d8ab2cc565f10fd6640c6d80f5f15d 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"
@@ -53,6 +55,8 @@ AliTPCFast & AliTPCFast::operator =(const AliTPCFast & param)
   //
   // assignment operator - dummy
   //
+  if (this == &param) return (*this);
+
   fParam=param.fParam;
   return (*this);
 }
@@ -130,9 +134,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();
@@ -233,7 +238,7 @@ void AliTPCFast::Hits2Clusters(AliRunLoader* runLoader) const
           Float_t ymax=xprim*TMath::Tan(0.5*alpha);
           if (TMath::Abs(xyz[0])>ymax) xyz[0]=yprim; 
        xyz[1]=gRandom->Gaus(tpcHit->Z(),TMath::Sqrt(sigmaZ)); // z
-          if (TMath::Abs(xyz[1])>param->GetZLength()) xyz[1]=tpcHit->Z(); 
+          if (TMath::Abs(xyz[1])>param->GetZLength(isec)) xyz[1]=tpcHit->Z(); 
        xyz[2]=sigmaRphi;                                     // fSigmaY2
        xyz[3]=sigmaZ;                                        // fSigmaZ2
        xyz[4]=tpcHit->fQ;                                    // q
@@ -389,9 +394,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 +459,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);
@@ -523,8 +529,8 @@ void AliTPCFast::Hits2ExactClustersSector(AliRunLoader* runLoader,
          sigmay2 = TMath::Min(sigmay2,1.);
          //
          //
-         z = sign*(param->GetZLength() - z);
-         if (TMath::Abs(z)< param->GetZLength()-1){
+         z = sign*(param->GetZLength(isec) - z);
+         if (TMath::Abs(z)< param->GetZLength(isec)-1){
            AliTPCClustersRow * row = (clustersArray->GetRow(isec,lastrow));
            if (row!=0) {
              AliTPCclusterMI* cl = new((AliTPCclusterMI*)row->Append()) AliTPCclusterMI ;