Small cosmetic changes

This commit is contained in:
Bastian M. Wojek 2011-05-23 12:44:18 +00:00
parent 95c6aaa4af
commit c6912f2efe
3 changed files with 19 additions and 19 deletions

View File

@ -171,7 +171,7 @@ Double_t PRunAsymmetry::CalcChiSquare(const std::vector<Double_t>& par)
if (startTimeBin < 0)
startTimeBin = 0;
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
if (endTimeBin >= N)
if (endTimeBin > N)
endTimeBin = N;
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.

View File

@ -155,7 +155,7 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
if (startTimeBin < 0)
startTimeBin = 0;
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
if (endTimeBin >= N)
if (endTimeBin > N)
endTimeBin = N;
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.
@ -254,7 +254,7 @@ Double_t PRunSingleHisto::CalcMaxLikelihood(const std::vector<Double_t>& par)
if (startTimeBin < 0)
startTimeBin = 0;
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
if (endTimeBin >= N)
if (endTimeBin > N)
endTimeBin = N;
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.
@ -343,7 +343,7 @@ void PRunSingleHisto::CalcTheory()
Double_t time;
for (UInt_t i=0; i<size; i++) {
time = start + (Double_t)i*resolution;
fData.AppendTheoryValue(N0*TMath::Exp(-time/tau)*(1+fTheory->Func(time, par, fFuncValues))+bkg);
fData.AppendTheoryValue(N0*TMath::Exp(-time/tau)*(1.0+fTheory->Func(time, par, fFuncValues))+bkg);
}
// clean up

View File

@ -2228,16 +2228,16 @@ void PTheory::CalculateLorentzLFIntegral(const Double_t *val) const
*/
Double_t PTheory::GetLFIntegralValue(const Double_t t) const
{
UInt_t idx = static_cast<UInt_t>(t/fSamplingTime);
if (idx < 0)
if (t < 0.0)
return 0.0;
if (idx > fLFIntegral.size()-2)
return fLFIntegral[fLFIntegral.size()-1];
UInt_t idx = static_cast<UInt_t>(t/fSamplingTime);
// liniarly interpolate between the two relvant function bins
Double_t df = (fLFIntegral[idx+1]-fLFIntegral[idx])/fSamplingTime*(t-idx*fSamplingTime);
if (idx + 2 > fLFIntegral.size())
return fLFIntegral.back();
// linearly interpolate between the two relvant function bins
Double_t df = (fLFIntegral[idx+1]-fLFIntegral[idx])*(t/fSamplingTime-static_cast<Double_t>(idx));
return fLFIntegral[idx]+df;
}
@ -2278,7 +2278,7 @@ void PTheory::CalculateDynKTLF(const Double_t *val, Int_t tag) const
}
}
if (N < 300) // if too view points, i.e. nu0 very small, take 300 points
if (N < 300) // if too few points, i.e. nu0 very small, take 300 points
N = 300;
// allocate memory for dyn KT LF function vector
@ -2386,16 +2386,16 @@ void PTheory::CalculateDynKTLF(const Double_t *val, Int_t tag) const
*/
Double_t PTheory::GetDynKTLFValue(const Double_t t) const
{
Int_t idx = static_cast<Int_t>(t/fDynLFdt);
if (idx < 0)
if (t < 0.0)
return 0.0;
if (idx > static_cast<Int_t>(fDynLFFuncValue.size())-2)
return fDynLFFuncValue[fDynLFFuncValue.size()-1];
UInt_t idx = static_cast<UInt_t>(t/fDynLFdt);
// liniarly interpolate between the two relvant function bins
Double_t df = (fDynLFFuncValue[idx+1]-fDynLFFuncValue[idx])*(t-idx*fDynLFdt)/fDynLFdt;
if (idx + 2 > fDynLFFuncValue.size())
return fDynLFFuncValue.back();
// linearly interpolate between the two relvant function bins
Double_t df = (fDynLFFuncValue[idx+1]-fDynLFFuncValue[idx])*(t/fDynLFdt-static_cast<Double_t>(idx));
return fDynLFFuncValue[idx]+df;
}