31 #include <Math/ProbFunc.h>
41 double& bChi2,
double& fChi2,
42 double& bNdf,
double& fNdf)
const {
46 bNdf = -1. * rep->
getDim();
47 fNdf = -1. * rep->
getDim();
50 for (std::vector<TrackPoint*>::const_iterator tpIter = pointsWM.begin(), endIter = pointsWM.end(); tpIter != endIter; ++tpIter) {
51 if (! (*tpIter)->hasFitterInfo(rep))
57 Exception exc(
"AbsKalmanFitter::getChiSqu(): fitterInfo is not a KalmanFitterInfo", __LINE__,__FILE__);
64 if (fup == NULL || bup == NULL) {
65 Exception exc(
"AbsKalmanFitter::getChiSqu(): fup == NULL || bup == NULL", __LINE__,__FILE__);
85 double bChi2(0), fChi2(0), bNdf(0), fNdf(0);
95 double bChi2(0), fChi2(0), bNdf(0), fNdf(0);
105 double bChi2(0), fChi2(0), bNdf(0), fNdf(0);
115 double bChi2(0), fChi2(0), bNdf(0), fNdf(0);
120 return std::max(0.,ROOT::Math::chisquared_cdf_c(bChi2, bNdf));
121 return std::max(0.,ROOT::Math::chisquared_cdf_c(fChi2, fNdf));
128 if (points.size() == 0)
131 for (std::vector<TrackPoint*>::const_iterator pIt = points.begin(), pEnd = points.end(); pIt != pEnd; ++pIt) {
155 if (points.size() == 0)
158 for (std::vector<TrackPoint*>::const_iterator pIt = points.begin(), pEnd = points.end(); pIt != pEnd; ++pIt) {
188 Exception e(
"AbsKalmanFitter::getMeasurement: no ReferenceState.", __LINE__,__FILE__);
192 std::vector<MeasurementOnPlane *> retVal;
201 Exception e(
"AbsKalmanFitter::getMeasurement: no prediction.", __LINE__,__FILE__);
205 std::vector<MeasurementOnPlane *> retVal;
216 Exception e(
"AbsKalmanFitter::getMeasurement: no ReferenceState.", __LINE__,__FILE__);
220 std::vector<MeasurementOnPlane *> retVal;
233 Exception e(
"AbsKalmanFitter::getMeasurement: no prediction.", __LINE__,__FILE__);
237 std::vector<MeasurementOnPlane *> retVal;
248 Exception e(
"AbsKalmanFitter::getMeasurement: choice not valid.", __LINE__,__FILE__);
274 Exception e(
"AbsKalmanFitter::canIgnoreWeights: choice not valid.", __LINE__,__FILE__);
double getNdf(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
virtual bool checkConsistency(const genfit::PruneFlags *=NULL) const
bool hasReferenceState() const
ReferenceStateOnPlane * getReferenceState() const
KalmanFittedStateOnPlane * getBackwardUpdate() const
bool isFitted() const
Has the track been fitted?
eMultipleMeasurementHandling multipleMeasurementHandling_
How to handle if there are multiple MeasurementsOnPlane.
bool isTrackFitted(const Track *tr, const AbsTrackRep *rep) const
virtual bool isLeftRightMeasurement() const
If the AbsMeasurement is a wire hit, the left/right resolution will be used.
const std::vector< genfit::TrackPoint * > & getPointsWithMeasurement() const
AbsMeasurement * getRawMeasurement(int i=0) const
MeasuredStateOnPlane with additional info produced by a Kalman filter or DAF.
bool canIgnoreWeights() const
returns if the fitter can ignore the weights and handle the MeasurementOnPlanes as if they had weight...
MeasurementOnPlane * getClosestMeasurementOnPlane(const StateOnPlane *) const
Get measurements which is closest to state.
void setFatal(bool b=true)
Set fatal flag.
Abstract base class for a track representation.
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
virtual bool hasPrediction(int direction) const
void getChiSquNdf(const Track *tr, const AbsTrackRep *rep, double &bChi2, double &fChi2, double &bNdf, double &fNdf) const
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
Object containing AbsMeasurement and AbsFitterInfo objects.
bool isTrackPrepared(const Track *tr, const AbsTrackRep *rep) const
KalmanFittedStateOnPlane * getForwardUpdate() const
double getChiSquareIncrement() const
double getPVal(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
double getChiSqu(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
bool hasBackwardUpdate() const
unsigned int getNumRawMeasurements() const
MeasuredStateOnPlane * getPrediction(int direction) const
const std::vector< MeasurementOnPlane * > getMeasurements(const KalmanFitterInfo *fi, const TrackPoint *tp, int direction) const
get the measurementsOnPlane taking the multipleMeasurementHandling_ into account
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
bool hasForwardUpdate() const
double getRedChiSqu(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
Defines for I/O streams used for error and debug printing.
This class collects all information needed and produced by a specific AbsFitter and is specific to on...
virtual unsigned int getDim() const =0
Get the dimension of the state vector used by the track representation.
FitStatus * getFitStatus(const AbsTrackRep *rep=NULL) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
const std::vector< genfit::MeasurementOnPlane * > & getMeasurementsOnPlane() const