// HitZPlane2.h #ifndef HitZPlane2_H #define HitZPlane2_H // Describes a (x,y) measurement on a ZPlane. // // This is a very simple hit. It produces one prediction with fixed // measurement which is simply the (x,y) of the track. #include "trfbase/Hit.h" #include "trfbase/McCluster.h" #include "SurfZPlane.h" namespace trf { //********************************************************************** class ClusZPlane2 : public McCluster { public: // static methods // Return the type name. static TypeName get_type_name() { return "ClusZPlane2"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } public: // cluster parameter indices enum { IX=0, IY=1 }; private: // attributes // the surface SurfZPlane _szp; // measurement double _x,_y; // the error matrix for the measurement double _dx2,_dy2,_dxdy; 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 . ClusZPlane2(double zpos, const HitVector& hm, const HitError& dhm); // Depricated , go and see figure#1 . ClusZPlane2(double zpos, double x, double y, const HitError& dhm); ClusZPlane2(double zpos, double x, double y, double dx2, double dy2, double dxdy); // Depricated , go and see figure#1 . ClusZPlane2(double zpos, const HitVector& hm, const HitError& dhm,const McIdList& mcids); // Depricated , go and see figure#1 . ClusZPlane2(double zpos, double x, double y, const HitError& dhm,const McIdList& mcids); ClusZPlane2(double zpos, double x, double y, double dx2, double dy2, double dxdy,const McIdList& mcids); // copy constructor ClusZPlane2(const ClusZPlane2& rhs); // destructor ~ClusZPlane2( ); // 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 _szp; }; // Depricated , go and see figure#1 HitVector get_hm() const { return HitVector(_x,_y); }; // Depricated , go and see figure#1 HitError get_dhm() const { return HitError(_dx2,_dxdy,_dy2); }; // there are no more predictions. Hit* new_next_prediction() const { return 0; }; inline double get_x() const { return _x; } inline double get_y() const { return _y; } inline double get_dx2() const { return _dx2; } inline double get_dy2() const { return _dy2; } inline double get_dxdy() const { return _dxdy; } }; //********************************************************************** class HitZPlane2 : public Hit { // Only ClusZPlane2 is allowed to construct HitZPlane2 objects. friend class ClusZPlane2; public: // Return the type name. static TypeName get_type_name() { return "HitZPlane2"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } private: // prediction for hm double _x,_y; // error matrix for hm double _dx2,_dy2,_dxdy; private: // output stream void ostr(std::ostream& stream) const; // equality bool equal(const Hit& hit) const; // constructor HitZPlane2(double x, double y, double dx2, double dy2, double dxdy); public: // copy constructor HitZPlane2(const HitZPlane2& lhs); // destructor ~HitZPlane2( ); // 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 dimension 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); inline double get_x() const { return _x; } inline double get_y() const { return _y; } inline double get_dx2() const { return _dx2; } inline double get_dy2() const { return _dy2; } inline double get_dxdy() const { return _dxdy; } // return a ClusZPlane2 reference to the cluster inline const ClusZPlane2& get_full_cluster() const { return (const ClusZPlane2&) *_pclus; }; }; } // end namespace trf #endif