- Float_t ped = ReverseAndSubtractPed( &(bunchvector.at(index)) , altrocfg1, altrocfg2, fReversed );
- Float_t maxf = TMath::MaxElement( bunchvector.at(index).GetLength(), fReversed );
- short maxrev = maxampindex - bunchvector.at(index).GetStartBin();
- // timebinOffset is timebin value at maximum (maxrev)
- short timebinOffset = maxampindex - (bunchvector.at(index).GetLength()-1);
- if( maxf < fAmpCut || ( maxamp - ped) > fOverflowCut ) // (maxamp - ped) > fOverflowCut = Close to saturation (use low gain then)
- {
- return AliCaloFitResults( maxamp, ped, Ret::kCrude, maxf, timebinOffset);
- }
- else if ( maxf >= fAmpCut )
- {
- int first = 0;
- int last = 0;
- SelectSubarray( fReversed, bunchvector.at(index).GetLength(), maxrev, &first, &last, fFitArrayCut );
- int nsamples = last - first + 1;
-
- if( ( nsamples ) >= fNsampleCut )
+ return AliCaloFitResults( maxamp, ped, Ret::kCrude, maxf, timebinOffset);
+ }
+ else if ( maxf >= fAmpCut )
+ {
+ int first = 0;
+ int last = 0;
+ SelectSubarray( fReversed, bunchvector.at(index).GetLength(), maxrev, &first, &last, fFitArrayCut );
+ int nsamples = last - first + 1;
+
+ if( ( nsamples ) >= fNsampleCut )