+ if( maxf < fAmpCut || ( maxamp - ped) > fOverflowCut ) // (maxamp - ped) > fOverflowCut = Close to saturation (use low gain then)
+ {
+ return AliCaloFitResults( maxamp, ped, AliCaloFitResults::kCrude, maxf, timebinOffset);
+ }
+ else if ( maxf >= fAmpCut ) // no if statement needed really; keep for readability
+ {
+ int first = 0;
+ int last = 0;
+ int maxrev = maxampindex - bunchvector.at(index).GetStartBin();
+ SelectSubarray( fReversed, bunchvector.at(index).GetLength(), maxrev , &first, &last);
+
+ Float_t chi2 = CalculateChi2(maxf, maxrev, first, last);
+ Int_t ndf = last - first - 1; // nsamples - 2
+ return AliCaloFitResults( maxamp, ped, AliCaloFitResults::kCrude, maxf, timebinOffset,
+ timebinOffset, chi2, ndf, AliCaloFitResults::kDummy, AliCaloFitSubarray(index, maxrev, first, last) );
+ } // ampcut
+ } // bunch index
+
+ return AliCaloFitResults(AliCaloFitResults::kInvalid , AliCaloFitResults::kInvalid);