diff --git a/ChangeLog b/ChangeLog index 7173bbc1..e2aef541 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ NEW 2012-04-24 added a first version for negative muon fitting. At the same logx/logy handling). FIXED 2012-05-30 fixed RRF bug in single histo plotting. FIXED 2012-05-18 fixed wrong forward/backward tag for ROOT-PPC (MUSR-215) +CHANGED 2012-08-28 prevent LF from allocating too much memory CHANGED 2012-06-29 changed handling of the timeout for musrfit. CHANGED 2012-05-10 prevent any2many from overwriting an input file. At the some additional bug fixing of any2many has be carried out. diff --git a/src/classes/PTheory.cpp b/src/classes/PTheory.cpp index 97f2f4c8..27664ad7 100644 --- a/src/classes/PTheory.cpp +++ b/src/classes/PTheory.cpp @@ -2595,10 +2595,10 @@ void PTheory::CalculateDynKTLF(const Double_t *val, Int_t tag) const Double_t tmin = 20.0; switch (tag) { case 0: // Gauss - tmin = sqrt(3.0)/val[1]; + tmin = fabs(sqrt(3.0)/val[1]); break; case 1: // Lorentz - tmin = 2.0/val[1]; + tmin = fabs(2.0/val[1]); break; default: break; @@ -2612,6 +2612,9 @@ void PTheory::CalculateDynKTLF(const Double_t *val, Int_t tag) const if (N < 300) // if too few points, i.e. nu0 very small, take 300 points N = 300; + if (N>1e6) // make sure that N is not too large to prevent memory overflow + N = 1e6; + // allocate memory for dyn KT LF function vector fDynLFFuncValue.clear(); // get rid of a possible previous vector fDynLFFuncValue.resize(N);