#ifndef TRACK_FITTER_KALMAN_H #define TRACK_FITTER_KALMAN_H #include #include #include #include #include #include #include "TrackFitterBase.h" class EXTPCKalDetector; namespace gear { class TPCParameters; class PadRowLayout2D; } //namespace gear namespace marlintpc { /** Kalman filter track fitter * * (to be filled) */ class TrackFitterKalman : public TrackFitterBase { private: /** The constructor needs nothing for pad geometry information. * Kalman filter implementation is independent of pad geometry. * * TrackFitterKalman class is a singleton. */ TrackFitterKalman(); public: virtual ~TrackFitterKalman(); /// Well defined interface to create a new instance of the track fitter static TrackFitterBase * getInstance(LCParameters const * parameters); virtual std::string getRevision(); /// Information what fitter implementation this is. virtual unsigned char getFitterType() const; #if 0 /** Return the distance of the hit \c testHitNumber of the testTrack * to the point of closest approach on the referenceTrack wrt.\ the * hit. * If no referenceTrack is given the * distance to the testTrack is returned. * * Throws EVENT::DataNotAvailableException in case there is no hit number * "testHitNumber" on testHit. * * Calls calculateResidual(EVENT::TrackerHit *testHit, EVENT::Track *trackWithoutTestHit) * in this implementation. */ virtual DoubleVec calculateResiduals(EVENT::Track *testTrack, unsigned int testHitNumber, EVENT::Track *referenceTrack = NULL); /** Return the distance of the given hit to the test track * where this hit has been removed. * The residual is calculated as the distance * along the pad row. * */ virtual DoubleVec calculateResiduals(EVENT::TrackerHit *testHit, EVENT::Track *trackWithoutTestHit); #endif /** Perform the actual fitting. Uses TrackFitterSimpleChiSquare::fitTrack, using the residuals * from this class, and then setting the correct fitter type. */ virtual IMPL::TrackImpl *fitTrack(EVENT::Track const * seedTrack); private: /// Calculate the angular distance on a circle. /// The maximum can be \f$\pi\f$. double distanceOnCircle(double phi1, double phi2); private: /// A pointer to the GEAR TPC parameters gear::TPCParameters const * _TPCParameters; /// A pointer to the GEAR pad layout gear::PadRowLayout2D const * _padLayout; /// A pinter to the EXTPCKalDetector static EXTPCKalDetector * _kaldetPtr; /// The type of pad layout (PadRowLayout2D::CARTESIAN or PadRowLayout2D::POLAR) int _padLayoutType; /// The private variable pointintg to the instance you get using getInstance function. /// This class is not explicitly a singleton, but if you use getInstance it behaves like one /// to avoid overhead by allocating and deallocating memory. static TrackFitterKalman * _theKalmanFilterFitter; /// temporary data members #if 1 static bool fgIsUpperHit; static bool fgIsLowerHit; static bool fgIsMidHit; #endif }; } // namespace marlintpc #endif // TRACK_FITTER_KALMAN_H