00001
00002
00003
00004
00005
00006
00007 #ifndef _H_SiDetLadder_
00008 #define _H_SiDetLadder_
00009
00010
00011 #include "instrument/SiStrip.h"
00012 #include "geometry/Point.h"
00013 #include <vector>
00014
00015
00016 class DOM_Element;
00017
00025 class SiDetLadder {
00026 public:
00028 SiDetLadder(const DOM_Element&);
00029
00031 virtual ~SiDetLadder ();
00032
00033
00034
00035
00036
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
00066
00068 static int badstrip();
00069
00070 private:
00071
00072
00073
00074 double m_guardring;
00075
00076
00077 double m_diegap;
00078
00079
00080 double m_strippitch;
00081
00082
00083 double m_width;
00084
00085
00086 double m_dieheight;
00087
00088
00089 int m_ndies;
00090
00091
00092 SiStripList* m_strips;
00093
00094
00095 int m_stripzero;
00096 };
00097
00098
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
00116 x -= m_guardring;
00117
00118
00119 if ((x < 0.) || (x > m_width - m_guardring*2.)) return badstrip();
00120
00121
00122 return static_cast<int>( floor ( x / m_strippitch ) );
00123 }
00124
00125 inline double SiDetLadder::localX (int id) const {
00126
00127 return id * m_strippitch + m_strippitch/2. + m_guardring;
00128 }
00129
00130 inline int SiDetLadder::nstrips() const {
00131
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