// HitXYPlane1.h #ifndef HitXYPlane1_H #define HitXYPlane1_H // Describes a v-z measurement on a XYPlane. // avz = wv*v + wz*z // // This is a very simple hit. It produces one prediction with fixed // measurement which is simply the avz of the track. #include "trfbase/Hit.h" #include "trfbase/McCluster.h" #include "SurfXYPlane.h" namespace trf { //********************************************************************** class ClusXYPlane1 : public McCluster { public: // static methods // Return the type name. static TypeName get_type_name() { return "ClusXYPlane1"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } private: // attributes // the surface SurfXYPlane _sxyp; // the v axis weight double _wv; // the z axis weight double _wz; // measurement double _avz; // the error (standard deviation) for the measurement double _davz; 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 ClusXYPlane1(double dist, double phi, double wv, double wz, double avz,double davz); // constructor ClusXYPlane1(double dist, double phi, double wv, double wz, double avz,double davz, const McIdList& mcids); // copy constructor ClusXYPlane1(const ClusXYPlane1& rhs); // destructor ~ClusXYPlane1( ); // 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; }; // return the wv pitch double get_wv() const { return _wv; }; // return the wz pitch double get_wz() const { return _wz; }; // return avz double get_avz() const { return _avz; }; // return davz double get_davz() const { return _davz; }; // there are no more predictions. Hit* new_next_prediction() const { return 0; }; }; //********************************************************************** class HitXYPlane1 : public Hit { // Only ClusXYPlane1 is allowed to construct HitXYPlane1 objects. friend class ClusXYPlane1; public: // Return the type name. static TypeName get_type_name() { return "HitXYPlane1"; } // Return the creator. static ObjCreator get_creator(); // Return the type. static Type get_static_type() { return get_creator(); } private: // prediction for avz double _avz_pre; // error matrix for avz double _eavz_pre; private: // output stream void ostr(std::ostream& stream) const; // equality bool equal(const Hit& hit) const; // constructor HitXYPlane1(double avz, double eavz); public: // copy constructor HitXYPlane1(const HitXYPlane1& lhs); // destructor ~HitXYPlane1( ); // Return 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 1; }; // 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 ClusXYPlane1 reference to the cluster const ClusXYPlane1& get_full_cluster() const { return (const ClusXYPlane1&) *_pclus; }; }; } // end namespace trf #endif