]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSclustererV2.cxx
changes to be compliant with Eff C++ rules
[u/mrichter/AliRoot.git] / ITS / AliITSclustererV2.cxx
index 532d04438d6a346d608971628eb88dc8f2dc3539..c572f221e7dc0144fccfcda7bc14bc70bece497b 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "AliITSclustererV2.h"
 #include "AliITSclusterV2.h"
+#include "AliITSDetTypeRec.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSPD.h"
 #include "AliITSRawStreamSDD.h"
@@ -28,15 +29,63 @@ ClassImp(AliITSclustererV2)
 
 extern AliRun *gAlice;
 
-AliITSclustererV2::AliITSclustererV2(const AliITSgeom *geom) {
+AliITSclustererV2::AliITSclustererV2():
+fNModules(0),
+fEvent(0),
+fI(0),
+fLastSPD1(0),
+fNySPD(0),
+fNzSPD(0),
+fYpitchSPD(0),
+fZ1pitchSPD(0),
+fZ2pitchSPD(0),
+fHwSPD(0),
+fHlSPD(0),
+fNySDD(0),
+fNzSDD(0),
+fYpitchSDD(0),
+fZpitchSDD(0),
+fHwSDD(0),
+fHlSDD(0),
+fYoffSDD(0),
+fLastSSD1(0),
+fYpitchSSD(0),
+fHwSSD(0),
+fHlSSD(0),
+fTanP(0),
+fTanN(0){
+   //default constructor
+ }
+AliITSclustererV2::AliITSclustererV2(const AliITSgeom *geom):
+fNModules(0),
+fEvent(0),
+fI(0),
+fLastSPD1(0),
+fNySPD(256),
+fNzSPD(160),
+fYpitchSPD(0.0050),
+fZ1pitchSPD(0.0425),
+fZ2pitchSPD(0.0625),
+fHwSPD(0.64),
+fHlSPD(3.48),
+fNySDD(256),
+fNzSDD(256),
+fYpitchSDD(0.01825),
+fZpitchSDD(0.02940),
+fHwSDD(3.5085),
+fHlSDD(3.7632),
+fYoffSDD(0.0425),
+fLastSSD1(0),
+fYpitchSSD(0.0095),
+fHwSSD(3.65),
+fHlSSD(2.00),
+fTanP(0.0275),
+fTanN(0.0075) {
   //------------------------------------------------------------
   // Standard constructor
   //------------------------------------------------------------
   AliITSgeom *g=(AliITSgeom*)geom;
 
-  fEvent=0;
-  fI=0;
-
   Int_t mmax=geom->GetIndexMax();
   if (mmax>2200) {
      Fatal("AliITSclustererV2","Too many ITS subdetectors !"); 
@@ -57,10 +106,6 @@ AliITSclustererV2::AliITSclustererV2(const AliITSgeom *geom) {
 
   //SPD geometry  
   fLastSPD1=g->GetModuleIndex(2,1,1)-1;
-  fNySPD=256; fNzSPD=160;
-  fYpitchSPD=0.0050;
-  fZ1pitchSPD=0.0425; fZ2pitchSPD=0.0625;
-  fHwSPD=0.64; fHlSPD=3.48;
   fYSPD[0]=0.5*fYpitchSPD;
   for (m=1; m<fNySPD; m++) fYSPD[m]=fYSPD[m-1]+fYpitchSPD; 
   fZSPD[0]=fZ1pitchSPD;
@@ -77,20 +122,8 @@ AliITSclustererV2::AliITSclustererV2(const AliITSgeom *geom) {
     fZSPD[m]-=dz;
   }
 
-  //SDD geometry 
-  fNySDD=256; fNzSDD=256;
-  fYpitchSDD=0.01825;
-  fZpitchSDD=0.02940;
-  fHwSDD=3.5085; fHlSDD=3.7632;
-  fYoffSDD=0.0425;
-
   //SSD geometry
   fLastSSD1=g->GetModuleIndex(6,1,1)-1;
-  fYpitchSSD=0.0095;
-  fHwSSD=3.65;
-  fHlSSD=2.00;
-  fTanP=0.0275;
-  fTanN=0.0075;
 
 }
 
@@ -224,13 +257,13 @@ void AliITSclustererV2::Digits2Clusters(AliRawReader* rawReader) {
 //**** Fast clusters *******************************
 #include "TParticle.h"
 
-#include "AliITS.h"
+//#include "AliITS.h"
 #include "AliITSmodule.h"
 #include "AliITSRecPoint.h"
 #include "AliITSsimulationFastPoints.h"
 #include "AliITSRecPoint.h"
 
-/*
+
 static void CheckLabels(Int_t lab[3]) {
   //------------------------------------------------------------
   // Tries to find mother's labels
@@ -257,7 +290,8 @@ static void CheckLabels(Int_t lab[3]) {
         else ;//cerr<<"CheckLabels : No empty labels !\n";
     }
 }
-*/
+
+/*
 static void CheckLabels(Int_t lab[3]) {
   //------------------------------------------------------------
   // Tries to find mother's labels
@@ -284,7 +318,7 @@ static void CheckLabels(Int_t lab[3]) {
   }
   
 }
-
+*/
 static void CheckLabels2(Int_t lab[10]) {
   //------------------------------------------------------------
   // Tries to find mother's labels
@@ -380,9 +414,9 @@ void AliITSclustererV2::RecPoints2Clusters
   for (Int_t i=0; i<ncl; i++) {
     AliITSRecPoint *p = (AliITSRecPoint *)points->UncheckedAt(i);
     Float_t lp[5];
-    lp[0]=-(-p->GetX()+fYshift[idx]); if (idx<=fLastSPD1) lp[0]*=-1; //SPD1
+    lp[0]=-(-p->GetDetLocalX()+fYshift[idx]); if (idx<=fLastSPD1) lp[0]*=-1; //SPD1
     lp[1]=  -p->GetZ()+fZshift[idx];
-    lp[2]=p->GetSigmaX2();
+    lp[2]=p->GetSigmaDetLocX2();
     lp[3]=p->GetSigmaZ2();
     lp[4]=p->GetQ()*36./23333.;  //electrons -> ADC
     Int_t lab[4]; 
@@ -394,55 +428,6 @@ void AliITSclustererV2::RecPoints2Clusters
   }  
 } 
 
-Int_t AliITSclustererV2::Hits2Clusters(TTree *hTree, TTree *cTree) {
-  //------------------------------------------------------------
-  // This function creates ITS clusters
-  //------------------------------------------------------------
-  if (!gAlice) {
-     Error("Hits2Clusters","gAlice==0 !");
-     return 1;
-  }
-
-  AliITS *its  = (AliITS*)gAlice->GetModule("ITS");
-  if (!its) { 
-     Error("Hits2Clusters","Can't find the ITS !"); 
-     return 2; 
-  }
-  AliITSgeom *geom=its->GetITSgeom();
-  Int_t mmax=geom->GetIndexMax();
-
-  its->InitModules(-1,mmax);
-  its->FillModules(hTree,0);
-
-  TClonesArray *clusters=new TClonesArray("AliITSclusterV2",1000);
-  TBranch *branch=cTree->GetBranch("Clusters");
-  if (!branch) cTree->Branch("Clusters",&clusters);
-  else branch->SetAddress(&clusters);
-
-  static TClonesArray *points=its->RecPoints();
-  AliITSsimulationFastPoints sim;
-  Int_t ncl=0;
-  for (Int_t m=0; m<mmax; m++) {
-    AliITSmodule *mod=its->GetModule(m);      
-    sim.CreateFastRecPoints(mod,m,gRandom);      
-
-    RecPoints2Clusters(points, m, clusters);
-    its->ResetRecPoints();
-
-    ncl+=clusters->GetEntriesFast();
-    cTree->Fill();
-    clusters->Clear();
-  }
-
-  Info("Hits2Clusters","Number of found fast clusters : %d",ncl);
-
-  //cTree->Write();
-
-  delete clusters;
-
-  return 0;
-}
-
 //***********************************
 
 #ifndef V1
@@ -1044,6 +1029,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
   Int_t cused2[3000];
   for (Int_t i=0;i<3000;i++) {cnegative[i]=0; cused1[i]=0;}
   for (Int_t i=0;i<3000;i++) {cpositive[i]=0; cused2[i]=0;}
+  for (Int_t i=0;i<30000;i++){negativepair[i]=positivepair[i]=0;}
   static Short_t pairs[1000][1000];
   memset(pairs,0,sizeof(Short_t)*1000000);
 //   Short_t ** pairs = new Short_t*[1000];
@@ -1706,7 +1692,7 @@ void AliITSclustererV2::FindClustersSSD(AliITSRawStream* input,
 #else   //V1
 
 #include "AliITSDetType.h"
-
+#include "AliITS.h"
 #include "AliITSsegmentationSPD.h"
 #include "AliITSClusterFinderSPD.h"