From: nilsen Date: Wed, 21 Aug 2002 22:04:27 +0000 (+0000) Subject: Added data member to SPD cluters and made related modifications to the X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=9e1e0cd7d6de3159250be10bb2b57a7a2e416b7c;p=u%2Fmrichter%2FAliRoot.git Added data member to SPD cluters and made related modifications to the SPD Cluster finders. Generaly cleanded up some of the code. --- diff --git a/ITS/AliITSClusterFinderSPD.cxx b/ITS/AliITSClusterFinderSPD.cxx index b8d53a3faa3..86e43f7f2cf 100644 --- a/ITS/AliITSClusterFinderSPD.cxx +++ b/ITS/AliITSClusterFinderSPD.cxx @@ -13,7 +13,6 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ - #include "AliITSClusterFinderSPD.h" #include "AliITS.h" #include "AliITSgeom.h" @@ -24,76 +23,71 @@ #include "AliITSresponse.h" #include "AliRun.h" - - +//#define DEBUG ClassImp(AliITSClusterFinderSPD) //---------------------------------------------------------- -AliITSClusterFinderSPD::AliITSClusterFinderSPD -(AliITSsegmentation *seg, TClonesArray *digits, TClonesArray *recp) -{ - // constructor - fSegmentation=seg; - fDigits=digits; - fClusters=recp; - fNclusters= fClusters->GetEntriesFast(); +AliITSClusterFinderSPD::AliITSClusterFinderSPD(AliITSsegmentation *seg, + TClonesArray *digits, + TClonesArray *recp){ + // constructor + + fSegmentation = seg; + fDigits = digits; + fClusters = recp; + fNclusters = fClusters->GetEntriesFast(); SetDx(); SetDz(); } - -//_____________________________________________________________________________ -AliITSClusterFinderSPD::AliITSClusterFinderSPD() -{ - // constructor - fSegmentation=0; - fDigits=0; - fClusters=0; - fNclusters=0; - SetDx(); - SetDz(); - +//______________________________________________________________________ +AliITSClusterFinderSPD::AliITSClusterFinderSPD(){ + // constructor + + fSegmentation = 0; + fDigits = 0; + fClusters = 0; + fNclusters = 0; + SetDx(); + SetDz(); } - -//__________________________________________________________________________ -AliITSClusterFinderSPD::AliITSClusterFinderSPD(const -AliITSClusterFinderSPD &source){ - // Copy Constructor - if(&source == this) return; - this->fClusters = source.fClusters ; - this->fNclusters = source.fNclusters ; - this->fDz = source.fDz ; - this->fDx = source.fDx ; - return; +//_____________________________________________________________________ +AliITSClusterFinderSPD::AliITSClusterFinderSPD(const AliITSClusterFinderSPD + &source){ + // Copy Constructor + + if(&source == this) return; + this->fClusters = source.fClusters ; + this->fNclusters = source.fNclusters ; + this->fDz = source.fDz ; + this->fDx = source.fDx ; + return; } - -//_________________________________________________________________________ -AliITSClusterFinderSPD& - AliITSClusterFinderSPD::operator=(const AliITSClusterFinderSPD &source) { - // Assignment operator - if(&source == this) return *this; - this->fClusters = source.fClusters ; - this->fNclusters = source.fNclusters ; - this->fDz = source.fDz ; - this->fDx = source.fDx ; - return *this; +//______________________________________________________________________ +AliITSClusterFinderSPD& AliITSClusterFinderSPD::operator=( + const AliITSClusterFinderSPD &source) { + // Assignment operator + + if(&source == this) return *this; + this->fClusters = source.fClusters ; + this->fNclusters = source.fNclusters ; + this->fDz = source.fDz ; + this->fDx = source.fDx ; + return *this; } - -//_____________________________________________________________________________ -void AliITSClusterFinderSPD::FindRawClusters(Int_t module){ - - // input of Cluster Finder - Int_t digitcount=0; - Int_t numberd=100000; +//______________________________________________________________________ +void AliITSClusterFinderSPD::FindRawClusters(Int_t module){ + // input of Cluster Finder + Int_t digitcount = 0; + Int_t numberd = 100000; Int_t *digx = new Int_t[numberd]; Int_t *digz = new Int_t[numberd]; Int_t *digtr1 = new Int_t[numberd]; Int_t *digtr2 = new Int_t[numberd]; Int_t *digtr3 = new Int_t[numberd]; Int_t *digtr4 = new Int_t[numberd]; - // output of Cluster Finder - Int_t numberc=10000; + Int_t numberc = 10000; Float_t *xcenterl = new Float_t[numberc]; Float_t *zcenterl = new Float_t[numberc]; Float_t *errxcenter = new Float_t[numberc]; @@ -101,325 +95,296 @@ void AliITSClusterFinderSPD::FindRawClusters(Int_t module){ Int_t *tr1clus = new Int_t[numberc]; Int_t *tr2clus = new Int_t[numberc]; Int_t *tr3clus = new Int_t[numberc]; - - Int_t nclus; + Int_t nclus; digitcount=0; Int_t ndigits = fDigits->GetEntriesFast(); if (!ndigits) return; - AliITSdigit *dig; AliITSdigitSPD *dig1; Int_t ndig; for(ndig=0; ndigUncheckedAt(ndig); - - digx[digitcount] = dig->fCoord2+1; //starts at 1 - digz[digitcount] = dig->fCoord1+1; //starts at 1 - - dig1= (AliITSdigitSPD*)fDigits->UncheckedAt(ndig); - - digtr1[digitcount] = dig1->fTracks[0]; - digtr2[digitcount] = dig1->fTracks[1]; - digtr3[digitcount] = dig1->fTracks[2]; - digtr4[digitcount] = dig1->fSignal; - - digitcount++; - } - - + dig= (AliITSdigit*)fDigits->UncheckedAt(ndig); + digx[digitcount] = dig->fCoord2+1; //starts at 1 + digz[digitcount] = dig->fCoord1+1; //starts at 1 + dig1= (AliITSdigitSPD*)fDigits->UncheckedAt(ndig); + digtr1[digitcount] = dig1->fTracks[0]; + digtr2[digitcount] = dig1->fTracks[1]; + digtr3[digitcount] = dig1->fTracks[2]; + digtr4[digitcount] = dig1->fSignal; + digitcount++; + } // end for ndig ClusterFinder(digitcount,digx,digz,digtr1,digtr2,digtr3,digtr4, - nclus,xcenterl,zcenterl,errxcenter,errzcenter, - tr1clus, tr2clus, tr3clus); - + nclus,xcenterl,zcenterl,errxcenter,errzcenter, + tr1clus, tr2clus, tr3clus,module); DigitToPoint(nclus,xcenterl,zcenterl,errxcenter,errzcenter, - tr1clus, tr2clus, tr3clus); - - - delete[] digx ; - delete[] digz ; - delete[] digtr1 ; - delete[] digtr2 ; - delete[] digtr3 ; - delete[] digtr4 ; - delete[] xcenterl ; - delete[] zcenterl ; - delete[] errxcenter ; - delete[] errzcenter ; - delete[] tr1clus ; - delete[] tr2clus ; - delete[] tr3clus ; - + tr1clus, tr2clus, tr3clus); + delete[] digx; + delete[] digz; + delete[] digtr1; + delete[] digtr2; + delete[] digtr3; + delete[] digtr4; + delete[] xcenterl; + delete[] zcenterl; + delete[] errxcenter; + delete[] errzcenter; + delete[] tr1clus; + delete[] tr2clus; + delete[] tr3clus; } -//----------------------------------------------------------------- -void AliITSClusterFinderSPD::ClusterFinder(Int_t ndigits, - Int_t digx[],Int_t digz[], - Int_t digtr1[],Int_t digtr2[],Int_t digtr3[],Int_t digtr4[], - Int_t &nclus, Float_t xcenter[],Float_t zcenter[], - Float_t errxcenter[],Float_t errzcenter[], - Int_t tr1clus[], Int_t tr2clus[], Int_t tr3clus[]) { -// -// Search for clusters of fired pixels (digits). Two digits are linked -// inside a cluster if they are countiguous both in row or column -// direction. Diagonal digits are not linked. -// xcenter, ycenter, zcenter are the coordinates of the center -// of each found cluster, calculated from the averaging the corresponding -// coordinate of the center of the linked digits. The coordinates are -// given in the local reference sistem. -// errxcenter, errycenter, errzcenter are the errors associated to -// the corresponding average. -// -// - - Int_t if1, min, max, nd; - Int_t x1, z1, t1, t2, t3, t4; - Int_t ndx, ndz, ndxmin, ndxmax, ndzmin, ndzmax; - Float_t dx, dz; - Int_t i,k,ipos=0; - Float_t xdum, zdum; - Int_t kmax, sigmax; - Float_t deltax, deltaz; - Float_t ndig; - - Int_t numberd=10000; - Int_t *ifpad = new Int_t[numberd]; - Int_t *xpad = new Int_t[numberd]; - Int_t *zpad = new Int_t[numberd]; - Int_t *tr1pad = new Int_t[numberd]; - Int_t *tr2pad = new Int_t[numberd]; - Int_t *tr3pad = new Int_t[numberd]; - Int_t *tr4pad = new Int_t[numberd]; - Int_t *iclus = new Int_t[numberd]; - - nclus=1; - for (i=0; i < ndigits ; i++){ - ifpad[i] = -1; - iclus[i] = 0; - } - - ifpad[0]=0; - for (i=0; i < ndigits-1 ; i++) { - if ( ifpad[i] == -1 ) { - nclus++; - ipos++; - ifpad[i]=nclus-1; - } - for (Int_t j=i+1 ; j < ndigits ; j++) { - if (ifpad[j]== -1 ) { - dx = TMath::Abs(digx[i]-digx[j]); - dz = TMath::Abs(digz[i]-digz[j]); - -// if ( ( dx+dz )==1 ) //clusters are not diagonal - if ( ( dx+dz )==1 || (dx==1 && dz==1) ) { //diagonal clusters allowed +//---------------------------------------------------------------------- +void AliITSClusterFinderSPD::ClusterFinder(Int_t ndigits,Int_t digx[], + Int_t digz[],Int_t digtr1[], + Int_t digtr2[],Int_t digtr3[], + Int_t digtr4[],Int_t &nclus, + Float_t xcenter[],Float_t zcenter[], + Float_t errxcenter[], + Float_t errzcenter[], + Int_t tr1clus[],Int_t tr2clus[], + Int_t tr3clus[],Int_t module){ + // Search for clusters of fired pixels (digits). Two digits are linked + // inside a cluster if they are countiguous both in row or column + // direction. Diagonal digits are not linked. + // xcenter, ycenter, zcenter are the coordinates of the center + // of each found cluster, calculated from the averaging the corresponding + // coordinate of the center of the linked digits. The coordinates are + // given in the local reference sistem. + // errxcenter, errycenter, errzcenter are the errors associated to + // the corresponding average. + Int_t if1, min, max, nd; + Int_t x1, z1, t1, t2, t3, t4; + Int_t ndx, ndz, ndxmin=0, ndxmax=0, ndzmin=0, ndzmax=0; + Float_t dx, dz; + Int_t i,k,ipos=0; + Float_t xdum, zdum; + Int_t kmax, sigmax; + Float_t deltax, deltaz; + Float_t ndig; + Int_t numberd = 10000; + Int_t *ifpad = new Int_t[numberd]; + Int_t *xpad = new Int_t[numberd]; + Int_t *zpad = new Int_t[numberd]; + Int_t *tr1pad = new Int_t[numberd]; + Int_t *tr2pad = new Int_t[numberd]; + Int_t *tr3pad = new Int_t[numberd]; + Int_t *tr4pad = new Int_t[numberd]; + Int_t *iclus = new Int_t[numberd]; + + nclus=1; + for (i=0; i < ndigits ; i++){ + ifpad[i] = -1; + iclus[i] = 0; + } // end for i + + ifpad[0]=0; + for (i=0; i < ndigits-1 ; i++) { + if ( ifpad[i] == -1 ) { + nclus++; + ipos++; + ifpad[i]=nclus-1; + } // end if ipad[i] + for (Int_t j=i+1 ; j < ndigits ; j++) { + if (ifpad[j]== -1 ) { + dx = TMath::Abs(digx[i]-digx[j]); + dz = TMath::Abs(digz[i]-digz[j]); + // if ( ( dx+dz )==1 ) //clusters are not diagonal + if(( dx+dz )==1 || (dx==1 && dz==1)){ + //diagonal clusters allowed ipos++; - ifpad[j]=ifpad[i]; - - x1=digx[j]; - z1=digz[j]; - digx[j]=digx[ipos]; - digz[j]=digz[ipos]; - digx[ipos]=x1; - digz[ipos]=z1; - - t1=digtr1[j]; - t2=digtr2[j]; - t3=digtr3[j]; - t4=digtr4[j]; - digtr1[j]=digtr1[ipos]; - digtr2[j]=digtr2[ipos]; - digtr3[j]=digtr3[ipos]; - digtr4[j]=digtr4[ipos]; - digtr1[ipos]=t1; - digtr2[ipos]=t2; - digtr3[ipos]=t3; - digtr4[ipos]=t4; - - if1=ifpad[j]; - ifpad[j]=ifpad[ipos]; - ifpad[ipos]=if1; - } - } - } - }//end loop on digits - - if ( ifpad[ndigits-1] == -1 ) { - nclus++; - ifpad[ndigits-1]=nclus-1; - } - - for (i=0 ; i < ndigits ; i++) iclus[ifpad[i]]++; - - min=0; - max=0; - // loop on found clusters - for (i=0 ; i < nclus ; i++) - { - min = max; - max += iclus[i]; - deltax = fSegmentation->Dpx(0); - if (iclus[i]!=1) - { - //cluster with more than one digit - nd=iclus[i]; - ndig=(Float_t) nd; + ifpad[j] = ifpad[i]; + + x1 = digx[j]; + z1 = digz[j]; + digx[j] = digx[ipos]; + digz[j] = digz[ipos]; + digx[ipos] = x1; + digz[ipos] = z1; + + t1 = digtr1[j]; + t2 = digtr2[j]; + t3 = digtr3[j]; + t4 = digtr4[j]; + digtr1[j] = digtr1[ipos]; + digtr2[j] = digtr2[ipos]; + digtr3[j] = digtr3[ipos]; + digtr4[j] = digtr4[ipos]; + digtr1[ipos] = t1; + digtr2[ipos] = t2; + digtr3[ipos] = t3; + digtr4[ipos] = t4; + + if1 = ifpad[j]; + ifpad[j] = ifpad[ipos]; + ifpad[ipos] = if1; + } // end dx+dx... + }// end if ifpad[j]== -1 + } // end for j + }//end loop on digits + if ( ifpad[ndigits-1] == -1 ) { + nclus++; + ifpad[ndigits-1]=nclus-1; + } // end if ifpad[ndigits-1] == -1 + + for (i=0 ; i < ndigits ; i++) iclus[ifpad[i]]++; + + min=0; + max=0; + // loop on found clusters + for (i=0 ; i < nclus ; i++){ + min = max; + max += iclus[i]; + deltax = fSegmentation->Dpx(0); + if (iclus[i]!=1){ + //cluster with more than one digit + nd=iclus[i]; + ndig=(Float_t) nd; Int_t count=0; - for (k=min;kGetPadCxz(digx[min],digz[min]-1,xdum, zdum); - - if (ndx == 1) { - xcenter[i] = xdum; - } - else{ - xcenter[i] = 0.; - for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); + for (k=min;kGetPadCxz(digx[min],digz[min]-1,xdum, zdum); + + if (ndx == 1) { + xcenter[i] = xdum; + }else{ + xcenter[i] = 0.; + for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); xcenter[i] += (xdum / nd); - } - } + } // end for k + } // end if ndx if (ndz == 1) { - zcenter[i] = zdum; - } - else { - zcenter[i] = 0.; - for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); - zcenter[i] += (zdum / nd); - } - } - - // error on points in x and z directions - - if (ndx == 1) { - errxcenter[i] = deltax / TMath::Sqrt(12.); - } - else { - errxcenter[i] = 0.; - for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); - errxcenter[i] += ((xdum-xcenter[i])*(xdum-xcenter[i]))/(nd*(nd-1)); - } - errxcenter[i] = TMath::Sqrt(errxcenter[i]); - } - + zcenter[i] = zdum; + } else { + zcenter[i] = 0.; + for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); + zcenter[i] += (zdum / nd); + } // end for k + } // end if ndz + + // error on points in x and z directions + + if (ndx == 1) { + errxcenter[i] = deltax / TMath::Sqrt(12.); + } else { + errxcenter[i] = 0.; + for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); + errxcenter[i] += ((xdum-xcenter[i])*(xdum-xcenter[i]))/ + (nd*(nd-1)); + } // end for k + errxcenter[i] = TMath::Sqrt(errxcenter[i]); + } // end if ndx if (ndz == 1) { - deltaz = fSegmentation->Dpz(digz[min]); + deltaz = fSegmentation->Dpz(digz[min]); errzcenter[i] = deltaz / TMath::Sqrt(12.); - } - else { + } else { errzcenter[i] = 0.; for (k=0;kGetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); - errzcenter[i] += ((zdum-zcenter[i])*(zdum-zcenter[i]))/(nd*(nd-1)); - } + fSegmentation->GetPadCxz(xpad[k],zpad[k]-1,xdum,zdum); + errzcenter[i] += ((zdum-zcenter[i])*(zdum-zcenter[i]))/ + (nd*(nd-1)); + } // end for k errzcenter[i] = TMath::Sqrt(errzcenter[i]); - } - // take three track numbers for the cluster - // choose the track numbers of the digit with higher signal - kmax = 0; - sigmax = 0; - for (k=0;k sigmax){ - sigmax = tr4pad[k]; - kmax = k; - } - } - if(sigmax != 0) { - tr1clus[i]= tr1pad[kmax]; - tr2clus[i]= tr2pad[kmax]; - tr3clus[i]= tr3pad[kmax]; - } - else { - tr1clus[i]= -2; - tr2clus[i]= -2; - tr3clus[i]= -2; - } - } - else { - - // cluster with single digit - ndig= 1.; + } // end if ndz + // take three track numbers for the cluster + // choose the track numbers of the digit with higher signal + kmax = 0; + sigmax = 0; + for (k=0;k sigmax){ + sigmax = tr4pad[k]; + kmax = k; + } // end if tr4pad[k] + } // end for k + if(sigmax != 0) { + tr1clus[i]= tr1pad[kmax]; + tr2clus[i]= tr2pad[kmax]; + tr3clus[i]= tr3pad[kmax]; + } else { + tr1clus[i]= -2; + tr2clus[i]= -2; + tr3clus[i]= -2; + } // end if sigmax + } else { + // cluster with single digit + ndig= 1.; ndx = 1; - ndz = 1; - fSegmentation->GetPadCxz(digx[min],digz[min]-1,xdum,zdum); - xcenter[i] = xdum; - zcenter[i] = zdum; - tr1clus[i]=digtr1[min]; - tr2clus[i]=digtr2[min]; - tr3clus[i]=digtr3[min]; + ndz = 1; + fSegmentation->GetPadCxz(digx[min],digz[min]-1,xdum,zdum); + xcenter[i] = xdum; + zcenter[i] = zdum; + tr1clus[i]=digtr1[min]; + tr2clus[i]=digtr2[min]; + tr3clus[i]=digtr3[min]; deltaz = fSegmentation->Dpz(digz[min]); errxcenter[i] = deltax / TMath::Sqrt(12.); errzcenter[i] = deltaz / TMath::Sqrt(12.); - } - - // store the cluster information to the AliITSRawCLusterSPD object - AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); - - //put the cluster center in local reference frame of the detector - // and in microns - xcenter[i] = xcenter[i] - fSegmentation->Dx()/2.; - zcenter[i] = zcenter[i] - fSegmentation->Dz()/2.; - - - AliITSRawClusterSPD *clust = new AliITSRawClusterSPD(zcenter[i], //f - xcenter[i], //f - ndig, //f - ndz,ndx, //ii - 0,0,0,0, //iiii - 0.,0., //ff - 0); //i - iTS->AddCluster(0,clust); - delete clust; - }//end loop on clusters - delete[] ifpad; - delete[] xpad ; - delete[] zpad ; - delete[] iclus; - delete[] tr1pad; - delete[] tr2pad; - delete[] tr3pad; - delete[] tr4pad; + } // end if iclus[i] + + // store the cluster information to the AliITSRawCLusterSPD object + static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); + + //put the cluster center in local reference frame of the detector + // and in microns + xcenter[i] = xcenter[i] - fSegmentation->Dx()/2.; + zcenter[i] = zcenter[i] - fSegmentation->Dz()/2.; + + AliITSRawClusterSPD *clust = new AliITSRawClusterSPD(zcenter[i], //f + xcenter[i], //f + ndig, //f + ndz,ndx, //ii + ndxmin,ndxmax,//ii + (Float_t) ndzmin, + (Float_t) ndzmax, + 0,module); //ii + iTS->AddCluster(0,clust); + delete clust; + }//end loop on clusters + delete[] ifpad; + delete[] xpad ; + delete[] zpad ; + delete[] iclus; + delete[] tr1pad; + delete[] tr2pad; + delete[] tr3pad; + delete[] tr4pad; } -//______________________________________________________ +//______________________________________________________---------------- void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus, - Float_t *xcenter, Float_t *zcenter, - Float_t *errxcenter,Float_t *errzcenter, - Int_t *tr1clus, Int_t *tr2clus, Int_t *tr3clus){ - // - // A point is associated to each cluster of SPD digits. The points - // and their associated errors are stored in the file galiceSP.root. - // - // - - Float_t l[3],xg,zg; - const Float_t kconv = 1.0e-4; // micron -> cm - - // get rec points - AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); - - for (Int_t i=0; i cm + + // get rec points + static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); + for (Int_t i=0; iDy()/2.; l[2] = kconv*zcenter[i]; @@ -427,8 +392,8 @@ void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus, xg = l[0]; zg = l[2]; - Float_t sigma2x = (kconv*errxcenter[i]) * (kconv*errxcenter[i]); - Float_t sigma2z = (kconv*errzcenter[i]) * (kconv*errzcenter[i]); + Float_t sigma2x = (kconv*errxcenter[i]) * (kconv*errxcenter[i]); + Float_t sigma2z = (kconv*errzcenter[i]) * (kconv*errzcenter[i]); AliITSRecPoint rnew; rnew.SetX(xg); rnew.SetZ(zg); @@ -440,5 +405,5 @@ void AliITSClusterFinderSPD::DigitToPoint(Int_t nclus, rnew.fTracks[1]=tr2clus[i]; rnew.fTracks[2]=tr3clus[i]; iTS->AddRecPoint(rnew); - } + } // end for i } diff --git a/ITS/AliITSClusterFinderSPD.h b/ITS/AliITSClusterFinderSPD.h index b5e2d51b70f..b202c9c13f8 100644 --- a/ITS/AliITSClusterFinderSPD.h +++ b/ITS/AliITSClusterFinderSPD.h @@ -9,55 +9,42 @@ class AliITSMapA1; -class AliITSClusterFinderSPD : - public AliITSClusterFinder - -{ -public: - AliITSClusterFinderSPD - (AliITSsegmentation *segmentation, - TClonesArray *digits, TClonesArray *recpoints); - AliITSClusterFinderSPD(); - virtual ~AliITSClusterFinderSPD(){ - // destructor - } - AliITSClusterFinderSPD(const AliITSClusterFinderSPD &source); // copy constructor - AliITSClusterFinderSPD& operator=(const AliITSClusterFinderSPD &source); // assignment operator - - - virtual void SetDx(Float_t dx=1.) { - // set dx - fDx=dx; - } - virtual void SetDz(Float_t dz=0.) { - // set dz - fDz=dz; - } - - // Search for clusters - virtual void FindRawClusters(Int_t module); - void DigitToPoint(Int_t nclus, Float_t *xcenter, Float_t *zcenter, - Float_t *errxcenter,Float_t *errzcenter, - Int_t *tr1clus, Int_t *tr2clus, Int_t *tr3clus); - void ClusterFinder(Int_t ndigits,Int_t digx[],Int_t digz[], - Int_t digtr1[],Int_t digtr2[],Int_t digtr3[],Int_t digtr4[], - Int_t &nclus, - Float_t xcenter[],Float_t zcenter[], - Float_t errxcenter[],Float_t errzcenter[], - Int_t tr1clus[],Int_t tr2clus[], Int_t tr3clus[]); - - - -private: - - TClonesArray *fClusters; // clusters - Int_t fNclusters; // num of clusters - Float_t fDz; // dz - Float_t fDx; // dx - - Int_t fMinNCells; // min num of cells in the cluster - - ClassDef(AliITSClusterFinderSPD,1) // SPD clustering - }; +class AliITSClusterFinderSPD : public AliITSClusterFinder{ + public: + AliITSClusterFinderSPD(AliITSsegmentation *segmentation, + TClonesArray *digits, TClonesArray *recpoints); + AliITSClusterFinderSPD(); + virtual ~AliITSClusterFinderSPD(){// destructor + } + // copy constructor + AliITSClusterFinderSPD(const AliITSClusterFinderSPD &source); + // assignment operator + AliITSClusterFinderSPD& operator=(const AliITSClusterFinderSPD &source); + + virtual void SetDx(Float_t dx=1.) {// set dx + fDx=dx;} + virtual void SetDz(Float_t dz=0.) {// set dz + fDz=dz;} + // Search for clusters + virtual void FindRawClusters(Int_t module); + void DigitToPoint(Int_t nclus, Float_t *xcenter, Float_t *zcenter, + Float_t *errxcenter,Float_t *errzcenter, + Int_t *tr1clus, Int_t *tr2clus, Int_t *tr3clus); + void ClusterFinder(Int_t ndigits,Int_t digx[],Int_t digz[], + Int_t digtr1[],Int_t digtr2[],Int_t digtr3[], + Int_t digtr4[], + Int_t &nclus, + Float_t xcenter[],Float_t zcenter[], + Float_t errxcenter[],Float_t errzcenter[], + Int_t tr1clus[],Int_t tr2clus[], Int_t tr3clus[], + Int_t module); + private: + TClonesArray *fClusters; // clusters + Int_t fNclusters; // num of clusters + Float_t fDz; // dz + Float_t fDx; // dx + Int_t fMinNCells; // min num of cells in the cluster + + ClassDef(AliITSClusterFinderSPD,1) // SPD clustering +}; #endif - diff --git a/ITS/AliITSClusterFinderSPDdubna.cxx b/ITS/AliITSClusterFinderSPDdubna.cxx index 0153f3d6c59..77183a68622 100644 --- a/ITS/AliITSClusterFinderSPDdubna.cxx +++ b/ITS/AliITSClusterFinderSPDdubna.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2001/06/14 14:33:53 barbera +New version from B. Batyunya to get the Dubna model work with the present HEAD + Revision 1.15 2001/05/01 22:37:44 nilsen Added a dummy argument to FindRawClusters. Argument used for SSD version. @@ -34,382 +37,294 @@ Fixed a reoccuring bug. Array sizes must be declare const. #include "AliITSresponse.h" #include "AliRun.h" - +//#define DEBUG ClassImp(AliITSClusterFinderSPDdubna) -//---------------------------------------------------------- -AliITSClusterFinderSPDdubna::AliITSClusterFinderSPDdubna -(AliITSsegmentation *seg, TClonesArray *digits, TClonesArray *recp) -{ - // constructor - fSegmentation=seg; - fDigits=digits; - fClusters=recp; - fNclusters=0; - fMap=new AliITSMapA1(fSegmentation,fDigits); +//---------------------------------------------------------------------- +AliITSClusterFinderSPDdubna::AliITSClusterFinderSPDdubna( + AliITSsegmentation *seg, TClonesArray *digits, TClonesArray *recp){ + // constructor + + fSegmentation = seg; + fDigits = digits; + fClusters = recp; + fNclusters = 0; + fMap = new AliITSMapA1(fSegmentation,fDigits); SetDx(); SetDz(); SetNCells(); } - -//_____________________________________________________________________________ -AliITSClusterFinderSPDdubna::AliITSClusterFinderSPDdubna() -{ - // constructor - fSegmentation=0; - fDigits=0; - fClusters=0; - fNclusters=0; - fMap=0; - SetDx(); - SetDz(); - SetNCells(); - +//_______________________________________________________________________ +AliITSClusterFinderSPDdubna::AliITSClusterFinderSPDdubna(){ + // constructor + + fSegmentation = 0; + fDigits = 0; + fClusters = 0; + fNclusters = 0; + fMap = 0; + SetDx(); + SetDz(); + SetNCells(); } +//______________________________________________________________________ +AliITSClusterFinderSPDdubna::~AliITSClusterFinderSPDdubna(){ + // destructor -//_____________________________________________________________________________ -AliITSClusterFinderSPDdubna::~AliITSClusterFinderSPDdubna() -{ - // destructor - if (fMap) delete fMap; - + if (fMap) delete fMap; } +//______________________________________________________________________ +void AliITSClusterFinderSPDdubna::Find1DClusters(Int_t mod){ + // Find one dimensional clusters, i.e. + // in r*phi(x) direction for each colunm in z direction -//_____________________________________________________________________________ - -void AliITSClusterFinderSPDdubna::Find1DClusters() -{ - // Find one dimensional clusters, i.e. - // in r*phi(x) direction for each colunm in z direction - - AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); - - // retrieve the parameters - Int_t fNofPixels = fSegmentation->Npz(); - Int_t fMaxNofSamples = fSegmentation->Npx(); - - // read in digits -> do not apply threshold - // signal in fired pixels is always 1 - - fMap->FillMap(); - - Int_t nofFoundClusters = 0; - - Int_t k,it,m; - for(k=0;k= fMaxNofSamples) break; // ! no possible for the fadc - - if(fMap->TestHit(k,id) == kUnused) { // start of the cluster - lclx += 1; - if(lclx == 1) xstart = id; - - } - - if(lclx > 0 && fMap->TestHit(k,id) == kEmpty) { - // end of cluster if a gap exists - xstop = id-1; - ilcl = 1; - break; - } - - } // end of m-loop - - if(lclx == 0 && ilcl == 0) it = id; // no cluster in the window, - // continue the "it" loop - - if(id >= fMaxNofSamples && lclx == 0) break; // the x row finished - - if(id < fMaxNofSamples && ilcl == 0 && lclx > 0) { - // cluster end is outside of the window, - mmax += 5; // increase mmax and repeat the cluster - // finding - it -= 1; - } - - if(id >= fMaxNofSamples && lclx > 0) { // the x row finished but - xstop = fMaxNofSamples - 1; // the end cluster exists - ilcl = 1; - } - - // --- Calculate z and x coordinates for one dimensional clusters - - if(ilcl == 1) { // new cluster exists - it = id; - mmax = 10; - nofFoundClusters++; - Float_t clusterCharge = 0.; - Float_t zpitch = fSegmentation->Dpz(k+1); - Float_t clusterZ, dummyX; - Int_t dummy=0; - fSegmentation->GetPadCxz(dummy,k,dummyX,clusterZ); - Float_t zstart = clusterZ - 0.5*zpitch; - Float_t zstop = clusterZ + 0.5*zpitch; - Float_t clusterX = 0.; - Int_t xstartfull = xstart; - Int_t xstopfull = xstop; - Int_t clusterSizeX = lclx; - Int_t clusterSizeZ = 1; - - Int_t its; - for(its=xstart; its<=xstop; its++) { - Int_t firedpixel=0; - if (fMap->GetHitIndex(k,its)>=0) firedpixel=1; - clusterCharge += firedpixel; - clusterX +=its + 0.5; - } - Float_t fRphiPitch = fSegmentation->Dpx(dummy); - clusterX /= (clusterSizeX/fRphiPitch); // center of gravity for x - - // Write the points (coordinates and some cluster information) to the - // AliITSRawClusterSPD object - - AliITSRawClusterSPD clust(clusterZ,clusterX,clusterCharge,clusterSizeZ,clusterSizeX,xstart,xstop,xstartfull,xstopfull,zstart,zstop,k); - - iTS->AddCluster(0,&clust); - - } // new cluster (ilcl=1) - } // X direction loop (it) - } // Z direction loop (k) - - //fMap->ClearMap(); - return; + static AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); + // retrieve the parameters + Int_t fNofPixels = fSegmentation->Npz(); + Int_t fMaxNofSamples = fSegmentation->Npx(); + + // read in digits -> do not apply threshold + // signal in fired pixels is always 1 + fMap->FillMap(); + + Int_t nofFoundClusters = 0; + + Int_t k,it,m; + for(k=0;k= fMaxNofSamples) break; // ! no possible for the fadc + if(fMap->TestHit(k,id) == kUnused) { // start of the cluster + lclx += 1; + if(lclx == 1) xstart = id; + } // end if fMap + if(lclx > 0 && fMap->TestHit(k,id) == kEmpty) { + // end of cluster if a gap exists + xstop = id-1; + ilcl = 1; + break; + } // end if lclx >0 ... + } // end of m-loop + if(lclx == 0 && ilcl == 0) it = id; // no cluster in the window, + // continue the "it" loop + if(id >= fMaxNofSamples && lclx == 0) break; // the x row finished + if(id < fMaxNofSamples && ilcl == 0 && lclx > 0) { + // cluster end is outside of the window, + mmax += 5; // increase mmax and repeat the cluster finding + it -= 1; + } // end if id< + if(id >= fMaxNofSamples && lclx > 0) { // the x row finished but + xstop = fMaxNofSamples - 1; // the end cluster exists + ilcl = 1; + } // end if id>= + // --- Calculate z and x coordinates for one dimensional clusters + if(ilcl == 1) { // new cluster exists + it = id; + mmax = 10; + nofFoundClusters++; + Float_t clusterCharge = 0.; + Float_t zpitch = fSegmentation->Dpz(k+1); + Int_t dummy = 0; + Float_t clusterZ, dummyX; + fSegmentation->GetPadCxz(dummy,k,dummyX,clusterZ); + Float_t zstart = clusterZ - 0.5*zpitch; + Float_t zstop = clusterZ + 0.5*zpitch; + Float_t clusterX = 0.; + Int_t clusterSizeX = lclx; + Int_t clusterSizeZ = 1; + Int_t its; + for(its=xstart; its<=xstop; its++) { + Int_t firedpixel=0; + if (fMap->GetHitIndex(k,its)>=0) firedpixel=1; + clusterCharge += firedpixel; + clusterX += its + 0.5; + } // end for its + Float_t fRphiPitch = fSegmentation->Dpx(dummy); + clusterX /= (clusterSizeX/fRphiPitch); // center of gravity for x + // Write the points (coordinates and some cluster information) + // to the AliITSRawClusterSPD object + + AliITSRawClusterSPD clust(clusterZ,clusterX,clusterCharge, + clusterSizeZ,clusterSizeX, + xstart,xstop,zstart,zstop,k,mod); + iTS->AddCluster(0,&clust); + } // new cluster (ilcl=1) + } // X direction loop (it) + } // Z direction loop (k) + //fMap->ClearMap(); + return; } - -//_____________________________________________________________________________ -void AliITSClusterFinderSPDdubna::GroupClusters() -{ - // Find two dimensional clusters, i.e. group one dimensional clusters - // into two dimensional ones (go both in x and z directions). - - // get number of clusters for this module - Int_t nofClusters = fClusters->GetEntriesFast(); - nofClusters -= fNclusters; - AliITSRawClusterSPD *clusterI; - AliITSRawClusterSPD *clusterJ; - - Int_t *label=new Int_t[nofClusters]; - Int_t i,j; - for(i=0; iAt(i); - clusterJ = (AliITSRawClusterSPD*) fClusters->At(j); - Bool_t pair = clusterI->Brother(clusterJ,fDz,fDx); - if(pair) { - - // if((clusterI->XStop() == clusterJ->XStart()-1)||(clusterI->XStart()==clusterJ->XStop()+1)) cout<<"!! Diagonal cluster"<PrintInfo(); - clusterJ->PrintInfo(); - */ - - clusterI->Add(clusterJ); - // cout << "remove cluster " << j << endl; - label[j] = 1; - fClusters->RemoveAt(j); - - /* - cout << "cluster " << i << " after grouping" << endl; - clusterI->PrintInfo(); - */ - - } // pair - } // J clusters - label[i] = 1; - } // I clusters - fClusters->Compress(); - - - /* +//______________________________________________________________________ +void AliITSClusterFinderSPDdubna::GroupClusters(){ + // Find two dimensional clusters, i.e. group one dimensional clusters + // into two dimensional ones (go both in x and z directions). + // get number of clusters for this module + + Int_t nofClusters = fClusters->GetEntriesFast(); + nofClusters -= fNclusters; + AliITSRawClusterSPD *clusterI; + AliITSRawClusterSPD *clusterJ; + Int_t *label=new Int_t[nofClusters]; + Int_t i,j; + for(i=0; iAt(i); + clusterJ = (AliITSRawClusterSPD*) fClusters->At(j); + Bool_t pair = clusterI->Brother(clusterJ,fDz,fDx); + if(pair) { +#ifndef DEBUG + cout << "clusters " << i << "," << j << " before grouping" << endl; + clusterI->PrintInfo(); + clusterJ->PrintInfo(); +#endif + clusterI->Add(clusterJ); +#ifndef DEBUG + cout << "remove cluster " << j << endl; +#endif + label[j] = 1; + fClusters->RemoveAt(j); +#ifndef DEBUG + cout << "cluster " << i << " after grouping" << endl; + clusterI->PrintInfo(); +#endif + } // pair + } // J clusters + label[i] = 1; + } // I clusters + fClusters->Compress(); +#ifndef DEBUG Int_t totalNofClusters = fClusters->GetEntriesFast(); cout << " Nomber of clusters at the group end ="<< totalNofClusters<GetEntriesFast(); - nofClusters -= fNclusters; - - Int_t i, ix, iz, jx, jz, xstart, xstop, zstart, zstop, nclx, nclz; - const Int_t trmax = 100; - Int_t cltracks[trmax], itr, tracki, ii, is, js, ie, ntr, tr0, tr1, tr2; - - for(i=0; iAt(i); - - nclx = clusterI->NclX(); - nclz = clusterI->NclZ(); - xstart = clusterI->XStartf(); - xstop = clusterI->XStopf(); - zstart = clusterI->Zend()-nclz+1; - zstop = clusterI->Zend(); - Int_t ind; - - for(iz=0; izGetHitIndex(jz,jx); - if(ind < 0) { - continue; - } - if(ind == 0 && iz >= 0 && ix > 0) { - continue; - } - if(ind == 0 && iz > 0 && ix >= 0) { - continue; - } - if(ind == 0 && iz == 0 && ix == 0 && i > 0) { - continue; - } - - AliITSdigitSPD *dig = (AliITSdigitSPD*)fMap->GetHit(jz,jx); - - /* - signal=dig->fSignal; - track0=dig->fTracks[0]; - track1=dig->fTracks[1]; - track2=dig->fTracks[2]; - */ - - for(itr=0; itr<3; itr++) { - tracki = dig->fTracks[itr]; - if(tracki >= 0) { - ii += 1; - if(ii > 90) { - } - if(ii < 99) cltracks[ii-1] = tracki; - } - } - } // ix pixel - } // iz pixel - - for(is=0; is= 0) { - ntr=ntr+1; - if(ntr==1) tr0=cltracks[ie]; - if(ntr==2) tr1=cltracks[ie]; - if(ntr==3) tr2=cltracks[ie]; - } - } - // if delta ray only - if(ntr == 0) ntr = 1; - - clusterI->SetNTracks(ntr); - clusterI->SetTracks(tr0,tr1,tr2); - - } // I cluster - +//______________________________________________________________________ +void AliITSClusterFinderSPDdubna::TracksInCluster(){ + // Find tracks creating one cluster + // get number of clusters for this module + Int_t nofClusters = fClusters->GetEntriesFast(); + Int_t i, ix, iz, jx, jz, xstart, xstop, zstart, zstop, nclx, nclz; + const Int_t trmax = 100; + Int_t cltracks[trmax], itr, tracki, ii, is, js, ie, ntr, tr0, tr1, tr2; + + nofClusters -= fNclusters; + for(i=0; iAt(i); + nclx = clusterI->NclX(); + nclz = clusterI->NclZ(); + xstart = clusterI->XStartf(); + xstop = clusterI->XStopf(); + zstart = clusterI->Zend()-nclz+1; + zstop = clusterI->Zend(); + Int_t ind; + for(iz=0; izGetHitIndex(jz,jx); + if(ind < 0) continue; + if(ind == 0 && iz >= 0 && ix > 0) continue; + if(ind == 0 && iz > 0 && ix >= 0) continue; + if(ind == 0 && iz == 0 && ix == 0 && i > 0) continue; + AliITSdigitSPD *dig = (AliITSdigitSPD*)fMap->GetHit(jz,jx); + for(itr=0; itr<3; itr++) { + tracki = dig->fTracks[itr]; + if(tracki >= 0) { + ii += 1; + if(ii < 99) cltracks[ii-1] = tracki; + } // end if tracki >-0 + } // end for itr + } // ix pixel + } // iz pixel + for(is=0; is= 0) { + ntr=ntr+1; + if(ntr==1) tr0=cltracks[ie]; + if(ntr==2) tr1=cltracks[ie]; + if(ntr==3) tr2=cltracks[ie]; + } // end if cltracks[ie] >-= + } // end for ie + // if delta ray only + if(ntr == 0) ntr = 1; + clusterI->SetNTracks(ntr); + clusterI->SetTracks(tr0,tr1,tr2); + } // I cluster } -//_____________________________________________________________________________ - -void AliITSClusterFinderSPDdubna::GetRecPoints() -{ - // get rec points - AliITS *iTS=(AliITS*)gAlice->GetModule("ITS"); - - // get number of clusters for this module - Int_t nofClusters = fClusters->GetEntriesFast(); - nofClusters -= fNclusters; - const Float_t kconv = 1.0e-4; - const Float_t kRMSx = 12.0*kconv; // microns -> cm ITS TDR Table 1.3 - const Float_t kRMSz = 70.0*kconv; // microns -> cm ITS TDR Table 1.3 - - Float_t spdLength = fSegmentation->Dz(); - Float_t spdWidth = fSegmentation->Dx(); - Int_t dummy = 0; - Float_t xpitch = fSegmentation->Dpx(dummy); - Int_t i; - Int_t track0, track1, track2; - - for(i=0; iAt(i); - Int_t clustersizex = clusterI->NclX(); - Int_t clustersizez = clusterI->NclZ(); - Int_t xstart = clusterI->XStartf(); - Float_t clusterx = 0; - Float_t clusterz = clusterI->Z(); - - for(Int_t ii=0; iiGetTracks(track0, track1, track2); - AliITSRecPoint rnew; - - rnew.SetX((clusterx - spdWidth/2)*kconv); - rnew.SetZ((clusterz - spdLength/2)*kconv); - rnew.SetQ(1.); - rnew.SetdEdX(0.); - rnew.SetSigmaX2(kRMSx*kRMSx); - rnew.SetSigmaZ2(kRMSz*kRMSz); - rnew.fTracks[0]=track0; - rnew.fTracks[1]=track1; - rnew.fTracks[2]=track2; - iTS->AddRecPoint(rnew); - } // I clusters - - fMap->ClearMap(); - +//______________________________________________________________________ +void AliITSClusterFinderSPDdubna::GetRecPoints(){ + // get rec points + static AliITS *iTS = (AliITS*)gAlice->GetModule("ITS"); + // get number of clusters for this module + Int_t nofClusters = fClusters->GetEntriesFast(); + const Float_t kconv = 1.0e-4; + const Float_t kRMSx = 12.0*kconv; // microns -> cm ITS TDR Table 1.3 + const Float_t kRMSz = 70.0*kconv; // microns -> cm ITS TDR Table 1.3 + Float_t spdLength = fSegmentation->Dz(); + Float_t spdWidth = fSegmentation->Dx(); + Int_t dummy = 0; + Float_t xpitch = fSegmentation->Dpx(dummy); + Int_t i; + Int_t track0, track1, track2; + + nofClusters -= fNclusters; + for(i=0; iAt(i); + Int_t clustersizex = clusterI->NclX(); + Int_t clustersizez = clusterI->NclZ(); + Int_t xstart = clusterI->XStartf(); + Float_t clusterx = 0; + Float_t clusterz = clusterI->Z(); + for(Int_t ii=0; iiGetTracks(track0, track1, track2); + AliITSRecPoint rnew; + rnew.SetX((clusterx - spdWidth/2)*kconv); + rnew.SetZ((clusterz - spdLength/2)*kconv); + rnew.SetQ(1.); + rnew.SetdEdX(0.); + rnew.SetSigmaX2(kRMSx*kRMSx); + rnew.SetSigmaZ2(kRMSz*kRMSz); + rnew.fTracks[0]=track0; + rnew.fTracks[1]=track1; + rnew.fTracks[2]=track2; + iTS->AddRecPoint(rnew); + } // I clusters + fMap->ClearMap(); } -//_____________________________________________________________________________ - -void AliITSClusterFinderSPDdubna::FindRawClusters(Int_t mod) -{ - // find raw clusters - cout<<"SPDdubna: module ="< #include @@ -128,7 +132,6 @@ Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster, Float_t danode,Float_t dtime) { Bool_t brother = kFALSE; - Bool_t test2 = kFALSE; Bool_t test3 = kFALSE; Bool_t test4 = kFALSE; @@ -164,10 +167,9 @@ ClassImp(AliITSRawClusterSPD) AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx, Float_t Charge,Int_t ClusterSizeZ, Int_t ClusterSizeX,Int_t xstart, - Int_t xstop,Int_t xstartf, - Int_t xstopf, + Int_t xstop, Float_t zstart,Float_t zstop, - Int_t zend) { + Int_t zend,Int_t module) { // constructor fZ = clz; @@ -177,11 +179,10 @@ AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx, fNClX = ClusterSizeX; fXStart = xstart; fXStop = xstop; - fXStartf = xstartf; - fXStopf = xstopf; fZStart = zstart; fZStop = zstop; fZend = zend; + fModule = module; } //______________________________________________________________________ void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) { @@ -194,10 +195,8 @@ void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) { this->fQ = this->fQ + clJ->Q(); this->fXStart = clJ->XStart(); // for a comparison with the next this->fXStop = clJ->XStop(); // z column - if(this->fXStartf > clJ->XStartf()) this->fXStartf = clJ->XStartf(); - if(this->fXStopf < clJ->XStopf()) this->fXStopf = clJ->XStopf(); if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend(); - this->fNClX = this->fXStopf - this->fXStartf + 1; + this->fNClX = this->fXStop - this->fXStart + 1; (this->fNClZ)++; return; @@ -232,8 +231,8 @@ void AliITSRawClusterSPD::PrintInfo(){ cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ< - - -class AliITSRawCluster : public TObject { - - // this class is subject to changes !!! - info used for declustering - // and eventual debugging - -public: - - AliITSRawCluster() { - fMultiplicity=0; - } - - virtual ~AliITSRawCluster() { - // destructor - } - virtual Bool_t IsSortable() const { - // is sortable - return kTRUE; - } - -public: - - Int_t fMultiplicity; // cluster multiplicity - - ClassDef(AliITSRawCluster,1) // AliITSRawCluster class - }; - -//--------------------------------------------- +// this class is subject to changes !!! - info used for declustering +// and eventual debugging + +class AliITSRawCluster : public TObject { + public: + AliITSRawCluster() { // default constructor + fMultiplicity=0;} + virtual ~AliITSRawCluster() {// destructor + } + virtual Bool_t IsSortable() const {// is sortable + return kTRUE;} + public: + Int_t fMultiplicity; // cluster multiplicity + + ClassDef(AliITSRawCluster,1) // AliITSRawCluster class +}; +//---------------------------------------------------------------------- +// these classes are subject to changes - keep them temporarily for +// compatibility !!! class AliITSRawClusterSPD : public AliITSRawCluster { - - // these classes are subject to changes - keep them temporarily for - // compatibility !!! - -public: - - AliITSRawClusterSPD() { - // constructor - fX=fZ=fQ=0; - fZStart=fZStop=0; - fNClZ=fNClX=fXStart=fXStop=fXStartf=fXStopf=fZend=fNTracks=0; - fTracks[0]=fTracks[1]=fTracks[2]=-3; - } - - AliITSRawClusterSPD(Float_t clz,Float_t clx,Float_t Charge,Int_t ClusterSizeZ,Int_t ClusterSizeX,Int_t xstart,Int_t xstop,Int_t xstartf,Int_t xstopf,Float_t zstart,Float_t zstop,Int_t zend); - virtual ~AliITSRawClusterSPD() { - // destructor - } - - void Add(AliITSRawClusterSPD* clJ); - Bool_t Brother(AliITSRawClusterSPD* cluster,Float_t dz,Float_t dx); - void PrintInfo(); - // Getters - Float_t Q() const { - // Q - return fQ ; - } - Float_t Z() const { - // Z - return fZ ; - } - Float_t X() const { - // X - return fX ; - } - // Float_t NclZ() const { - Int_t NclZ() const { - // NclZ - return fNClZ ; - } - // Float_t NclX() const { - Int_t NclX() const { - // NclX - return fNClX ; - } - Int_t XStart() const { - //XStart - return fXStart; - } - Int_t XStop() const { - //XStop - return fXStop; - } - Int_t XStartf() const { - //XStartf - return fXStartf; - } - Int_t XStopf() const { - //XStopf - return fXStopf; - } - Float_t ZStart() const { - //ZStart - return fZStart; - } - Float_t ZStop() const { - //ZStop - return fZStop; - } - Int_t Zend() const { - //Zend - return fZend; - } - Int_t NTracks() const { - //NTracks - return fNTracks; - } - - void GetTracks(Int_t &track0,Int_t &track1,Int_t &track2) const { - // returns tracks created a cluster - - track0=fTracks[0]; - track1=fTracks[1]; - track2=fTracks[2]; - return; + public: + AliITSRawClusterSPD() {// constructor + fX=fZ=fQ=0.0; + fZStart=fZStop=0.0; + fNClZ=fNClX=fXStart=fXStop=fZend=fNTracks=0; + fTracks[0]=fTracks[1]=fTracks[2]=-3,fModule=0; + } + AliITSRawClusterSPD(Float_t clz,Float_t clx,Float_t Charge, + Int_t ClusterSizeZ,Int_t ClusterSizeX, + Int_t xstart,Int_t xstop,Float_t zstart, + Float_t zstop,Int_t zend,Int_t module); + virtual ~AliITSRawClusterSPD() {// destructor + } + void Add(AliITSRawClusterSPD* clJ); + Bool_t Brother(AliITSRawClusterSPD* cluster,Float_t dz,Float_t dx); + void PrintInfo(); + // Getters + Float_t Q() const {// Q + return fQ ;} + Float_t Z() const {// Z + return fZ ;} + Float_t X() const {// X + return fX ;} + Int_t NclZ() const {// NclZ + return fNClZ ;} + Int_t NclX() const {// NclX + return fNClX ;} + Int_t XStart() const {//XStart + return fXStart;} + Int_t XStop() const {//XStop + return fXStop;} + Int_t XStartf() const {//XStartf + return fXStart;} + Int_t XStopf() const {//XStopf + return fXStop;} + Float_t ZStart() const {//ZStart + return fZStart;} + Float_t ZStop() const {//ZStop + return fZStop;} + Int_t Zend() const {//Zend + return fZend;} + Int_t NTracks() const {//NTracks + return fNTracks;} + Int_t Module() const {//Returns module where this cluster came from + return fModule;} + void GetTracks(Int_t &track0,Int_t &track1,Int_t &track2) const { + // returns tracks created a cluster + track0=fTracks[0]; + track1=fTracks[1]; + track2=fTracks[2]; + return; }; - - void SetTracks(Int_t track0, Int_t track1, Int_t track2) { - // set tracks in cluster (not more than three ones) - fTracks[0]=track0; - fTracks[1]=track1; - fTracks[2]=track2; - } - void SetNTracks(Int_t ntracks) { - // set ntracks - fNTracks=ntracks; - } - -protected: - - Float_t fX; // X of cluster - Float_t fZ; // Z of cluster - Float_t fQ; // Q of cluster - Int_t fNClZ; // Cluster size in Z direction - Int_t fNClX; // Cluster size in X direction - Int_t fXStart; // number of first pixel in cluster - Int_t fXStop; // number of last pixel in cluster - Int_t fXStartf; // number of first pixel in full cluster - Int_t fXStopf; // number of last pixel in full cluster - Float_t fZStart; // number of first pixel in cluster - Float_t fZStop; // number of last pixel in cluster - Int_t fZend; // Zend - Int_t fNTracks; // number of tracks created a cluster - Int_t fTracks[3]; // tracks created a cluster + void SetTracks(Int_t track0, Int_t track1, Int_t track2) { + // set tracks in cluster (not more than three ones) + fTracks[0]=track0; + fTracks[1]=track1; + fTracks[2]=track2; + } + void SetNTracks(Int_t ntracks) { + // set ntracks + fNTracks=ntracks; + } + protected: + Float_t fX; // X of cluster + Float_t fZ; // Z of cluster + Float_t fQ; // Q of cluster + Int_t fNClZ; // Cluster size in Z direction + Int_t fNClX; // Cluster size in X direction + Int_t fXStart; // number of first pixel in cluster + Int_t fXStop; // number of last pixel in cluster + Float_t fZStart; // number of first pixel in cluster + Float_t fZStop; // number of last pixel in cluster + Int_t fZend; // Zend + Int_t fNTracks; // number of tracks created a cluster + Int_t fTracks[3]; // tracks created a cluster + Int_t fModule; // Module number for this culuster ClassDef(AliITSRawClusterSPD,1) // AliITSRawCluster class for SPD - - }; - -//--------------------------------------------- +}; +//---------------------------------------------------------------------- class AliITSRawClusterSDD : public AliITSRawCluster { - -public: - - AliITSRawClusterSDD() { - // constructor - fX=fZ=fQ=0; - fWing=0; - fNanodes=1; - fAnode=fTime=fPeakAmplitude=0; - fPeakPosition=-1; - fMultiplicity=0; - fTstart=fTstop=fTstartf=fTstopf=0; - fAstart=fAstop=0; - } - - AliITSRawClusterSDD(Int_t wing, Float_t Anode,Float_t Time, Float_t Charge, - Float_t PeakAmplitude,Int_t PeakPosition, Float_t Asigma, Float_t Tsigma, Float_t DriftPath, Float_t AnodeOffset, Int_t Samples, - Int_t Tstart, Int_t Tstop, Int_t Tstartf, Int_t Tstopf, Int_t Anodes, Int_t Astart, Int_t Astop); - AliITSRawClusterSDD( const AliITSRawClusterSDD & source); -// AliITSRawClusterSDD(Int_t wing, Float_t Anode,Float_t Time,Float_t Charge, -// Float_t PeakAmplitude,Int_t PeakPosition,Float_t Asigma, Float_t Tsigma,Float_t DriftPath, Float_t AnodeOffset,Int_t Samples); - virtual ~AliITSRawClusterSDD() { - // destructor - } - - void Add(AliITSRawClusterSDD* clJ); - Bool_t Brother(AliITSRawClusterSDD* cluster,Float_t dz,Float_t dx); -// Bool_t Brother(AliITSRawClusterSDD* cluster); - void PrintInfo(); - // Setters - void SetX(Float_t x) {fX=x;} - void SetZ(Float_t z) {fZ=z;} - void SetQ(Float_t q) {fQ=q;} - void SetAnode(Float_t anode) {fAnode=anode;} - void SetTime(Float_t time) {fTime=time;} - void SetAsigma(Float_t asigma) {fAsigma=asigma;} - void SetTsigma(Float_t tsigma) {fTsigma=tsigma;} - void SetWing(Int_t wing) {fWing=wing;} - void SetNanodes(Int_t na) {fNanodes=na;} - void SetNsamples(Int_t ns) {fMultiplicity=ns;} - void SetPeakAmpl(Float_t ampl) {fPeakAmplitude=ampl;} - void SetPeakPos(Int_t pos) {fPeakPosition=pos;} - // Getters - Float_t X() const { - //X - return fX ; - } - Float_t Z() const { - //Z - return fZ ; - } - Float_t Q() const { - //Q - return fQ ; - } - Float_t A() const { - //A - return fAnode ; - } - Float_t T() const { - //T - return fTime ; - } - Float_t Asigma() const { - //Asigma - return fAsigma ; - } - Float_t Tsigma() const { - //Tsigma - return fTsigma ; - } - Float_t W() const { - //W - return fWing ; - } - Int_t Anodes() const { - //Anodes - return fNanodes ; - } - Int_t Samples() const { - //Samples - return fMultiplicity; - } - Float_t PeakAmpl() const { - //PeakAmpl - return fPeakAmplitude ; - } - Float_t SumAmpl() const { - //PeakAmpl - return fSumAmplitude ; - } - Int_t PeakPos() {return fPeakPosition;} - - Int_t Tstart() const { - //Tstart - return fTstart ; - } - Int_t Tstartf() const { - //Tstartf - return fTstartf ; - } - Int_t Tstop() const { - //Tstop - return fTstop ; - } - Int_t Tstopf() const { - //Tstopf - return fTstopf ; - } - Int_t Astart() const { - //Astart - return fAstart ; - } - Int_t Astop() const { - //Astop - return fAstop ; - } -public: - - Float_t fX; // X of cluster - Float_t fZ; // Z of cluster - Float_t fQ; // Q of cluster - Int_t fWing; // Wing number - Float_t fAnode; // Anode number - Float_t fTime; // Drift Time - Float_t fAsigma; // - Float_t fTsigma; // - Float_t fPeakAmplitude; // Peak Amplitude - Float_t fSumAmplitude; // Total Amplitude (for weighting) - Int_t fPeakPosition; // index of digit corresponding to peak - Int_t fNanodes; // N of anodes used for the cluster - Int_t fTstart; // First sample in 1D cluster - Int_t fTstop; // Last sample in 1D cluster - Int_t fTstartf; // First sample in the full 2D cluster - Int_t fTstopf; // Last sample in the full 2D cluster - Int_t fAstart; // First anode in the 2D cluster - Int_t fAstop; // last anode in the 2D cluster - - ClassDef(AliITSRawClusterSDD,1) // AliITSRawCluster class for SDD - }; - -//----------------------------------------- + public: + AliITSRawClusterSDD() { + // constructor + fX=fZ=fQ=0; + fWing=0; + fNanodes=1; + fAnode=fTime=fPeakAmplitude=0; + fPeakPosition=-1; + fMultiplicity=0; + fTstart=fTstop=fTstartf=fTstopf=0; + fAstart=fAstop=0; + } + AliITSRawClusterSDD(Int_t wing,Float_t Anode,Float_t Time,Float_t Charge, + Float_t PeakAmplitude,Int_t PeakPosition, + Float_t Asigma,Float_t Tsigma,Float_t DriftPath, + Float_t AnodeOffset, Int_t Samples, + Int_t Tstart, Int_t Tstop,Int_t Tstartf,Int_t Tstopf, + Int_t Anodes, Int_t Astart, Int_t Astop); + AliITSRawClusterSDD( const AliITSRawClusterSDD & source); + virtual ~AliITSRawClusterSDD() {// destructor + } + void Add(AliITSRawClusterSDD* clJ); + Bool_t Brother(AliITSRawClusterSDD* cluster,Float_t dz,Float_t dx); + void PrintInfo(); + // Setters + void SetX(Float_t x) {fX=x;} + void SetZ(Float_t z) {fZ=z;} + void SetQ(Float_t q) {fQ=q;} + void SetAnode(Float_t anode) {fAnode=anode;} + void SetTime(Float_t time) {fTime=time;} + void SetAsigma(Float_t asigma) {fAsigma=asigma;} + void SetTsigma(Float_t tsigma) {fTsigma=tsigma;} + void SetWing(Int_t wing) {fWing=wing;} + void SetNanodes(Int_t na) {fNanodes=na;} + void SetNsamples(Int_t ns) {fMultiplicity=ns;} + void SetPeakAmpl(Float_t ampl) {fPeakAmplitude=ampl;} + void SetPeakPos(Int_t pos) {fPeakPosition=pos;} + // Getters + Float_t X() const {//X + return fX ;} + Float_t Z() const {//Z + return fZ ;} + Float_t Q() const {//Q + return fQ ;} + Float_t A() const {//A + return fAnode ;} + Float_t T() const {//T + return fTime ;} + Float_t Asigma() const {//Asigma + return fAsigma ;} + Float_t Tsigma() const {//Tsigma + return fTsigma ;} + Float_t W() const {//W + return fWing ;} + Int_t Anodes() const {//Anodes + return fNanodes ;} + Int_t Samples() const {//Samples + return fMultiplicity;} + Float_t PeakAmpl() const {//PeakAmpl + return fPeakAmplitude ;} + Float_t SumAmpl() const {//PeakAmpl + return fSumAmplitude ;} + Int_t PeakPos() {return fPeakPosition;} + Int_t Tstart() const {//Tstart + return fTstart ;} + Int_t Tstartf() const {//Tstartf + return fTstartf ;} + Int_t Tstop() const {//Tstop + return fTstop;} + Int_t Tstopf() const {//Tstopf + return fTstopf ;} + Int_t Astart() const {//Astart + return fAstart ;} + Int_t Astop() const {//Astop + return fAstop ;} + public: + Float_t fX; // X of cluster + Float_t fZ; // Z of cluster + Float_t fQ; // Q of cluster + Int_t fWing; // Wing number + Float_t fAnode; // Anode number + Float_t fTime; // Drift Time + Float_t fAsigma; // + Float_t fTsigma; // + Float_t fPeakAmplitude; // Peak Amplitude + Float_t fSumAmplitude; // Total Amplitude (for weighting) + Int_t fPeakPosition; // index of digit corresponding to peak + Int_t fNanodes; // N of anodes used for the cluster + Int_t fTstart; // First sample in 1D cluster + Int_t fTstop; // Last sample in 1D cluster + Int_t fTstartf; // First sample in the full 2D cluster + Int_t fTstopf; // Last sample in the full 2D cluster + Int_t fAstart; // First anode in the 2D cluster + Int_t fAstop; // last anode in the 2D cluster + + ClassDef(AliITSRawClusterSDD,1) // AliITSRawCluster class for SDD +}; +//---------------------------------------------------------------------- class AliITSRawClusterSSD : public AliITSRawCluster { - -public: - - AliITSRawClusterSSD() { - fMultiplicityN=0; - fQErr=0; - fSignalP=0; - fSignalN=0; - fStatus=-1; - fNtracks=0; - } - AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn); - virtual ~AliITSRawClusterSSD() { - // destructor - } - - Int_t GetStatus() const { - // get status - return fStatus; - } - void SetStatus(Int_t status) { - // set status - fStatus=status; - } - - -public: - Int_t fMultiplicityN; // The number of N side strips involved - // in this point calculations - Float_t fQErr; // Total charge error - Float_t fSignalP; // Signal of P side cluster - Float_t fSignalN; // Signal of N side cluster - Int_t fStatus; // Flag status : 0 - real point - // 1 - ghost - // 2 - EIC ? - // 3 - single side - Int_t fNtracks; // Number of tracks created the cluster - - - // Float_t fProbability; // The probability that this is a "real" point - // Int_t fIndexMapN[100]; // indices of digits for Nside - the corresponding - // info for P side is carried in the base class - // Float_t fChi2N; - ClassDef(AliITSRawClusterSSD,1) // AliITSRawCluster class for SSD - + public: + AliITSRawClusterSSD() { + fMultiplicityN=0; + fQErr=0; + fSignalP=0; + fSignalN=0; + fStatus=-1; + fNtracks=0; + } + AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn); + virtual ~AliITSRawClusterSSD() {// destructor + } + Int_t GetStatus() const {// get status + return fStatus;} + void SetStatus(Int_t status) {// set status + fStatus=status;} + public: + Int_t fMultiplicityN; // The number of N side strips involved + // in this point calculations + Float_t fQErr; // Total charge error + Float_t fSignalP; // Signal of P side cluster + Float_t fSignalN; // Signal of N side cluster + Int_t fStatus; // Flag status : 0 - real point + // 1 - ghost + // 2 - EIC ? + // 3 - single side + Int_t fNtracks; // Number of tracks created the cluster + ClassDef(AliITSRawClusterSSD,1) // AliITSRawCluster class for SSD }; - - #endif