Small cosmetic changes
This commit is contained in:
@ -171,7 +171,7 @@ Double_t PRunAsymmetry::CalcChiSquare(const std::vector<Double_t>& par)
|
|||||||
if (startTimeBin < 0)
|
if (startTimeBin < 0)
|
||||||
startTimeBin = 0;
|
startTimeBin = 0;
|
||||||
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
|
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
|
||||||
if (endTimeBin >= N)
|
if (endTimeBin > N)
|
||||||
endTimeBin = N;
|
endTimeBin = N;
|
||||||
|
|
||||||
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.
|
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.
|
||||||
|
@ -155,7 +155,7 @@ Double_t PRunSingleHisto::CalcChiSquare(const std::vector<Double_t>& par)
|
|||||||
if (startTimeBin < 0)
|
if (startTimeBin < 0)
|
||||||
startTimeBin = 0;
|
startTimeBin = 0;
|
||||||
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
|
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
|
||||||
if (endTimeBin >= N)
|
if (endTimeBin > N)
|
||||||
endTimeBin = N;
|
endTimeBin = N;
|
||||||
|
|
||||||
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.
|
// 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)
|
if (startTimeBin < 0)
|
||||||
startTimeBin = 0;
|
startTimeBin = 0;
|
||||||
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
|
Int_t endTimeBin = static_cast<Int_t>(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1;
|
||||||
if (endTimeBin >= N)
|
if (endTimeBin > N)
|
||||||
endTimeBin = N;
|
endTimeBin = N;
|
||||||
|
|
||||||
// Calculate the theory function once to ensure one function evaluation for the current set of parameters.
|
// 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;
|
Double_t time;
|
||||||
for (UInt_t i=0; i<size; i++) {
|
for (UInt_t i=0; i<size; i++) {
|
||||||
time = start + (Double_t)i*resolution;
|
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
|
// clean up
|
||||||
|
@ -2228,16 +2228,16 @@ void PTheory::CalculateLorentzLFIntegral(const Double_t *val) const
|
|||||||
*/
|
*/
|
||||||
Double_t PTheory::GetLFIntegralValue(const Double_t t) const
|
Double_t PTheory::GetLFIntegralValue(const Double_t t) const
|
||||||
{
|
{
|
||||||
UInt_t idx = static_cast<UInt_t>(t/fSamplingTime);
|
if (t < 0.0)
|
||||||
|
|
||||||
if (idx < 0)
|
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
|
||||||
if (idx > fLFIntegral.size()-2)
|
UInt_t idx = static_cast<UInt_t>(t/fSamplingTime);
|
||||||
return fLFIntegral[fLFIntegral.size()-1];
|
|
||||||
|
|
||||||
// liniarly interpolate between the two relvant function bins
|
if (idx + 2 > fLFIntegral.size())
|
||||||
Double_t df = (fLFIntegral[idx+1]-fLFIntegral[idx])/fSamplingTime*(t-idx*fSamplingTime);
|
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;
|
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;
|
N = 300;
|
||||||
|
|
||||||
// allocate memory for dyn KT LF function vector
|
// 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
|
Double_t PTheory::GetDynKTLFValue(const Double_t t) const
|
||||||
{
|
{
|
||||||
Int_t idx = static_cast<Int_t>(t/fDynLFdt);
|
if (t < 0.0)
|
||||||
|
|
||||||
if (idx < 0)
|
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
|
||||||
if (idx > static_cast<Int_t>(fDynLFFuncValue.size())-2)
|
UInt_t idx = static_cast<UInt_t>(t/fDynLFdt);
|
||||||
return fDynLFFuncValue[fDynLFFuncValue.size()-1];
|
|
||||||
|
|
||||||
// liniarly interpolate between the two relvant function bins
|
if (idx + 2 > fDynLFFuncValue.size())
|
||||||
Double_t df = (fDynLFFuncValue[idx+1]-fDynLFFuncValue[idx])*(t-idx*fDynLFdt)/fDynLFdt;
|
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;
|
return fDynLFFuncValue[idx]+df;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user