// The eveluation of Peak position and amplitude using the Neural Network
if( bunchvector.size() <= 0 )
{
- return AliCaloFitResults(9999, 9999, 9999, 9999 , 9999, 9999, 9999 );
+ return AliCaloFitResults(AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid , AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid );
}
- short maxindex;
+ short maxampindex;
short maxamp;
- int bindex = SelectBunch( bunchvector, &maxindex , &maxamp ) ;
+ int index = SelectBunch( bunchvector, &maxampindex , &maxamp ) ;
- if( bindex < 0 )
+ if( index < 0 )
{
- return AliCaloFitResults(9999, 9999, 9999, 9999 , 9999, 9999, 9999 );
+ return AliCaloFitResults(AliCaloFitResults::kInvalid, AliCaloFitResults::kInvalid);
}
int first = 0;
int last = 0;
- Float_t ped = ReverseAndSubtractPed( &(bunchvector.at( bindex ) ) , altrocfg1, altrocfg2, fReversed );
+ Float_t ped = ReverseAndSubtractPed( &(bunchvector.at( index ) ) , altrocfg1, altrocfg2, fReversed );
- short maxrev = maxindex - bunchvector.at(bindex).GetStartBin();
- short timebinOffset = maxindex - (bunchvector.at(bindex).GetLength()-1);
-
- SelectSubarray( fReversed, bunchvector.at(bindex).GetLength(), maxrev , &first, &last);
+ short maxrev = maxampindex - bunchvector.at(index).GetStartBin();
+ short timebinOffset = maxampindex - (bunchvector.at(index).GetLength()-1);
+ double maxf = maxamp - ped;
+
+ SelectSubarray( fReversed, bunchvector.at(index).GetLength(), maxrev , &first, &last);
if(maxrev < 1000 )
{
if ( ( maxrev - first) < 2 && (last - maxrev ) < 2)
{
- return AliCaloFitResults(9999, 9999, 9999, 9999 , 9999, 9999, 9999 );
+ return AliCaloFitResults( maxamp, ped, AliCaloFitResults::kNoFit, maxf, maxrev+timebinOffset, AliCaloFitResults::kNoFit, AliCaloFitResults::kNoFit,
+ AliCaloFitResults::kNoFit, AliCaloFitSubarray(index, maxrev, first, last) );
}
else
{
double amp = (maxamp - ped)*fNeuralNet->Value( 0, fNNInput[0], fNNInput[1], fNNInput[2], fNNInput[3], fNNInput[4]);
double tof = (fNeuralNet->Value( 1, fNNInput[0], fNNInput[1], fNNInput[2], fNNInput[3], fNNInput[4]) + timebinOffset ) ;
- return AliCaloFitResults( maxamp, ped , -1, amp , tof, -2, -3 );
+ return AliCaloFitResults( maxamp, ped , AliCaloFitResults::kDummy, amp , tof, AliCaloFitResults::kDummy, AliCaloFitResults::kDummy,
+ AliCaloFitResults::kDummy, AliCaloFitSubarray(index, maxrev, first, last) );
}
}
- return AliCaloFitResults(9999, 9999, 9999, 9999 , 9999, 9999, 9999 );
+ return AliCaloFitResults( maxamp, ped, AliCaloFitResults::kNoFit, maxf, maxrev+timebinOffset, AliCaloFitResults::kNoFit, AliCaloFitResults::kNoFit,
+ AliCaloFitResults::kNoFit, AliCaloFitSubarray(index, maxrev, first, last) );
}