+ AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
+
+ // Get the digits
+ digitsIn = fDigitsManager->GetDigits(idet);
+ digitsIn->Expand();
+ AliTRDdataArrayF *digitsOut = new AliTRDdataArrayF(digitsIn->GetNrow(), digitsIn->GetNcol(), digitsIn->GetNtime());
+
+ Transform(digitsIn, digitsOut, idet, nRowMax, nColMax, nTimeTotal, ADCthreshold);
+
+ track0 = fDigitsManager->GetDictionary(idet,0);
+ track0->Expand();
+ track1 = fDigitsManager->GetDictionary(idet,1);
+ track1->Expand();
+ track2 = fDigitsManager->GetDictionary(idet,2);
+ track2->Expand();
+
+ // Loop through the chamber and find the maxima
+ for ( row = 0; row < nRowMax; row++) {
+ for ( col = 2; col < nColMax; col++) {
+ //for ( col = 4; col < nColMax-2; col++) {
+ for (time = 0; time < nTimeTotal; time++) {
+
+ Float_t signalL = TMath::Abs(digitsOut->GetDataUnchecked(row,col ,time));
+ Float_t signalM = TMath::Abs(digitsOut->GetDataUnchecked(row,col-1,time));
+ Float_t signalR = TMath::Abs(digitsOut->GetDataUnchecked(row,col-2,time));
+
+// // Lonok for the maximum
+// if (signalM >= maxThresh) {
+// if (((signalL >= sigThresh) &&
+// (signalL < signalM)) ||
+// ((signalR >= sigThresh) &&
+// (signalR < signalM))) {
+// // Maximum found, mark the position by a negative signal
+// digitsOut->SetDataUnchecked(row,col-1,time,-signalM);
+// }
+// }
+ // Look for the maximum
+ if (signalM >= maxThresh) {
+ if ( (TMath::Abs(signalL)<=signalM) && (TMath::Abs(signalR)<=signalM) &&
+ (TMath::Abs(signalL)+TMath::Abs(signalR))>sigThresh ) {
+ // Maximum found, mark the position by a negative signal
+ digitsOut->SetDataUnchecked(row,col-1,time,-signalM);
+ }
+ }
+ }
+ }
+ }
+
+ // Now check the maxima and calculate the cluster position
+ for ( row = 0; row < nRowMax ; row++) {
+ for (time = 0; time < nTimeTotal; time++) {
+ for ( col = 1; col < nColMax-1; col++) {
+
+ // Maximum found ?
+ if (digitsOut->GetDataUnchecked(row,col,time) < 0) {
+
+ Int_t iPad;
+ for (iPad = 0; iPad < kNclus; iPad++) {
+ Int_t iPadCol = col - 1 + iPad;
+ clusterSignal[iPad] = TMath::Abs(digitsOut->GetDataUnchecked(row
+ ,iPadCol
+ ,time));
+ clusterTracks[3*iPad ] = track0->GetDataUnchecked(row,iPadCol,time) - 1;
+ clusterTracks[3*iPad+1] = track1->GetDataUnchecked(row,iPadCol,time) - 1;
+ clusterTracks[3*iPad+2] = track2->GetDataUnchecked(row,iPadCol,time) - 1;