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 ROOT::Math::chisquared_cdf_c(bChi2, bNdf);
121 return 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;
214 if (tp->getNumRawMeasurements() == 1 &&
dynamic_cast<WireMeasurement*
>(tp->getRawMeasurement()) != NULL) {
216 Exception e(
"AbsKalmanFitter::getMeasurement: no ReferenceState.", __LINE__,__FILE__);
220 std::vector<MeasurementOnPlane *> retVal;
231 if (tp->getNumRawMeasurements() == 1 &&
dynamic_cast<WireMeasurement*
>(tp->getRawMeasurement()) != NULL) {
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__);
This class collects all information needed and produced by a specific AbsFitter and is specific to on...
virtual bool hasPrediction(int direction) const
double getChiSqu(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
double getRedChiSqu(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
bool canIgnoreWeights() const
returns if the fitter can ignore the weights and handle the MeasurementOnPlanes as if they had weight...
bool isTrackFitted(const Track *tr, const AbsTrackRep *rep) const
const std::vector< MeasurementOnPlane * > getMeasurements(const KalmanFitterInfo *fi, const TrackPoint *tp, int direction) const
get the measurementsOnPlane taking the multipleMeasurementHandling_ into account
void getChiSquNdf(const Track *tr, const AbsTrackRep *rep, double &bChi2, double &fChi2, double &bNdf, double &fNdf) const
double getPVal(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
bool isTrackPrepared(const Track *tr, const AbsTrackRep *rep) const
eMultipleMeasurementHandling multipleMeasurementHandling_
How to handle if there are multiple MeasurementsOnPlane.
double getNdf(const Track *tr, const AbsTrackRep *rep, int direction=-1) const
Abstract base class for a track representation.
virtual unsigned int getDim() const =0
Get the dimension of the state vector used by the track representation.
Exception class for error handling in GENFIT (provides storage for diagnostic information)
void setFatal(bool b=true)
Set fatal flag.
bool isFitted() const
Has the track been fitted?
MeasuredStateOnPlane with additional info produced by a Kalman filter or DAF.
double getChiSquareIncrement() const
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
ReferenceStateOnPlane * getReferenceState() const
virtual bool checkConsistency() const
const std::vector< genfit::MeasurementOnPlane * > & getMeasurementsOnPlane() const
bool hasReferenceState() const
KalmanFittedStateOnPlane * getBackwardUpdate() const
MeasurementOnPlane * getClosestMeasurementOnPlane(const StateOnPlane *) const
Get measurements which is closest to state.
bool hasForwardUpdate() const
MeasuredStateOnPlane * getPrediction(int direction) const
bool hasBackwardUpdate() const
KalmanFittedStateOnPlane * getForwardUpdate() const
Object containing AbsMeasurement and AbsFitterInfo objects.
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
const std::vector< genfit::TrackPoint * > & getPointsWithMeasurement() const
FitStatus * getFitStatus(const AbsTrackRep *rep=NULL) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the co...
@ weightedClosestToPrediction
@ weightedClosestToReference
@ weightedClosestToReferenceWire
@ unweightedClosestToReference
@ weightedClosestToPredictionWire
@ unweightedClosestToPredictionWire
@ unweightedClosestToPrediction
@ unweightedClosestToReferenceWire