44 #include "AliRunLoader.h"
47 #include <Riostream.h>
49 #include <TVirtualFitter.h>
76 Double_t Param2Coef(Int_t icand, Double_t coef, Double_t *par, Int_t nHits)
81 if (nHits == 1)
return 1.;
82 if (nHits == 2)
return icand==0 ? par[2] : TMath::Max(1.-par[2],0.);
83 if (icand == 0)
return par[2];
84 if (icand == 1)
return TMath::Max((1.-par[2])*par[5], 0.);
85 return TMath::Max(1.-par[2]-coef,0.);
90 FitFunction(Int_t& , Double_t* ,
91 Double_t&
f, Double_t* par,
96 TObjArray* userObjects =
static_cast<TObjArray*
>(TVirtualFitter::GetFitter()->GetObjectFit());
105 Double_t qTot = cluster->
Charge(), coef = 0;
108 for ( Int_t i = 0 ; i < npads; ++i )
114 Double_t charge = 0.;
115 for (Int_t j = 0; j < nHits; ++j) {
118 TVector2 lowerLeft = TVector2(par[indx],par[indx+1]) - pad->
Position() - pad->
Dimensions();
119 TVector2 upperRight(lowerLeft + pad->
Dimensions()*2.0);
120 Double_t estimatedCharge = mathieson->
IntXY(lowerLeft.X(),lowerLeft.Y(),
121 upperRight.X(),upperRight.Y());
122 coef = Param2Coef(j, coef, par, nHits);
123 charge += estimatedCharge * coef;
127 Double_t delta = charge - pad->
Charge();
140 fPreClusterFinder(clusterFinder),
168 AliInfo(Form(
"Total clusters %d AddVirtualPad needed %d",
182 for ( Int_t i = 0; i < 2; ++i )
191 AliRunLoader *runLoader = AliRunLoader::Instance();
192 fEventNumber = runLoader ? runLoader->GetEventNumber() : 0;
263 for ( Int_t i = 0; i < mult; ++i )
289 printf(
" bbb %3d %1d %8.4f %8.4f %8.4f %8.4f %6.1f %3d %3d %2d %1d %1d \n",
296 if (!cluster)
return kFALSE;
302 AliDebug(1,
"No pixel for the above cluster");
307 Int_t nMax = 1, localMax[100], maxPos[100] = {0};
308 Double_t maxVal[100];
312 if (nMax > 1) TMath::Sort(nMax, maxVal, maxPos, kTRUE);
317 for (Int_t i = 0; i < nMax; ++i)
363 AliDebug(2,
"Start of CheckPreCluster=");
386 Int_t* flags =
new Int_t[npad];
387 for (Int_t j = 0; j < npad; ++j) flags[j] = 0;
390 for ( Int_t i = 0; i < npad; ++i)
393 if ( padi->
Cathode() != 0 )
continue;
394 for (Int_t j = i+1; j < npad; ++j)
397 if ( padj->
Cathode() != 1 )
continue;
399 flags[i] = flags[j] = 1;
405 for (Int_t i = 0; i < npad; ++i)
407 if (!flags[i]) ++nFlags;
413 if (
fDebug) cout <<
" nFlags: " << nFlags << endl;
415 for (Int_t i = 0; i < npad; ++i)
418 if (flags[i])
continue;
420 Int_t cath1 = TMath::Even(cath);
424 if (!mpPad.
IsValid())
continue;
426 if (nFlags == 1 && pad->
Charge() < 3.05)
continue;
427 AliDebug(2,Form(
"Releasing the following pad : de,cath,ix,iy %d,%d,%d,%d charge %e",
429 toBeRemoved.AddLast(pad);
432 Int_t nRemove = toBeRemoved.GetEntriesFast();
433 for ( Int_t i = 0; i < nRemove; ++i )
435 cluster->
RemovePad(static_cast<AliMUONPad*>(toBeRemoved.UncheckedAt(i)));
453 for ( Int_t i = 0; i < mult; ++i )
462 if ( pad->
Charge() < cmin )
471 else if ( pad->
Charge() > cmax )
477 AliDebug(2,Form(
"Pad imin,imax %d,%d cmin,cmax %e,%e",
478 imin,imax,cmin,cmax));
482 Double_t* dist =
new Double_t[mult];
489 for ( Int_t i = 0; i < mult; ++i )
492 if ( i == imax)
continue;
495 Double_t dx = (pad->
X()-padmax->
X())/padmax->
DX()/2.0;
496 Double_t dy = (pad->
Y()-padmax->
Y())/padmax->
DY()/2.0;
497 dist[i] = TMath::Sqrt(dx*dx+dy*dy);
500 dmin = dist[i] + 1E-3;
506 TMath::Sort(mult,dist,flags,kFALSE);
507 Double_t xmax(-1), distPrev(999);
510 for ( Int_t i = 0; i < mult; ++i )
512 Int_t indx = flags[i];
515 if ( dist[indx] > dmin )
518 Double_t dx = (pad->
X()-padmax->
X())/padmax->
DX()/2.0;
519 Double_t dy = (pad->
Y()-padmax->
Y())/padmax->
DY()/2.0;
522 if (dx >= 0 && dy >= 0)
continue;
523 if (TMath::Abs(dx) > TMath::Abs(dy) && dx >= 0)
continue;
524 if (TMath::Abs(dy) > TMath::Abs(dx) && dy >= 0)
continue;
526 if (dist[indx] > distPrev + 1)
break;
527 if ( pad->
Charge() <= cmax || TMath::Abs(dist[indx]-xmax) < 1E-3 )
530 if (TMath::Abs(dist[indx]-xmax) < 1.e-3)
532 cmax = TMath::Max(pad->
Charge(),cmax);
539 distPrev = dist[indx];
540 AliDebug(2,Form(
"Releasing the following pad : de,cath,ix,iy %d,%d,%d,%d charge %e",
544 toBeRemoved.AddLast(pad);
548 Int_t nRemove = toBeRemoved.GetEntriesFast();
549 for ( Int_t i = 0; i < nRemove; ++i )
551 cluster->
RemovePad(static_cast<AliMUONPad*>(toBeRemoved.UncheckedAt(i)));
558 AliDebug(2,
"End of CheckPreClusterTwoCathodes=");
573 for ( Int_t i = 0; i < nPix; ++i )
578 pixelI->
Size(0),pixelI->
Size(1),0.0);
580 for ( Int_t j = i+1; j < nPix; ++j )
585 pixelJ->
Size(0),pixelJ->
Size(1),0.0);
590 AliInfo(Form(
"The following 2 pixels (%d and %d) overlap !",i,j));
613 AliWarning(
"Got no pad at all ?!");
632 Double_t width[2] = {dim.X(), dim.Y()}, xy0[2] = { 0.0, 0.0 };
635 for ( Int_t i = 0; i < mult; ++i) {
637 for (Int_t j = 0; j < 2; ++j) {
638 if (found[j] == 0 && TMath::Abs(pad->
Size(j)-width[j]) < fgkDistancePrecision) {
639 xy0[j] = pad->
Coord(j);
643 if (found[0] && found[1])
break;
646 Double_t min[2], max[2];
647 Int_t cath0 = 0, cath1 = 1;
651 Double_t leftDownX, leftDownY;
653 Double_t rightUpX, rightUpY;
659 if (cath1 != cath0) {
662 min[0] = TMath::Max (min[0], leftDownX);
663 min[1] = TMath::Max (min[1], leftDownY);
664 max[0] = TMath::Min (max[0], rightUpX);
665 max[1] = TMath::Min (max[1], rightUpY);
669 if (cath0 != cath1) {
672 if (TMath::Abs(dim0.Y()-dim1.Y()) < fgkDistancePrecision) {
675 for ( Int_t i = 1; i < mult; ++i) {
678 Double_t dist = TMath::Abs (pad0->
Coord(1) - pad->
Coord(1));
679 Double_t dd = dist - Int_t(dist/width[1]/2.) * width[1] * 2.;
680 if (TMath::Abs(dd/width[1]/2.-0.5) < fgkDistancePrecision) {
691 for (Int_t i = 0; i < 2; ++i) {
692 Double_t dist = (min[i] - xy0[i]) / width[i] / 2;
693 if (TMath::Abs(dist) < 1.e-6) dist = -1.e-6;
694 min[i] = xy0[i] + (TMath::Nint(dist-TMath::Sign(1.e-6,dist))
695 + TMath::Sign(0.5,dist)) * width[i] * 2;
696 nbins[i] = TMath::Nint ((max[i] - min[i]) / width[i] / 2);
697 if (nbins[i] == 0) ++nbins[i];
698 max[i] = min[i] + nbins[i] * width[i] * 2;
703 TH2D *hist1 =
new TH2D (
"Grid",
"", nbins[0], min[0], max[0], nbins[1], min[1], max[1]);
704 TH2D *hist2 =
new TH2D (
"Entries",
"", nbins[0], min[0], max[0], nbins[1], min[1], max[1]);
705 TAxis *xaxis = hist1->GetXaxis();
706 TAxis *yaxis = hist1->GetYaxis();
709 for ( Int_t i = 0; i < mult; ++i) {
711 Int_t ix0 = xaxis->FindBin(pad->
X());
712 Int_t iy0 = yaxis->FindBin(pad->
Y());
717 for (Int_t i = 1; i <= nbins[0]; ++i) {
718 Double_t x = xaxis->GetBinCenter(i);
719 for (Int_t j = 1; j <= nbins[1]; ++j) {
720 if (hist2->GetBinContent(hist2->GetBin(i,j)) < 0.01525)
continue;
721 if (cath0 != cath1) {
723 Double_t cont = hist2->GetBinContent(hist2->GetBin(i,j));
724 if (cont < 999.)
continue;
725 if (cont-Int_t(cont/1000.)*1000. < 0.07625)
continue;
729 Double_t y = yaxis->GetBinCenter(j);
730 Double_t charge = hist1->GetBinContent(hist1->GetBin(i,j));
752 TH2D *hist1, TH2D *hist2)
756 TAxis *axis = idir == 0 ? hist1->GetXaxis() : hist1->GetYaxis();
757 Int_t nbins = axis->GetNbins(), cath = pad->
Cathode();
758 Double_t bin = axis->GetBinWidth(1), amask = TMath::Power(1000.,cath*1.);
762 for (Int_t i = 0; i < nbinPad; ++i) {
763 Int_t ixy = idir == 0 ? ix0 + i : iy0 + i;
764 if (ixy > nbins)
break;
765 Double_t lowEdge = axis->GetBinLowEdge(ixy);
766 if (lowEdge + fgkDistancePrecision > pad->
Coord(idir) + pad->
Size(idir))
break;
767 if (idir == 0)
PadOverHist(1, ixy, iy0, pad, hist1, hist2);
770 Double_t cont = pad->
Charge();
771 if (hist2->GetBinContent(hist2->GetBin(ix0, ixy)) > 0.01525)
772 cont = TMath::Min (hist1->GetBinContent(hist1->GetBin(ix0, ixy)), cont)
773 + TMath::Min (TMath::Max(hist1->GetBinContent(hist1->GetBin(ix0, ixy)),cont)*0.1, 1.525);
774 hist1->SetBinContent(hist1->GetBin(ix0, ixy), cont);
775 hist2->SetBinContent(hist2->GetBin(ix0, ixy), hist2->GetBinContent( hist2->GetBin(ix0, ixy))+amask);
779 for (Int_t i = -1; i > -nbinPad; --i) {
780 Int_t ixy = idir == 0 ? ix0 + i : iy0 + i;
782 Double_t upEdge = axis->GetBinUpEdge(ixy);
783 if (upEdge - fgkDistancePrecision < pad->Coord(idir) - pad->
Size(idir))
break;
784 if (idir == 0)
PadOverHist(1, ixy, iy0, pad, hist1, hist2);
787 Double_t cont = pad->
Charge();
788 if (hist2->GetBinContent(hist2->GetBin(ix0, ixy)) > 0.01525)
789 cont = TMath::Min (hist1->GetBinContent(hist1->GetBin(ix0, ixy)), cont)
790 + TMath::Min (TMath::Max(hist1->GetBinContent(hist1->GetBin(ix0, ixy)),cont)*0.1,1.525);
791 hist1->SetBinContent(hist1->GetBin(ix0, ixy), cont);
792 hist2->SetBinContent(hist2->GetBin(ix0, ixy), hist2->GetBinContent( hist2->GetBin(ix0, ixy))+amask);
802 AliDebug(1,Form(
"nPix=%d",pixArray->GetLast()+1));
811 Double_t xylim[4] = {999, 999, 999, 999};
813 Int_t nPix = pixArray->GetEntriesFast();
815 if ( nPix <= 0 )
return 0;
818 for (Int_t ipix = 0; ipix < nPix; ++ipix) {
819 pixPtr = (
AliMUONPad*) pixArray->UncheckedAt(ipix);
820 for (Int_t i = 0; i < 4; ++i)
821 xylim[i] = TMath::Min (xylim[i], (i%2 ? -1 : 1)*pixPtr->
Coord(i/2));
823 for (Int_t i = 0; i < 4; ++i) xylim[i] -= pixPtr->
Size(i/2);
825 Int_t nx = TMath::Nint ((-xylim[1]-xylim[0])/pixPtr->
Size(0)/2);
826 Int_t ny = TMath::Nint ((-xylim[3]-xylim[2])/pixPtr->
Size(1)/2);
827 if (pixArray ==
fPixArray)
fHistAnode =
new TH2D(
"anode",
"anode",nx,xylim[0],-xylim[1],ny,xylim[2],-xylim[3]);
828 else fHistAnode =
new TH2D(
"anode1",
"anode1",nx,xylim[0],-xylim[1],ny,xylim[2],-xylim[3]);
829 for (Int_t ipix = 0; ipix < nPix; ++ipix) {
830 pixPtr = (
AliMUONPad*) pixArray->UncheckedAt(ipix);
835 Int_t nMax = 0, indx, nxy = ny * nx;
836 Int_t *isLocalMax =
new Int_t[nxy];
837 for (Int_t i = 0; i < nxy; ++i) isLocalMax[i] = 0;
839 for (Int_t i = 1; i <= ny; ++i) {
841 for (Int_t j = 1; j <= nx; ++j) {
844 if (isLocalMax[indx+j-1] != 0)
continue;
849 for (Int_t i = 1; i <= ny; ++i) {
851 for (Int_t j = 1; j <= nx; ++j) {
852 if (isLocalMax[indx+j-1] > 0) {
853 localMax[nMax] = indx + j - 1;
855 if (nMax > 99)
break;
859 AliError(
" Too many local maxima !!!");
863 if (
fDebug) cout <<
" Local max: " << nMax << endl;
864 delete [] isLocalMax;
873 Int_t nx = hist->GetNbinsX();
874 Int_t ny = hist->GetNbinsY();
875 Int_t cont = TMath::Nint (hist->GetBinContent(hist->GetBin(j,i)));
876 Int_t cont1 = 0, indx = (i-1)*nx+j-1, indx1 = 0, indx2 = 0;
878 Int_t ie = i + 2, je = j + 2;
879 for (Int_t i1 = i-1; i1 < ie; ++i1) {
880 if (i1 < 1 || i1 > ny)
continue;
881 indx1 = (i1 - 1) * nx;
882 for (Int_t j1 = j-1; j1 < je; ++j1) {
883 if (j1 < 1 || j1 > nx)
continue;
884 if (i == i1 && j == j1)
continue;
885 indx2 = indx1 + j1 - 1;
886 cont1 = TMath::Nint (hist->GetBinContent(hist->GetBin(j1,i1)));
887 if (cont < cont1) { isLocalMax[indx] = -1;
return; }
888 else if (cont > cont1) isLocalMax[indx2] = -1;
890 isLocalMax[indx] = 1;
891 if (isLocalMax[indx2] == 0) {
893 if (isLocalMax[indx2] < 0) { isLocalMax[indx] = -1;
return; }
894 else isLocalMax[indx2] = -1;
899 isLocalMax[indx] = 1;
904 const Int_t *maxPos, Int_t nMax)
913 Double_t xmin =
fHistAnode->GetXaxis()->GetXmin();
914 Double_t xmax =
fHistAnode->GetXaxis()->GetXmax();
915 Double_t ymin =
fHistAnode->GetYaxis()->GetXmin();
916 Double_t ymax =
fHistAnode->GetYaxis()->GetXmax();
918 TVirtualFitter* fitter = TVirtualFitter::Fitter(0,nMax*3);
920 fitter->SetFCN(FitFunction);
922 Float_t stepX = 0.01;
923 Float_t stepY = 0.01;
924 Float_t stepQ = 0.01;
926 Double_t args[10] = {-1.};
928 fitter->ExecuteCommand(
"SET PRINT",args,1);
929 fitter->ExecuteCommand(
"SET NOW",args,0);
933 for (Int_t i = 0; i < nMax; ++i) {
934 Int_t ic = localMax[maxPos[i]] / nx + 1;
935 Int_t jc = localMax[maxPos[i]] % nx + 1;
936 Double_t yc =
fHistAnode->GetYaxis()->GetBinCenter(ic);
937 Double_t xc =
fHistAnode->GetXaxis()->GetBinCenter(jc);
939 fitter->SetParameter(indx,
"Hit X position",xc,stepX,xmin,xmax);
940 fitter->SetParameter(indx+1,
"Hit Y position",yc,stepY,ymin,ymax);
941 fitter->SetParameter(indx+2,
"Hit contribution",0.6,stepQ,0.,1.);
943 fitter->SetParameter(indx+2,
"Hit contribution",0.,0.,0,0);
948 userObjects.Add(&cluster);
950 userObjects.Add(
this);
952 fitter->SetObjectFit(&userObjects);
956 fitter->ExecuteCommand(
"MIGRAD",args,2);
963 Double_t qTot = cluster.
Charge(), par[9] = {0.}, err[9] = {0.}, coef = 0.;
965 for (Int_t j = 0; j < nMax; ++j) {
967 par[indx+2] = fitter->GetParameter(indx+2);
968 coef = Param2Coef(j, coef, par, nMax);
969 par[indx] = fitter->GetParameter(indx);
970 par[indx+1] = fitter->GetParameter(indx+1);
971 err[indx] = fitter->GetParError(indx);
972 err[indx+1] = fitter->GetParError(indx+1);
974 if ( coef*qTot >= 2.135 )
978 cluster1->
SetCharge(coef*qTot,coef*qTot);
980 cluster1->
SetPosition(TVector2(par[indx],par[indx+1]),TVector2(err[indx],err[indx+1]));
986 AliDebug(2,Form(
"Adding RawCluster detElemId %4d mult %2d charge %5d (xl,yl)=(%9.6g,%9.6g)",
997 const Int_t *localMax, Int_t iMax)
1012 Int_t ic = localMax[iMax] / nx + 1;
1013 Int_t jc = localMax[iMax] % nx + 1;
1021 Int_t nonb[2] = {1, 0};
1030 Double_t wx =
fHistAnode->GetXaxis()->GetBinWidth(1)/2;
1031 Double_t wy =
fHistAnode->GetYaxis()->GetBinWidth(1)/2;
1032 Double_t yc =
fHistAnode->GetYaxis()->GetBinCenter(ic);
1033 Double_t xc =
fHistAnode->GetXaxis()->GetBinCenter(jc);
1041 Double_t qMax[2] = {0};
1042 AliMUONPad *matrix[2][3] = {{0x0,0x0,0x0},{0x0,0x0,0x0}};
1043 for (Int_t j = 0; j < npad; ++j)
1048 if (
fDebug) { cout << j <<
" "; pad->
Print(
"full"); }
1051 matrix[pad->
Cathode()][1] = pad;
1052 if (nSides == 1) matrix[!pad->
Cathode()][1] = pad;
1059 for (Int_t j = 0; j < npad; ++j)
1063 if (pad == matrix[cath][1])
continue;
1064 Int_t nLoops = 3 - nSides;
1066 for (Int_t k = 0; k < nLoops; ++k) {
1068 if (k) cath1 = !cath;
1071 Double_t dist = pad->
Coord(nonb[cath1]) - matrix[cath][1]->
Coord(nonb[cath1]);
1072 Double_t dir = TMath::Sign (1., dist);
1073 dist = TMath::Abs(dist) - pad->
Size(nonb[cath1]) - matrix[cath][1]->
Size(nonb[cath1]);
1075 if (TMath::Abs(dist) < fgkDistancePrecision) {
1077 dist = pad->
Coord(!nonb[cath1]) - matrix[cath1][1]->
Coord(!nonb[cath1]);
1078 if (TMath::Abs(dist) >
1079 TMath::Max(pad->
Size(!nonb[cath1]), matrix[cath1][1]->
Size(!nonb[cath1])) - fgkDistancePrecision)
break;
1080 Int_t idir = TMath::Nint (dir);
1081 if (matrix[cath1][1+idir] == 0x0) matrix[cath1][1+idir] = pad;
1082 else if (pad->
Charge() > matrix[cath1][1+idir]->
Charge()) matrix[cath1][1+idir] = pad;
1089 Double_t coord[2] = {0.}, qAver = 0.;
1090 for (Int_t i = 0; i < 2; ++i) {
1092 Double_t coordQ = 0.;
1093 Int_t cath = matrix[i][1]->
Cathode();
1094 if (i && nSides == 1) cath = !cath;
1095 for (Int_t j = 0; j < 3; ++j) {
1096 if (matrix[i][j] == 0x0)
continue;
1097 Double_t dq = matrix[i][j]->
Charge();
1099 coordQ += dq * matrix[i][j]->
Coord(nonb[cath]);
1102 coord[cath] = coordQ / q;
1103 qAver = TMath::Max (qAver, q);
1107 if ( qAver >= 2.135 )
1114 cluster1->
SetPosition(TVector2(coord[1],coord[0]),TVector2(0.,0.));
1116 cluster1->
SetPosition(TVector2(coord[0],coord[1]),TVector2(0.,0.));
1123 AliDebug(2,Form(
"Adding RawCluster detElemId %4d mult %2d charge %5d (xl,yl)=(%9.6g,%9.6g)",
1137 if (
this == &rhs)
return *
this;
1139 AliFatal(
"Not implemented.");
1146 Int_t &nInX, Int_t &nInY)
const
1155 if ( nInX < 0 ) statusToTest =
fgkZero;
1157 Bool_t mustMatch(kTRUE);
1159 Long_t cn = cluster.
NofPads(statusToTest,mustMatch);
1187 TString swhat(what);
1189 if ( swhat.Contains(
"precluster") )
static Bool_t AreOverlapping(const AliMUONPad &d1, const AliMUONPad &d2, const TVector2 &precision, AliMpArea &overlapArea)
static AliMq::Station12Type GetStation12Type(Int_t detElemId)
AliMUONCluster * CheckPrecluster(const AliMUONCluster &cluster)
Check precluster to simplify it (if possible), and return the simplified cluster. ...
void PadsInXandY(AliMUONCluster &cluster, Int_t &nInX, Int_t &nInY) const
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Bool_t IsReal() const
Return info whether this is a real pad or a virtual one.
Interface of a cluster finder.
static const Int_t fgkUseForFit
should be used for fit
void SetSqrtKx3AndDeriveKx2Kx4(Float_t SqrtKx3)
Mathieson sqrt{Kx3} and derived Kx2 and Kx4.
static Float_t Pitch()
Return wire pitch.
Int_t fDebug
! debug level
AliMUONClusterFinderPeakFit & operator=(const AliMUONClusterFinderPeakFit &rhs)
Not implemented.
Bool_t Overlap(const AliMUONPad &pad, const AliMUONPad &pixel)
Checks whether a pad and a pixel have an overlapping area.
Bool_t IsSaturated() const
Return info whether this pad is saturated or not.
void BuildPixArrayOneCathode(AliMUONCluster &cluster)
Bool_t WorkOnPreCluster()
Float_t IntXY(Float_t xi1, Float_t yi1, Float_t xi2, Float_t yi2) const
Charge integration on region (x1,y1,x2,y2).
A group of adjacent pads.
static Float_t SqrtKy3St1()
Return SqrtKy3 for Station 1 & 2.
Int_t fClusterNumber
! current cluster number
AliMUONCluster * CheckPreclusterTwoCathodes(AliMUONCluster *cluster)
static Float_t SqrtKx3()
Return SqrtKx3 for Slat.
TFile f("CalibObjects.root")
Implementation of Mathieson response.
TVector2 Dimensions() const
Return half dimensions in x and y (cm)
virtual void Print(Option_t *opt="") const
Int_t fNAddVirtualPads
! number of clusters for which we added virtual pads
A rectangle area positioned in plane..
AliMUONPad * Pixel(Int_t i) const
TH2D * fHistAnode
! histo for local maxima search
virtual void Print(Option_t *opt="") const
static const Double_t fgkDistancePrecision
used to check overlaps and so on
Int_t fEventNumber
! current event being processed
Double_t DY() const
Return half dimensions in y (cm)
Int_t Multiplicity() const
virtual Bool_t Prepare(Int_t detElemId, TObjArray *pads[2], const AliMpArea &area)
virtual Bool_t NeedSegmentation() const
AliMUONCluster * fPreCluster
! current pre-cluster
void SetPosition(const TVector2 &pos, const TVector2 &errorOnPos)
Set (x,y) of that cluster and errors.
static Float_t PitchSt1()
Return wire pitch for Station 1 & 2.
static Float_t SqrtKy3()
Return SqrtKy3 for Slat.
virtual Bool_t UsePad(const AliMUONPad &pad)
void RemovePixel(Int_t i)
void PadOverHist(Int_t idir, Int_t ix0, Int_t iy0, AliMUONPad *pad, TH2D *h1, TH2D *h2)
Double_t Y() const
Return position in y (cm)
static Float_t SqrtKx3St1()
Return SqrtKx3 for Station 1 & 2.
virtual AliMUONCluster * NextCluster()
Int_t Iy() const
Return y-index.
static const TVector2 fgkDecreaseSize
idem
void Release()
Detach this pad from a cluster.
void LeftDownCorner(Double_t &x, Double_t &y) const
Double_t X() const
Return position in x (cm)
virtual ~AliMUONClusterFinderPeakFit()
void SetPitch(Float_t p1)
Int_t Cathode() const
Return cathode number.
Bool_t IsUsed() const
Return true if is used.
void SetCharge(Float_t chargeCath0, Float_t chargeCath1)
Set cathode (re)computed charges.
static const Int_t fgkZero
pad "basic" state
Double_t Size(Int_t ixy) const
void plot(const std::vector< TH1 * > &v, Double_t min, Double_t max, Double_t factor)
void RemovePad(AliMUONPad *pad)
void FindClusterFit(AliMUONCluster &cluster, const Int_t *localMax, const Int_t *maxPos, Int_t nMax)
TVector2 Position() const
Return (x,y) of that cluster.
void SetChi2(Float_t chi2)
Set chi2 of the RawCharge fit.
Bool_t IsValid() const
Return validity.
Int_t fDetElemId
! current DE being processed
TVector2 Position() const
Return positions in x and y (cm)
virtual Bool_t Prepare(Int_t detElemId, TObjArray *pads[2], const AliMpArea &area, const AliMpVSegmentation *seg[2])
virtual AliMpPad PadByPosition(Double_t x, Double_t y, Bool_t warning=true) const =0
Find pad by position.
Int_t fNClusters
! total number of clusters
TObjArray * fPixArray
! collection of pixels
void RightUpCorner(Double_t &x, Double_t &y) const
virtual AliMUONCluster * NextCluster()=0
Long_t NofPads(Int_t cathode, Int_t statusMask, Bool_t matchMask) const
Compute number of pads in X and Y direction for a given cathode.
void FlagLocalMax(TH2D *hist, Int_t i, Int_t j, Int_t *isLocalMax)
The abstract base class for the segmentation.
Int_t Ix() const
Return x-index.
AliMpArea Area() const
Area that contains all the pads (whatever the cathode)
Int_t PairFirst(MpPair_t pair)
Decode the first integer from encoded pair.
AliMUONClusterFinderPeakFit(Bool_t plot, AliMUONVClusterFinder *clusterFinder)
const AliMpVSegmentation * fkSegmentation[2]
! new segmentation
void Print(Option_t *opt="") const
Double_t Charge() const
Return pad charge.
TObjArray fClusterList
! clusters corresponding to the current pre-cluster
Double_t Coord(Int_t ixy) const
Class which encapsuate all information about a pad.
AliMUONMathieson * fMathieson
! Mathieson to compute the charge repartition
Bool_t IsSaturated(Int_t cathode) const
Whether we have at least one saturated pad in a given cathode.
Int_t DetElemId() const
Return detection element id.
Float_t ChargeAsymmetry() const
Return the cathode's charges asymmetry.
Int_t FindLocalMaxima(TObjArray *pixArray, Int_t *localMax, Double_t *maxVal)
Cluster finder in MUON arm of ALICE.
Int_t PairSecond(MpPair_t pair)
Decode the second integer from encoded pair.
Bool_t fPlot
! whether we should plot thing (for debug only, quite slow!)
void FindClusterCOG(AliMUONCluster &cluster, const Int_t *localMax, Int_t iMax)
TVector2 MinPadDimensions(Int_t cathode, Int_t statusMask, Bool_t matchMask) const
Return the smallest pad dimensions for a given cathode.
Int_t Status() const
Return status word.
Int_t MaxRawChargeCathode() const
Return the max raw charge on the chathod.
AliMUONPad * Pad(Int_t index) const
void BuildPixArray(AliMUONCluster &cluster)
build array of pixels
void SetSqrtKy3AndDeriveKy2Ky4(Float_t SqrtKy3)
Mathieson sqrt{Ky3} and derived Ky2 and Ky4.
AliMUONVClusterFinder * fPreClusterFinder
! the pre-clustering worker
Combination of digit and mppad informations.
Int_t GetNMax() const
Return the number of local maxima.
Double_t DX() const
Return half dimensions in x (cm)
Int_t fNMax
! number of local maxima