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 **************************************************************************/
17 #include "AliRICHClusterFinder.h"
20 #include "AliRICHMap.h"
21 #include "AliRICHSDigit.h"
22 #include "AliRICHDigit.h"
23 #include "AliRICHRawCluster.h"
24 #include "AliRICHParam.h"
34 #include <TPostScript.h>
37 //----------------------------------------------------------
38 static AliSegmentation *gSegmentation;
39 static AliRICHResponse* gResponse;
40 static Int_t gix[500];
41 static Int_t giy[500];
42 static Float_t gCharge[500];
44 static Int_t gFirst=kTRUE;
45 static TMinuit *gMyMinuit ;
46 void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
47 static Int_t gChargeTot;
49 ClassImp(AliRICHClusterFinder)
50 //__________________________________________________________________________________________________
51 AliRICHClusterFinder::AliRICHClusterFinder(AliRICH *pRICH)
53 Info("main ctor","Start.");
57 fSegmentation=Rich()->C(1)->GetSegmentationModel();
58 fResponse =Rich()->C(1)->GetResponseModel();
60 fDigits=0; fNdigits=0;
70 //__________________________________________________________________________________________________
71 void AliRICHClusterFinder::Decluster(AliRICHRawCluster *cluster)
72 {// Decluster algorithm
73 Info("Decluster","Start.");
74 if(cluster->fMultiplicity==1||cluster->fMultiplicity==2){//Nothing special for 1- and 2-clusters
75 if(fNPeaks != 0) {cluster->fNcluster[0]=fNPeaks; cluster->fNcluster[1]=0;}
76 AddRawCluster(*cluster);
78 }else if(cluster->fMultiplicity==3){// 3-cluster, check topology
80 Centered(cluster);// ok, cluster is centered and added in Centered()
81 else{//if(fDeclusterFlag)
82 if(fNPeaks!=0){cluster->fNcluster[0]=fNPeaks;cluster->fNcluster[1]=0;}
83 AddRawCluster(*cluster);
86 }else{//4-and more-pad clusters
87 if(cluster->fMultiplicity<= fClusterSize){
89 SplitByLocalMaxima(cluster);
91 if(fNPeaks!= 0){cluster->fNcluster[0]=fNPeaks; cluster->fNcluster[1]=0; }
92 AddRawCluster(*cluster);
98 //__________________________________________________________________________________________________
99 Bool_t AliRICHClusterFinder::Centered(AliRICHRawCluster *cluster)
100 {//Is the cluster centered?
103 dig= (AliRICHDigit*)fDigits->UncheckedAt(cluster->fIndexMap[0]);
104 Int_t x[kMaxNeighbours], y[kMaxNeighbours], xN[kMaxNeighbours], yN[kMaxNeighbours];
105 Int_t nn=Rich()->Param()->Neighbours(dig->PadX(),dig->PadY(),x,y);
109 for (Int_t i=0; i<nn; i++){//neighbours loop
110 if(fHitMap->TestHit(x[i],y[i]) == kUsed){
117 if(nd==2){// cluster is centered !
119 cluster->fNcluster[0]=fNPeaks;
120 cluster->fNcluster[1]=0;
123 AddRawCluster(*cluster);
127 // Highest signal on an edge, split cluster into 2+1
128 // who is the neighbour ?
129 Int_t nind=fHitMap->GetHitIndex(xN[0], yN[0]);
130 Int_t i1= (nind==cluster->fIndexMap[1]) ? 1:2;
131 Int_t i2= (nind==cluster->fIndexMap[1]) ? 2:1;
133 AliRICHRawCluster cnew;
135 cnew.fNcluster[0]=-1;
136 cnew.fNcluster[1]=fNRawClusters;
138 cnew.fNcluster[0]=fNPeaks;
141 cnew.fMultiplicity=2;
142 cnew.fIndexMap[0]=cluster->fIndexMap[0];
143 cnew.fIndexMap[1]=cluster->fIndexMap[i1];
145 cnew.fClusterType=cnew.PhysicsContribution();
149 cluster->fMultiplicity=1;
150 cluster->fIndexMap[0]=cluster->fIndexMap[i2];
151 cluster->fIndexMap[1]=0;
152 cluster->fIndexMap[2]=0;
153 FillCluster(cluster);
155 cluster->fNcluster[0]=fNPeaks;
156 cluster->fNcluster[1]=0;
158 cluster->fClusterType=cluster->PhysicsContribution();
159 AddRawCluster(*cluster);
163 Warning("Centered","\n Completely screwed up %d !! \n",nd);
168 //__________________________________________________________________________________________________
169 void AliRICHClusterFinder::SplitByLocalMaxima(AliRICHRawCluster *c)
170 {// Split the cluster according to the number of maxima inside
171 AliRICHDigit* dig[100], *digt;
172 Int_t ix[100], iy[100], q[100];
173 Float_t x[100], y[100];
174 Int_t i; // loops over digits
175 Int_t j; // loops over local maxima
176 Int_t mul=c->fMultiplicity;
177 // dump digit information into arrays
178 for (i=0; i<mul; i++){
179 dig[i]= (AliRICHDigit*)fDigits->UncheckedAt(c->fIndexMap[i]);
180 ix[i]= dig[i]->PadX();
181 iy[i]= dig[i]->PadY();
182 q[i] = dig[i]->Signal();
183 Rich()->Param()->Pad2Local(ix[i], iy[i], x[i], y[i]);
188 Int_t associatePeak[100];
191 Int_t xNei[kMaxNeighbours], yNei[kMaxNeighbours];
192 for (i=0; i<mul; i++) {
193 fSegmentation->Neighbours(ix[i], iy[i], &nn, xNei, yNei);
195 for (j=0; j<nn; j++) {
196 if (fHitMap->TestHit(xNei[j], yNei[j])==kEmpty) continue;
197 digt=(AliRICHDigit*) fHitMap->GetHit(xNei[j], yNei[j]);
198 if (digt->Signal() > q[i]) {
201 // handle special case of neighbouring pads with equal signal
202 } else if (digt->Signal() == q[i]) {
204 for (Int_t k=0; k<nLocal; k++) {
205 if (xNei[j]==ix[indLocal[k]] && yNei[j]==iy[indLocal[k]]){
211 } // loop over next neighbours
212 // Maxima should not be on the edge
217 } // loop over all digits
218 // If only one local maximum found but multiplicity is high take global maximum from the list of digits.
219 if (nLocal==1 && mul>5) {
221 for (i=0; i<mul; i++) {
231 // If number of local maxima is 2 try to fit a double gaussian
233 // Initialise global variables for fit
235 gSegmentation=fSegmentation;
236 gResponse =fResponse;
239 for (i=0; i<mul; i++) {
242 gCharge[i]=Float_t(q[i]);
246 gMyMinuit = new TMinuit(5);
248 gMyMinuit->SetFCN(fcn);
249 gMyMinuit->mninit(5,10,7);
250 Double_t arglist[20];
253 // Set starting values
254 static Double_t vstart[5];
255 vstart[0]=x[indLocal[0]];
256 vstart[1]=y[indLocal[0]];
257 vstart[2]=x[indLocal[1]];
258 vstart[3]=y[indLocal[1]];
259 vstart[4]=Float_t(q[indLocal[0]])/
260 Float_t(q[indLocal[0]]+q[indLocal[1]]);
261 // lower and upper limits
262 static Double_t lower[5], upper[5];
263 Int_t isec=fSegmentation->Sector(ix[indLocal[0]], iy[indLocal[0]]);
264 lower[0]=vstart[0]-fSegmentation->Dpx(isec)/2;
265 lower[1]=vstart[1]-fSegmentation->Dpy(isec)/2;
267 upper[0]=lower[0]+fSegmentation->Dpx(isec);
268 upper[1]=lower[1]+fSegmentation->Dpy(isec);
270 isec=fSegmentation->Sector(ix[indLocal[1]], iy[indLocal[1]]);
271 lower[2]=vstart[2]-fSegmentation->Dpx(isec)/2;
272 lower[3]=vstart[3]-fSegmentation->Dpy(isec)/2;
274 upper[2]=lower[2]+fSegmentation->Dpx(isec);
275 upper[3]=lower[3]+fSegmentation->Dpy(isec);
280 static Double_t step[5]={0.005, 0.03, 0.005, 0.03, 0.01};
282 gMyMinuit->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
283 gMyMinuit->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
284 gMyMinuit->mnparm(2,"x2",vstart[2],step[2],lower[2],upper[2],ierflag);
285 gMyMinuit->mnparm(3,"y2",vstart[3],step[3],lower[3],upper[3],ierflag);
286 gMyMinuit->mnparm(4,"a0",vstart[4],step[4],lower[4],upper[4],ierflag);
287 // ready for minimisation
288 gMyMinuit->SetPrintLevel(-1);
289 gMyMinuit->mnexcm("SET OUT", arglist, 0, ierflag);
293 gMyMinuit->mnexcm("SET NOGR", arglist, 0, ierflag);
294 gMyMinuit->mnexcm("SCAN", arglist, 0, ierflag);
295 gMyMinuit->mnexcm("EXIT" , arglist, 0, ierflag);
297 Double_t xrec[2], yrec[2], qfrac;
299 Double_t epxz, b1, b2;
301 gMyMinuit->mnpout(0, chname, xrec[0], epxz, b1, b2, ierflg);
302 gMyMinuit->mnpout(1, chname, yrec[0], epxz, b1, b2, ierflg);
303 gMyMinuit->mnpout(2, chname, xrec[1], epxz, b1, b2, ierflg);
304 gMyMinuit->mnpout(3, chname, yrec[1], epxz, b1, b2, ierflg);
305 gMyMinuit->mnpout(4, chname, qfrac, epxz, b1, b2, ierflg);
306 // One cluster for each maximum
307 for (j=0; j<2; j++) {
308 AliRICHRawCluster cnew;
310 cnew.fNcluster[0]=-1;
311 cnew.fNcluster[1]=fNRawClusters;
313 cnew.fNcluster[0]=fNPeaks;
316 cnew.fMultiplicity=0;
317 cnew.fX=Float_t(xrec[j]);
318 cnew.fY=Float_t(yrec[j]);
320 cnew.fQ=Int_t(gChargeTot*qfrac);
322 cnew.fQ=Int_t(gChargeTot*(1-qfrac));
324 gSegmentation->SetHit(xrec[j],yrec[j],0);
325 for (i=0; i<mul; i++) {
326 cnew.fIndexMap[cnew.fMultiplicity]=c->fIndexMap[i];
327 gSegmentation->SetPad(gix[i], giy[i]);
328 Float_t q1=gResponse->IntXY(gSegmentation);
329 cnew.fContMap[cnew.fMultiplicity]=Float_t(q[i])/(q1*cnew.fQ);
330 cnew.fMultiplicity++;
332 FillCluster(&cnew,0);
333 cnew.fClusterType=cnew.PhysicsContribution();
341 if (nLocal !=-100 || !fitted) {
342 // Check if enough local clusters have been found, if not add global maxima to the list
347 Warning("SplitByLocalMaxima","no local maximum found");
351 if (nPerMax > fNperMax) {
352 Int_t nGlob=mul/fNperMax-nLocal+1;
355 for (i=0; i<mul; i++) {
362 if (nnew==nGlob) break;
366 for (i=0; i<mul; i++) { // Associate hits to peaks
369 if (isLocal[i]) continue;
370 for (j=0; j<nLocal; j++) {
371 Int_t il=indLocal[j];
372 Float_t d=TMath::Sqrt((x[i]-x[il])*(x[i]-x[il])
373 +(y[i]-y[il])*(y[i]-y[il]));
375 if (d<dmin) { // Select nearest peak
379 } else if (d==dmin) { // If more than one take highest peak
388 // One cluster for each maximum
389 for (j=0; j<nLocal; j++) {
390 AliRICHRawCluster cnew;
392 cnew.fNcluster[0]=-1;
393 cnew.fNcluster[1]=fNRawClusters;
395 cnew.fNcluster[0]=fNPeaks;
398 cnew.fIndexMap[0]=c->fIndexMap[indLocal[j]];
399 cnew.fMultiplicity=1;
400 for (i=0; i<mul; i++) {
401 if (isLocal[i]) continue;
402 if (associatePeak[i]==j) {
403 cnew.fIndexMap[cnew.fMultiplicity]=c->fIndexMap[i];
404 cnew.fMultiplicity++;
408 cnew.fClusterType=cnew.PhysicsContribution();
413 }//SplitByLocalMaxima(AliRICHRawCluster *c)
414 //__________________________________________________________________________________________________
415 void AliRICHClusterFinder::FillCluster(AliRICHRawCluster* c, Int_t flag)
416 {// Completes cluster information starting from list of digits
430 for (Int_t i=0; i<c->fMultiplicity; i++){
431 dig= (AliRICHDigit*)fDigits->UncheckedAt(c->fIndexMap[i]);
432 ix=dig->PadX()+c->fOffsetMap[i];
434 Int_t q=dig->Signal();
435 if (dig->Physics() >= dig->Signal()) {
437 } else if (dig->Physics() == 0) {
439 } else c->fPhysicsMap[i]=1;
440 // peak signal and track list
442 if (q>c->fPeakSignal) {
444 c->fTracks[0]=dig->Hit();
445 c->fTracks[1]=dig->Track(0);
446 c->fTracks[2]=dig->Track(1);
449 if (c->fContMap[i] > frac) {
452 c->fTracks[0]=dig->Hit();
453 c->fTracks[1]=dig->Track(0);
454 c->fTracks[2]=dig->Track(1);
458 fSegmentation->GetPadC(ix, iy, x, y, z);
464 } // loop over digits
469 c->fX=fSegmentation->GetAnod(c->fX);
471 // apply correction to the coordinate along the anode wire
474 Rich()->Param()->Local2Pad(x,y,ix,iy);
475 Rich()->Param()->Pad2Local(ix,iy,x,y);
476 Int_t isec=fSegmentation->Sector(ix,iy);
477 TF1* cogCorr = fSegmentation->CorrFunc(isec-1);
480 Float_t yOnPad=(c->fY-y)/fSegmentation->Dpy(isec);
481 c->fY=c->fY-cogCorr->Eval(yOnPad, 0, 0);
484 }//FillCluster(AliRICHRawCluster* c, Int_t flag)
485 //__________________________________________________________________________________________________
486 void AliRICHClusterFinder::AddDigit2Cluster(Int_t i, Int_t j, AliRICHRawCluster &c)
487 {//Find clusters Add i,j as element of the cluster
488 Info("AddDigit2Cluster","Start with digit(%i,%i)",i,j);
490 Int_t idx = fHitMap->GetHitIndex(i,j);
491 AliRICHDigit* dig = (AliRICHDigit*) fHitMap->GetHit(i,j);
492 Int_t q=dig->Signal();
493 if(q>TMath::Abs(c.fPeakSignal)){
495 c.fTracks[0]=dig->Hit();
496 c.fTracks[1]=dig->Track(0);
497 c.fTracks[2]=dig->Track(1);
499 // Make sure that list of digits is ordered
500 Int_t mu=c.fMultiplicity;
503 if (dig->Physics() >= dig->Signal()) {
505 } else if (dig->Physics() == 0) {
507 } else c.fPhysicsMap[mu]=1;
510 for (Int_t ind=mu-1; ind>=0; ind--) {
511 Int_t ist=(c.fIndexMap)[ind];
512 Int_t ql=((AliRICHDigit*)fDigits->UncheckedAt(ist))->Signal();
514 c.fIndexMap[ind]=idx;
515 c.fIndexMap[ind+1]=ist;
523 if (c.fMultiplicity >= 50 ) {
524 Info("AddDigit2CLuster","multiplicity >50 %d \n",c.fMultiplicity);
527 Float_t x,y;// Prepare center of gravity calculation
528 Rich()->Param()->Pad2Local(i,j,x,y);
529 c.fX+=q*x; c.fY+=q*y; c.fQ += q;
530 fHitMap->FlagHit(i,j);// Flag hit as taken
533 Int_t xList[4], yList[4]; // Now look recursively for all neighbours
534 for (Int_t iNei=0;iNei<Rich()->Param()->Neighbours(i,j,xList,yList);iNei++)
535 if(fHitMap->TestHit(xList[iNei],yList[iNei])==kUnused) AddDigit2Cluster(xList[iNei],yList[iNei],c);
536 }//AddDigit2Cluster()
537 //__________________________________________________________________________________________________
538 void AliRICHClusterFinder::FindRawClusters()
539 {//finds neighbours and fill the tree with raw clusters
540 Info("FindRawClusters","Start for Chamber %i.",fChamber);
544 fHitMap=new AliRICHMap(fDigits);
546 for(Int_t iDigN=0;iDigN<fNdigits;iDigN++){//digits loop
547 AliRICHDigit *dig=(AliRICHDigit*)fDigits->UncheckedAt(iDigN);
548 Int_t i=dig->PadX(); Int_t j=dig->PadY();
549 if(fHitMap->TestHit(i,j)==kUsed||fHitMap->TestHit(i,j)==kEmpty) continue;
552 c.fMultiplicity=0; c.fPeakSignal=dig->Signal();
553 c.fTracks[0]=dig->Hit();c.fTracks[1]=dig->Track(0);c.fTracks[2]=dig->Track(1);
554 c.fNcluster[0]=-1;// tag the beginning of cluster list in a raw cluster
556 AddDigit2Cluster(i,j,c);//form initial cluster
558 c.fX /= c.fQ; // center of gravity
559 //c.fX=fSegmentation->GetAnod(c.fX);
563 // Int_t ix,iy;// apply correction to the coordinate along the anode wire
564 // Float_t x=c.fX, y=c.fY;
565 // Rich()->Param()->Local2Pad(x,y,ix,iy);
566 // Rich()->Param()->Pad2Local(ix,iy,x,y);
567 // Int_t isec=fSegmentation->Sector(ix,iy);
568 // TF1* cogCorr=fSegmentation->CorrFunc(isec-1);
570 // Float_t yOnPad=(c.fY-y)/fSegmentation->Dpy(isec);
571 // c.fY=c.fY-cogCorr->Eval(yOnPad,0,0);
574 c.fNcluster[1]=fNRawClusters; c.fClusterType=c.PhysicsContribution();
580 c.fMultiplicity=0; for(int k=0;k<c.fMultiplicity;k++) c.fIndexMap[k]=0;//reset cluster object
583 Info("FindRawClusters","Stop.");
585 //__________________________________________________________________________________________________
586 void AliRICHClusterFinder::CalibrateCOG()
594 fSegmentation->GiveTestPoints(n, x, y);
595 for (i=0; i<n; i++) {
599 SinoidalFit(xtest, ytest, func);
600 if (func) fSegmentation->SetCorrFunc(i, new TF1(*func));
604 //__________________________________________________________________________________________________
605 void AliRICHClusterFinder::SinoidalFit(Float_t x, Float_t y, TF1 *func)
607 static Int_t count=0;
613 Float_t xg[kNs], yg[kNs], xrg[kNs], yrg[kNs];
614 Float_t xsig[kNs], ysig[kNs];
617 fSegmentation->GetPadI(x,y,0,ix,iy);
618 fSegmentation->GetPadC(ix,iy,x,y,z);
619 Int_t isec=fSegmentation->Sector(ix,iy);
621 Float_t xmin = x-fSegmentation->Dpx(isec)/2;
622 Float_t ymin = y-fSegmentation->Dpy(isec)/2;
624 // Integration Limits
625 Float_t dxI=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
626 Float_t dyI=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
636 Float_t dy=fSegmentation->Dpy(isec)/(kNs-1);
638 for (i=0; i<kNs; i++) {// Pad Loop
641 fSegmentation->SigGenInit(x, yscan, 0);
643 for (fSegmentation->FirstPad(x, yscan,0, dxI, dyI);
644 fSegmentation->MorePads();
645 fSegmentation->NextPad())
647 qp=fResponse->IntXY(fSegmentation);
651 Int_t ixs=fSegmentation->Ix();
652 Int_t iys=fSegmentation->Iy();
654 fSegmentation->GetPadC(ixs,iys,xs,ys,zs);
658 Float_t ycog=sum/qcheck;
659 yg[i]=(yscan-y)/fSegmentation->Dpy(isec);
660 yrg[i]=(ycog-y)/fSegmentation->Dpy(isec);
666 Float_t dx=fSegmentation->Dpx(isec)/(kNs-1);
668 for (i=0; i<kNs; i++) {// Pad Loop
671 fSegmentation->SigGenInit(xscan, y, 0);
673 for (fSegmentation->FirstPad(xscan, y, 0, dxI, dyI);
674 fSegmentation->MorePads();
675 fSegmentation->NextPad())
677 qp=fResponse->IntXY(fSegmentation);
681 Int_t ixs=fSegmentation->Ix();
682 Int_t iys=fSegmentation->Iy();
684 fSegmentation->GetPadC(ixs,iys,xs,ys,zs);
688 Float_t xcog=sum/qcheck;
689 xcog=fSegmentation->GetAnod(xcog);
691 xg[i]=(xscan-x)/fSegmentation->Dpx(isec);
692 xrg[i]=(xcog-x)/fSegmentation->Dpx(isec);
696 // Creates a Root function based on function sinoid above and perform the fit
697 TGraph *graphyr= new TGraph(kNs,yrg,ysig);
698 Double_t sinoid(Double_t *x, Double_t *par);
699 new TF1("sinoidf",sinoid,0.5,0.5,5);
700 graphyr->Fit("sinoidf","Q");
701 func = (TF1*)graphyr->GetListOfFunctions()->At(0);
703 //__________________________________________________________________________________________________
704 Double_t sinoid(Double_t *x, Double_t *par)
707 Double_t arg = -2*TMath::Pi()*x[0];
708 Double_t fitval= par[0]*TMath::Sin(arg)+
709 par[1]*TMath::Sin(2*arg)+
710 par[2]*TMath::Sin(3*arg)+
711 par[3]*TMath::Sin(4*arg)+
712 par[4]*TMath::Sin(5*arg);
715 //__________________________________________________________________________________________________
716 Double_t DoubleGauss(Double_t *x, Double_t *par)
717 {//Double gaussian function
718 Double_t arg1 = (x[0]-par[1])/0.18;
719 Double_t arg2 = (x[0]-par[3])/0.18;
720 return par[0]*TMath::Exp(-arg1*arg1/2)+par[2]*TMath::Exp(-arg2*arg2/2);
722 //__________________________________________________________________________________________________
723 Float_t DiscrCharge(Int_t i,Double_t *par)
725 // par[0] x-position of first cluster
726 // par[1] y-position of first cluster
727 // par[2] x-position of second cluster
728 // par[3] y-position of second cluster
729 // par[4] charge fraction of first cluster
730 // 1-par[4] charge fraction of second cluster
735 for (Int_t jbin=0; jbin<gNbins; jbin++) {
739 //printf("\n sum of charge from DiscrCharge %f\n", qtot);
740 gChargeTot=Int_t(qtot);
743 gSegmentation->SetPad(gix[i], giy[i]);
745 gSegmentation->SetHit(par[0],par[1],0);
746 Float_t q1=gResponse->IntXY(gSegmentation);
749 gSegmentation->SetHit(par[2],par[3],0);
750 Float_t q2=gResponse->IntXY(gSegmentation);
752 Float_t value = qtot*(par[4]*q1+(1.-par[4])*q2);
754 }//DiscrCharge(Int_t i,Double_t *par)
755 //__________________________________________________________________________________________________
756 void fcn(Int_t &npar, Double_t */*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
757 {// Minimisation function
765 for (i=0; i<gNbins; i++) {
766 Float_t q0=gCharge[i];
767 Float_t q1=DiscrCharge(i,par);
768 delta=(q0-q1)/TMath::Sqrt(q0);
773 chisq=chisq+=(qtot-qcont)*(qtot-qcont)*0.5;
776 //__________________________________________________________________________________________________
777 void AliRICHClusterFinder::Exec()
779 Info("Exec","Start.");
781 Rich()->GetLoader()->LoadDigits();
783 for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//events loop
784 gAlice->GetRunLoader()->GetEvent(iEventN);
786 Rich()->GetLoader()->MakeTree("R"); Rich()->MakeBranch("R");
787 Rich()->ResetDigitsOld(); Rich()->ResetRawClusters();
789 Rich()->GetLoader()->TreeD()->GetEntry(0);
790 for(fChamber=1;fChamber<=kNCH;fChamber++){//chambers loop
791 fDigits=Rich()->DigitsOld(fChamber); fNdigits=fDigits->GetEntries();
797 Rich()->GetLoader()->TreeR()->Fill();
798 Rich()->GetLoader()->WriteRecPoints("OVERWRITE");
800 Rich()->GetLoader()->UnloadDigits(); Rich()->GetLoader()->UnloadRecPoints();
801 Rich()->ResetDigitsOld(); Rich()->ResetRawClusters();
802 Info("Exec","Stop.");
804 //__________________________________________________________________________________________________