// AddFitCyl_PhiZ_PhiZ.h #ifndef AddFitCyl_PhiZ_PhiZ_H #define AddFitCyl_PhiZ_PhiZ_H // An add fitter to add a cylinder phiz-measurement to a track // with one phi-measurement and any number of phi-measurements. // // If the propagator is not defined, then the parameters are set at // directly at the new surface and the fit is performed. // // If the optional propagator is defined, then the track is propagated // back to the first hit, has parameters set, and is then propagated // to the new hit surface where a fit is performed. // // Note that the fitter and propagator are not managed here. // // ObjStream example: // // [ myfit AddFitCyl_PhiZ_PhiZ // bfield=2.0 // fitter=*myfit // propagator=*myprop // surface=@mysurf // error_matrix=double( // 0.01 // 0.0 0.02 // 0.0 0.0 0.03 // 0.0 0.0 0.0 0.04 // 0.0 0.0 0.0 0.0 0.05 // ) // fit_order="UNCHANGED" // flag="DR_ALPHA" // z0min=-50 // z0max=50 // ] // // To use the global bfield: // // [ myfit AddFitCyl_PhiZ_PhiZ bfield=@bfield ... ] // // #include "ptr/Ptr.h" #include "trffit/AddFitter.h" #include "trfcyl/SurfCylinder.h" #include "trfbase/TrackVector.h" #include "trfbase/SurfacePtr.h" #include "trfbase/ObjDoublePtr.h" namespace trf { class Propagator; class AddFitCyl_PhiZ_PhiZ : public AddFitter { public: // static methods // Return the type name. static TypeName get_type_name() { return "AddFitCyl_PhiZ_PhiZ"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // enums // Possible states for flag specifying how to calculate tan(lambda) enum FlagState { DR_ONLY, // assumes alpha =0 and C = 0 DR_ALPHA, // assumes C = 0; alpha well known DR_ALPHA_CURV // alpha and C are well known }; enum FitOrder { INWARD = 0, OUTWARD = 1, UNCHANGED = 2 }; private: // attributes // Magnetic field (Tesla) ObjDoublePtr _bfield; // fitter (used to update error matrix) const AddFitter& _fit; // propagator const Propagator& _prop; // surface at which to start track SurfacePtr _psrf; // Starting error matrix. const TrackError _err; // flag indicating to use the current track curvature to // estimate lambda FlagState _flag; int _fit_order; // z0 limits double _z0min; double _z0max; private: // methods // ouput stream void ostr(std::ostream& stream) const; public: // methods // constructor AddFitCyl_PhiZ_PhiZ(ObjDoublePtr bfield, const AddFitter& fit, const Propagator& prop, const SurfacePtr& psrf, const TrackError& err, double z0min, double z0max, FlagState flag =DR_ALPHA ); AddFitCyl_PhiZ_PhiZ(ObjDoublePtr bfield, const AddFitter& fit, const Propagator& prop, const SurfacePtr& psrf, const TrackError& err, double z0min, double z0max, FlagState flag, int fit_order ); // destructor ~AddFitCyl_PhiZ_PhiZ(); // Return the type. Type get_type() const { return get_static_type(); } // Write the object data. ObjData write_data() const; // Return the B-fiield. double get_bfield() const { return (*_bfield)(); } // Return the fitter. const AddFitter& get_fitter() const { return _fit; } // Return the propagator. const Propagator& get_propagator() const { return _prop; } // Return the starting surface. const SurfacePtr& get_surface() const { return _psrf; } // Return the starting error. const TrackError& get_error() const { return _err; } // Return the min z0. double get_z0min() const { return _z0min; } // Return the max z0. double get_z0max() const { return _z0max; } // Return the flag. FlagState get_flag() const { return _flag; } // add the hit int add_hit(HTrack& trh, const HitPtr& phit) const; // Return fit order flag int get_fit_order() const { return _fit_order;} }; } // end namespace trf #endif