Fixes the crash of Fourier if the maximal range given in the Fourier block is larger than the available.
This commit is contained in:
parent
c6f5c1205e
commit
9c700a3773
@ -8,6 +8,8 @@ FIXED 2015-10-29 TMusrRunHeader didn't map a double vector properly into a
|
|||||||
string. The last element was a copy of the 2nd last instead
|
string. The last element was a copy of the 2nd last instead
|
||||||
if the proper last. This is now fixed. Fixed also some
|
if the proper last. This is now fixed. Fixed also some
|
||||||
comment typo.
|
comment typo.
|
||||||
|
FIXED 2015-11-11 Fixes the crash of Fourier if the maximal range given in the
|
||||||
|
Fourier block is larger than the available.
|
||||||
|
|
||||||
changes since 0.14.0
|
changes since 0.14.0
|
||||||
===================================
|
===================================
|
||||||
|
@ -299,6 +299,10 @@ TH1F* PFourier::GetPhaseOptRealFourier(Double_t &phase, const Double_t scale, co
|
|||||||
// check if maximum frequency is given. If yes, get the proper maxBin
|
// check if maximum frequency is given. If yes, get the proper maxBin
|
||||||
if (max != -1.0) {
|
if (max != -1.0) {
|
||||||
maxBin = (UInt_t)(max/fResolution);
|
maxBin = (UInt_t)(max/fResolution);
|
||||||
|
if (maxBin >= noOfFourierBins) {
|
||||||
|
maxBin = noOfFourierBins;
|
||||||
|
cerr << "**WARNING** maximum frequency/field out of range. Will adopted it." << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the real/imag Fourier from min to max
|
// copy the real/imag Fourier from min to max
|
||||||
|
Loading…
x
Reference in New Issue
Block a user