00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #include "StSsdHit.h"
00058 #include "StTrack.h"
00059
00060 static const char rcsid[] = "$Id: StSsdHit.cxx,v 2.14 2009/11/23 22:20:51 ullrich Exp $";
00061
00062 StMemoryPool StSsdHit::mPool(sizeof(StSsdHit));
00063
00064 ClassImp(StSsdHit)
00065
00066 StSsdHit::StSsdHit()
00067 {
00068 mLocalPosition[0] = 0;
00069 mLocalPosition[1] = 0;
00070 }
00071
00072
00073 StSsdHit::StSsdHit(const StThreeVectorF& p,
00074 const StThreeVectorF& e,
00075 unsigned int hw, float q, unsigned char c)
00076 : StHit(p, e, hw, q, c)
00077 {
00078 mLocalPosition[0] = 0;
00079 mLocalPosition[1] = 0;
00080 }
00081
00082
00083 StSsdHit::~StSsdHit() {}
00084
00085 unsigned int
00086 StSsdHit::ladder() const
00087 {
00088 unsigned long numwaf = (mHardwarePosition>>4) & ~(~0UL<<9);
00089 return (numwaf/mWaferPerLadder+1);
00090 }
00091
00092 unsigned int
00093 StSsdHit::wafer() const
00094 {
00095 unsigned long numwaf = (mHardwarePosition>>4) & ~(~0UL<<9);
00096 return (numwaf-(numwaf/mWaferPerLadder)*mWaferPerLadder+1);
00097 }
00098
00099 unsigned int
00100 StSsdHit::centralStripNSide() const
00101 {
00102 return bits(13, 10);
00103 }
00104
00105 unsigned int
00106 StSsdHit::centralStripPSide() const
00107 {
00108 return (bits(23, 5)+bits(13,10)-15);
00109 }
00110
00111 unsigned int
00112 StSsdHit::clusterSizeNSide() const
00113 {
00114 return bits(28, 2)+1;
00115 }
00116
00117 unsigned int
00118 StSsdHit::clusterSizePSide() const
00119 {
00120 return bits(30, 2)+1;
00121 }
00122
00123 float
00124 StSsdHit::localPosition(unsigned int i) const
00125 {
00126 if (i<2)
00127 return mLocalPosition[i];
00128 else
00129 return 0;
00130 }
00131
00132 void
00133 StSsdHit::setLocalPosition(float u, float v)
00134 {
00135 mLocalPosition[0] = u;
00136 mLocalPosition[1] = v;
00137 }
00138
00139 int
00140 StSsdHit::volumeID() const {return 10000 * sector() + 7000 + 100 * wafer() + ladder();}
00141
00142 ostream& operator<<(ostream& os, const StSsdHit& v)
00143 {
00144 return os << Form("Ssd l:%2i w:%2i",v.ladder(), v.wafer())
00145 << *((StHit *)&v)
00146 << Form(" Luv: %8.3f %8.3f",v.localPosition(0),v.localPosition(1));
00147 }
00148 void StSsdHit::Print(const Option_t *option) const { cout << *this << endl;}