]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCFast.cxx
Correct the way primary photons are in EMCAL acceptance, change some histograms title...
[u/mrichter/AliRoot.git] / TPC / AliTPCFast.cxx
index 09ee16796679410fe5d507798be7c0fa28e40e12..2d5ec7aa0f3f1ded748bd3a4e5968b00f1802564 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <TParticle.h>
 #include <TVector.h>
+#include <TRandom.h>
 
 #include "AliRunLoader.h"
 #include "AliRun.h"
@@ -232,7 +233,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
@@ -452,23 +453,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);
@@ -522,8 +523,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 ;