// HitXYPlane2.h #ifndef HitXYPlane2_H #define HitXYPlane2_H // Describes a (v,z) measurement on a XYPlane. // // This is a very simple hit. It produces one prediction with fixed // measurement which is simply the (v,z) of the track. #include "trfbase/Hit.h" #include "trfbase/McCluster.h" #include "SurfXYPlane.h" //********************************************************************** namespace trf { class ClusXYPlane2 : public McCluster { public: // static methods // Return the type name. static TypeName get_type_name() { return "ClusXYPlane2"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // cluster parameter indices enum { IV=0, IZ=1 }; private: // attributes // the surface SurfXYPlane _sxyp; // measurement double _v,_z; // the error matrix for the measurement double _dv2,_dz2,_dvdz; private: // methods // output stream void ostr(std::ostream& stream) const; // equality bool equal(const Cluster& clus) const; // generate first (and only) track prediction HitList _predict(const ETrack& tre) const; public: // methods // constructor // Depricated , go and see figure#1 . ClusXYPlane2(double dist, double phi, const HitVector& hm, const HitError& dhm ); // Depricated , go and see figure#1 . ClusXYPlane2(double dist,double phi, double v, double z, const HitError& dhm ); ClusXYPlane2(double dist,double phi, double v, double z, double dv2, double dz2, double dvdz ); // constructor // Depricated , go and see figure#1 . ClusXYPlane2(double dist, double phi, const HitVector& hm, const HitError& dhm,const McIdList& mcids ); // Depricated , go and see figure#1 . ClusXYPlane2(double dist,double phi, double v, double z, const HitError& dhm,const McIdList& mcids ); ClusXYPlane2(double dist,double phi, double v, double z, double dv2, double dz2, double dvdz,const McIdList& mcids ); // copy constructor ClusXYPlane2(const ClusXYPlane2& rhs); // destructor ~ClusXYPlane2( ); // return a unique address specifying the type Type get_type() const { return get_static_type(); }; // Write the object data. ObjData write_data() const; // return the surface const Surface& get_surface() const { return _sxyp; }; // Depricated , go and see figure#1 . HitVector get_hm() const { return HitVector(_v,_z); }; // Depricated , go and see figure#1 . HitError get_dhm() const { return HitError(_dv2,_dvdz,_dz2); }; inline double get_v() const { return _v; } inline double get_z() const { return _z; } inline double get_dv2() const { return _dv2; } inline double get_dz2() const { return _dz2; } inline double get_dvdz() const { return _dvdz; } // there are no more predictions. Hit* new_next_prediction() const { return 0; }; }; //********************************************************************** class HitXYPlane2 : public Hit { // Only ClusXYPlane2 is allowed to construct HitXYPlane2 objects. friend class ClusXYPlane2; public: // Return the type name. static TypeName get_type_name() { return "HitXYPlane2"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } private: // prediction for hm double _v,_z; // error matrix for hm double _dv2,_dz2,_dvdz; private: // output stream void ostr(std::ostream& stream) const; // equality bool equal(const Hit& hit) const; // constructor HitXYPlane2(double v, double z, double dv2, double dz2, double dvdz); public: // copy constructor HitXYPlane2(const HitXYPlane2& lhs); // destructor ~HitXYPlane2( ); // return the dimension inline int size() const { return 2; }; // return the measured hit vector HitVector measured_vector() const; // return the measured hit error HitError measured_error() const; // return the predicted hit vector HitVector predicted_vector() const; // return the predicted hit error HitError predicted_error() const; // return the derivative HitDerivative dhit_dtrack() const; // return the difference between prediction and measurement HitVector difference_vector() const; // update the prediction void update( const ETrack& tre); // return a ClusXYPlane2 reference to the cluster inline const ClusXYPlane2& get_full_cluster() const { return (const ClusXYPlane2&) *_pclus; }; inline double get_v() const { return _v; } inline double get_z() const { return _z; } inline double get_dv2() const { return _dv2; } inline double get_dz2() const { return _dz2; } inline double get_dvdz() const { return _dvdz; } // return a unique address specifying the type Type get_type() const { return get_static_type(); }; // Write the object data. ObjData write_data() const; }; } // end namespace trf #endif