#ifndef SISTRIPS_HPP #define SISTRIPS_HPP // // $Id: SiStrips.hpp,v 1.11 2002/05/12 23:39:15 skulik Exp $ // // File: SiStrips.hpp // Purpose: Provide a wrapper for the silicon geometry and field correction // needed to convert silicon cluster positions to global positions. // The strips classes for disks and barrels differ only in the // request needed to get the geometry positioning information. Thus, // define a base class "SiSrtips" which is the class used by RECO. // However, build two different superclasses "SiLadderStrips" and // "SiWedgeStrips" whose only purpose is to provide the correct // instantiation of an SiStrips class. // // Created: 24-NOV-1997 John Hobbs // // $Revision: 1.11 $ // // // Include files #include #include #include namespace dgs { class CartesianCoordinate; } class SiLadder; class SiWedge; class SiLadderStrips; // Actually defined below class SiWedgeStrips; //using namespace std; // Global definitions /** General strips class. The strips classes for disks and barrels differ only in the request needed to get the geometry positioning information. Thus, define a base class "SiSrtips" which is the class used by RECO. However, build two different superclasses "SiLadderStrips" and "SiWedgeStrips" whose only purpose is to provide the correct instantiation of an SiStrips class. */ class SiStrips { public: /** Instantiate a standard strips class. @param pitch pitch. @param stereo stereo angle. @param strip0 distance between the first readout strip and the edge of the active area. @param number of strips. @param view p or n side. */ SiStrips(float pitch, float stereo, float strip0, float nstrip, float view,double err_factor=1.,double err_const_term=0.); /// Default constructor. SiStrips() {} virtual ~SiStrips () {} /// Return the pitch. float get_pitch() const; /// Return the stereo angle. float get_stereo_angle() const; /// Return the position (relative) of the first strip. float get_strip0() const; /// Return the number of strips on this view. float get_nstrip() const; /// Return the view index. float get_view() const; // methods that returns constant to enlarge cluster //errors as err=sqrt((err**2 + const_term**2))*scale_factor double get_err_scale_factor() const ; double get_err_const_term() const ; /// Convert (X,Y) on the detector to global DZero. virtual dgs::CartesianCoordinate get_global(const dgs::CartesianCoordinate& local_point) const =0; /** Convert errors on the measured positions to global DZero. The error matrix is represented by a vector of vectors to limit the package contamination. **/ virtual std::vector< std::vector > transform_error(const float sxx, const float szz, const float sxz) const =0; private: float _pitch; float _stereo; float _strip0; float _nstrip; float _view; double _err_factor; double _err_const_term; friend class SiLadderStrips; // Allow classes which inherit me to directly set my friend class SiWedgeStrips; // attributes. No one else is allowed to do this. }; /// Implement an SiStrips which refers to a ladder class SiLadderStrips: public SiStrips { public: /// Instantiate SiLadderStrips for the given ladder and view. SiLadderStrips(float pitch, float stereo, float strip0, float nstrip, float view, dgs::Handle location); SiLadderStrips(float pitch, float stereo, float strip0, float nstrip, float view,double err_factor,double err_const_term, dgs::Handle location); /** Convert the given local coordinate to its corresponding point in global DZero. */ dgs::CartesianCoordinate get_global(const dgs::CartesianCoordinate& local_point) const; /// Convert errors to global DZero std::vector< std::vector > transform_error(const float sxx, const float szz, const float sxz) const; /// Return the ladder itself. dgs::Handle get_ladder_handle() const; /// Text dump a ladder SiStrips. friend std::ostream& operator <<(std::ostream& os, const SiLadderStrips &me); private: /// Handle to the given ladder in the Base Geometry tree. dgs::Handle _location; }; /// Implement an SiStrips which refers to a wedge class SiWedgeStrips: public SiStrips { public: SiWedgeStrips(float pitch, float stereo, float strip0, float nstrip, float view, dgs::Handle location); SiWedgeStrips(float pitch, float stereo, float strip0, float nstrip, float view,double err_factor,double err_const_term, dgs::Handle location); /** Convert the given local coordinate to its corresponding point in global DZero. */ dgs::CartesianCoordinate get_global(const dgs::CartesianCoordinate& local_point) const; /// Convert errors to global DZero std::vector< std::vector > transform_error(const float sxx, const float szz, const float sxz) const; /// Return the wedge itself. dgs::Handle get_wedge_handle() const; /// Text dump a wedge SiStrips. friend std::ostream& operator <<(std::ostream& os, const SiWedgeStrips& me); private: /// Handle to the given wedge in the Base Geometry tree. dgs::Handle _location; }; // Constructors/Destructors // Accessors #endif //SISTRIPS_HPP