mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-10 19:20:44 +01:00
Removed criteria of rejecting fits if sample fit chi2PerDof is bad.
This commit is contained in:
parent
c48e2be20b
commit
375b8fd038
@ -247,14 +247,6 @@ void XYSampleData::checkChi2PerDof(double Chi2PerDof)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XYSampleData::checkChi2PerDof(double Chi2PerDof, unsigned int &counter)
|
|
||||||
{
|
|
||||||
if(Chi2PerDof >= 2 or Chi2PerDof < 0 or isnan(Chi2PerDof))
|
|
||||||
{
|
|
||||||
counter++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// get total fit variance matrix and its pseudo-inverse ////////////////////////
|
// get total fit variance matrix and its pseudo-inverse ////////////////////////
|
||||||
const DMat & XYSampleData::getFitVarMat(void)
|
const DMat & XYSampleData::getFitVarMat(void)
|
||||||
{
|
{
|
||||||
@ -314,7 +306,6 @@ SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
|
|||||||
result.chi2_.resize(nSample_);
|
result.chi2_.resize(nSample_);
|
||||||
result.model_.resize(v.size());
|
result.model_.resize(v.size());
|
||||||
double chi2PerDof;
|
double chi2PerDof;
|
||||||
unsigned int badSampleFits = 0;
|
|
||||||
goodFit_ = true;
|
goodFit_ = true;
|
||||||
FOR_STAT_ARRAY(result, s)
|
FOR_STAT_ARRAY(result, s)
|
||||||
{
|
{
|
||||||
@ -342,11 +333,6 @@ SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
|
|||||||
result.model_[j][s] = sampleResult.getModel(j);
|
result.model_[j][s] = sampleResult.getModel(j);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(badSampleFits > 0.25*nSample_)
|
|
||||||
{
|
|
||||||
goodFit_ = false;
|
|
||||||
cerr << "At least " << 0.25*nSample_ << " of the sample fits have bad chi2/dof. Aborting fit." << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.nPar_ = sampleResult.getNPar();
|
result.nPar_ = sampleResult.getNPar();
|
||||||
|
@ -93,7 +93,6 @@ public:
|
|||||||
DVec getYError(const Index j);
|
DVec getYError(const Index j);
|
||||||
bool checkFit(); // check fit candidate based on chi2PerDof
|
bool checkFit(); // check fit candidate based on chi2PerDof
|
||||||
void checkChi2PerDof(double Chi2PerDof);
|
void checkChi2PerDof(double Chi2PerDof);
|
||||||
void checkChi2PerDof(double Chi2PerDof, unsigned int &counter);
|
|
||||||
// get total fit variance matrix and its pseudo-inverse
|
// get total fit variance matrix and its pseudo-inverse
|
||||||
const DMat & getFitVarMat(void);
|
const DMat & getFitVarMat(void);
|
||||||
const DMat & getFitVarMatPInv(void);
|
const DMat & getFitVarMatPInv(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user