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 **************************************************************************/
21 #include "AliMUONClusterFinderVS.h"
22 #include "AliMUONDigit.h"
23 #include "AliMUONRawCluster.h"
24 #include "AliSegmentation.h"
25 #include "AliMUONResponse.h"
26 #include "AliMUONClusterInput.h"
27 #include "AliMUONHitMapA1.h"
29 //_____________________________________________________________________
30 // This function is minimized in the double-Mathieson fit
31 void fcnS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
32 void fcnS1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
33 void fcnCombiS1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
34 void fcnCombiS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
36 ClassImp(AliMUONClusterFinderVS)
38 AliMUONClusterFinderVS::AliMUONClusterFinderVS()
41 // Default constructor
42 fInput=AliMUONClusterInput::Instance();
45 fTrack[0]=fTrack[1]=-1;
46 fDebugLevel = 0; // make silent default
47 fGhostChi2Cut = 1e6; // nothing done by default
50 for(Int_t i=0; i<100; i++) {
51 for (Int_t j=0; j<2; j++) {
55 fRawClusters = new TClonesArray("AliMUONRawCluster",1000);
58 //____________________________________________________________________________
59 AliMUONClusterFinderVS::~AliMUONClusterFinderVS()
61 // Reset tracks information
64 fRawClusters->Delete();
69 AliMUONClusterFinderVS::AliMUONClusterFinderVS(const AliMUONClusterFinderVS & clusterFinder):TObject(clusterFinder)
71 // Protected copy constructor
73 Fatal("AliMUONClusterFinderAZModule", "Not implemented.");
75 //____________________________________________________________________________
76 void AliMUONClusterFinderVS::ResetRawClusters()
78 // Reset tracks information
80 if (fRawClusters) fRawClusters->Clear();
82 //____________________________________________________________________________
83 void AliMUONClusterFinderVS::Decluster(AliMUONRawCluster *cluster)
85 // Decluster by local maxima
86 SplitByLocalMaxima(cluster);
88 //____________________________________________________________________________
89 void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
91 // Split complex cluster by local maxima
94 fInput->SetCluster(c);
96 fMul[0]=c->GetMultiplicity(0);
97 fMul[1]=c->GetMultiplicity(1);
100 // dump digit information into arrays
105 for (cath=0; cath<2; cath++) {
107 for (i=0; i<fMul[cath]; i++)
110 fDig[i][cath]=fInput->Digit(cath, c->GetIndex(i, cath));
112 fIx[i][cath]= fDig[i][cath]->PadX();
113 fIy[i][cath]= fDig[i][cath]->PadY();
115 fQ[i][cath] = fDig[i][cath]->Signal();
116 // pad centre coordinates
118 GetPadC(fIx[i][cath], fIy[i][cath], fX[i][cath], fY[i][cath], fZ[i][cath]);
119 } // loop over cluster digits
120 } // loop over cathodes
126 // Initialise and perform mathieson fits
127 Float_t chi2, oldchi2;
128 // ++++++++++++++++++*************+++++++++++++++++++++
129 // (1) No more than one local maximum per cathode plane
130 // +++++++++++++++++++++++++++++++*************++++++++
131 if ((fNLocal[0]==1 && (fNLocal[1]==0 || fNLocal[1]==1)) ||
132 (fNLocal[0]==0 && fNLocal[1]==1)) {
133 // Perform combined single Mathieson fit
134 // Initial values for coordinates (x,y)
136 // One local maximum on cathodes 1 and 2 (X->cathode 2, Y->cathode 1)
137 if (fNLocal[0]==1 && fNLocal[1]==1) {
138 fXInit[0]=c->GetX(1);
139 fYInit[0]=c->GetY(0);
140 // One local maximum on cathode 1 (X,Y->cathode 1)
141 } else if (fNLocal[0]==1) {
142 fXInit[0]=c->GetX(0);
143 fYInit[0]=c->GetY(0);
144 // One local maximum on cathode 2 (X,Y->cathode 2)
146 fXInit[0]=c->GetX(1);
147 fYInit[0]=c->GetY(1);
150 fprintf(stderr,"\n cas (1) CombiSingleMathiesonFit(c)\n");
151 chi2=CombiSingleMathiesonFit(c);
152 // Int_t ndf = fgNbins[0]+fgNbins[1]-2;
153 // Float_t prob = TMath::Prob(Double_t(chi2),ndf);
154 // prob1->Fill(prob);
155 // chi2_1->Fill(chi2);
158 fprintf(stderr," chi2 %f ",chi2);
160 c->SetX(0, fXFit[0]);
161 c->SetY(0, fYFit[0]);
168 c->SetX(0, fSeg[0]->GetAnod(c->GetX(0)));
169 c->SetX(1, fSeg[1]->GetAnod(c->GetX(1)));
171 // If reasonable chi^2 add result to the list of rawclusters
174 // If not try combined double Mathieson Fit
177 fprintf(stderr," MAUVAIS CHI2 !!!\n");
178 if (fNLocal[0]==1 && fNLocal[1]==1) {
179 fXInit[0]=fX[fIndLocal[0][1]][1];
180 fYInit[0]=fY[fIndLocal[0][0]][0];
181 fXInit[1]=fX[fIndLocal[0][1]][1];
182 fYInit[1]=fY[fIndLocal[0][0]][0];
183 } else if (fNLocal[0]==1) {
184 fXInit[0]=fX[fIndLocal[0][0]][0];
185 fYInit[0]=fY[fIndLocal[0][0]][0];
186 fXInit[1]=fX[fIndLocal[0][0]][0];
187 fYInit[1]=fY[fIndLocal[0][0]][0];
189 fXInit[0]=fX[fIndLocal[0][1]][1];
190 fYInit[0]=fY[fIndLocal[0][1]][1];
191 fXInit[1]=fX[fIndLocal[0][1]][1];
192 fYInit[1]=fY[fIndLocal[0][1]][1];
195 // Initial value for charge ratios
199 fprintf(stderr,"\n cas (1) CombiDoubleMathiesonFit(c)\n");
200 chi2=CombiDoubleMathiesonFit(c);
201 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
202 // Float_t prob = TMath::Prob(chi2,ndf);
203 // prob2->Fill(prob);
204 // chi2_2->Fill(chi2);
206 // Was this any better ??
208 fprintf(stderr," Old and new chi2 %f %f ", oldchi2, chi2);
209 if (fFitStat!=0 && chi2>0 && (2.*chi2 < oldchi2)) {
211 fprintf(stderr," Split\n");
212 // Split cluster into two according to fit result
216 fprintf(stderr," Don't Split\n");
222 // +++++++++++++++++++++++++++++++++++++++
223 // (2) Two local maxima per cathode plane
224 // +++++++++++++++++++++++++++++++++++++++
225 } else if (fNLocal[0]==2 && fNLocal[1]==2) {
227 // Let's look for ghosts first
229 Float_t xm[4][2], ym[4][2];
230 Float_t dpx, dpy, dx, dy;
231 Int_t ixm[4][2], iym[4][2];
232 Int_t isec, im1, im2, ico;
234 // Form the 2x2 combinations
235 // 0-0, 0-1, 1-0, 1-1
237 for (im1=0; im1<2; im1++) {
238 for (im2=0; im2<2; im2++) {
239 xm[ico][0]=fX[fIndLocal[im1][0]][0];
240 ym[ico][0]=fY[fIndLocal[im1][0]][0];
241 xm[ico][1]=fX[fIndLocal[im2][1]][1];
242 ym[ico][1]=fY[fIndLocal[im2][1]][1];
244 ixm[ico][0]=fIx[fIndLocal[im1][0]][0];
245 iym[ico][0]=fIy[fIndLocal[im1][0]][0];
246 ixm[ico][1]=fIx[fIndLocal[im2][1]][1];
247 iym[ico][1]=fIy[fIndLocal[im2][1]][1];
251 // ico = 0 : first local maximum on cathodes 1 and 2
252 // ico = 1 : fisrt local maximum on cathode 1 and second on cathode 2
253 // ico = 2 : second local maximum on cathode 1 and first on cathode 1
254 // ico = 3 : second local maximum on cathodes 1 and 2
256 // Analyse the combinations and keep those that are possible !
257 // For each combination check consistency in x and y
260 Float_t dr[4] = {1.e4, 1.e4, 1.e4, 1.e4};
263 // In case of staggering maxima are displaced by exactly half the pad-size in y.
264 // We have to take into account the numerical precision in the consistency check;
267 for (ico=0; ico<4; ico++) {
268 accepted[ico]=kFALSE;
269 // cathode one: x-coordinate
270 isec=fSeg[0]->Sector(ixm[ico][0], iym[ico][0]);
271 dpx=fSeg[0]->Dpx(isec)/2.;
272 dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
273 // cathode two: y-coordinate
274 isec=fSeg[1]->Sector(ixm[ico][1], iym[ico][1]);
275 dpy=fSeg[1]->Dpy(isec)/2.;
276 dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
278 printf("\n %i %f %f %f %f %f %f \n", ico, ym[ico][0], ym[ico][1], dy, dpy, dx, dpx );
279 if ((dx <= dpx) && (dy <= dpy+eps)) {
282 dr[ico] = TMath::Sqrt(dx*dx+dy*dy);
286 accepted[ico]=kFALSE;
290 printf("\n iacc= %d:\n", iacc);
292 if (accepted[0] && accepted[1]) {
293 if (dr[0] >= dr[1]) {
300 if (accepted[2] && accepted[3]) {
301 if (dr[2] >= dr[3]) {
308 // eliminate one candidate
312 for (ico=0; ico<4; ico++) {
313 if (accepted[ico] && dr[ico] > drmax) {
319 accepted[icobad] = kFALSE;
326 printf("\n iacc= %d:\n", iacc);
328 fprintf(stderr,"\n iacc=2: No problem ! \n");
329 } else if (iacc==4) {
330 fprintf(stderr,"\n iacc=4: Ok, but ghost problem !!! \n");
331 } else if (iacc==0) {
332 fprintf(stderr,"\n iacc=0: I don't know what to do with this !!!!!!!!! \n");
336 // Initial value for charge ratios
337 fQrInit[0]=Float_t(fQ[fIndLocal[0][0]][0])/
338 Float_t(fQ[fIndLocal[0][0]][0]+fQ[fIndLocal[1][0]][0]);
339 fQrInit[1]=Float_t(fQ[fIndLocal[0][1]][1])/
340 Float_t(fQ[fIndLocal[0][1]][1]+fQ[fIndLocal[1][1]][1]);
342 // ******* iacc = 0 *******
343 // No combinations found between the 2 cathodes
344 // We keep the center of gravity of the cluster
349 // ******* iacc = 1 *******
350 // Only one combination found between the 2 cathodes
352 // Initial values for the 2 maxima (x,y)
354 // 1 maximum is initialised with the maximum of the combination found (X->cathode 2, Y->cathode 1)
355 // 1 maximum is initialised with the other maximum of the first cathode
357 if (fDebugLevel) fprintf(stderr,"ico=0\n");
362 } else if (accepted[1]){
363 if (fDebugLevel) fprintf(stderr,"ico=1\n");
368 } else if (accepted[2]){
369 if (fDebugLevel) fprintf(stderr,"ico=2\n");
374 } else if (accepted[3]){
375 if (fDebugLevel) fprintf(stderr,"ico=3\n");
382 fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
383 chi2=CombiDoubleMathiesonFit(c);
384 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
385 // Float_t prob = TMath::Prob(chi2,ndf);
386 // prob2->Fill(prob);
387 // chi2_2->Fill(chi2);
389 fprintf(stderr," chi2 %f\n",chi2);
391 // If reasonable chi^2 add result to the list of rawclusters
396 // 1 maximum is initialised with the maximum of the combination found (X->cathode 2, Y->cathode 1)
397 // 1 maximum is initialised with the other maximum of the second cathode
399 if (fDebugLevel) fprintf(stderr,"ico=0\n");
404 } else if (accepted[1]){
405 if (fDebugLevel) fprintf(stderr,"ico=1\n");
410 } else if (accepted[2]){
411 if (fDebugLevel) fprintf(stderr,"ico=2\n");
416 } else if (accepted[3]){
417 if (fDebugLevel) fprintf(stderr,"ico=3\n");
424 fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
425 chi2=CombiDoubleMathiesonFit(c);
426 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
427 // Float_t prob = TMath::Prob(chi2,ndf);
428 // prob2->Fill(prob);
429 // chi2_2->Fill(chi2);
431 fprintf(stderr," chi2 %f\n",chi2);
433 // If reasonable chi^2 add result to the list of rawclusters
437 //We keep only the combination found (X->cathode 2, Y->cathode 1)
438 for (Int_t ico=0; ico<2; ico++) {
440 AliMUONRawCluster cnew;
442 for (cath=0; cath<2; cath++) {
443 cnew.SetX(cath, Float_t(xm[ico][1]));
444 cnew.SetY(cath, Float_t(ym[ico][0]));
445 cnew.SetZ(cath, fZPlane);
447 cnew.SetMultiplicity(cath,c->GetMultiplicity(cath));
448 for (i=0; i<fMul[cath]; i++) {
449 cnew.SetIndex(i, cath, c->GetIndex(i,cath));
450 fSeg[cath]->SetPad(fIx[i][cath], fIy[i][cath]);
453 fprintf(stderr,"\nRawCluster %d cath %d\n",ico,cath);
454 fprintf(stderr,"mult_av %d\n",c->GetMultiplicity(cath));
456 FillCluster(&cnew,cath);
458 cnew.SetClusterType(cnew.PhysicsContribution());
467 // ******* iacc = 2 *******
468 // Two combinations found between the 2 cathodes
470 // Was the same maximum taken twice
471 if ((accepted[0]&&accepted[1]) || (accepted[2]&&accepted[3])) {
472 if (fDebugLevel) fprintf(stderr,"\n Maximum taken twice !!!\n");
474 // Have a try !! with that
475 if (accepted[0]&&accepted[3]) {
487 fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
488 chi2=CombiDoubleMathiesonFit(c);
489 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
490 // Float_t prob = TMath::Prob(chi2,ndf);
491 // prob2->Fill(prob);
492 // chi2_2->Fill(chi2);
496 // No ghosts ! No Problems ! - Perform one fit only !
497 if (accepted[0]&&accepted[3]) {
509 fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
510 chi2=CombiDoubleMathiesonFit(c);
511 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
512 // Float_t prob = TMath::Prob(chi2,ndf);
513 // prob2->Fill(prob);
514 // chi2_2->Fill(chi2);
516 fprintf(stderr," chi2 %f\n",chi2);
520 // ******* iacc = 4 *******
521 // Four combinations found between the 2 cathodes
523 } else if (iacc==4) {
524 // Perform fits for the two possibilities !!
525 // Accept if charges are compatible on both cathodes
526 // If none are compatible, keep everything
532 fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
533 chi2=CombiDoubleMathiesonFit(c);
534 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
535 // Float_t prob = TMath::Prob(chi2,ndf);
536 // prob2->Fill(prob);
537 // chi2_2->Fill(chi2);
539 fprintf(stderr," chi2 %f\n",chi2);
540 // store results of fit and postpone decision
541 Double_t sXFit[2],sYFit[2],sQrFit[2];
543 for (Int_t i=0;i<2;i++) {
554 fprintf(stderr,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
555 chi2=CombiDoubleMathiesonFit(c);
556 // ndf = fgNbins[0]+fgNbins[1]-6;
557 // prob = TMath::Prob(chi2,ndf);
558 // prob2->Fill(prob);
559 // chi2_2->Fill(chi2);
561 fprintf(stderr," chi2 %f\n",chi2);
562 // We have all informations to perform the decision
563 // Compute the chi2 for the 2 possibilities
564 Float_t chi2fi,chi2si,chi2f,chi2s;
566 chi2f = (TMath::Log(fInput->TotalCharge(0)*fQrFit[0]
567 / (fInput->TotalCharge(1)*fQrFit[1]) )
568 / fInput->Response()->ChargeCorrel() );
570 chi2fi = (TMath::Log(fInput->TotalCharge(0)*(1-fQrFit[0])
571 / (fInput->TotalCharge(1)*(1-fQrFit[1])) )
572 / fInput->Response()->ChargeCorrel() );
573 chi2f += chi2fi*chi2fi;
575 chi2s = (TMath::Log(fInput->TotalCharge(0)*sQrFit[0]
576 / (fInput->TotalCharge(1)*sQrFit[1]) )
577 / fInput->Response()->ChargeCorrel() );
579 chi2si = (TMath::Log(fInput->TotalCharge(0)*(1-sQrFit[0])
580 / (fInput->TotalCharge(1)*(1-sQrFit[1])) )
581 / fInput->Response()->ChargeCorrel() );
582 chi2s += chi2si*chi2si;
584 // usefull to store the charge matching chi2 in the cluster
585 // fChi2[0]=sChi2[1]=chi2f;
586 // fChi2[1]=sChi2[0]=chi2s;
588 if (chi2f<=fGhostChi2Cut && chi2s<=fGhostChi2Cut)
590 if (chi2f>fGhostChi2Cut && chi2s>fGhostChi2Cut) {
596 if (chi2f<=fGhostChi2Cut)
598 if (chi2s<=fGhostChi2Cut) {
599 // retreive saved values
600 for (Int_t i=0;i<2;i++) {
611 } else if (fNLocal[0]==2 && fNLocal[1]==1) {
612 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
613 // (3) Two local maxima on cathode 1 and one maximum on cathode 2
614 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
616 Float_t xm[4][2], ym[4][2];
617 Float_t dpx, dpy, dx, dy;
618 Int_t ixm[4][2], iym[4][2];
619 Int_t isec, im1, ico;
621 // Form the 2x2 combinations
622 // 0-0, 0-1, 1-0, 1-1
624 for (im1=0; im1<2; im1++) {
625 xm[ico][0]=fX[fIndLocal[im1][0]][0];
626 ym[ico][0]=fY[fIndLocal[im1][0]][0];
627 xm[ico][1]=fX[fIndLocal[0][1]][1];
628 ym[ico][1]=fY[fIndLocal[0][1]][1];
630 ixm[ico][0]=fIx[fIndLocal[im1][0]][0];
631 iym[ico][0]=fIy[fIndLocal[im1][0]][0];
632 ixm[ico][1]=fIx[fIndLocal[0][1]][1];
633 iym[ico][1]=fIy[fIndLocal[0][1]][1];
636 // ico = 0 : first local maximum on cathodes 1 and 2
637 // ico = 1 : second local maximum on cathode 1 and first on cathode 2
639 // Analyse the combinations and keep those that are possible !
640 // For each combination check consistency in x and y
644 // In case of staggering maxima are displaced by exactly half the pad-size in y.
645 // We have to take into account the numerical precision in the consistency check;
649 for (ico=0; ico<2; ico++) {
650 accepted[ico]=kFALSE;
651 isec=fSeg[0]->Sector(ixm[ico][0], iym[ico][0]);
652 dpx=fSeg[0]->Dpx(isec)/2.;
653 dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
654 isec=fSeg[1]->Sector(ixm[ico][1], iym[ico][1]);
655 dpy=fSeg[1]->Dpy(isec)/2.;
656 dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
658 printf("\n %i %f %f %f %f \n", ico, ym[ico][0], ym[ico][1], dy, dpy );
659 if ((dx <= dpx) && (dy <= dpy+eps)) {
665 accepted[ico]=kFALSE;
673 // Initial value for charge ratios
674 fQrInit[0]=Float_t(fQ[fIndLocal[0][0]][0])/
675 Float_t(fQ[fIndLocal[0][0]][0]+fQ[fIndLocal[1][0]][0]);
676 fQrInit[1]=fQrInit[0];
678 if (accepted[0] && accepted[1]) {
680 fXInit[0]=0.5*(xm[0][1]+xm[0][0]);
682 fXInit[1]=0.5*(xm[0][1]+xm[1][0]);
686 chi23=CombiDoubleMathiesonFit(c);
695 } else if (accepted[0]) {
700 chi21=CombiDoubleMathiesonFit(c);
701 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
702 // Float_t prob = TMath::Prob(chi2,ndf);
703 // prob2->Fill(prob);
704 // chi2_2->Fill(chi21);
706 fprintf(stderr," chi2 %f\n",chi21);
707 if (chi21<10) Split(c);
708 } else if (accepted[1]) {
713 chi22=CombiDoubleMathiesonFit(c);
714 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
715 // Float_t prob = TMath::Prob(chi2,ndf);
716 // prob2->Fill(prob);
717 // chi2_2->Fill(chi22);
719 fprintf(stderr," chi2 %f\n",chi22);
720 if (chi22<10) Split(c);
723 if (chi21 > 10 && chi22 > 10 && chi23 > 10) {
724 // We keep only the combination found (X->cathode 2, Y->cathode 1)
725 for (Int_t ico=0; ico<2; ico++) {
727 AliMUONRawCluster cnew;
729 for (cath=0; cath<2; cath++) {
730 cnew.SetX(cath, Float_t(xm[ico][1]));
731 cnew.SetY(cath, Float_t(ym[ico][0]));
732 cnew.SetZ(cath, fZPlane);
733 cnew.SetMultiplicity(cath, c->GetMultiplicity(cath));
734 for (i=0; i<fMul[cath]; i++) {
735 cnew.SetIndex(i, cath, c->GetIndex(i, cath));
736 fSeg[cath]->SetPad(fIx[i][cath], fIy[i][cath]);
739 fprintf(stderr,"\nRawCluster %d cath %d\n",ico,cath);
740 fprintf(stderr,"mult_av %d\n",c->GetMultiplicity(cath));
742 FillCluster(&cnew,cath);
744 cnew.SetClusterType(cnew.PhysicsContribution());
751 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
752 // (3') One local maximum on cathode 1 and two maxima on cathode 2
753 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
754 } else if (fNLocal[0]==1 && fNLocal[1]==2) {
755 Float_t xm[4][2], ym[4][2];
756 Float_t dpx, dpy, dx, dy;
757 Int_t ixm[4][2], iym[4][2];
758 Int_t isec, im1, ico;
760 // Form the 2x2 combinations
761 // 0-0, 0-1, 1-0, 1-1
763 for (im1=0; im1<2; im1++) {
764 xm[ico][0]=fX[fIndLocal[0][0]][0];
765 ym[ico][0]=fY[fIndLocal[0][0]][0];
766 xm[ico][1]=fX[fIndLocal[im1][1]][1];
767 ym[ico][1]=fY[fIndLocal[im1][1]][1];
769 ixm[ico][0]=fIx[fIndLocal[0][0]][0];
770 iym[ico][0]=fIy[fIndLocal[0][0]][0];
771 ixm[ico][1]=fIx[fIndLocal[im1][1]][1];
772 iym[ico][1]=fIy[fIndLocal[im1][1]][1];
775 // ico = 0 : first local maximum on cathodes 1 and 2
776 // ico = 1 : first local maximum on cathode 1 and second on cathode 2
778 // Analyse the combinations and keep those that are possible !
779 // For each combination check consistency in x and y
783 // In case of staggering maxima are displaced by exactly half the pad-size in y.
784 // We have to take into account the numerical precision in the consistency check;
788 for (ico=0; ico<2; ico++) {
789 accepted[ico]=kFALSE;
790 isec=fSeg[0]->Sector(ixm[ico][0], iym[ico][0]);
791 dpx=fSeg[0]->Dpx(isec)/2.;
792 dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
793 isec=fSeg[1]->Sector(ixm[ico][1], iym[ico][1]);
794 dpy=fSeg[1]->Dpy(isec)/2.;
795 dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
797 printf("\n %i %f %f %f %f \n", ico, ym[ico][0], ym[ico][1], dy, dpy );
798 if ((dx <= dpx) && (dy <= dpy+eps)) {
801 if (fDebugLevel) fprintf(stderr,"ico %d\n",ico);
805 accepted[ico]=kFALSE;
813 fQrInit[1]=Float_t(fQ[fIndLocal[0][1]][1])/
814 Float_t(fQ[fIndLocal[0][1]][1]+fQ[fIndLocal[1][1]][1]);
816 fQrInit[0]=fQrInit[1];
819 if (accepted[0] && accepted[1]) {
821 fYInit[0]=0.5*(ym[0][0]+ym[0][1]);
823 fYInit[1]=0.5*(ym[0][0]+ym[1][1]);
826 chi23=CombiDoubleMathiesonFit(c);
835 } else if (accepted[0]) {
840 chi21=CombiDoubleMathiesonFit(c);
841 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
842 // Float_t prob = TMath::Prob(chi2,ndf);
843 // prob2->Fill(prob);
844 // chi2_2->Fill(chi21);
846 fprintf(stderr," chi2 %f\n",chi21);
847 if (chi21<10) Split(c);
848 } else if (accepted[1]) {
853 chi22=CombiDoubleMathiesonFit(c);
854 // Int_t ndf = fgNbins[0]+fgNbins[1]-6;
855 // Float_t prob = TMath::Prob(chi2,ndf);
856 // prob2->Fill(prob);
857 // chi2_2->Fill(chi22);
859 fprintf(stderr," chi2 %f\n",chi22);
860 if (chi22<10) Split(c);
863 if (chi21 > 10 && chi22 > 10 && chi23 > 10) {
864 //We keep only the combination found (X->cathode 2, Y->cathode 1)
865 for (Int_t ico=0; ico<2; ico++) {
867 AliMUONRawCluster cnew;
869 for (cath=0; cath<2; cath++) {
870 cnew.SetX(cath, Float_t(xm[ico][1]));
871 cnew.SetY(cath, Float_t(ym[ico][0]));
872 cnew.SetZ(cath, fZPlane);
873 cnew.SetMultiplicity(cath, c->GetMultiplicity(cath));
874 for (i=0; i<fMul[cath]; i++) {
875 cnew.SetIndex(i, cath, c->GetIndex(i, cath));
876 fSeg[cath]->SetPad(fIx[i][cath], fIy[i][cath]);
879 fprintf(stderr,"\nRawCluster %d cath %d\n",ico,cath);
880 fprintf(stderr,"mult_av %d\n",c->GetMultiplicity(cath));
882 FillCluster(&cnew,cath);
884 cnew.SetClusterType(cnew.PhysicsContribution());
891 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
892 // (4) At least three local maxima on cathode 1 or on cathode 2
893 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
894 } else if (fNLocal[0]>2 || fNLocal[1]>2) {
895 Int_t param = fNLocal[0]*fNLocal[1];
898 Float_t ** xm = new Float_t * [param];
899 for (ii=0; ii<param; ii++) xm[ii]=new Float_t [2];
900 Float_t ** ym = new Float_t * [param];
901 for (ii=0; ii<param; ii++) ym[ii]=new Float_t [2];
902 Int_t ** ixm = new Int_t * [param];
903 for (ii=0; ii<param; ii++) ixm[ii]=new Int_t [2];
904 Int_t ** iym = new Int_t * [param];
905 for (ii=0; ii<param; ii++) iym[ii]=new Int_t [2];
908 Float_t dpx, dpy, dx, dy;
911 for (Int_t im1=0; im1<fNLocal[0]; im1++) {
912 for (Int_t im2=0; im2<fNLocal[1]; im2++) {
913 xm[ico][0]=fX[fIndLocal[im1][0]][0];
914 ym[ico][0]=fY[fIndLocal[im1][0]][0];
915 xm[ico][1]=fX[fIndLocal[im2][1]][1];
916 ym[ico][1]=fY[fIndLocal[im2][1]][1];
918 ixm[ico][0]=fIx[fIndLocal[im1][0]][0];
919 iym[ico][0]=fIy[fIndLocal[im1][0]][0];
920 ixm[ico][1]=fIx[fIndLocal[im2][1]][1];
921 iym[ico][1]=fIy[fIndLocal[im2][1]][1];
928 fprintf(stderr,"nIco %d\n",nIco);
929 for (ico=0; ico<nIco; ico++) {
931 fprintf(stderr,"ico = %d\n",ico);
932 isec=fSeg[0]->Sector(ixm[ico][0], iym[ico][0]);
933 dpx=fSeg[0]->Dpx(isec)/2.;
934 dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
935 isec=fSeg[1]->Sector(ixm[ico][1], iym[ico][1]);
936 dpy=fSeg[1]->Dpy(isec)/2.;
937 dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
939 fprintf(stderr,"dx %f dpx %f dy %f dpy %f\n",dx,dpx,dy,dpy);
940 fprintf(stderr," X %f Y %f\n",xm[ico][1],ym[ico][0]);
942 if ((dx <= dpx) && (dy <= dpy)) {
944 fprintf(stderr,"ok\n");
946 AliMUONRawCluster cnew;
947 for (cath=0; cath<2; cath++) {
948 cnew.SetX(cath, Float_t(xm[ico][1]));
949 cnew.SetY(cath, Float_t(ym[ico][0]));
950 cnew.SetZ(cath, fZPlane);
951 cnew.SetMultiplicity(cath, c->GetMultiplicity(cath));
952 for (i=0; i<fMul[cath]; i++) {
953 cnew.SetIndex(i, cath, c->GetIndex(i, cath));
954 fSeg[cath]->SetPad(fIx[i][cath], fIy[i][cath]);
956 FillCluster(&cnew,cath);
958 cnew.SetClusterType(cnew.PhysicsContribution());
970 void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* /*c*/)
972 // Find all local maxima of a cluster
974 printf("\n Find Local maxima !");
978 Int_t cath, cath1; // loops over cathodes
979 Int_t i; // loops over digits
980 Int_t j; // loops over cathodes
984 // counters for number of local maxima
985 fNLocal[0]=fNLocal[1]=0;
986 // flags digits as local maximum
987 Bool_t isLocal[100][2];
988 for (i=0; i<100;i++) {
989 isLocal[i][0]=isLocal[i][1]=kFALSE;
991 // number of next neighbours and arrays to store them
994 // loop over cathodes
995 for (cath=0; cath<2; cath++) {
996 // loop over cluster digits
997 for (i=0; i<fMul[cath]; i++) {
998 // get neighbours for that digit and assume that it is local maximum
999 fSeg[cath]->Neighbours(fIx[i][cath], fIy[i][cath], &nn, x, y);
1000 isLocal[i][cath]=kTRUE;
1001 Int_t isec= fSeg[cath]->Sector(fIx[i][cath], fIy[i][cath]);
1002 Float_t a0 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
1003 // loop over next neighbours, if at least one neighbour has higher charger assumption
1004 // digit is not local maximum
1005 for (j=0; j<nn; j++) {
1006 if (fHitMap[cath]->TestHit(x[j], y[j])==kEmpty) continue;
1007 digt=(AliMUONDigit*) fHitMap[cath]->GetHit(x[j], y[j]);
1008 isec=fSeg[cath]->Sector(x[j], y[j]);
1009 Float_t a1 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
1010 if (digt->Signal()/a1 > fQ[i][cath]/a0) {
1011 isLocal[i][cath]=kFALSE;
1014 // handle special case of neighbouring pads with equal signal
1015 } else if (digt->Signal() == fQ[i][cath]) {
1016 if (fNLocal[cath]>0) {
1017 for (Int_t k=0; k<fNLocal[cath]; k++) {
1018 if (x[j]==fIx[fIndLocal[k][cath]][cath]
1019 && y[j]==fIy[fIndLocal[k][cath]][cath])
1021 isLocal[i][cath]=kFALSE;
1023 } // loop over local maxima
1024 } // are there already local maxima
1026 } // loop over next neighbours
1027 if (isLocal[i][cath]) {
1028 fIndLocal[fNLocal[cath]][cath]=i;
1031 } // loop over all digits
1032 } // loop over cathodes
1035 printf("\n Found %d %d %d %d local Maxima\n",
1036 fNLocal[0], fNLocal[1], fMul[0], fMul[1]);
1037 fprintf(stderr,"\n Cathode 1 local Maxima %d Multiplicite %d\n",fNLocal[0], fMul[0]);
1038 fprintf(stderr," Cathode 2 local Maxima %d Multiplicite %d\n",fNLocal[1], fMul[1]);
1044 if (fNLocal[1]==2 && (fNLocal[0]==1 || fNLocal[0]==0)) {
1045 Int_t iback=fNLocal[0];
1047 // Two local maxima on cathode 2 and one maximum on cathode 1
1048 // Look for local maxima considering up and down neighbours on the 1st cathode only
1050 // Loop over cluster digits
1054 for (i=0; i<fMul[cath]; i++) {
1055 isec=fSeg[cath]->Sector(fIx[i][cath],fIy[i][cath]);
1056 dpy=fSeg[cath]->Dpy(isec);
1057 dpx=fSeg[cath]->Dpx(isec);
1058 if (isLocal[i][cath]) continue;
1059 // Pad position should be consistent with position of local maxima on the opposite cathode
1060 if ((TMath::Abs(fX[i][cath]-fX[fIndLocal[0][cath1]][cath1]) > dpx/2.) &&
1061 (TMath::Abs(fX[i][cath]-fX[fIndLocal[1][cath1]][cath1]) > dpx/2.))
1064 // get neighbours for that digit and assume that it is local maximum
1065 isLocal[i][cath]=kTRUE;
1066 // compare signal to that on the two neighbours on the left and on the right
1067 // iNN counts the number of neighbours with signal, it should be 1 or 2
1071 ->FirstPad(fX[i][cath], fY[i][cath], fZPlane, 0., dpy);
1077 ix = fSeg[cath]->Ix();
1078 iy = fSeg[cath]->Iy();
1079 // skip the current pad
1080 if (iy == fIy[i][cath]) continue;
1082 if (fHitMap[cath]->TestHit(ix, iy)!=kEmpty) {
1084 digt=(AliMUONDigit*) fHitMap[cath]->GetHit(ix,iy);
1085 if (digt->Signal() > fQ[i][cath]) isLocal[i][cath]=kFALSE;
1087 } // Loop over pad neighbours in y
1088 if (isLocal[i][cath] && iNN>0) {
1089 fIndLocal[fNLocal[cath]][cath]=i;
1092 } // loop over all digits
1093 // if one additional maximum has been found we are happy
1094 // if more maxima have been found restore the previous situation
1097 "\n New search gives %d local maxima for cathode 1 \n",
1100 " %d local maxima for cathode 2 \n",
1103 if (fNLocal[cath]>2) {
1104 fNLocal[cath]=iback;
1107 } // 1,2 local maxima
1109 if (fNLocal[0]==2 && (fNLocal[1]==1 || fNLocal[1]==0)) {
1110 Int_t iback=fNLocal[1];
1112 // Two local maxima on cathode 1 and one maximum on cathode 2
1113 // Look for local maxima considering left and right neighbours on the 2nd cathode only
1116 Float_t eps = 1.e-5;
1119 // Loop over cluster digits
1120 for (i=0; i<fMul[cath]; i++) {
1121 isec=fSeg[cath]->Sector(fIx[i][cath],fIy[i][cath]);
1122 dpx=fSeg[cath]->Dpx(isec);
1123 dpy=fSeg[cath]->Dpy(isec);
1124 if (isLocal[i][cath]) continue;
1125 // Pad position should be consistent with position of local maxima on the opposite cathode
1126 if ((TMath::Abs(fY[i][cath]-fY[fIndLocal[0][cath1]][cath1]) > dpy/2.+eps) &&
1127 (TMath::Abs(fY[i][cath]-fY[fIndLocal[1][cath1]][cath1]) > dpy/2.+eps))
1131 // get neighbours for that digit and assume that it is local maximum
1132 isLocal[i][cath]=kTRUE;
1133 // compare signal to that on the two neighbours on the left and on the right
1135 // iNN counts the number of neighbours with signal, it should be 1 or 2
1138 ->FirstPad(fX[i][cath], fY[i][cath], fZPlane, dpx, 0.);
1145 ix = fSeg[cath]->Ix();
1146 iy = fSeg[cath]->Iy();
1148 // skip the current pad
1149 if (ix == fIx[i][cath]) continue;
1151 if (fHitMap[cath]->TestHit(ix, iy)!=kEmpty) {
1153 digt=(AliMUONDigit*) fHitMap[cath]->GetHit(ix,iy);
1154 if (digt->Signal() > fQ[i][cath]) isLocal[i][cath]=kFALSE;
1156 } // Loop over pad neighbours in x
1157 if (isLocal[i][cath] && iNN>0) {
1158 fIndLocal[fNLocal[cath]][cath]=i;
1161 } // loop over all digits
1162 // if one additional maximum has been found we are happy
1163 // if more maxima have been found restore the previous situation
1165 fprintf(stderr,"\n New search gives %d local maxima for cathode 1 \n",fNLocal[0]);
1166 fprintf(stderr,"\n %d local maxima for cathode 2 \n",fNLocal[1]);
1167 printf("\n New search gives %d %d \n",fNLocal[0],fNLocal[1]);
1169 if (fNLocal[cath]>2) {
1170 fNLocal[cath]=iback;
1172 } // 2,1 local maxima
1176 void AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t flag, Int_t cath)
1179 // Completes cluster information starting from list of digits
1186 c->SetPeakSignal(cath,c->GetPeakSignal(0));
1188 c->SetPeakSignal(cath,0);
1195 c->SetCharge(cath,0);
1199 fprintf(stderr,"\n fPeakSignal %d\n",c->GetPeakSignal(cath));
1200 for (Int_t i=0; i<c->GetMultiplicity(cath); i++)
1202 dig= fInput->Digit(cath,c->GetIndex(i,cath));
1203 ix=dig->PadX()+c->GetOffset(i,cath);
1205 Int_t q=dig->Signal();
1206 if (!flag) q=Int_t(q*c->GetContrib(i,cath));
1207 // fprintf(stderr,"q %d c->fPeakSignal[ %d ] %d\n",q,cath,c->fPeakSignal[cath]);
1208 if (dig->Physics() >= dig->Signal()) {
1210 } else if (dig->Physics() == 0) {
1212 } else c->SetPhysics(i,1);
1216 fprintf(stderr,"q %d c->fPeakSignal[cath] %d\n",q,c->GetPeakSignal(cath));
1217 // peak signal and track list
1218 if (q>c->GetPeakSignal(cath)) {
1219 c->SetPeakSignal(cath, q);
1220 c->SetTrack(0,dig->Hit());
1221 c->SetTrack(1,dig->Track(0));
1222 c->SetTrack(2,dig->Track(1));
1223 // fprintf(stderr," c->fTracks[0] %d c->fTracks[1] %d\n",dig->fHit,dig->fTracks[0]);
1227 fSeg[cath]->GetPadC(ix, iy, x, y, z);
1230 c->AddCharge(cath, q);
1232 } // loop over digits
1234 fprintf(stderr," fin du cluster c\n");
1238 c->SetX(cath, c->GetX(cath)/c->GetCharge(cath));
1240 c->SetX(cath, fSeg[cath]->GetAnod(c->GetX(cath)));
1241 c->SetY(cath, c->GetY(cath)/c->GetCharge(cath));
1243 // apply correction to the coordinate along the anode wire
1247 fSeg[cath]->GetPadI(x, y, fZPlane, ix, iy);
1248 fSeg[cath]->GetPadC(ix, iy, x, y, z);
1249 Int_t isec=fSeg[cath]->Sector(ix,iy);
1250 TF1* cogCorr = fSeg[cath]->CorrFunc(isec-1);
1253 Float_t yOnPad=(c->GetY(cath)-y)/fSeg[cath]->Dpy(isec);
1254 c->SetY(cath, c->GetY(cath)-cogCorr->Eval(yOnPad, 0, 0));
1259 void AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t cath)
1262 // Completes cluster information starting from list of digits
1272 Float_t xpad, ypad, zpad;
1275 for (Int_t i=0; i<c->GetMultiplicity(cath); i++)
1277 dig = fInput->Digit(cath,c->GetIndex(i,cath));
1279 GetPadC(dig->PadX(),dig->PadY(),xpad,ypad, zpad);
1281 fprintf(stderr,"x %f y %f cx %f cy %f\n",xpad,ypad,c->GetX(0),c->GetY(0));
1282 dx = xpad - c->GetX(0);
1283 dy = ypad - c->GetY(0);
1284 dr = TMath::Sqrt(dx*dx+dy*dy);
1289 fprintf(stderr," dr %f\n",dr);
1290 Int_t q=dig->Signal();
1291 if (dig->Physics() >= dig->Signal()) {
1293 } else if (dig->Physics() == 0) {
1295 } else c->SetPhysics(i,1);
1296 c->SetPeakSignal(cath,q);
1297 c->SetTrack(0,dig->Hit());
1298 c->SetTrack(1,dig->Track(0));
1299 c->SetTrack(2,dig->Track(1));
1301 fprintf(stderr," c->fTracks[0] %d c->fTracks[1] %d\n",dig->Hit(),
1305 } // loop over digits
1307 // apply correction to the coordinate along the anode wire
1309 c->SetX(cath,fSeg[cath]->GetAnod(c->GetX(cath)));
1312 void AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONRawCluster &c){
1316 // Find a super cluster on both cathodes
1319 // Add i,j as element of the cluster
1322 Int_t idx = fHitMap[cath]->GetHitIndex(i,j);
1323 AliMUONDigit* dig = (AliMUONDigit*) fHitMap[cath]->GetHit(i,j);
1324 Int_t q=dig->Signal();
1325 Int_t theX=dig->PadX();
1326 Int_t theY=dig->PadY();
1328 if (q > TMath::Abs(c.GetPeakSignal(0)) && q > TMath::Abs(c.GetPeakSignal(1))) {
1329 c.SetPeakSignal(cath,q);
1330 c.SetTrack(0,dig->Hit());
1331 c.SetTrack(1,dig->Track(0));
1332 c.SetTrack(2,dig->Track(1));
1336 // Make sure that list of digits is ordered
1338 Int_t mu=c.GetMultiplicity(cath);
1339 c.SetIndex(mu, cath, idx);
1341 if (dig->Physics() >= dig->Signal()) {
1343 } else if (dig->Physics() == 0) {
1345 } else c.SetPhysics(mu,1);
1349 for (Int_t ind = mu-1; ind >= 0; ind--) {
1350 Int_t ist=c.GetIndex(ind,cath);
1351 Int_t ql=fInput->Digit(cath, ist)->Signal();
1352 Int_t ix=fInput->Digit(cath, ist)->PadX();
1353 Int_t iy=fInput->Digit(cath, ist)->PadY();
1355 if (q>ql || (q==ql && theX > ix && theY < iy)) {
1356 c.SetIndex(ind, cath, idx);
1357 c.SetIndex(ind+1, cath, ist);
1365 c.SetMultiplicity(cath, c.GetMultiplicity(cath)+1);
1366 if (c.GetMultiplicity(cath) >= 50 ) {
1368 printf("FindCluster - multiplicity >50 %d \n",c.GetMultiplicity(0));
1369 c.SetMultiplicity(cath, 49);
1372 // Prepare center of gravity calculation
1374 fSeg[cath]->GetPadC(i, j, x, y, z);
1378 c.AddCharge(cath,q);
1380 // Flag hit as "taken"
1381 fHitMap[cath]->FlagHit(i,j);
1383 // Now look recursively for all neighbours and pad hit on opposite cathode
1385 // Loop over neighbours
1389 Int_t xList[10], yList[10];
1390 fSeg[cath]->Neighbours(i,j,&nn,xList,yList);
1391 for (Int_t in=0; in<nn; in++) {
1395 if (fHitMap[cath]->TestHit(ix,iy)==kUnused) {
1397 printf("\n Neighbours %d %d %d", cath, ix, iy);
1398 FindCluster(ix, iy, cath, c);
1403 Int_t iXopp[50], iYopp[50];
1405 // Neighbours on opposite cathode
1406 // Take into account that several pads can overlap with the present pad
1407 Int_t isec=fSeg[cath]->Sector(i,j);
1413 dx = (fSeg[cath]->Dpx(isec))/2.;
1418 dy = (fSeg[cath]->Dpy(isec))/2;
1420 // loop over pad neighbours on opposite cathode
1421 for (fSeg[iop]->FirstPad(x, y, fZPlane, dx, dy);
1422 fSeg[iop]->MorePads();
1423 fSeg[iop]->NextPad())
1426 ix = fSeg[iop]->Ix(); iy = fSeg[iop]->Iy();
1427 if (fDebugLevel > 1)
1428 printf("\n ix, iy: %f %f %f %d %d %d", x,y,z,ix, iy, fSector);
1429 if (fHitMap[iop]->TestHit(ix,iy)==kUnused){
1432 if (fDebugLevel > 1)
1433 printf("\n Opposite %d %d %d", iop, ix, iy);
1436 } // Loop over pad neighbours
1437 // This had to go outside the loop since recursive calls inside the iterator are not possible
1440 for (jopp=0; jopp<nOpp; jopp++) {
1441 if (fHitMap[iop]->TestHit(iXopp[jopp],iYopp[jopp]) == kUnused)
1442 FindCluster(iXopp[jopp], iYopp[jopp], iop, c);
1446 //_____________________________________________________________________________
1448 void AliMUONClusterFinderVS::FindRawClusters()
1451 // MUON cluster finder from digits -- finds neighbours on both cathodes and
1452 // fills the tree with raw clusters
1456 // Return if no input datad available
1457 if (!fInput->NDigits(0) && !fInput->NDigits(1)) return;
1459 fSeg[0] = fInput->Segmentation(0);
1460 fSeg[1] = fInput->Segmentation(1);
1462 fHitMap[0] = new AliMUONHitMapA1(fSeg[0], fInput->Digits(0));
1463 fHitMap[1] = new AliMUONHitMapA1(fSeg[1], fInput->Digits(1));
1471 fHitMap[0]->FillHits();
1472 fHitMap[1]->FillHits();
1474 // Outer Loop over Cathodes
1475 for (cath=0; cath<2; cath++) {
1476 for (ndig=0; ndig<fInput->NDigits(cath); ndig++) {
1477 dig = fInput->Digit(cath, ndig);
1478 Int_t i=dig->PadX();
1479 Int_t j=dig->PadY();
1480 if (fHitMap[cath]->TestHit(i,j)==kUsed ||fHitMap[0]->TestHit(i,j)==kEmpty) {
1485 fprintf(stderr,"\n CATHODE %d CLUSTER %d\n",cath,ncls);
1486 AliMUONRawCluster c;
1487 c.SetMultiplicity(0, 0);
1488 c.SetMultiplicity(1, 0);
1489 c.SetPeakSignal(cath,dig->Signal());
1490 c.SetTrack(0, dig->Hit());
1491 c.SetTrack(1, dig->Track(0));
1492 c.SetTrack(2, dig->Track(1));
1493 // tag the beginning of cluster list in a raw cluster
1494 c.SetNcluster(0,-1);
1496 fSeg[cath]->GetPadC(i,j,xcu, ycu, fZPlane);
1497 fSector= fSeg[cath]->Sector(i,j)/100;
1499 printf("\n New Seed %d %d ", i,j);
1502 FindCluster(i,j,cath,c);
1503 // ^^^^^^^^^^^^^^^^^^^^^^^^
1504 // center of gravity
1505 if (c.GetX(0)!=0.) c.SetX(0, c.GetX(0)/c.GetCharge(0)); // c.fX[0] /= c.fQ[0];
1507 c.SetX(0,fSeg[0]->GetAnod(c.GetX(0)));
1508 if (c.GetY(0)!=0.) c.SetY(0, c.GetY(0)/c.GetCharge(0)); // c.fY[0] /= c.fQ[0];
1510 if(c.GetCharge(1)!=0.) c.SetX(1, c.GetX(1)/c.GetCharge(1)); // c.fX[1] /= c.fQ[1];
1513 c.SetX(1, fSeg[0]->GetAnod(c.GetX(1)));
1514 if(c.GetCharge(1)!=0.) c.SetY(1, c.GetY(1)/c.GetCharge(1));// c.fY[1] /= c.fQ[1];
1520 fprintf(stderr,"\n Cathode 1 multiplicite %d X(CG) %f Y(CG) %f\n",
1521 c.GetMultiplicity(0),c.GetX(0),c.GetY(0));
1522 fprintf(stderr," Cathode 2 multiplicite %d X(CG) %f Y(CG) %f\n",
1523 c.GetMultiplicity(1),c.GetX(1),c.GetY(1));
1525 // Analyse cluster and decluster if necessary
1528 c.SetNcluster(1,fNRawClusters);
1529 c.SetClusterType(c.PhysicsContribution());
1536 // reset Cluster object
1537 { // begin local scope
1538 for (int k=0;k<c.GetMultiplicity(0);k++) c.SetIndex(k, 0, 0);
1539 } // end local scope
1541 { // begin local scope
1542 for (int k=0;k<c.GetMultiplicity(1);k++) c.SetIndex(k, 1, 0);
1543 } // end local scope
1545 c.SetMultiplicity(0,0);
1546 c.SetMultiplicity(1,0);
1550 } // end loop cathodes
1555 Float_t AliMUONClusterFinderVS::SingleMathiesonFit(AliMUONRawCluster *c, Int_t cath)
1557 // Performs a single Mathieson fit on one cathode
1559 Double_t arglist[20];
1561 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
1563 clusterInput.Fitter()->SetFCN(fcnS1);
1564 clusterInput.Fitter()->mninit(2,10,7);
1565 clusterInput.Fitter()->SetPrintLevel(-1+fDebugLevel);
1567 clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
1568 // Set starting values
1569 static Double_t vstart[2];
1570 vstart[0]=c->GetX(1);
1571 vstart[1]=c->GetY(0);
1574 // lower and upper limits
1575 static Double_t lower[2], upper[2];
1577 fSeg[cath]->GetPadI(c->GetX(cath), c->GetY(cath), fZPlane, ix, iy);
1578 Int_t isec=fSeg[cath]->Sector(ix, iy);
1579 lower[0]=vstart[0]-fSeg[cath]->Dpx(isec)/2;
1580 lower[1]=vstart[1]-fSeg[cath]->Dpy(isec)/2;
1582 upper[0]=lower[0]+fSeg[cath]->Dpx(isec);
1583 upper[1]=lower[1]+fSeg[cath]->Dpy(isec);
1586 static Double_t step[2]={0.0005, 0.0005};
1588 clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
1589 clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
1590 // ready for minimisation
1594 clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
1595 clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
1596 // clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
1597 Double_t fmin, fedm, errdef;
1598 Int_t npari, nparx, istat;
1600 clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);
1604 // Get fitted parameters
1605 Double_t xrec, yrec;
1607 Double_t epxz, b1, b2;
1609 clusterInput.Fitter()->mnpout(0, chname, xrec, epxz, b1, b2, ierflg);
1610 clusterInput.Fitter()->mnpout(1, chname, yrec, epxz, b1, b2, ierflg);
1616 Float_t AliMUONClusterFinderVS::CombiSingleMathiesonFit(AliMUONRawCluster * /*c*/)
1618 // Perform combined Mathieson fit on both cathode planes
1620 Double_t arglist[20];
1622 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
1623 clusterInput.Fitter()->SetFCN(fcnCombiS1);
1624 clusterInput.Fitter()->mninit(2,10,7);
1625 clusterInput.Fitter()->SetPrintLevel(-1+fDebugLevel);
1627 clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
1628 static Double_t vstart[2];
1629 vstart[0]=fXInit[0];
1630 vstart[1]=fYInit[0];
1633 // lower and upper limits
1634 static Float_t lower[2], upper[2];
1636 fSeg[0]->GetPadI(fXInit[0], fYInit[0], fZPlane, ix, iy);
1637 isec=fSeg[0]->Sector(ix, iy);
1638 Float_t dpy=fSeg[0]->Dpy(isec);
1639 fSeg[1]->GetPadI(fXInit[0], fYInit[0], fZPlane, ix, iy);
1640 isec=fSeg[1]->Sector(ix, iy);
1641 Float_t dpx=fSeg[1]->Dpx(isec);
1644 Float_t xdum, ydum, zdum;
1646 // Find save upper and lower limits
1650 for (fSeg[1]->FirstPad(fXInit[0], fYInit[0], fZPlane, dpx, 0.);
1651 fSeg[1]->MorePads(); fSeg[1]->NextPad())
1653 ix=fSeg[1]->Ix(); iy=fSeg[1]->Iy();
1654 fSeg[1]->GetPadC(ix,iy, upper[0], ydum, zdum);
1655 if (icount ==0) lower[0]=upper[0];
1659 if (lower[0]>upper[0]) {xdum=lower[0]; lower[0]=upper[0]; upper[0]=xdum;}
1663 printf("\n single y %f %f", fXInit[0], fYInit[0]);
1665 for (fSeg[0]->FirstPad(fXInit[0], fYInit[0], fZPlane, 0., dpy);
1666 fSeg[0]->MorePads(); fSeg[0]->NextPad())
1668 ix=fSeg[0]->Ix(); iy=fSeg[0]->Iy();
1669 fSeg[0]->GetPadC(ix,iy,xdum,upper[1],zdum);
1670 if (icount ==0) lower[1]=upper[1];
1673 printf("\n upper lower %d %f %f", icount, upper[1], lower[1]);
1676 if (lower[1]>upper[1]) {xdum=lower[1]; lower[1]=upper[1]; upper[1]=xdum;}
1679 static Double_t step[2]={0.00001, 0.0001};
1681 clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
1682 clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
1683 // ready for minimisation
1687 clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
1688 clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
1689 // clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
1690 Double_t fmin, fedm, errdef;
1691 Int_t npari, nparx, istat;
1693 clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);
1697 // Get fitted parameters
1698 Double_t xrec, yrec;
1700 Double_t epxz, b1, b2;
1702 clusterInput.Fitter()->mnpout(0, chname, xrec, epxz, b1, b2, ierflg);
1703 clusterInput.Fitter()->mnpout(1, chname, yrec, epxz, b1, b2, ierflg);
1709 Bool_t AliMUONClusterFinderVS::DoubleMathiesonFit(AliMUONRawCluster * /*c*/, Int_t cath)
1711 // Performs a double Mathieson fit on one cathode
1715 // Initialise global variables for fit
1716 Double_t arglist[20];
1718 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
1719 clusterInput.Fitter()->SetFCN(fcnS2);
1720 clusterInput.Fitter()->mninit(5,10,7);
1721 clusterInput.Fitter()->SetPrintLevel(-1+fDebugLevel);
1723 clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
1724 // Set starting values
1725 static Double_t vstart[5];
1726 vstart[0]=fX[fIndLocal[0][cath]][cath];
1727 vstart[1]=fY[fIndLocal[0][cath]][cath];
1728 vstart[2]=fX[fIndLocal[1][cath]][cath];
1729 vstart[3]=fY[fIndLocal[1][cath]][cath];
1730 vstart[4]=Float_t(fQ[fIndLocal[0][cath]][cath])/
1731 Float_t(fQ[fIndLocal[0][cath]][cath]+fQ[fIndLocal[1][cath]][cath]);
1732 // lower and upper limits
1733 static Float_t lower[5], upper[5];
1734 Int_t isec=fSeg[cath]->Sector(fIx[fIndLocal[0][cath]][cath], fIy[fIndLocal[0][cath]][cath]);
1735 lower[0]=vstart[0]-fSeg[cath]->Dpx(isec);
1736 lower[1]=vstart[1]-fSeg[cath]->Dpy(isec);
1738 upper[0]=lower[0]+2.*fSeg[cath]->Dpx(isec);
1739 upper[1]=lower[1]+2.*fSeg[cath]->Dpy(isec);
1741 isec=fSeg[cath]->Sector(fIx[fIndLocal[1][cath]][cath], fIy[fIndLocal[1][cath]][cath]);
1742 lower[2]=vstart[2]-fSeg[cath]->Dpx(isec)/2;
1743 lower[3]=vstart[3]-fSeg[cath]->Dpy(isec)/2;
1745 upper[2]=lower[2]+fSeg[cath]->Dpx(isec);
1746 upper[3]=lower[3]+fSeg[cath]->Dpy(isec);
1751 static Double_t step[5]={0.0005, 0.0005, 0.0005, 0.0005, 0.0001};
1753 clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
1754 clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
1755 clusterInput.Fitter()->mnparm(2,"x2",vstart[2],step[2],lower[2],upper[2],ierflag);
1756 clusterInput.Fitter()->mnparm(3,"y2",vstart[3],step[3],lower[3],upper[3],ierflag);
1757 clusterInput.Fitter()->mnparm(4,"a0",vstart[4],step[4],lower[4],upper[4],ierflag);
1758 // ready for minimisation
1762 clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
1763 clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
1764 // clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
1765 // Get fitted parameters
1766 Double_t xrec[2], yrec[2], qfrac;
1768 Double_t epxz, b1, b2;
1770 clusterInput.Fitter()->mnpout(0, chname, xrec[0], epxz, b1, b2, ierflg);
1771 clusterInput.Fitter()->mnpout(1, chname, yrec[0], epxz, b1, b2, ierflg);
1772 clusterInput.Fitter()->mnpout(2, chname, xrec[1], epxz, b1, b2, ierflg);
1773 clusterInput.Fitter()->mnpout(3, chname, yrec[1], epxz, b1, b2, ierflg);
1774 clusterInput.Fitter()->mnpout(4, chname, qfrac, epxz, b1, b2, ierflg);
1776 Double_t fmin, fedm, errdef;
1777 Int_t npari, nparx, istat;
1779 clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);
1784 Float_t AliMUONClusterFinderVS::CombiDoubleMathiesonFit(AliMUONRawCluster * /*c*/)
1787 // Perform combined double Mathieson fit on both cathode planes
1789 Double_t arglist[20];
1791 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
1792 clusterInput.Fitter()->SetFCN(fcnCombiS2);
1793 clusterInput.Fitter()->mninit(6,10,7);
1794 clusterInput.Fitter()->SetPrintLevel(-1+fDebugLevel);
1796 clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
1797 // Set starting values
1798 static Double_t vstart[6];
1799 vstart[0]=fXInit[0];
1800 vstart[1]=fYInit[0];
1801 vstart[2]=fXInit[1];
1802 vstart[3]=fYInit[1];
1803 vstart[4]=fQrInit[0];
1804 vstart[5]=fQrInit[1];
1805 // lower and upper limits
1806 static Float_t lower[6], upper[6];
1810 fSeg[1]->GetPadI(fXInit[0], fYInit[0], fZPlane, ix, iy);
1811 isec=fSeg[1]->Sector(ix, iy);
1812 dpx=fSeg[1]->Dpx(isec);
1814 fSeg[0]->GetPadI(fXInit[0], fYInit[0], fZPlane, ix, iy);
1815 isec=fSeg[0]->Sector(ix, iy);
1816 dpy=fSeg[0]->Dpy(isec);
1820 Float_t xdum, ydum, zdum;
1822 printf("\n Cluster Finder: %f %f %f %f ", fXInit[0], fXInit[1],fYInit[0], fYInit[1] );
1824 // Find save upper and lower limits
1827 for (fSeg[1]->FirstPad(fXInit[0], fYInit[0], fZPlane, dpx, 0.);
1828 fSeg[1]->MorePads(); fSeg[1]->NextPad())
1830 ix=fSeg[1]->Ix(); iy=fSeg[1]->Iy();
1831 // if (fHitMap[1]->TestHit(ix, iy) == kEmpty) continue;
1832 fSeg[1]->GetPadC(ix,iy,upper[0],ydum,zdum);
1833 if (icount ==0) lower[0]=upper[0];
1836 if (lower[0]>upper[0]) {xdum=lower[0]; lower[0]=upper[0]; upper[0]=xdum;}
1837 // vstart[0] = 0.5*(lower[0]+upper[0]);
1842 for (fSeg[0]->FirstPad(fXInit[0], fYInit[0], fZPlane, 0., dpy);
1843 fSeg[0]->MorePads(); fSeg[0]->NextPad())
1845 ix=fSeg[0]->Ix(); iy=fSeg[0]->Iy();
1846 // if (fHitMap[0]->TestHit(ix, iy) == kEmpty) continue;
1847 fSeg[0]->GetPadC(ix,iy,xdum,upper[1],zdum);
1848 if (icount ==0) lower[1]=upper[1];
1852 if (lower[1]>upper[1]) {xdum=lower[1]; lower[1]=upper[1]; upper[1]=xdum;}
1853 // vstart[1] = 0.5*(lower[1]+upper[1]);
1856 fSeg[1]->GetPadI(fXInit[1], fYInit[1], fZPlane, ix, iy);
1857 isec=fSeg[1]->Sector(ix, iy);
1858 dpx=fSeg[1]->Dpx(isec);
1859 fSeg[0]->GetPadI(fXInit[1], fYInit[1], fZPlane, ix, iy);
1860 isec=fSeg[0]->Sector(ix, iy);
1861 dpy=fSeg[0]->Dpy(isec);
1864 // Find save upper and lower limits
1868 for (fSeg[1]->FirstPad(fXInit[1], fYInit[1], fZPlane, dpx, 0);
1869 fSeg[1]->MorePads(); fSeg[1]->NextPad())
1871 ix=fSeg[1]->Ix(); iy=fSeg[1]->Iy();
1872 // if (fHitMap[1]->TestHit(ix, iy) == kEmpty) continue;
1873 fSeg[1]->GetPadC(ix,iy,upper[2],ydum,zdum);
1874 if (icount ==0) lower[2]=upper[2];
1877 if (lower[2]>upper[2]) {xdum=lower[2]; lower[2]=upper[2]; upper[2]=xdum;}
1878 // vstart[2] = 0.5*(lower[2]+upper[2]);
1882 for (fSeg[0]->FirstPad(fXInit[1], fYInit[1], fZPlane, 0, dpy);
1883 fSeg[0]-> MorePads(); fSeg[0]->NextPad())
1885 ix=fSeg[0]->Ix(); iy=fSeg[0]->Iy();
1886 // if (fHitMap[0]->TestHit(ix, iy) != kEmpty) continue;
1888 fSeg[0]->GetPadC(ix,iy,xdum,upper[3],zdum);
1889 if (icount ==0) lower[3]=upper[3];
1893 if (lower[3]>upper[3]) {xdum=lower[3]; lower[3]=upper[3]; upper[3]=xdum;}
1895 // vstart[3] = 0.5*(lower[3]+upper[3]);
1903 static Double_t step[6]={0.0005, 0.0005, 0.0005, 0.0005, 0.001, 0.001};
1904 clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
1905 clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
1906 clusterInput.Fitter()->mnparm(2,"x2",vstart[2],step[2],lower[2],upper[2],ierflag);
1907 clusterInput.Fitter()->mnparm(3,"y2",vstart[3],step[3],lower[3],upper[3],ierflag);
1908 clusterInput.Fitter()->mnparm(4,"a0",vstart[4],step[4],lower[4],upper[4],ierflag);
1909 clusterInput.Fitter()->mnparm(5,"a1",vstart[5],step[5],lower[5],upper[5],ierflag);
1910 // ready for minimisation
1914 clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
1915 clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
1916 // clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
1917 // Get fitted parameters
1919 Double_t epxz, b1, b2;
1921 clusterInput.Fitter()->mnpout(0, chname, fXFit[0], epxz, b1, b2, ierflg);
1922 clusterInput.Fitter()->mnpout(1, chname, fYFit[0], epxz, b1, b2, ierflg);
1923 clusterInput.Fitter()->mnpout(2, chname, fXFit[1], epxz, b1, b2, ierflg);
1924 clusterInput.Fitter()->mnpout(3, chname, fYFit[1], epxz, b1, b2, ierflg);
1925 clusterInput.Fitter()->mnpout(4, chname, fQrFit[0], epxz, b1, b2, ierflg);
1926 clusterInput.Fitter()->mnpout(5, chname, fQrFit[1], epxz, b1, b2, ierflg);
1928 Double_t fmin, fedm, errdef;
1929 Int_t npari, nparx, istat;
1931 clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);
1939 void AliMUONClusterFinderVS::Split(AliMUONRawCluster* c)
1942 // One cluster for each maximum
1945 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
1946 for (j=0; j<2; j++) {
1947 AliMUONRawCluster cnew;
1948 cnew.SetGhost(c->GetGhost());
1949 for (cath=0; cath<2; cath++) {
1950 cnew.SetChi2(cath,fChi2[0]);
1951 // ?? why not cnew.fChi2[cath]=fChi2[cath];
1954 cnew.SetNcluster(0,-1);
1955 cnew.SetNcluster(1,fNRawClusters);
1957 cnew.SetNcluster(0,fNPeaks);
1958 cnew.SetNcluster(1,0);
1960 cnew.SetMultiplicity(cath,0);
1961 cnew.SetX(cath, Float_t(fXFit[j]));
1962 cnew.SetY(cath, Float_t(fYFit[j]));
1963 cnew.SetZ(cath, fZPlane);
1965 cnew.SetCharge(cath, Int_t(clusterInput.TotalCharge(cath)*fQrFit[cath]));
1967 cnew.SetCharge(cath, Int_t(clusterInput.TotalCharge(cath)*(1-fQrFit[cath])));
1969 fSeg[cath]->SetHit(fXFit[j],fYFit[j],fZPlane);
1970 for (i=0; i<fMul[cath]; i++) {
1971 cnew.SetIndex(cnew.GetMultiplicity(cath), cath, c->GetIndex(i,cath));
1972 fSeg[cath]->SetPad(fIx[i][cath], fIy[i][cath]);
1973 Float_t q1=fInput->Response()->IntXY(fSeg[cath]);
1974 cnew.SetContrib(i, cath, q1*Float_t(cnew.GetCharge(cath))/Float_t(fQ[i][cath]));
1975 cnew.SetMultiplicity(cath, cnew.GetMultiplicity(cath)+1 );
1977 FillCluster(&cnew,0,cath);
1980 cnew.SetClusterType(cnew.PhysicsContribution());
1981 if (cnew.GetCharge(0)>0 && cnew.GetCharge(1)>0) AddRawCluster(cnew);
1988 // Minimisation functions
1990 void fcnS1(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
1992 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
1999 for (i=0; i<clusterInput.Nmul(0); i++) {
2000 Float_t q0=clusterInput.Charge(i,0);
2001 Float_t q1=clusterInput.DiscrChargeS1(i,par);
2010 void fcnCombiS1(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
2012 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
2019 for (cath=0; cath<2; cath++) {
2020 for (i=0; i<clusterInput.Nmul(cath); i++) {
2021 Float_t q0=clusterInput.Charge(i,cath);
2022 Float_t q1=clusterInput.DiscrChargeCombiS1(i,par,cath);
2033 void fcnS2(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
2035 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
2042 for (i=0; i<clusterInput.Nmul(0); i++) {
2044 Float_t q0=clusterInput.Charge(i,0);
2045 Float_t q1=clusterInput.DiscrChargeS2(i,par);
2055 void fcnCombiS2(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
2057 AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
2063 for (cath=0; cath<2; cath++) {
2064 for (i=0; i<clusterInput.Nmul(cath); i++) {
2065 Float_t q0=clusterInput.Charge(i,cath);
2066 Float_t q1=clusterInput.DiscrChargeCombiS2(i,par,cath);
2076 void AliMUONClusterFinderVS::AddRawCluster(const AliMUONRawCluster& c)
2079 // Add a raw cluster copy to the list
2082 // AliMUON *pMUON=(AliMUON*)gAlice->GetModule("MUON");
2083 // pMUON->GetMUONData()->AddRawCluster(fInput->Chamber(),c);
2087 TClonesArray &lrawcl = *fRawClusters;
2088 new(lrawcl[fNRawClusters++]) AliMUONRawCluster(c);
2090 fprintf(stderr,"\nfNRawClusters %d\n",fNRawClusters);
2093 Bool_t AliMUONClusterFinderVS::TestTrack(Int_t t) const {
2094 // Test if track was user selected
2095 if (fTrack[0]==-1 || fTrack[1]==-1) {
2097 } else if (t==fTrack[0] || t==fTrack[1]) {
2104 AliMUONClusterFinderVS& AliMUONClusterFinderVS
2105 ::operator = (const AliMUONClusterFinderVS& rhs)
2107 // Protected assignement operator
2109 if (this == &rhs) return *this;
2111 Fatal("operator=", "Not implemented.");