]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSClusterFinderV2SSD.cxx
Commenting out debug printout
[u/mrichter/AliRoot.git] / ITS / AliITSClusterFinderV2SSD.cxx
index 94e20f949f77ef37db9ef01987739531eaecb186..5b7f3ccf14beb1c0782e2adbfe0a08d0d0046d1a 100644 (file)
 //                                                                        //
 ///////////////////////////////////////////////////////////////////////////
 
-#include "AliRun.h"
 
 #include "AliITSClusterFinderV2SSD.h"
-#include "AliITSclusterV2.h"
+#include "AliITSRecPoint.h"
+#include "AliITSgeomTGeo.h"
+#include "AliITSDetTypeRec.h"
 #include "AliRawReader.h"
 #include "AliITSRawStreamSSD.h"
-
 #include <TClonesArray.h>
-#include "AliITS.h"
-#include "AliITSgeom.h"
 #include "AliITSdigitSSD.h"
+#include "AliITSCalibrationSSD.h"
 
 ClassImp(AliITSClusterFinderV2SSD)
 
 
-AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD():AliITSClusterFinderV2(){
+AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD(AliITSDetTypeRec* dettyp):AliITSClusterFinderV2(dettyp),
+fLastSSD1(AliITSgeomTGeo::GetModuleIndex(6,1,1)-1),
+fYpitchSSD(0.0095),
+fHwSSD(3.65),
+fHlSSD(2.00),
+fTanP(0.0275),
+fTanN(0.0075){
 
   //Default constructor
 
-  AliITSgeom* geom = (AliITSgeom*)fITS->GetITSgeom();
-
-  fLastSSD1=geom->GetModuleIndex(6,1,1)-1;
-  fYpitchSSD=0.0095;
-  fHwSSD=3.65;
-  fHlSSD=2.00;
-  fTanP=0.0275;
-  fTanN=0.0075;
-
-
-
 }
  
 
@@ -64,11 +58,23 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(TClonesArray *alldigits) {
   //------------------------------------------------------------
   // Actual SSD cluster finder
   //------------------------------------------------------------
+  AliITSCalibrationSSD* cal = (AliITSCalibrationSSD*)GetResp(fModule);
+  Float_t gain=0;
+
   Int_t smaxall=alldigits->GetEntriesFast();
   if (smaxall==0) return;
   TObjArray *digits = new TObjArray;
   for (Int_t i=0;i<smaxall; i++){
     AliITSdigitSSD *d=(AliITSdigitSSD*)alldigits->UncheckedAt(i);
+
+    if(d->IsSideP()) gain = cal->GetGainP(d->GetStripNumber());  
+    else gain = cal->GetGainN(d->GetStripNumber());
+
+    Float_t q=gain*d->GetSignal(); // calibration brings mip peaks around 120 (in ADC units)
+    q=cal->ADCToKeV(q); // converts the charge in KeV from ADC units
+    //Float_t q=d->GetSignal()/4.29;// temp. fix (for PID purposed - normalis. to be checked)
+    d->SetSignal(Int_t(q));
+
     if (d->GetSignal()<3) continue;
     digits->AddLast(d);
   }
@@ -212,7 +218,7 @@ void AliITSClusterFinderV2SSD::RawdataToClusters(AliRawReader* rawReader,TClones
   
 }
 
-void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStream* input, 
+void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStreamSSD* input, 
                                        TClonesArray** clusters) 
 {
   //------------------------------------------------------------
@@ -229,12 +235,15 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStream* input,
   Int_t prevStrip = -1;
   Int_t prevFlag = -1;
   Int_t prevModule = -1;
+  Float_t gain=0;
+  AliITSCalibrationSSD* cal=NULL;
+  
 
   // read raw data input stream
   while (kTRUE) {
     Bool_t next = input->Next();
 
-    if(input->GetSignal()<3 && next) continue;
+    if(input->GetSignal()<(3*4.) && next) continue;
     // check if a new cluster starts
     Int_t strip = input->GetCoord2();
     Int_t flag = input->GetCoord1();
@@ -274,7 +283,7 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStream* input,
 
       // when all data from a module was read, search for clusters
       if (prevFlag >= 0) {
-       clusters[iModule] = new TClonesArray("AliITSclusterV2");
+       clusters[iModule] = new TClonesArray("AliITSRecPoint");
        fModule = iModule;
        FindClustersSSD(&clusters1D[0][0], nClusters[0], 
                        &clusters1D[1][0], nClusters[1], clusters[iModule]);
@@ -286,11 +295,17 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStream* input,
       nClusters[0] = nClusters[1] = 0;
       y = q = 0.;
       nDigits = 0;
+
+      cal = (AliITSCalibrationSSD*)GetResp(input->GetModuleID());
+
     }
 
+    if(input->GetSideFlag()==0) gain = cal->GetGainP(input->GetStrip());  
+    else gain = cal->GetGainN(input->GetStrip());
+    
     // add digit to current cluster
-    q += input->GetSignal();
-    y += strip * input->GetSignal();
+    q += cal->ADCToKeV( gain * input->GetSignal() );  // signal is corrected for gain and converted in KeV 
+    y += strip * cal->ADCToKeV( gain * input->GetSignal() );
     nDigits++;
     prevStrip = strip;
     prevFlag = flag;
@@ -308,6 +323,9 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
   //------------------------------------------------------------
   // Actual SSD cluster finder
   //------------------------------------------------------------
+
+  const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(fModule);
+
   TClonesArray &cl=*clusters;
   //
   Float_t tanp=fTanP, tann=fTanN;
@@ -323,6 +341,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]=0; positivepair[i]=0;}
   static Short_t pairs[1000][1000];
   memset(pairs,0,sizeof(Short_t)*1000000);
 //   Short_t ** pairs = new Short_t*[1000];
@@ -398,8 +417,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       zt-=fHlSSD; yt-=fHwSSD;
       ybest=yt; zbest=zt; 
       qbest=0.5*(pos[ip].GetQ()+neg[j].GetQ());
-      lp[0]=-(-ybest+fYshift[fModule]);
-      lp[1]=  -zbest+fZshift[fModule];
+      {
+      Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+      mT2L->MasterToLocal(loc,trk);
+      lp[0]=trk[1];
+      lp[1]=trk[2];
+      }
       lp[2]=0.0025*0.0025;  //SigmaY2
       lp[3]=0.110*0.110;  //SigmaZ2
       
@@ -413,22 +436,34 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       CheckLabels2(milab);
       milab[3]=(((ip<<10) + j)<<10) + idet; // pos|neg|det
       Int_t info[3] = {pos[ip].GetNd(),neg[j].GetNd(),fNlayer[fModule]};
-      AliITSclusterV2 * cl2;
-      if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
+      AliITSRecPoint * cl2;
+      if(clusters){
+       cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+       cl2->SetChargeRatio(ratio);     
+       cl2->SetType(1);
+       pairs[ip][j]=1;
+       if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
+         cl2->SetType(2);
+         pairs[ip][j]=2;
+       }
+       cused1[ip]++;
+       cused2[j]++;
+       
+      }
       else{
-       cl2 = new AliITSclusterV2(milab,lp,info);
-       fITS->AddClusterV2(*cl2);
+       cl2 = new AliITSRecPoint(milab,lp,info);        
+       cl2->SetChargeRatio(ratio);     
+       cl2->SetType(1);
+       pairs[ip][j]=1;
+       if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
+         cl2->SetType(2);
+         pairs[ip][j]=2;
+       }
+       cused1[ip]++;
+       cused2[j]++;
+       fDetTypeRec->AddRecPoint(*cl2);
       }
       ncl++;
-      cl2->SetChargeRatio(ratio);      
-      cl2->SetType(1);
-      pairs[ip][j]=1;
-      if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
-       cl2->SetType(2);
-       pairs[ip][j]=2;
-      }
-      cused1[ip]++;
-      cused2[j]++;
     }
   }
     
@@ -453,8 +488,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          zt-=fHlSSD; yt-=fHwSSD;
          ybest =yt;  zbest=zt; 
          qbest =pos[ip].GetQ();
-         lp[0]=-(-ybest+fYshift[fModule]);
-         lp[1]=  -zbest+fZshift[fModule];
+          {
+          Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+          mT2L->MasterToLocal(loc,trk);
+          lp[0]=trk[1];
+          lp[1]=trk[2];
+          }
          lp[2]=0.0025*0.0025;  //SigmaY2
          lp[3]=0.110*0.110;  //SigmaZ2
          
@@ -470,25 +509,36 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          milab[3]=(((ip<<10) + in)<<10) + idet; // pos|neg|det
          Int_t info[3] = {pos[ip].GetNd(),neg[in].GetNd(),fNlayer[fModule]};
 
-         AliITSclusterV2 * cl2;
-         if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
+         AliITSRecPoint * cl2;
+         if(clusters){
+           cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           cl2->SetType(5);
+           pairs[ip][in] = 5;
+           if ((pos[ip].GetNd()+neg[in].GetNd())>6){ //multi cluster
+             cl2->SetType(6);
+             pairs[ip][in] = 6;
+           }       
+         }
          else{
-           cl2 = new AliITSclusterV2(milab,lp,info);
-           fITS->AddClusterV2(*cl2);
+           cl2 = new AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           cl2->SetType(5);
+           pairs[ip][in] = 5;
+           if ((pos[ip].GetNd()+neg[in].GetNd())>6){ //multi cluster
+             cl2->SetType(6);
+             pairs[ip][in] = 6;
+           }
+           
+           fDetTypeRec->AddRecPoint(*cl2);
          }
          ncl++;
-         cl2->SetChargeRatio(ratio);           
-         cl2->SetType(5);
-         pairs[ip][in] = 5;
-         if ((pos[ip].GetNd()+neg[in].GetNd())>6){ //multi cluster
-           cl2->SetType(6);
-           pairs[ip][in] = 6;
-         }
        }
+       
        //
        // add second pair
        
-       //      if (!(cused1[ip2] || cused2[in])){  //
+      //       if (!(cused1[ip2] || cused2[in])){  //
        if (pairs[ip2][in]==100){
          Float_t yp=pos[ip2].GetY()*fYpitchSSD;
          Float_t yn=neg[in].GetY()*fYpitchSSD;
@@ -497,8 +547,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          zt-=fHlSSD; yt-=fHwSSD;
          ybest =yt;  zbest=zt; 
          qbest =pos[ip2].GetQ();
-         lp[0]=-(-ybest+fYshift[fModule]);
-         lp[1]=  -zbest+fZshift[fModule];
+          {
+          Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+          mT2L->MasterToLocal(loc,trk);
+          lp[0]=trk[1];
+          lp[1]=trk[2];
+          }
          lp[2]=0.0025*0.0025;  //SigmaY2
          lp[3]=0.110*0.110;  //SigmaZ2
          
@@ -513,21 +567,31 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          ratio = (pos[ip2].GetQ()-neg[in].GetQ())/(pos[ip2].GetQ()+neg[in].GetQ());
          milab[3]=(((ip2<<10) + in)<<10) + idet; // pos|neg|det
          Int_t info[3] = {pos[ip2].GetNd(),neg[in].GetNd(),fNlayer[fModule]};
-
-         AliITSclusterV2 * cl2;
-         if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
+         
+         AliITSRecPoint * cl2;
+         if(clusters){
+           cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           cl2->SetType(5);
+           pairs[ip2][in] =5;
+           if ((pos[ip2].GetNd()+neg[in].GetNd())>6){ //multi cluster
+             cl2->SetType(6);
+             pairs[ip2][in] =6;
+           }
+         }
          else{
-           cl2 = new AliITSclusterV2(milab,lp,info);
-           fITS->AddClusterV2(*cl2);
+           cl2 = new AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           cl2->SetType(5);
+           pairs[ip2][in] =5;
+           if ((pos[ip2].GetNd()+neg[in].GetNd())>6){ //multi cluster
+             cl2->SetType(6);
+             pairs[ip2][in] =6;
+           }
+
+           fDetTypeRec->AddRecPoint(*cl2);
          }
          ncl++;
-         cl2->SetChargeRatio(ratio);           
-         cl2->SetType(5);
-         pairs[ip2][in] =5;
-         if ((pos[ip2].GetNd()+neg[in].GetNd())>6){ //multi cluster
-           cl2->SetType(6);
-           pairs[ip2][in] =6;
-         }
        }       
        cused1[ip]++;
        cused1[ip2]++;
@@ -535,7 +599,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       }
     }    
   }
-  
+
   //  
   for (Int_t jn=0;jn<nn;jn++){
     if (cused2[jn]) continue;
@@ -559,8 +623,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          zt-=fHlSSD; yt-=fHwSSD;
          ybest =yt;  zbest=zt; 
          qbest =neg[jn].GetQ();
-         lp[0]=-(-ybest+fYshift[fModule]);
-         lp[1]=  -zbest+fZshift[fModule];
+          {
+          Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+          mT2L->MasterToLocal(loc,trk);
+          lp[0]=trk[1];
+          lp[1]=trk[2];
+          }
          lp[2]=0.0025*0.0025;  //SigmaY2
          lp[3]=0.110*0.110;  //SigmaZ2
          
@@ -576,20 +644,31 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          milab[3]=(((ip<<10) + jn)<<10) + idet; // pos|neg|det
          Int_t info[3] = {pos[ip].GetNd(),neg[jn].GetNd(),fNlayer[fModule]};
 
-         AliITSclusterV2 * cl2;
-         if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
+         AliITSRecPoint * cl2;
+         if(clusters){
+           cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           cl2->SetType(7);
+           pairs[ip][jn] =7;
+           if ((pos[ip].GetNd()+neg[jn].GetNd())>6){ //multi cluster
+             cl2->SetType(8);
+             pairs[ip][jn]=8;
+           }
+
+         }
          else{
-           cl2 = new AliITSclusterV2(milab,lp,info);
-           fITS->AddClusterV2(*cl2);
+           cl2 = new AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           cl2->SetType(7);
+           pairs[ip][jn] =7;
+           if ((pos[ip].GetNd()+neg[jn].GetNd())>6){ //multi cluster
+             cl2->SetType(8);
+             pairs[ip][jn]=8;
+           }
+
+           fDetTypeRec->AddRecPoint(*cl2);
          }
          ncl++;
-         cl2->SetChargeRatio(ratio);           
-         cl2->SetType(7);
-         pairs[ip][jn] =7;
-         if ((pos[ip].GetNd()+neg[jn].GetNd())>6){ //multi cluster
-           cl2->SetType(8);
-           pairs[ip][jn]=8;
-         }
        }
        //
        // add second pair
@@ -602,8 +681,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          zt-=fHlSSD; yt-=fHwSSD;
          ybest =yt;  zbest=zt; 
          qbest =neg[jn2].GetQ();
-         lp[0]=-(-ybest+fYshift[fModule]);
-         lp[1]=  -zbest+fZshift[fModule];
+          {
+          Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+          mT2L->MasterToLocal(loc,trk);
+          lp[0]=trk[1];
+          lp[1]=trk[2];
+          }
          lp[2]=0.0025*0.0025;  //SigmaY2
          lp[3]=0.110*0.110;  //SigmaZ2
          
@@ -618,21 +701,32 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          ratio = (pos[ip].GetQ()-neg[jn2].GetQ())/(pos[ip].GetQ()+neg[jn2].GetQ());
          milab[3]=(((ip<<10) + jn2)<<10) + idet; // pos|neg|det
          Int_t info[3] = {pos[ip].GetNd(),neg[jn2].GetNd(),fNlayer[fModule]};
-         AliITSclusterV2 * cl2;
-         if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
+         AliITSRecPoint * cl2;
+         if(clusters){
+           cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           pairs[ip][jn2]=7;
+           cl2->SetType(7);
+           if ((pos[ip].GetNd()+neg[jn2].GetNd())>6){ //multi cluster
+             cl2->SetType(8);
+             pairs[ip][jn2]=8;
+           }
+           
+         }
          else{
-           cl2 = new AliITSclusterV2(milab,lp,info);
-           fITS->AddClusterV2(*cl2);
+           cl2 = new AliITSRecPoint(milab,lp,info);
+           cl2->SetChargeRatio(ratio);         
+           pairs[ip][jn2]=7;
+           cl2->SetType(7);
+           if ((pos[ip].GetNd()+neg[jn2].GetNd())>6){ //multi cluster
+             cl2->SetType(8);
+             pairs[ip][jn2]=8;
+           }
+           
+           fDetTypeRec->AddRecPoint(*cl2);
          }
 
          ncl++;
-         cl2->SetChargeRatio(ratio);           
-         pairs[ip][jn2]=7;
-         cl2->SetType(7);
-         if ((pos[ip].GetNd()+neg[jn2].GetNd())>6){ //multi cluster
-           cl2->SetType(8);
-           pairs[ip][jn2]=8;
-         }
        }
        cused1[ip]++;
        cused2[jn]++;
@@ -693,8 +787,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       zt-=fHlSSD; yt-=fHwSSD;
       ybest=yt; zbest=zt; 
       qbest=0.5*(pos[ip].GetQ()+neg[j].GetQ());
-      lp[0]=-(-ybest+fYshift[fModule]);
-      lp[1]=  -zbest+fZshift[fModule];
+      {
+      Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+      mT2L->MasterToLocal(loc,trk);
+      lp[0]=trk[1];
+      lp[1]=trk[2];
+      }
       lp[2]=0.0025*0.0025;  //SigmaY2
       lp[3]=0.110*0.110;  //SigmaZ2    
       lp[4]=qbest;        //Q
@@ -708,24 +806,34 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       ratio = (pos[ip].GetQ()-neg[j].GetQ())/(pos[ip].GetQ()+neg[j].GetQ());
       milab[3]=(((ip<<10) + j)<<10) + idet; // pos|neg|det
       Int_t info[3] = {pos[ip].GetNd(),neg[j].GetNd(),fNlayer[fModule]};
-      AliITSclusterV2 * cl2;
-      if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
-      else{
-       cl2 = new AliITSclusterV2(milab,lp,info);
-           fITS->AddClusterV2(*cl2);
+      AliITSRecPoint * cl2;
+      if(clusters){
+       cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+       cl2->SetChargeRatio(ratio);     
+       cl2->SetType(10);
+       pairs[ip][j]=10;
+       if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
+         cl2->SetType(11);
+         pairs[ip][j]=11;
+       }
+       cused1[ip]++;
+       cused2[j]++;      
       }
-      
-
+      else{
+       cl2 = new AliITSRecPoint(milab,lp,info);
+       cl2->SetChargeRatio(ratio);     
+       cl2->SetType(10);
+       pairs[ip][j]=10;
+       if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
+         cl2->SetType(11);
+         pairs[ip][j]=11;
+       }
+       cused1[ip]++;
+       cused2[j]++;      
+       
+       fDetTypeRec->AddRecPoint(*cl2);
+      }      
       ncl++;
-      cl2->SetChargeRatio(ratio);      
-      cl2->SetType(10);
-      pairs[ip][j]=10;
-      if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
-       cl2->SetType(11);
-       pairs[ip][j]=11;
-      }
-      cused1[ip]++;
-      cused2[j]++;      
     }
 
   }
@@ -750,8 +858,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       if (TMath::Abs(zt)<fHlSSD+0.01*(neg[j].GetNd()+pos[i].GetNd())) {
         ybest=yt; zbest=zt; 
         qbest=0.5*(pos[i].GetQ()+neg[j].GetQ());
-        lp[0]=-(-ybest+fYshift[fModule]);
-        lp[1]=  -zbest+fZshift[fModule];
+        {
+        Double_t loc[3]={ybest,0.,zbest},trk[3]={0.,0.,0.};
+        mT2L->MasterToLocal(loc,trk);
+        lp[0]=trk[1];
+        lp[1]=trk[2];
+        }
         lp[2]=0.0025*0.0025;  //SigmaY2
         lp[3]=0.110*0.110;  //SigmaZ2
 
@@ -765,15 +877,19 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        CheckLabels2(milab);
        milab[3]=(((i<<10) + j)<<10) + idet; // pos|neg|det
        Int_t info[3] = {pos[i].GetNd(),neg[j].GetNd(),fNlayer[fModule]};
-       AliITSclusterV2 * cl2;
-       if(clusters) cl2 = new (cl[ncl]) AliITSclusterV2(milab,lp,info);
+       AliITSRecPoint * cl2;
+       if(clusters){
+         cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+         cl2->SetChargeRatio(ratio);
+         cl2->SetType(100+cpositive[j]+cnegative[i]);    
+       }
        else{
-         cl2 = new AliITSclusterV2(milab,lp,info);
-         fITS->AddClusterV2(*cl2);
+         cl2 = new AliITSRecPoint(milab,lp,info);
+         cl2->SetChargeRatio(ratio);
+         cl2->SetType(100+cpositive[j]+cnegative[i]);
+         fDetTypeRec->AddRecPoint(*cl2);
        }
        ncl++;
-       cl2->SetChargeRatio(ratio);
-       cl2->SetType(100+cpositive[j]+cnegative[i]);
        //cl2->SetType(0);
        /*
          if (pairs[i][j]<100){