{
// Default constructor
fInput=AliMUONClusterInput::Instance();
- fSegmentationType = fInput->GetSegmentationType();
// cout << " TYPE" << fSegmentationType << endl;
fHitMap[0] = 0;
fHitMap[1] = 0;
// number of next neighbours and arrays to store them
Int_t nn;
Int_t x[10], y[10];
-// loop over cathodes
+ // loop over cathodes
for (cath=0; cath<2; cath++) {
-// loop over cluster digits
- for (i=0; i<fMul[cath]; i++) {
-// get neighbours for that digit and assume that it is local maximum
- if (fSegmentationType == 1)
- fSeg[cath]->Neighbours(fIx[i][cath], fIy[i][cath], &nn, x, y);
- else
- fSeg2[cath]->Neighbours(fInput->DetElemId(), fIx[i][cath], fIy[i][cath], &nn, x, y);
+ // loop over cluster digits
+ for (i=0; i<fMul[cath]; i++) {
+ // get neighbours for that digit and assume that it is local maximum
+ Int_t isec;
+ Float_t a0;
- isLocal[i][cath]=kTRUE;
- Int_t isec= fSeg[cath]->Sector(fIx[i][cath], fIy[i][cath]);
- Float_t a0 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
-// loop over next neighbours, if at least one neighbour has higher charger assumption
-// digit is not local maximum
- for (j=0; j<nn; j++) {
- if (fHitMap[cath]->TestHit(x[j], y[j])==kEmpty) continue;
- digt=(AliMUONDigit*) fHitMap[cath]->GetHit(x[j], y[j]);
- Float_t a1;
- if (fSegmentationType == 1) {
- isec=fSeg[cath]->Sector(x[j], y[j]);
- a1 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
- } else {
- isec=fSeg2[cath]->Sector(fInput->DetElemId(), x[j], y[j]);
- a1 = fSeg2[cath]->Dpx(fInput->DetElemId(),isec)*fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
- }
- if (digt->Signal()/a1 > fQ[i][cath]/a0) {
+ if (fSegmentationType == 1)
+ fSeg[cath]->Neighbours(fIx[i][cath], fIy[i][cath], &nn, x, y);
+ else
+ fSeg2[cath]->Neighbours(fInput->DetElemId(), fIx[i][cath], fIy[i][cath], &nn, x, y);
+
+ isLocal[i][cath]=kTRUE;
+
+ if (fSegmentationType == 1) {
+ isec = fSeg[cath]->Sector(fIx[i][cath], fIy[i][cath]);
+ a0 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
+ } else {
+ isec = fSeg2[cath]->Sector(fInput->DetElemId(), fIx[i][cath], fIy[i][cath]);
+ a0 = fSeg2[cath]->Dpx(fInput->DetElemId(), isec)*fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
+ }
+ // loop over next neighbours, if at least one neighbour has higher charger assumption
+ // digit is not local maximum
+ for (j=0; j<nn; j++) {
+ if (fHitMap[cath]->TestHit(x[j], y[j])==kEmpty) continue;
+ digt=(AliMUONDigit*) fHitMap[cath]->GetHit(x[j], y[j]);
+ Float_t a1;
+ if (fSegmentationType == 1) {
+ isec=fSeg[cath]->Sector(x[j], y[j]);
+ a1 = fSeg[cath]->Dpx(isec)*fSeg[cath]->Dpy(isec);
+ } else {
+ isec=fSeg2[cath]->Sector(fInput->DetElemId(), x[j], y[j]);
+ a1 = fSeg2[cath]->Dpx(fInput->DetElemId(),isec)*fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
+ }
+ if (digt->Signal()/a1 > fQ[i][cath]/a0) {
+ isLocal[i][cath]=kFALSE;
+ break;
+ //
+ // handle special case of neighbouring pads with equal signal
+ } else if (digt->Signal() == fQ[i][cath]) {
+ if (fNLocal[cath]>0) {
+ for (Int_t k=0; k<fNLocal[cath]; k++) {
+ if (x[j]==fIx[fIndLocal[k][cath]][cath]
+ && y[j]==fIy[fIndLocal[k][cath]][cath])
+ {
isLocal[i][cath]=kFALSE;
- break;
-//
-// handle special case of neighbouring pads with equal signal
- } else if (digt->Signal() == fQ[i][cath]) {
- if (fNLocal[cath]>0) {
- for (Int_t k=0; k<fNLocal[cath]; k++) {
- if (x[j]==fIx[fIndLocal[k][cath]][cath]
- && y[j]==fIy[fIndLocal[k][cath]][cath])
- {
- isLocal[i][cath]=kFALSE;
- }
- } // loop over local maxima
- } // are there already local maxima
- } // same charge ?
- } // loop over next neighbours
- if (isLocal[i][cath]) {
- fIndLocal[fNLocal[cath]][cath]=i;
- fNLocal[cath]++;
- }
- } // loop over all digits
+ }
+ } // loop over local maxima
+ } // are there already local maxima
+ } // same charge ?
+ } // loop over next neighbours
+ if (isLocal[i][cath]) {
+ fIndLocal[fNLocal[cath]][cath]=i;
+ fNLocal[cath]++;
+ }
+ } // loop over all digits
} // loop over cathodes
AliDebug(1,Form("\n Found %d %d %d %d local Maxima\n",
// Return if no input datad available
if (!fInput->NDigits(0) && !fInput->NDigits(1)) return;
+ fSegmentationType = fInput->GetSegmentationType();
+
if (fSegmentationType == 1) {
fSeg[0] = fInput->Segmentation(0);
fSeg[1] = fInput->Segmentation(1);
AliMUONDigit* digit;
- TArrayI id(100); // contains the different IdDE
- id.Reset();
+ TArrayI id(200); // contains the different IdDE
+
// Loop on chambers and on cathode planes
TClonesArray* muonDigits;
Int_t flag = 0;
for (Int_t ich = 0; ich < AliMUONConstants::NTrackingCh(); ich++) {
+
+ id.Reset();
n1 = 0;
n2 = 0;
//cathode 0
digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
new(lDigit[n1++]) AliMUONDigit(*digit);
idDE = digit->DetElemId();
- if (idDE != idDE_prev)
+ if (idDE != idDE_prev) {
id.AddAt(idDE,n2++);
+ }
idDE_prev = idDE;
}
muonDigits = fMUONData->Digits(ich);
ndig = muonDigits->GetEntriesFast();
+ Int_t idSize = n2;
+
for (k = 0; k < ndig; k++) {
digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
idDE = digit->DetElemId();
flag = 0;
- for (Int_t n = 0; n < id.GetSize(); n++) {
- if (id[n] == idDE) {
+ // looking for new idDE in cathode 1 (method to be checked CF)
+ for (Int_t n = 0; n < idSize; n++) {
+ if (idDE == id[n]) {
flag = 1;
break;
}
- if (flag) continue;
- id[id.GetSize()+1] = idDE;
}
+ if (flag) continue;
+ id.AddAt(idDE,n2++);
}
- // loop over id DE
- for (idDE = 0; idDE < id.GetSize(); idDE++) {
+ idSize = n2;
+ // loop over id DE
+ for (idDE = 0; idDE < idSize; idDE++) {
TClonesArray &lhits1 = *dig1;
TClonesArray &lhits2 = *dig2;
n1 = n2 = 0;
+ // printf("idDE %d\n", id[idDE]);
for (k = 0; k < digAll->GetEntriesFast(); k++) {
digit = (AliMUONDigit*) digAll->UncheckedAt(k);
- if (id[idDE] == digit->DetElemId())
+ // printf("digit idDE %d\n", digit->DetElemId());
+ if (id[idDE] == digit->DetElemId()) {
if (digit->Cathode() == 1)
new(lhits1[n1++]) AliMUONDigit(*digit);
else
new(lhits2[n2++]) AliMUONDigit(*digit);
-
+ }
}
// cluster finder
}
dig1->Delete();
dig2->Delete();
- digAll->Delete();
- }
+ } // idDE
+ digAll->Delete();
} // for ich
delete dig1;
delete dig2;
void AliMUONSt345SlatSegmentation::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
{
if (ix<1 || ix>Npx() || iy<1 || iy>Npy() ){
- AliWarning(Form("ix or iy out of boundaries: Npx=%d and Npy=%d",Npx(),Npy()));
+ AliWarning(Form("ix %d or iy %d out of boundaries: Npx=%d and Npy=%d",ix, iy, Npx(), Npy()));
x=-99999.; y=-99999.;
}
else {
break;
}
}
- if (isec == -1) AliWarning(Form("isector equal to %d with x %f, y %f", isec, x, y));
+ if (isec == -1) AliWarning(Form("isector equal to %d with xl %f, yl %f", isec, x, y));
if (isec>0) {
ix= Int_t((x-fCx[isec-1])/(*fDpxD)[isec])
+fNpxS[isec-1]+1;
fXhit = x;
fYhit = y;
- if (x < 0) fXhit = 0;
- if (y < 0) fYhit = 0;
+ // if (x < 0) fXhit = 0;
+// if (y < 0) fYhit = 0;
- if (x >= fCx[fNsec-1]) fXhit = fCx[fNsec-1];
- if (y >= fDyPCB) fYhit = fDyPCB;
+// if (x >= fCx[fNsec-1]) fXhit = fCx[fNsec-1];
+// if (y >= fDyPCB) fYhit = fDyPCB;
}
//----------------------------------------------------------------------------
Float_t x02=x0a + dx;
Float_t y01=yhit - dy;
Float_t y02=yhit + dy;
- // if (x01 < 0) x01 = 0;
+// if (x01 < 0) x01 = 0;
// if (y01 < 0) y01 = 0;
// if (x02 >= fCx[fNsec-1]) x02 = fCx[fNsec-1];
if (fIxmax > fNpx) fIxmax=fNpx;
if (fIymax > fNpyS[isec]) fIymax = fNpyS[isec];
+ if (fIxmin < 1) fIxmin = 1; // patch for the moment (Ch. Finck)
+ if (fIymin < 1) fIymin = 1;
fXmin=x01;
fXmax=x02;
fSector=Sector(fIx,fIy);
} else {
- fIx=-1;
- fIy=-1;
+ fIx=-999;
+ fIy=-999;
}
- // printf("\n Next Pad %d %d %f %f %d %d %d %d %d ",
}
//-------------------------------------------------------------------------
Int_t AliMUONSt345SlatSegmentation::MorePads()
//
// Are there more pads in the integration region
- return (fIx != -1 || fIy != -1);
+ return (fIx != -999 || fIy != -999);
}
//--------------------------------------------------------------------------
Int_t AliMUONSt345SlatSegmentation::Sector(Int_t ix, Int_t iy)
break;
}
}
- if (isec == -1) printf("\n Sector: Attention isec ! %d %d %d %d \n",
- fId, ix, iy,fNpxS[3]);
+ if (isec == -1) AliWarning(Form("Sector = %d with ix %d and iy %d, max padx %d",
+ isec, ix, iy,fNpxS[3]));
return isec;