+
+//_______________________________________________________________________
+Float_t AliTPCseed::GetTPCClustInfo(Int_t nNeighbours, Int_t type, Int_t row0, Int_t row1)
+{
+ //
+ // TPC cluster information
+ // type 0: get fraction of found/findable clusters with neighbourhood definition
+ // 1: found clusters
+ // 2: findable (number of clusters above and below threshold)
+ //
+ // definition of findable clusters:
+ // a cluster is defined as findable if there is another cluster
+ // within +- nNeighbours pad rows. The idea is to overcome threshold
+ // effects with a very simple algorithm.
+ //
+
+ const Float_t kClusterShapeCut = 1.5; // IMPPRTANT TO DO: move value to AliTPCRecoParam
+ const Float_t ktany = TMath::Tan(TMath::DegToRad()*10);
+ const Float_t kedgey =3.;
+
+ Float_t ncl = 0;
+ Float_t nclBelowThr = 0; // counts number of clusters below threshold
+
+ for (Int_t irow=row0; irow<row1; irow++){
+ AliTPCclusterMI* cluster = GetClusterPointer(irow);
+
+ if (!cluster && irow > 1 && irow < 157) {
+ Bool_t isClBefore = kFALSE;
+ Bool_t isClAfter = kFALSE;
+ for(Int_t ithres = 1; ithres <= nNeighbours; ithres++) {
+ AliTPCclusterMI * clusterBefore = GetClusterPointer(irow - ithres);
+ if (clusterBefore) isClBefore = kTRUE;
+ AliTPCclusterMI * clusterAfter = GetClusterPointer(irow + ithres);
+ if (clusterAfter) isClAfter = kTRUE;
+ }
+ if (isClBefore && isClAfter) nclBelowThr++;
+ }
+ if (!cluster) continue;
+ //
+ //
+ if (TMath::Abs(cluster->GetY())>cluster->GetX()*ktany-kedgey) continue; // edge cluster
+ //
+ AliTPCTrackerPoint * point = GetTrackPoint(irow);
+ if (point==0) continue;
+ Float_t rsigmay = TMath::Sqrt(point->GetSigmaY());
+ if (rsigmay > kClusterShapeCut) continue;
+ //
+ if (cluster->IsUsed(11)) continue; // remove shared clusters for PbPb
+ ncl++;
+ }
+
+ if(ncl<10)
+ return 0;
+ if(type==0)
+ if(nclBelowThr+ncl>0)
+ return ncl/(nclBelowThr+ncl);
+ if(type==1)
+ return ncl;
+ if(type==2)
+ return ncl+nclBelowThr;
+ return 0;
+}