-
- // Loop through the detector pixel
- for (time = 0; time < nTimeMax; time++) {
- for ( col = 0; col < nColMax; col++) {
- for ( row = 0; row < nRowMax; row++) {
-
- Int_t signal = digits->GetData(row,col,time);
- Int_t index = digits->GetIndex(row,col,time);
-
- // Fill the detector matrix
- if (signal > signalThresh) {
- // Store the signal amplitude
- digitMatrix->SetSignal(row,col,time,signal);
- // Store the digits number
- digitMatrix->AddTrack(row,col,time,index);
- }
-
- }
- }
- }
-
- // Loop chamber and find maxima in digitMatrix
- for ( row = 0; row < nRowMax; row++) {
- for ( col = 1; col < nColMax; col++) {
- for (time = 0; time < nTimeMax; time++) {
-
- if (digitMatrix->GetSignal(row,col,time)
- < digitMatrix->GetSignal(row,col - 1,time)) {
- // really maximum?
- if (col > 1) {
- if (digitMatrix->GetSignal(row,col - 2,time)
- < digitMatrix->GetSignal(row,col - 1,time)) {
- // yes, so set maximum flag
- maximaMatrix->SetSignal(row,col - 1,time,1);
- }
- else maximaMatrix->SetSignal(row,col - 1,time,0);
- }
- }
-
- } // time
- } // col
- } // row
-
- // now check maxima and calculate cluster position
- for ( row = 0; row < nRowMax; row++) {
- for ( col = 1; col < nColMax; col++) {
- for (time = 0; time < nTimeMax; time++) {
-
- if ((maximaMatrix->GetSignal(row,col,time) > 0)
- && (digitMatrix->GetSignal(row,col,time) > maxThresh)) {
-
- // Ratio resulting from unfolding
- Float_t ratio = 0;
- // Signals on max and neighbouring pads
- Float_t padSignal[kNsig] = {0};
- // Signals from cluster
- Float_t clusterSignal[kNclus] = {0};
- // Cluster pad info
- Float_t clusterPads[kNclus] = {0};
- // Cluster digit info
- Int_t clusterDigit[kNclus] = {0};
+ digits->Expand();
+ 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 (time = 0; time < nTimeTotal; time++) {
+
+ Int_t signalL = TMath::Abs(digits->GetDataUnchecked(row,col ,time));
+ Int_t signalM = TMath::Abs(digits->GetDataUnchecked(row,col-1,time));
+ Int_t signalR = TMath::Abs(digits->GetDataUnchecked(row,col-2,time));
+
+ // Look for the maximum
+ if (signalM >= maxThresh) {
+ if (((signalL >= sigThresh) &&
+ (signalL < signalM)) ||
+ ((signalR >= sigThresh) &&
+ (signalR < signalM))) {
+ // Maximum found, mark the position by a negative signal
+ digits->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 (digits->GetDataUnchecked(row,col,time) < 0) {