1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.2 2000/06/30 12:07:49 kowal2
19 Updated from the TPC-PreRelease branch
21 Revision 1.1.2.1 2000/06/25 08:52:51 kowal2
22 replacing AliClusterFinder
26 //-----------------------------------------------------------------------------
28 // Implementation of class ALICLUSTERFINDER
30 //Class for cluster finding in two dimension.
31 //In the present there are implemented two algorithm
32 //primitive recursion algorithm. (FindPeaks)
33 //Algorithm is not working in case of overlaping clusters
34 //Maximum - minimum in direction algoritm (Find clusters)
35 //In this algoritm we suppose that each cluster has local
36 //maximum. From this local maximum I mus see each point
38 //From maximum i can accept every point in radial
39 //direction which is before border in direction
40 //Border in direction occur if we have next in
41 //direction nder threshold or response begin
42 //to increase in given radial direction
43 //-----------------------------------------------------------------------------
46 #include "AliArrayI.h"
47 #include "TClonesArray.h"
52 #include "AliCluster.h"
53 #include "AliTPCClusterFinder.h"
56 //direction constants possible direction in 8 different sectors
60 const Int_t kClStackSize =1000;
65 static AliTPCClusterFinder * gClusterFinder; //for fitting routine
67 void gauss(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
69 AliArrayI * points = gClusterFinder->GetStack();
70 const Int_t nbins = gClusterFinder->GetStackIndex();
75 for (i=0;i<nbins; i++) {
76 Float_t x = points->At(i*3);
77 Float_t y = points->At(i*3+1);
78 Float_t z = points->At(i*3+2);
79 Float_t deltax2 = (x-par[1]);
82 Float_t deltay2 = (y-par[2]);
86 delta = z-par[0]*TMath::Exp(-deltax2-deltay2);
93 ClassImp(AliTPCClusterFinder)
96 AliTPCClusterFinder::AliTPCClusterFinder()
102 fMulSigma2 = 16; //4 sigma
107 fStack = new AliArrayI;
108 fStack->Set(kClStackSize);
117 fMinuit= new TMinuit(5);
118 fMinuit->SetFCN(gauss);
119 gClusterFinder = this;
124 AliTPCClusterFinder::~AliTPCClusterFinder()
126 if (fDigits != 0) delete fDigits;
129 void AliTPCClusterFinder::SetSigmaX(Float_t s0, Float_t s1x, Float_t s1y)
136 void AliTPCClusterFinder::SetSigmaY(Float_t s0, Float_t s1x, Float_t s1y)
145 Bool_t AliTPCClusterFinder::SetSigma2(Int_t i, Int_t j, Float_t & sigmax2, Float_t &sigmay2)
148 //set sigmax2 and sigma y2 accordig i and j position of cell
151 // Float_t x[3] = {ItoX(i),JtoY(j),0};
155 sigmax2= fSigmaX[0]+fSigmaX[1]*x+fSigmaX[2]*y;
156 sigmay2= fSigmaY[0]+fSigmaY[1]*x+fSigmaY[2]*y;
161 Bool_t AliTPCClusterFinder::SetSigma2(Int_t i, Int_t j, Float_t & sigmax2, Float_t &sigmay2)
164 //set sigmax2 and sigma y2 accordig i and j position of cell
166 if (fDetectorParam==0) {
171 Float_t x[3] = {ItoX(i),JtoY(j),0};
173 fDetectorParam->GetClusterSize(x,fDetectorIndex,0,0,sigma);
174 sigmax2=sigma[0]*(fX2-fX1)*(fX2-fX1)/(fDimX*fDimX);
175 sigmay2=sigma[1]*(fY2-fY1)*(fY2-fY1)/(fDimY*fDimY);
181 void AliTPCClusterFinder::GetHisto(TH2F * his2)
184 UInt_t idim =his2->GetNbinsX();
185 UInt_t jdim =his2->GetNbinsY();
186 fX1 = his2->GetXaxis()->GetXmin();
187 fX2 = his2->GetXaxis()->GetXmax();
188 fY1 = his2->GetYaxis()->GetXmin();
189 fY2 = his2->GetYaxis()->GetXmax();
191 if ( (idim>0) && (jdim>0))
196 Int_t size =idim*jdim;
197 if (fDigits !=0) delete fDigits;
198 fDigits = (Int_t*) new Int_t[size];
199 fCells = (AliCell*) new AliCell[size];
203 for (Int_t i = 0; i<(Int_t)idim;i++)
204 for (Int_t j = 0; j<(Int_t)jdim;j++)
206 Int_t index = his2->GetBin(i+1,j+1);
207 //AliCell * cell = GetCell(i,j);
208 //if (cell!=0) cell->SetSignal(his2->GetBinContent(index));
209 SetSignal(his2->GetBinContent(index),i,j);
217 void AliTPCClusterFinder::FindMaxima()
219 for (Int_t i=0; i<fDimX; i++)
220 for (Int_t j=0;j<fDimY; j++)
221 if (IsMaximum(i,j)) cout<<i<<" "<<j<<"\n";
225 void AliTPCClusterFinder::Transform(AliDigitCluster * c)
227 //transform coordinata from bin coordinata to "normal coordinata"
228 //for example if we initialize finder with histogram
229 //it transform values from bin coordinata to the histogram coordinata
232 c->fMaxX=ItoX(c->fMaxX);
233 c->fMaxY=JtoY(c->fMaxY);
235 c->fSigmaX2=c->fSigmaX2*(fX2-fX1)*(fX2-fX1)/(fDimX*fDimX);
236 c->fSigmaY2=c->fSigmaY2*(fY2-fY1)*(fY2-fY1)/(fDimY*fDimY);
237 c->fArea =c->fArea*(fX2-fX1)*(fY2-fY1)/(fDimX*fDimY);
239 void AliTPCClusterFinder::AddToStack(Int_t i, Int_t j, Int_t signal)
244 if ( ((fStackIndex+2)>=kClStackSize) || (fStackIndex<0) ) return;
245 fStack->AddAt(i,fStackIndex);
246 fStack->AddAt(j,fStackIndex+1);
247 fStack->AddAt(signal,fStackIndex+2);
251 void AliTPCClusterFinder::GetClusterStatistic(AliDigitCluster & cluster)
254 //calculate statistic of cluster
256 Double_t sumxw,sumyw,sumx2w,sumy2w,sumxyw,sumw;
257 Int_t minx,maxx,miny,maxy;
258 sumxw=sumyw=sumx2w=sumy2w=sumxyw=sumw=0;
263 Int_t x0=fStack->At(0);
264 Int_t y0=fStack->At(1);
267 Int_t maxQ=fStack->At(2);
270 for (Int_t i = 0; i<fStackIndex;i+=3){
271 Int_t x = fStack->At(i);
272 Int_t y = fStack->At(i+1);
275 Int_t w = fStack->At(i+2);
294 cluster.fX = sumxw/sumw;
295 cluster.fY = sumyw/sumw;
297 cluster.fSigmaX2 = sumx2w/sumw-cluster.fX*cluster.fX;
298 cluster.fSigmaY2 = sumy2w/sumw-cluster.fY*cluster.fY;
299 cluster.fSigmaXY = sumxyw/sumw-cluster.fX*cluster.fY;
300 cluster.fMaxX = maxQx;
301 cluster.fMaxY = maxQy;
303 cluster.fArea = fStackIndex/3;
304 cluster.fNx = maxx-minx+1;
305 cluster.fNy = maxy-miny+1;
310 void AliTPCClusterFinder::GetClusterFit(AliDigitCluster & cluster)
313 //calculate statistic of cluster
315 Double_t arglist[10];
319 fMinuit->mnexcm("SET ERR", arglist ,1,ierflg);
321 //fistly find starting parameters
322 Int_t minx,maxx,miny,maxy,maxQ,maxQx,maxQy;
324 Float_t sumxw,sumyw,sumw;
334 for (Int_t i = 0; i<fStackIndex;i+=3){
335 Int_t x = fStack->At(i);
336 Int_t y = fStack->At(i+1);
337 Int_t w = fStack->At(i+2);
354 Int_t nx = maxx-minx+1;
355 Int_t ny = maxy-miny+1;
357 SetSigma2(maxQx,maxQy,fCurrentSigmaX2,fCurrentSigmaY2);
358 Double_t vstart[5]={maxQ,sumxw/sumw,sumyw/sumw,1/(2*fCurrentSigmaX2),1/(2*fCurrentSigmaY2)};
359 Double_t step[5]={1.,0.01,0.01,0.01,0.01};
360 fMinuit->mnparm(0, "amp", vstart[0], step[0], 0,0,ierflg);
361 fMinuit->mnparm(1, "x0", vstart[1], step[1], 0,0,ierflg);
362 fMinuit->mnparm(2, "y0", vstart[2], step[2], 0,0,ierflg);
363 fMinuit->mnparm(3, "sx2", vstart[3], step[3], 0,0,ierflg);
364 fMinuit->mnparm(4, "sy2", vstart[4], step[4], 0,0,ierflg);
368 fMinuit->mnfree(0); //set unfixed all parameters
369 //if we have area less then
370 if (over<=21) { //if we dont't have more then 7 points
371 fMinuit->FixParameter(3);
372 fMinuit->FixParameter(4);
375 if (nx<3) fMinuit->FixParameter(3); //fix sigma x if no data in x direction
376 if (ny<3) fMinuit->FixParameter(4); //fix sigma y if no data in y direction
378 fMinuit->mnexcm("MIGRAD", arglist ,2,ierflg);
383 fMinuit->GetParameter(0,x[0],error[0]);
384 fMinuit->GetParameter(1,x[1],error[1]);
385 fMinuit->GetParameter(2,x[2],error[2]);
386 fMinuit->GetParameter(3,x[3],error[3]);
387 fMinuit->GetParameter(4,x[4],error[4]);
391 cluster.fMaxX = maxQx;
392 cluster.fMaxY = maxQy;
395 cluster.fSigmaX2 = 1/TMath::Sqrt(2*x[3]);
396 cluster.fSigmaY2 = 1/TMath::Sqrt(2*x[4]);
397 cluster.fSigmaXY = 0;
399 cluster.fArea = over;
405 Bool_t AliTPCClusterFinder::CheckIfDirBorder(Float_t x, Float_t y,
409 //function which control if given cell with index i, j is the
410 //minimum in direction
411 // x and y are estimate of local maximum
412 //direction is given by the
414 AliCell * cellor= GetCell(i,j);
415 Int_t sigor = GetSignal(i,j);
417 //control derivation in direction
418 //if function grows up in direction then there is border
421 Float_t dd = TMath::Sqrt(dx*dx+dy*dy);
422 Float_t ddx = TMath::Abs(dx);
423 ddx = (ddx>0.5) ? ddx-0.5: 0;
425 Float_t ddy = TMath::Abs(dy);
426 ddy = (ddy>0.5) ? ddy-0.5: 0;
428 Float_t d2 = ddx/(2*fDirSigmaFac*fCurrentSigmaX2)+ddy/(2*fDirSigmaFac*fCurrentSigmaY2); //safety factor
429 //I accept sigmax and sigma y bigge by factor sqrt(fDirsigmaFac)
430 Float_t amp = TMath::Exp(-d2)*fCurrentMaxAmp*fDirAmpFac; //safety factor fDirFac>1
432 if (sigor>amp) return kTRUE;
433 if (dd==0) return kFALSE;
437 virtualcell = GetVirtualSignal(i+dx,j+dy);
438 if (virtualcell <=fThreshold) return kFALSE;
439 if (virtualcell>sigor)
440 if (virtualcell>(sigor+fNoiseTh))
441 {cellor->SetDirBorder(fIndex); return kTRUE;}
444 virtualcell = GetVirtualSignal(i+2*dx,j+2*dy);
445 if (virtualcell>sigor)
446 { cellor->SetDirBorder(fIndex); return kTRUE;}
455 Bool_t AliTPCClusterFinder::IsMaximum(Int_t i, Int_t j)
457 //there is maximum if given digits is 1 sigma over all adjacent
459 //or ther exist virual maximum
460 //is maximum on 24 points neighboring
461 // Bool_t res = kFALSE;
465 AliCell * cell = GetCell(i,j);
466 Int_t signal = GetSignal(i,j);
467 if (cell == 0) return kFALSE;
468 for ( Int_t di=-1;di<=1;di++)
469 for ( Int_t dj=-1;dj<=1;dj++){
470 if ( (di!=0) || (dj!=0))
472 AliCell * cell2=GetCell(i+di,j+dj);
473 Int_t signal2 = GetSignal(i+di,j+dj);
480 if (signal2>signal) return kFALSE;
481 if (signal2>fThreshold) overth++;
482 if (signal2==signal) {
483 if (di<0) return kFALSE;
484 if ( (di+dj)<0) return kFALSE;
486 // if (signal>=signal2){
488 if (signal>fNoiseTh+signal2)
494 //if I have only one neighborough over threshold
495 if (overth<2) return kFALSE;
496 if (over<8) return kFALSE;
500 fCurrentMaxAmp =signal;
501 SetMaximum(fIndex,i,j);
504 //check if there exist virtual maximum
505 for (Float_t ddi=0.;(ddi<1.);ddi+=0.5)
506 for (Float_t ddj=0.;(ddj<1.);ddj+=0.5)
507 if (IsVirtualMaximum(Float_t(i)+ddi,Float_t(j)+ddj)){
508 fCurrentMaxX = i+ddi;
509 fCurrentMaxY = j+ddj;
510 fCurrentMaxAmp =signal;
511 SetMaximum(fIndex,i,j);
517 Bool_t AliTPCClusterFinder::IsVirtualMaximum(Float_t x, Float_t y)
519 //there is maximum if given digits is 1 sigma over all adjacent
521 //is maximum on 24 points neighboring
526 Float_t virtualcell = GetVirtualSignal(x,y);
527 if (virtualcell < 0) return kFALSE;
528 for ( Int_t di=-1;di<=1;di++)
529 for ( Int_t dj=-1;dj<=1;dj++)
530 if ( (di!=0) || (dj!=0))
532 Float_t virtualcell2=GetVirtualSignal(x+di,y+dj);
533 if (virtualcell2 < 0) {
539 if (virtualcell2>fThreshold) overth++;
540 if (virtualcell>=virtualcell2){
542 if (virtualcell>fNoiseTh+virtualcell2)
547 if (overth<2) return kFALSE;
548 //if there exist only one or less neighboring above threshold
549 if (oversigma==8) res = kTRUE;
550 else if ((over==8)&&(GetNType()==8)) res=kTRUE;
552 for ( Int_t di=-2;di<=2;di++)
553 for ( Int_t dj=-2;dj<=2;dj++)
554 if ( (di==2)||(di==-2) || (dj==2)|| (dj==-2) )
556 Float_t virtualcell2=GetVirtualSignal(x+di,y+dj);
557 if (virtualcell2 < 0) {
563 if (virtualcell>=virtualcell2) over+=1;
566 if (over == 24) res=kTRUE;
572 void AliTPCClusterFinder::ResetSignal()
575 Int_t size = fDimX*fDimY;
577 if (rOK==kTRUE) for (Int_t i=0 ; i<size;i++) dig[i] = 0;
582 void AliTPCClusterFinder::ResetStatus()
584 //reset status of signals to not used
585 Int_t size = fDimX*fDimY;
587 if (rOK==kTRUE) for (Int_t i=0 ; i<size;i++)
592 AliCell * AliTPCClusterFinder::GetCell(Int_t i, Int_t j)
594 //return reference to the cell with index i,j
596 if ( (i>=0) && (i<fDimX) && (j>=0) && (j<fDimY) )
597 return &fCells[i+j*fDimX];
601 Float_t AliTPCClusterFinder::GetVirtualSignal(Float_t ri, Float_t rj)
603 //it generate virtual cell as mean value from different cels
604 //after using it must be destructed !!!
607 Int_t ddi = (ri>i)? 1:0;
608 Int_t ddj = (rj>j)? 1:0;
611 for (Int_t di=0;di<=ddi;di++)
612 for (Int_t dj=0;dj<=ddj;dj++)
614 Float_t w = (ri-i-di)*(ri-i-di)+(rj-j-dj)*(rj-j-dj);
615 if (w>0) w=1/TMath::Sqrt(w);
617 AliCell * cel2 =GetCell(i+di,j+dj);
618 Int_t signal2 = GetSignal(i+di,j+dj);
624 if (sumw>0) return (sum/sumw);
631 void AliTPCClusterFinder::Streamer(TBuffer & R__b)
633 if (R__b.IsReading()) {
634 // Version_t R__v = R__b.ReadVersion();
636 R__b.WriteVersion(AliTPCClusterFinder::IsA());
642 void AliTPCClusterFinder::SetBlockIndex(Int_t * index)
645 //calculate which indexes we must check for border
647 if (TMath::Abs(index[0])<2) index[2] = 0;
649 index[2] = TMath::Abs(index[0])-1;
650 if (index[0]<0) index[2]*=-1; //first x block
652 if (TMath::Abs(index[1])<2) index[3] = 0;
654 index[3] = TMath::Abs(index[1])-1;
655 if (index[1]<0) index[3]*=-1; //first y block
657 if (TMath::Abs(index[0])<TMath::Abs(index[1])){
662 if (index[0]==index[1]) {
673 //***********************************************************************
674 //***********************************************************************
676 TClonesArray * AliTPCClusterFinder::FindPeaks1(TClonesArray *arr)
678 //find peaks and write it in form of AliTPCcluster to array
680 fClustersArray=new TClonesArray("AliDigitCluster",300);
684 fClustersArray = arr;
685 fIndex = fClustersArray->GetEntriesFast();
690 for (Int_t i=0; i<fDimX; i++)
691 for (Int_t j=0;j<fDimY; j++)
695 AliCell * cell = GetCell(i,j);
696 if (!(cell->IsChecked())) Adjacent(i,j);
697 //if there exists more then 2 digits cluster
698 if (fStackIndex >2 ){
699 if (fBFit==kFALSE) GetClusterStatistic(c);
700 else GetClusterFit(c);
701 //write some important chracteristic area of cluster
704 //write cluster information to array
705 TClonesArray &lclusters = *fClustersArray;
706 new (lclusters[fIndex++]) AliDigitCluster(c);
707 // cout<<"fx="<<c.fX<<" fy"<<c.fY<<"\n";
710 return fClustersArray;
714 TClonesArray * AliTPCClusterFinder::FindPeaks2(TClonesArray *arr)
716 //find peaks and write it in form of AliTPCcluster to array
718 fClustersArray=new TClonesArray("AliDigitCluster",300);
722 fClustersArray = arr;
723 fIndex = fClustersArray->GetEntriesFast();
729 for (Int_t i=0; i<fDimX; i++)
730 for (Int_t j=0;j<fDimY; j++)
733 if (IsMaximum(i,j) == kTRUE){
734 SetSigma2(i,j,fCurrentSigmaX2,fCurrentSigmaY2);
737 //if there exists more then 2 digits cluster
738 if (fStackIndex >2 ){
739 if (fBFit==kFALSE) GetClusterStatistic(c);
740 else GetClusterFit(c);
741 //write some important chracteristic area of cluster
744 //write cluster information to array
745 TClonesArray &lclusters = *fClustersArray;
746 new(lclusters[fIndex++]) AliDigitCluster(c);
747 // cout<<"fx="<<c.fX<<" fy"<<c.fY<<"\n";
751 return fClustersArray;
755 TClonesArray * AliTPCClusterFinder::FindPeaks3(TClonesArray *arr)
757 //find peaks and write it in form of AliTPCcluster to array
759 fClustersArray=new TClonesArray("AliDigitCluster",300);
763 fClustersArray = arr;
764 fIndex = fClustersArray->GetEntriesFast();
772 for (Int_t i=0; i<fDimX; i++)
773 for (Int_t j=0;j<fDimY; j++)
776 if (IsMaximum(i,j) == kTRUE){
777 SetSigma2(i,j,fCurrentSigmaX2,fCurrentSigmaY2);
778 AddToStack(i,j,GetSignal(i,j));
780 //loop over different distance
782 for ( Int_t dd =1;((dd<=dmax) && (naccepted>0));dd++){
784 for (Int_t di = -dd;di<=dd;di++){
785 Int_t ddj = dd-abs(di);
786 Int_t sigstart = (ddj>0) ? -1 : 0;
787 for (Int_t sig = sigstart;sig<=1;sig+=2){
789 AliCell *cell= GetCell(i+di,j+dj);
790 Int_t signal = GetSignal(i+di,j+dj);
791 if (cell==0) continue;
796 SetBlockIndex(index); //adjust index to control
797 if ( IsBorder(fIndex,i+index[2],j+index[3]) ||
798 IsBorder(fIndex,i+index[4],j+index[5])) {
799 cell->SetBorder(fIndex);
803 if ( signal<=fThreshold ){
805 cell->SetThBorder(fIndex);
806 if (fBFit==kTRUE) AddToStack(i+di,j+dj,signal);
810 if (CheckIfDirBorder(fCurrentMaxX,fCurrentMaxY,i+di,j+dj) == kTRUE) {
811 if (fBFit==kFALSE) AddToStack(i+di,j+dj,signal/2);
814 AddToStack(i+di,j+dj,signal);
820 } //if there is maximum
821 //if there exists more then 2 digits cluster
822 if (fStackIndex >2 ){
823 if (fBFit==kFALSE) GetClusterStatistic(c);
824 else GetClusterFit(c);
825 //write some important chracteristic area of cluster
828 //write cluster information to array
829 TClonesArray &lclusters = *fClustersArray;
830 new(lclusters[fIndex++]) AliDigitCluster(c);
831 // cout<<"fx="<<c.fX<<" fy"<<c.fY<<"\n";
833 } //lopp over all digits
835 return fClustersArray;
843 void AliTPCClusterFinder::Adjacent(Int_t i,Int_t j)
846 //recursive agorithm program
848 if (fBDistType==kTRUE) {
849 Float_t delta = (i-fCurrentMaxX)*(i-fCurrentMaxX)/fCurrentSigmaX2;
850 delta+=(j-fCurrentMaxY)*(j-fCurrentMaxY)/fCurrentSigmaY2;
851 if (delta > fMulSigma2) {
852 SetDirBorder(fIndex,i,j);
856 AliCell *cell = GetCell(i,j);
857 Int_t signal = GetSignal(i,j);
859 cell->SetChecked(fIndex);
860 if ( (q>fThreshold) || (fBFit==kTRUE)) AddToStack(i,j,q);
865 newcel = GetCell(i-1,j);
866 if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i-1,j);
867 newcel = GetCell(i,j-1);
868 if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i,j-1);
869 newcel = GetCell(i+1,j);
870 if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i+1,j);
871 newcel = GetCell(i,j+1);
872 if (newcel !=0) if (!newcel->IsChecked(fIndex) ) Adjacent(i,j+1);
874 else cell->SetThBorder(fIndex);
879 AliH2F * AliTPCClusterFinder::DrawHisto( const char *option=0,
880 Float_t x1, Float_t x2, Float_t y1, Float_t y2)
883 //draw digits in given array
887 sprintf(ch,"Cluster finder digits ");
888 if ( (fDimX<1)|| (fDimY<1)) {
891 AliH2F * his = new AliH2F(ch,ch,fDimX,fX1,fX2,fDimY,fY1,fY2);
892 //set histogram values
893 for (Int_t i = 0; i<fDimX;i++)
894 for (Int_t j = 0; j<fDimY;j++){
897 his->Fill(x,y,GetSignal(i,j));
900 AliH2F *h2fsub = his->GetSubrange2d(x1,x2,y1,y2);
904 if (his==0) return 0;
905 if (option!=0) his->Draw(option);
911 void AliTPCClusterFinder::DrawCluster(
912 Int_t color, Int_t size, Int_t style)
915 if (fClustersArray==0) return;
916 //draw marker for each of cluster
917 Int_t ncl=fClustersArray->GetEntriesFast();
918 for (Int_t i=0;i<ncl;i++){
919 AliCluster *cl = (AliCluster*)fClustersArray->UncheckedAt(i);
920 TMarker * marker = new TMarker;
921 marker->SetX(cl->fX);
922 marker->SetY(cl->fY);
923 marker->SetMarkerSize(size);
924 marker->SetMarkerStyle(style);
925 marker->SetMarkerColor(color);
932 AliH2F * AliTPCClusterFinder::DrawBorders( const char *option, AliH2F *h, Int_t type ,
933 Float_t x1, Float_t x2, Float_t y1, Float_t y2)
936 //draw digits in given array
940 sprintf(ch,"Cluster finder digits borders");
941 if ( (fDimX<1)|| (fDimY<1)) {
946 else his = new AliH2F(ch,ch,fDimX,fX1,fX2,fDimY,fY1,fY2);
947 //set histogram values
948 for (Int_t i = 0; i<fDimX;i++)
949 for (Int_t j = 0; j<fDimY;j++){
952 if (((type==1)||(type==0))&&IsMaximum(0,i,j)) his->Fill(x,y,16);
953 if (((type==3)||(type==0))&&(IsDirBorder(0,i,j))) his->Fill(x,y,8);
954 if (((type==4)||(type==0))&&(IsThBorder(0,i,j))) his->Fill(x,y,4);
955 if (((type==2)||(type==0))&&IsBorder(0,i,j)) his->Fill(x,y,1);
960 AliH2F *h2fsub = his->GetSubrange2d(x1,x2,y1,y2);
964 if (his==0) return 0;
965 if (option!=0) his->Draw(option);