]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
SSD cluster finder adapted to work with several sensors at a time (one DDL) - E....
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Dec 2007 17:07:16 +0000 (17:07 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Dec 2007 17:07:16 +0000 (17:07 +0000)
ITS/AliITSClusterFinderV2SSD.cxx
ITS/AliITSClusterFinderV2SSD.h
ITS/AliITSRawStreamSSD.h

index cf157bb2e1096d5f6aad89b0e3579451e9ef4767..4bbe26fad05fccd031107f48cf2d9e37b7a578e4 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+
+/* $Id$ */
+
 ////////////////////////////////////////////////////////////////////////////
 //            Implementation of the ITS clusterer V2 class                //
 //                                                                        //
 //          Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch            //
+//          Revised: Enrico Fragiacomo, enrico.fragiacomo@ts.infn.it      //
 //                                                                        //
 ///////////////////////////////////////////////////////////////////////////
 
+#include <Riostream.h>
+
 
 #include "AliITSClusterFinderV2SSD.h"
 #include "AliITSRecPoint.h"
@@ -30,8 +36,8 @@
 #include "AliITSdigitSSD.h"
 #include "AliITSCalibrationSSD.h"
 
-Short_t *AliITSClusterFinderV2SSD::fPairs = 0x0;
-Int_t    AliITSClusterFinderV2SSD::fPairsSize = 0;
+Short_t *AliITSClusterFinderV2SSD::fgPairs = 0x0;
+Int_t    AliITSClusterFinderV2SSD::fgPairsSize = 0;
 
 ClassImp(AliITSClusterFinderV2SSD)
 
@@ -48,6 +54,27 @@ fTanN(0.0075){
 
 }
  
+//______________________________________________________________________
+AliITSClusterFinderV2SSD::AliITSClusterFinderV2SSD(const AliITSClusterFinderV2SSD &cf) : AliITSClusterFinderV2(cf),                                            fLastSSD1(cf.fLastSSD1),
+fYpitchSSD(cf.fYpitchSSD),
+fHwSSD(cf.fHwSSD),
+fHlSSD(cf.fHlSSD),
+fTanP(cf.fTanP),
+fTanN(cf.fTanN)
+{
+  // Copy constructor
+
+}
+
+//______________________________________________________________________
+AliITSClusterFinderV2SSD& AliITSClusterFinderV2SSD::operator=(const AliITSClusterFinderV2SSD&  cf ){
+  // Assignment operator
+
+  this->~AliITSClusterFinderV2SSD();
+  new(this) AliITSClusterFinderV2SSD(cf);
+  return *this;
+}
+
 
 void AliITSClusterFinderV2SSD::FindRawClusters(Int_t mod){
 
@@ -117,31 +144,6 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(TClonesArray *alldigits) {
         CheckLabels2(milab);
          c[*n].SetLabels(milab);
          //Split suspiciously big cluster
-        /*
-        if (nd>10&&nd<16){
-          c[*n].SetY(y/q-0.3*nd);
-          c[*n].SetQ(0.5*q);
-          (*n)++;
-          if (*n==MAX) {
-            Error("FindClustersSSD","Too many 1D clusters !");
-              return;
-          }
-          c[*n].SetY(y/q-0.0*nd);
-          c[*n].SetQ(0.5*q);
-          c[*n].SetNd(nd);
-          (*n)++;
-          if (*n==MAX) {
-            Error("FindClustersSSD","Too many 1D clusters !");
-              return;
-          }
-          //
-          c[*n].SetY(y/q+0.3*nd);
-          c[*n].SetQ(0.5*q);
-          c[*n].SetNd(nd);
-          c[*n].SetLabels(milab);
-        }
-        else{
-        */
         if (nd>4&&nd<25) {
           c[*n].SetY(y/q-0.25*nd);
           c[*n].SetQ(0.5*q);
@@ -218,6 +220,7 @@ void AliITSClusterFinderV2SSD::RawdataToClusters(AliRawReader* rawReader,TClones
   //------------------------------------------------------------
   rawReader->Reset();
   AliITSRawStreamSSD inputSSD(rawReader);
+  rawReader->SelectEquipment(-1,0,15);
   FindClustersSSD(&inputSSD,clusters);
   
 }
@@ -236,87 +239,263 @@ void AliITSClusterFinderV2SSD::FindClustersSSD(AliITSRawStreamSSD* input,
   Float_t q = 0.;
   Float_t y = 0.;
   Int_t nDigits = 0;
-  Int_t prevStrip = -1;
-  Int_t prevFlag = -1;
-  Int_t prevModule = -1;
   Float_t gain=0;
+  Float_t noise=0.;
+  Float_t oldnoise=0.;
   AliITSCalibrationSSD* cal=NULL;
-  
+
+  Int_t signal=0;
+  Int_t iModule;
+  Int_t matrix[12][1536];
+  Int_t iddl=511;
+  Int_t iad=1;
+  Int_t ddl, ad, adc;
+  Int_t oddl = 0;
+  Int_t oad = 0;
+  Int_t oadc = 0;
+  Int_t ostrip = 0;
+  Int_t osignal = 65535;
+  Int_t strip;
+  Int_t n=0;
+  Bool_t next=0;
 
   // read raw data input stream
   while (kTRUE) {
-    Bool_t next = input->Next();
-
-    if(input->GetSignal()<(3*4.) && next) continue;
-    // check if a new cluster starts
-    Int_t strip = input->GetCoord2();
-    Int_t flag = input->GetCoord1();
-    if ((!next || (input->GetModuleID() != prevModule)||
-        (strip-prevStrip > 1) || (flag != prevFlag)) &&
-       (nDigits > 0)) {
-      if (nClusters[prevFlag] == kMax) {
-       Error("FindClustersSSD", "Too many 1D clusters !");
-       return;
-      }
-      Ali1Dcluster& cluster = clusters1D[prevFlag][nClusters[prevFlag]++];
-      cluster.SetY(y/q);
-      cluster.SetQ(q);
-      cluster.SetNd(nDigits);
-      cluster.SetLabels(lab);
-
-      //Split suspiciously big cluster
-      if (nDigits > 4&&nDigits < 25) {
-       cluster.SetY(y/q - 0.25*nDigits);
-        cluster.SetQ(0.5*q);
-       if (nClusters[prevFlag] == kMax) {
-         Error("FindClustersSSD", "Too many 1D clusters !");
-         return;
+    
+    // reset signal matrix
+    for(Int_t i=0; i<12; i++) { for(Int_t j=0; j<1536; j++) { matrix[i][j] = 65535;} }
+
+    if(osignal!=65535) { 
+      n++;
+      matrix[oadc][ostrip] = osignal; // recover data from previous occurence of input->Next() 
+    }
+
+    // buffer data for ddl=iddl and ad=iad
+    while(kTRUE) {
+
+      next = input->Next();
+      ddl=input->GetDDL(); 
+      ad=input->GetAD();
+      adc = input->GetADC(); adc = (adc<6)? adc : adc - 2;
+      strip = input->GetStrip();
+      if(input->GetSideFlag()) strip=1535-strip;
+      signal = input->GetSignal();
+      //cout<<ddl<<" "<<ad<<" "<<adc<<" "<<strip<<" "<<signal<<endl;
+
+      if((ddl==iddl)&&(ad==iad)) {n++; matrix[adc][strip] = signal;}
+      else {oddl=iddl; oad=iad; oadc = adc; ostrip = strip; osignal=signal; iddl=ddl; iad=ad; break;}
+      
+      if(!next) break;
+    }
+    
+    if(n==0) continue; // first occurence
+    n=0; osignal=0;
+
+    // fill 1Dclusters
+    for(Int_t iadc=0; iadc<12; iadc++) {  // loop over ADC index for ddl=oddl and ad=oad
+
+      Int_t iimod = (oad - 1)  * 12 + iadc;
+      iModule = AliITSRawStreamSSD::GetModuleNumber(oddl,iimod);
+      if(iModule==-1) continue;
+      //cout<<"ddl="<<oddl<<" ad"<<oad<<" module="<<iModule<<endl;
+      cal = (AliITSCalibrationSSD*)GetResp(iModule);
+
+      Bool_t first = 0;
+
+      for(Int_t istrip=0; istrip<768; istrip++) { // P-side
+
+       signal = matrix[iadc][istrip];
+       oldnoise = noise;
+       noise = cal->GetNoiseP(istrip);
+       if(signal<3*noise) signal = 65535; // in case ZS was not done in hw do it now
+
+       if (signal!=65535) {
+         gain = cal->GetGainP(istrip);
+         signal = (Int_t) ( signal * gain ); // signal is corrected for gain
+         //cout<<"ddl="<<oddl<<" ad"<<oad<<" module="<<iModule<<" strip= "<<istrip<<
+         //        " sig="<<signal<<endl;
+         signal = (Int_t) cal->ADCToKeV( signal ); // signal is  converted in KeV 
+        
+         q += signal;    // add digit to current cluster
+         y += istrip * signal;   
+         nDigits++;
+         first=1;
+       }
+
+       else if(first) {
+
+         if ( ((nDigits==1)&&(q>5*oldnoise)) || (nDigits>1) ) {
+
+           Ali1Dcluster& cluster = clusters1D[0][nClusters[0]++];
+           cluster.SetY(y/q);
+           cluster.SetQ(q);
+           cluster.SetNd(nDigits);
+           cluster.SetLabels(lab);
+           
+           //Split suspiciously big cluster
+           if (nDigits > 4&&nDigits < 25) {
+             cluster.SetY(y/q - 0.25*nDigits);
+             cluster.SetQ(0.5*q);
+             if (nClusters[0] == kMax) {
+               Error("FindClustersSSD", "Too many 1D clusters !");
+               return;
+             }
+             Ali1Dcluster& cluster2 = clusters1D[0][nClusters[0]++];
+             cluster2.SetY(y/q + 0.25*nDigits);
+             cluster2.SetQ(0.5*q);
+             cluster2.SetNd(nDigits);
+             cluster2.SetLabels(lab);
+           }
+           
+         }
+         
+         y = q = 0.;
+         nDigits = 0;
+         first=0;
        }
-       Ali1Dcluster& cluster2 = clusters1D[prevFlag][nClusters[prevFlag]++];
-       cluster2.SetY(y/q + 0.25*nDigits);
-       cluster2.SetQ(0.5*q);
-       cluster2.SetNd(nDigits);
-       cluster2.SetLabels(lab);
+
+      } // loop over strip on P-side
+
+      // if last strip does have signal
+      if(first) {
+       
+         if ( ((nDigits==1)&&(q>5*oldnoise)) || (nDigits>1) ) {
+
+           Ali1Dcluster& cluster = clusters1D[0][nClusters[0]++];
+           cluster.SetY(y/q);
+           cluster.SetQ(q);
+           cluster.SetNd(nDigits);
+           cluster.SetLabels(lab);
+           
+           //Split suspiciously big cluster
+           if (nDigits > 4&&nDigits < 25) {
+             cluster.SetY(y/q - 0.25*nDigits);
+             cluster.SetQ(0.5*q);
+             if (nClusters[0] == kMax) {
+               Error("FindClustersSSD", "Too many 1D clusters !");
+               return;
+             }
+             Ali1Dcluster& cluster2 = clusters1D[0][nClusters[0]++];
+             cluster2.SetY(y/q + 0.25*nDigits);
+             cluster2.SetQ(0.5*q);
+             cluster2.SetNd(nDigits);
+             cluster2.SetLabels(lab);
+           }
+           
+         }
+         y = q = 0.;
+         nDigits = 0;
+         first=0;
       }
-      y = q = 0.;
-      nDigits = 0;
-    }
+      
+      oldnoise = 0.;
+      noise = 0.;
+      for(Int_t istrip=768; istrip<1536; istrip++) { // N-side
+       
+       signal = matrix[iadc][istrip];
+       strip = 1535-istrip;
+       oldnoise = noise;
+       noise = cal->GetNoiseN(strip);
+       if(signal<3*noise) signal = 65535; // in case ZS was not done in hw do it now
+
+       if (signal!=65535) {
+         gain = cal->GetGainN(strip);
+         signal = (Int_t) ( signal * gain); // signal is corrected for gain
+         signal = (Int_t) cal->ADCToKeV( signal ); // signal is  converted in KeV 
+         
+         // add digit to current cluster
+         q += signal;
+         y += strip * signal;
+         nDigits++;
+         first=1;
+       }
+
+       else if(first) {
+
+         if ( ((nDigits==1)&&(q>5*oldnoise)) || (nDigits>1) ) {
+           
+           Ali1Dcluster& cluster = clusters1D[1][nClusters[1]++];
+           cluster.SetY(y/q);
+           cluster.SetQ(q);
+           cluster.SetNd(nDigits);
+           cluster.SetLabels(lab);
+           
+           //Split suspiciously big cluster
+           if (nDigits > 4&&nDigits < 25) {
+             cluster.SetY(y/q - 0.25*nDigits);
+             cluster.SetQ(0.5*q);
+             if (nClusters[1] == kMax) {
+               Error("FindClustersSSD", "Too many 1D clusters !");
+               return;
+             }
+             Ali1Dcluster& cluster2 = clusters1D[1][nClusters[1]++];
+             cluster2.SetY(y/q + 0.25*nDigits);
+             cluster2.SetQ(0.5*q);
+             cluster2.SetNd(nDigits);
+             cluster2.SetLabels(lab);
+           }
+           
+         }
+         y = q = 0.;
+         nDigits = 0;
+         first=0;        
+       }
+       
+      } // loop over strips on N-side
 
-    if (!next || (input->GetModuleID() != prevModule)) {
-      Int_t iModule = prevModule;
+      if(first) {
+       
+         if ( ((nDigits==1)&&(q>5*oldnoise)) || (nDigits>1) ) {
 
-      // when all data from a module was read, search for clusters
-      if (prevFlag >= 0) {
+           Ali1Dcluster& cluster = clusters1D[1][nClusters[1]++];
+           cluster.SetY(y/q);
+           cluster.SetQ(q);
+           cluster.SetNd(nDigits);
+           cluster.SetLabels(lab);
+           
+           //Split suspiciously big cluster
+           if (nDigits > 4&&nDigits < 25) {
+             cluster.SetY(y/q - 0.25*nDigits);
+             cluster.SetQ(0.5*q);
+             if (nClusters[1] == kMax) {
+               Error("FindClustersSSD", "Too many 1D clusters !");
+               return;
+             }
+             Ali1Dcluster& cluster2 = clusters1D[1][nClusters[1]++];
+             cluster2.SetY(y/q + 0.25*nDigits);
+             cluster2.SetQ(0.5*q);
+             cluster2.SetNd(nDigits);
+             cluster2.SetLabels(lab);
+           }
+           
+         }
+         y = q = 0.;
+         nDigits = 0;
+         first=0;        
+      }
+      
+      // create recpoints
+      if((nClusters[0])&&(nClusters[1])) {
+       //cout<<"creating recpoint for module="<<iModule<<" "<<nClusters[0]<<" "<<nClusters[1]<<endl;
        clusters[iModule] = new TClonesArray("AliITSRecPoint");
        fModule = iModule;
+       //      fModule = 500;
        FindClustersSSD(&clusters1D[0][0], nClusters[0], 
                        &clusters1D[1][0], nClusters[1], clusters[iModule]);
        Int_t nClusters = clusters[iModule]->GetEntriesFast();
        nClustersSSD += nClusters;
       }
 
-      if (!next) break;
       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 += 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;
-    prevModule = input->GetModuleID();
+    } // loop over adc
 
+    if((!next)||(iddl==528)) break;
   }
-
+  
   Info("FindClustersSSD", "found clusters in ITS SSD: %d", nClustersSSD);
 }
 
@@ -328,6 +507,8 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
   // Actual SSD cluster finder
   //------------------------------------------------------------
 
+  //  Float_t xyz[3];
+
   const TGeoHMatrix *mT2L=AliITSgeomTGeo::GetTracking2LocalMatrix(fModule);
 
   TClonesArray &cl=*clusters;
@@ -347,12 +528,13 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
   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;}
 
-  if ((np*nn) > fPairsSize) {
-    if (fPairs) delete [] fPairs;
-    fPairsSize = 4*np*nn;
-    fPairs = new Short_t[fPairsSize];
+  if ((np*nn) > fgPairsSize) {
+    if (fgPairs) delete [] fgPairs;
+    fgPairsSize = 4*np*nn;
+    fgPairs = new Short_t[fgPairsSize];
   }
-  memset(fPairs,0,sizeof(Short_t)*np*nn);
+  memset(fgPairs,0,sizeof(Short_t)*np*nn);
+
   //
   // find available pairs
   //
@@ -371,16 +553,20 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        positivepair[j*10+cpositive[j]] =i;
        cnegative[i]++;  //counters
        cpositive[j]++; 
-       fPairs[i*nn+j]=100;
+       fgPairs[i*nn+j]=100;
       }
     }
   }
+
+  //
+  // try to recover points out of but close to the module boundaries 
   //
   for (Int_t i=0; i<np; i++) {
     Float_t yp=pos[i].GetY()*fYpitchSSD; 
     if (pos[i].GetQ()<3) continue;
     for (Int_t j=0; j<nn; j++) {
       if (neg[j].GetQ()<3) continue;
+      // if both 1Dclusters have an other cross continue
       if (cpositive[j]&&cnegative[i]) continue;
       Float_t yn=neg[j].GetY()*fYpitchSSD;
       Float_t zt=(2*fHlSSD*tanp + yp - yn)/(tann+tanp);
@@ -388,16 +574,18 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       zt-=fHlSSD; yt-=fHwSSD;
       if (TMath::Abs(yt)<fHwSSD+0.1)
       if (TMath::Abs(zt)<fHlSSD+0.15) {
+       // tag 1Dcluster (eventually will produce low quality recpoint)
        if (cnegative[i]==0) pos[i].SetNd(100);  // not available pair
        if (cpositive[j]==0) neg[j].SetNd(100);  // not available pair
        negativepair[i*10+cnegative[i]] =j;  //index
        positivepair[j*10+cpositive[j]] =i;
        cnegative[i]++;  //counters
        cpositive[j]++; 
-       fPairs[i*nn+j]=100;
+       fgPairs[i*nn+j]=100;
       }
     }
   }
+
   //
   Float_t lp[5];
   Int_t milab[10];
@@ -441,30 +629,41 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       milab[3]=(((ip<<10) + j)<<10) + idet; // pos|neg|det
       Int_t info[3] = {pos[ip].GetNd(),neg[j].GetNd(),fNlayer[fModule]};
       AliITSRecPoint * cl2;
-      if(clusters){
+    
+      if(clusters){  // Note clusters != 0 when method is called for rawdata
+
+
        cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+       //      cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
        cl2->SetChargeRatio(ratio);     
        cl2->SetType(1);
-       fPairs[ip*nn+j]=1;
+       fgPairs[ip*nn+j]=1;
        if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
          cl2->SetType(2);
-         fPairs[ip*nn+j]=2;
+         fgPairs[ip*nn+j]=2;
        }
        cused1[ip]++;
        cused2[j]++;
        
       }
-      else{
+      else{ // Note clusters == 0 when method is called for digits
+
        cl2 = new AliITSRecPoint(milab,lp,info);        
+
+       //      cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
        cl2->SetChargeRatio(ratio);     
        cl2->SetType(1);
-       fPairs[ip*nn+j]=1;
+       fgPairs[ip*nn+j]=1;
        if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
          cl2->SetType(2);
-         fPairs[ip*nn+j]=2;
+         fgPairs[ip*nn+j]=2;
        }
        cused1[ip]++;
        cused2[j]++;
+       //cout<<"AliITSClusterFinderV2SSD "<<fModule<<" gold"<<endl;
        fDetTypeRec->AddRecPoint(*cl2);
       }
       ncl++;
@@ -484,7 +683,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       if (TMath::Abs(pcharge-neg[in].GetQ())<10){
        //
        // add first pair
-       if (fPairs[ip*nn+in]==100){  //
+       if (fgPairs[ip*nn+in]==100){  //
          Float_t yp=pos[ip].GetY()*fYpitchSSD; 
          Float_t yn=neg[in].GetY()*fYpitchSSD;
          Float_t zt=(2*fHlSSD*tanp + yp - yn)/(tann+tanp);
@@ -515,25 +714,30 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
 
          AliITSRecPoint * cl2;
          if(clusters){
+
            cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+           //  cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
            cl2->SetChargeRatio(ratio);         
            cl2->SetType(5);
-           fPairs[ip*nn+in] = 5;
+           fgPairs[ip*nn+in] = 5;
            if ((pos[ip].GetNd()+neg[in].GetNd())>6){ //multi cluster
              cl2->SetType(6);
-             fPairs[ip*nn+in] = 6;
+             fgPairs[ip*nn+in] = 6;
            }       
          }
          else{
            cl2 = new AliITSRecPoint(milab,lp,info);
            cl2->SetChargeRatio(ratio);         
            cl2->SetType(5);
-           fPairs[ip*nn+in] = 5;
+           fgPairs[ip*nn+in] = 5;
            if ((pos[ip].GetNd()+neg[in].GetNd())>6){ //multi cluster
              cl2->SetType(6);
-             fPairs[ip*nn+in] = 6;
+             fgPairs[ip*nn+in] = 6;
            }
-           
+           //cout<<"AliITSClusterFinderV2SSD "<<fModule<<" silver1"<<endl;
+
            fDetTypeRec->AddRecPoint(*cl2);
          }
          ncl++;
@@ -543,7 +747,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        // add second pair
        
       //       if (!(cused1[ip2] || cused2[in])){  //
-       if (fPairs[ip2*nn+in]==100){
+       if (fgPairs[ip2*nn+in]==100){
          Float_t yp=pos[ip2].GetY()*fYpitchSSD;
          Float_t yn=neg[in].GetY()*fYpitchSSD;
          Float_t zt=(2*fHlSSD*tanp + yp - yn)/(tann+tanp);
@@ -575,24 +779,28 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          AliITSRecPoint * cl2;
          if(clusters){
            cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+           //  cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
            cl2->SetChargeRatio(ratio);         
            cl2->SetType(5);
-           fPairs[ip2*nn+in] =5;
+           fgPairs[ip2*nn+in] =5;
            if ((pos[ip2].GetNd()+neg[in].GetNd())>6){ //multi cluster
              cl2->SetType(6);
-             fPairs[ip2*nn+in] =6;
+             fgPairs[ip2*nn+in] =6;
            }
          }
          else{
            cl2 = new AliITSRecPoint(milab,lp,info);
            cl2->SetChargeRatio(ratio);         
            cl2->SetType(5);
-           fPairs[ip2*nn+in] =5;
+           fgPairs[ip2*nn+in] =5;
            if ((pos[ip2].GetNd()+neg[in].GetNd())>6){ //multi cluster
              cl2->SetType(6);
-             fPairs[ip2*nn+in] =6;
+             fgPairs[ip2*nn+in] =6;
            }
-
+           
+           //   cout<<"AliITSClusterFinderV2SSD "<<fModule<<" silver2"<<endl;
            fDetTypeRec->AddRecPoint(*cl2);
          }
          ncl++;
@@ -619,7 +827,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        //
        // add first pair
        //      if (!(cused1[ip]||cused2[jn])){
-       if (fPairs[ip*nn+jn]==100){
+       if (fgPairs[ip*nn+jn]==100){
          Float_t yn=neg[jn].GetY()*fYpitchSSD; 
          Float_t yp=pos[ip].GetY()*fYpitchSSD;
          Float_t zt=(2*fHlSSD*tanp + yp - yn)/(tann+tanp);
@@ -651,12 +859,15 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          AliITSRecPoint * cl2;
          if(clusters){
            cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+           //  cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
            cl2->SetChargeRatio(ratio);         
            cl2->SetType(7);
-           fPairs[ip*nn+jn] =7;
+           fgPairs[ip*nn+jn] =7;
            if ((pos[ip].GetNd()+neg[jn].GetNd())>6){ //multi cluster
              cl2->SetType(8);
-             fPairs[ip*nn+jn]=8;
+             fgPairs[ip*nn+jn]=8;
            }
 
          }
@@ -664,11 +875,12 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
            cl2 = new AliITSRecPoint(milab,lp,info);
            cl2->SetChargeRatio(ratio);         
            cl2->SetType(7);
-           fPairs[ip*nn+jn] =7;
+           fgPairs[ip*nn+jn] =7;
            if ((pos[ip].GetNd()+neg[jn].GetNd())>6){ //multi cluster
              cl2->SetType(8);
-             fPairs[ip*nn+jn]=8;
+             fgPairs[ip*nn+jn]=8;
            }
+           //cout<<"AliITSClusterFinderV2SSD "<<fModule<<" silverN1"<<endl;
 
            fDetTypeRec->AddRecPoint(*cl2);
          }
@@ -677,7 +889,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        //
        // add second pair
        //      if (!(cused1[ip]||cused2[jn2])){
-       if (fPairs[ip*nn+jn2]==100){
+       if (fgPairs[ip*nn+jn2]==100){
          Float_t yn=neg[jn2].GetY()*fYpitchSSD; 
          Double_t yp=pos[ip].GetY()*fYpitchSSD; 
          Double_t zt=(2*fHlSSD*tanp + yp - yn)/(tann+tanp);
@@ -708,25 +920,29 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          AliITSRecPoint * cl2;
          if(clusters){
            cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+           //  cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
            cl2->SetChargeRatio(ratio);         
-           fPairs[ip*nn+jn2]=7;
+           fgPairs[ip*nn+jn2]=7;
            cl2->SetType(7);
            if ((pos[ip].GetNd()+neg[jn2].GetNd())>6){ //multi cluster
              cl2->SetType(8);
-             fPairs[ip*nn+jn2]=8;
+             fgPairs[ip*nn+jn2]=8;
            }
            
          }
          else{
            cl2 = new AliITSRecPoint(milab,lp,info);
            cl2->SetChargeRatio(ratio);         
-           fPairs[ip*nn+jn2]=7;
+           fgPairs[ip*nn+jn2]=7;
            cl2->SetType(7);
            if ((pos[ip].GetNd()+neg[jn2].GetNd())>6){ //multi cluster
              cl2->SetType(8);
-             fPairs[ip*nn+jn2]=8;
+             fgPairs[ip*nn+jn2]=8;
            }
-           
+           //cout<<"AliITSClusterFinderV2SSD "<<fModule<<" silverN2"<<endl;
+
            fDetTypeRec->AddRecPoint(*cl2);
          }
 
@@ -756,6 +972,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        }
       }
       if (j<0) continue;  // not proper cluster      
+
       Int_t count =0;
       for (Int_t di=0;di<cnegative[ip];di++){
        Int_t   jc = negativepair[ip*10+di];
@@ -781,7 +998,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        if (TMath::Abs(chargedif)<minchargediff+4.) count++;
       }
       if (count>1) continue;   
-      if (fPairs[ip*nn+j]<100) continue;
+      if (fgPairs[ip*nn+j]<100) continue;
       //
       //almost gold clusters
       Float_t yp=pos[ip].GetY()*fYpitchSSD; 
@@ -813,12 +1030,15 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
       AliITSRecPoint * cl2;
       if(clusters){
        cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+       //      cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
        cl2->SetChargeRatio(ratio);     
        cl2->SetType(10);
-       fPairs[ip*nn+j]=10;
+       fgPairs[ip*nn+j]=10;
        if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
          cl2->SetType(11);
-         fPairs[ip*nn+j]=11;
+         fgPairs[ip*nn+j]=11;
        }
        cused1[ip]++;
        cused2[j]++;      
@@ -827,14 +1047,16 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        cl2 = new AliITSRecPoint(milab,lp,info);
        cl2->SetChargeRatio(ratio);     
        cl2->SetType(10);
-       fPairs[ip*nn+j]=10;
+       fgPairs[ip*nn+j]=10;
        if ((pos[ip].GetNd()+neg[j].GetNd())>6){ //multi cluster
          cl2->SetType(11);
-         fPairs[ip*nn+j]=11;
+         fgPairs[ip*nn+j]=11;
        }
        cused1[ip]++;
        cused2[j]++;      
        
+       //cout<<"AliITSClusterFinderV2SSD "<<fModule<<" 2x2"<<endl;
+
        fDetTypeRec->AddRecPoint(*cl2);
       }      
       ncl++;
@@ -852,7 +1074,7 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
     //  Int_t j = negativepair[10*i+di];
       if (neg[j].GetQ()<3) continue;
       if (cused2[j]||cused1[i]) continue;      
-      if (fPairs[i*nn+j]>0 &&fPairs[i*nn+j]<100) continue;
+      if (fgPairs[i*nn+j]>0 &&fgPairs[i*nn+j]<100) continue;
       ratio = (pos[i].GetQ()-neg[j].GetQ())/(pos[i].GetQ()+neg[j].GetQ());      
       Float_t yn=neg[j].GetY()*fYpitchSSD;
       Float_t zt=(2*fHlSSD*tanp + yp - yn)/(tann+tanp);
@@ -884,6 +1106,9 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
        AliITSRecPoint * cl2;
        if(clusters){
          cl2 = new (cl[ncl]) AliITSRecPoint(milab,lp,info);
+
+         //    cl2-> GetGlobalXYZ(xyz); cout<<"rec "<<xyz[0]<<" "<<xyz[1]<<" "<<xyz[2]<<endl;
+
          cl2->SetChargeRatio(ratio);
          cl2->SetType(100+cpositive[j]+cnegative[i]);    
        }
@@ -891,16 +1116,19 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
          cl2 = new AliITSRecPoint(milab,lp,info);
          cl2->SetChargeRatio(ratio);
          cl2->SetType(100+cpositive[j]+cnegative[i]);
+         
+         //cout<<"AliITSClusterFinderV2SSD "<<fModule<<" other"<<endl;
+
          fDetTypeRec->AddRecPoint(*cl2);
        }
        ncl++;
        //cl2->SetType(0);
        /*
-         if (fPairs[i*nn+j]<100){
-         printf("problem:- %d\n", fPairs[i*nn+j]);
+         if (fgPairs[i*nn+j]<100){
+         printf("problem:- %d\n", fgPairs[i*nn+j]);
          }
          if (cnegative[i]<2&&cpositive[j]<2){
-         printf("problem:- %d\n", fPairs[i*nn+j]);
+         printf("problem:- %d\n", fgPairs[i*nn+j]);
          }
        */
       }
@@ -910,4 +1138,3 @@ FindClustersSSD(Ali1Dcluster* neg, Int_t nn,
 }
 
 
-
index 4cc819a7795d5e29203d565724aaa8ab5d7b8329..3a1d9d930dbc164b5ac48948c5e516cbdaa5b0fc 100644 (file)
@@ -25,7 +25,8 @@ public:
   virtual void FindRawClusters(Int_t mod);
   virtual void RawdataToClusters(AliRawReader* rawReader,TClonesArray** clusters);
  protected:
-
+  AliITSClusterFinderV2SSD(const AliITSClusterFinderV2SSD& cf);
+  AliITSClusterFinderV2SSD& operator=(const AliITSClusterFinderV2SSD&  cf );
   void FindClustersSSD(TClonesArray *digits);
   void FindClustersSSD(Ali1Dcluster* neg, Int_t nn, 
                       Ali1Dcluster* pos, Int_t np,
@@ -42,8 +43,8 @@ public:
   Float_t fTanP;          //tangent of the stereo angle on the P side
   Float_t fTanN;          //tangent of the stereo angle on the N side
 
-  static Short_t*fPairs;         //array used to build positive-negative pairs
-  static Int_t   fPairsSize;     //actual size of pairs array
+  static Short_t* fgPairs;       //array used to build positive-negative pairs
+  static Int_t    fgPairsSize;    //actual size of pairs array
 
   ClassDef(AliITSClusterFinderV2SSD,1)  // ITS cluster finder V2 for SDD
 };
index 2694c18df16c46135245bbe6ddd6e929d5caac62..923383ac31458344d29a8cf9fe51f9d190e9ded0 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef ALIITSRAWSTREAMSSD_H
 #define ALIITSRAWSTREAMSSD_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* $Id$ */
@@ -25,8 +25,11 @@ class AliITSRawStreamSSD: public AliITSRawStream {
 
     virtual Bool_t   Next();
 
-    Int_t            GetSideFlag() const {return fCoord1;};
-    Int_t            GetStrip() const {return fCoord2;};
+    Int_t            GetSideFlag() const {return fCoord1;}
+    Int_t            GetStrip() const {return fCoord2;}
+    Int_t GetDDL() const {return fddl;}
+    Int_t GetAD() const {return fad;}
+    Int_t GetADC() const {return fadc;}
 
     enum {kDDLsNumber = 16};      // number of DDLs in SSD
     enum {kModulesPerDDL = 108};  // number of modules in each DDL