Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

SiDetLadder.h

Go to the documentation of this file.
00001 // $Id: SiDetLadder.h,v 1.5 2000/11/03 17:30:57 jrb Exp $
00002 // 
00003 //  Original author: Sawyer Gillespie
00004 //                   hgillesp@u.washington.edu
00005 //
00006 
00007 #ifndef _H_SiDetLadder_
00008 #define _H_SiDetLadder_
00009 
00010 // includes
00011 #include "instrument/SiStrip.h"
00012 #include "geometry/Point.h"
00013 #include <vector>
00014 
00015 // forward declarations
00016 class DOM_Element;
00017 
00025 class   SiDetLadder {
00026  public:
00028   SiDetLadder(const DOM_Element&);
00029 
00031   virtual ~SiDetLadder ();
00032 
00033   // is the point inside the active area (local coords). This function
00034   // returns the distance to the edge of the active area, or a negative
00035   // number if the point is outside the active area. There is also the 
00036   // possibility of checking only for being in the active area in one dimension (x);
00037   double  insideActiveArea(const Point& p) const;
00038   double  insideActiveArea(double x, double y) const;
00039   double  insideActiveArea(double x) const;
00040 
00042   int     stripId(double x) const;
00043 
00045   double  localX(int id) const;
00046 
00048   int nstrips() const;
00049 
00051   double  width() const;
00052 
00054   double  height() const;
00055 
00057   std::vector<SiStrip>   score(const Point& entry, const Point& exit,
00058                                float eloss, int stripoffset = 0) const; 
00059 
00062   void    score(const Point& entry, const Point& exit, float eloss,
00063                 SiStripList& l, int stripoffset = 0) const;
00064     
00065   // static methods
00066 
00068   static int badstrip();
00069 
00070  private:
00071   // data members
00072 
00073   // guard ring around edge of a particular die
00074   double m_guardring;  
00075 
00076   // gap between the individual dies in the y direction
00077   double  m_diegap;
00078 
00079   // pitch of the strips in this ladder
00080   double  m_strippitch;
00081 
00082   // width of the silicon (including guard ring)
00083   double  m_width;
00084 
00085   // height of each silicon die (including guard ring)
00086   double  m_dieheight;
00087     
00088   // number of dies comprising the ladder
00089   int     m_ndies;
00090 
00091   // container into which the strips are inserted
00092   SiStripList*    m_strips;
00093 
00094   // offset (0) strip id for this ladder in the list of strips
00095   int     m_stripzero;
00096 };
00097 
00098 // inline declarations
00099 
00100 inline double   SiDetLadder::width() const {
00101   return m_width;
00102 }
00103 
00104 inline double   SiDetLadder::height() const {
00105   return m_ndies * m_dieheight * (m_ndies - 1) * m_diegap;
00106 }
00107 
00108 
00109 
00110 inline double   SiDetLadder::insideActiveArea(const Point& p) const {
00111   return insideActiveArea (p.x(), p.y());
00112 }
00113 
00114 inline int  SiDetLadder::stripId(double x) const {
00115   // offset the x value by the guard ring
00116   x -= m_guardring;
00117 
00118     // check that this is a valid strip
00119   if ((x < 0.) || (x > m_width - m_guardring*2.)) return badstrip();
00120 
00121   // compute the strip id
00122   return static_cast<int>( floor ( x / m_strippitch ) );
00123 }
00124 
00125 inline double   SiDetLadder::localX (int id) const {
00126   // compute the x-location of strip within the  (no-bounds checks)
00127   return id * m_strippitch + m_strippitch/2. + m_guardring;
00128 }
00129 
00130 inline int  SiDetLadder::nstrips() const {
00131   // compute the number of strips across the dies
00132   return static_cast<int>( (m_width - m_guardring*2)/m_strippitch );
00133 }
00134 
00135 inline int  SiDetLadder::badstrip() {
00136   return SiStrip::undef_strip();
00137 }
00138 
00139 #endif  // _H_SiDetLadder

Generated at Wed Nov 21 12:22:39 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000