8 #include <pxd/geometry/SensorInfo.h>
9 #include <framework/gearbox/Unit.h>
10 #include <framework/gearbox/Const.h>
11 #include <framework/geometry/BFieldManager.h>
12 #include <vxd/geometry/GeoCache.h>
19 double SensorInfo::getElectronMobility(
double E)
const
22 static double vmElec = 1.53 * pow(m_temperature, -0.87) * 1.E9 * Unit::cm
24 static double EcElec = 1.01 * pow(m_temperature, +1.55) * Unit::V
26 static double betaElec = 2.57 * pow(m_temperature, +0.66) * 1.E-2;
28 return (vmElec / EcElec * 1.
29 / (pow(1. + pow((fabs(E) / EcElec), betaElec), (1. / betaElec))));
32 const TVector3 SensorInfo::getEField(
const TVector3& point)
const
35 double depletionVoltage = 0.5 * Unit::e * m_bulkDoping
36 / Const::permSi * m_thickness * m_thickness;
37 double gateZ = 0.5 * m_thickness - m_gateDepth;
38 double Ez = 2 * depletionVoltage * (point.Z() - gateZ) / m_thickness
44 const TVector3 SensorInfo::getBField(
const TVector3& point)
const
46 TVector3 pointGlobal = pointToGlobal(point,
true);
47 TVector3 bGlobal = BFieldManager::getField(pointGlobal);
48 TVector3 bLocal = vectorToLocal(bGlobal,
true);
52 const TVector3 SensorInfo::getDriftVelocity(
const TVector3& E,
53 const TVector3& B)
const
56 double mobility = -getElectronMobility(E.Mag());
57 double mobilityH = m_hallFactor * mobility;
59 TVector3 EcrossB = E.Cross(B);
60 TVector3 BEdotB = E.Dot(B) * B;
61 TVector3 v = mobility * E + mobility * mobilityH * EcrossB
62 + mobility * mobilityH * mobilityH * BEdotB;
63 v *= 1.0 / (1.0 + mobilityH * mobilityH * B.Mag2());
67 int SensorInfo::getPixelKind(
const VxdID sensorID,
double v)
const
76 int SensorInfo::getPixelKindNew(
const VxdID& sensorID,
int vID)
const
83 if (std::fabs(vPitch - 0.0055) < 0.0001)
85 else if (std::fabs(vPitch - 0.0060) < 0.0001)
87 else if (std::fabs(vPitch - 0.0070) < 0.0001)
89 else if (std::fabs(vPitch - 0.0085) < 0.0001)
92 B2FATAL(
"Unexpected pixel vPitch.");
97 const TVector3 SensorInfo::getLorentzShift(
double u,
double v)
const
100 const double alphaGL = 1.0 / 3.0 * sqrt(5.0 + 2.0 * sqrt(10.0 / 7.0));
101 const double betaGL = 1.0 / 3.0 * sqrt(5.0 - 2.0 * sqrt(10.0 / 7.0));
102 const double walpha = (322 - 13.0 * sqrt(70)) / 900;
103 const double wbeta = (322 + 13.0 * sqrt(70)) / 900;
104 const double distanceToPlane = 0.5 * m_thickness - m_gateDepth;
105 const double midpoint = 0.5 * distanceToPlane;
106 const double h = 0.5 * distanceToPlane;
107 const double weightGL[5] = {
108 h * walpha, h * wbeta, h * 128.0 / 225.0, h * wbeta, h* walpha
110 const double zKnots[5] = {
111 midpoint - alphaGL * h, midpoint - betaGL * h, midpoint, midpoint + betaGL * h, midpoint + alphaGL* h
114 TVector3 position(u, v, 0);
115 TVector3 currentBField = getBField(position);
116 for (
int iz = 0; iz < 5; ++iz) {
118 TVector3 currentEField = getEField(TVector3(0, 0, zKnots[iz]));
119 TVector3 velocity = getDriftVelocity(currentEField, currentBField);
120 position += weightGL[iz] / velocity.Z() * velocity;
123 position.SetX(position.X() - u);
124 position.SetY(position.Y() - v);
128 void SensorInfo::cook()
130 m_iup = m_uCells / m_width;
131 m_up = m_width / m_uCells;
133 m_vsplit = m_length * (m_splitLength - 0.5);
135 m_vp = m_length * m_splitLength / m_vCells;
138 m_vp2 = m_length * (1 - m_splitLength) / m_vCells2;
141 m_hxIG = 0.5 * m_up - m_clearBorderSmallPitch;
142 m_mIGL = 0.5 * (m_vp - m_sourceBorderLargePitch + m_drainBorderLargePitch);
143 m_sIGL = 0.5 * (m_vp - m_sourceBorderLargePitch - m_drainBorderLargePitch);
144 m_mIGS = 0.5 * (m_vp2 - m_sourceBorderSmallPitch + m_drainBorderSmallPitch);
145 m_sIGS = 0.5 * (m_vp2 - m_sourceBorderSmallPitch - m_drainBorderSmallPitch);
148 int SensorInfo::getTrappedID(
double x,
double y)
const
150 double huCells = 0.5 * m_uCells;
151 double ix = floor(x * m_iup + huCells);
153 double x0 = (ix + 0.5 - huCells) * m_up;
155 if (fabs(x - x0) < m_hxIG) {
156 if ((
unsigned)jx >= (unsigned)m_uCells)
return -1;
157 double ys = y - m_vsplit;
159 double iy = floor(ys * m_ivp2);
162 double y0 = iy * m_vp2 * 2 + m_vp2;
163 double yl = fabs(ys - y0);
164 if (fabs(yl - m_mIGS) < m_sIGS) {
165 if ((
unsigned)jy >= (
unsigned)m_vCells2)
return -1;
166 return jx + m_uCells * (jy + m_vCells);
170 ys = y + 0.5 * m_length;
171 double iy = floor(ys * m_ivp);
174 double y0 = iy * m_vp * 2 + m_vp;
175 double yl = fabs(ys - y0);
176 if (fabs(yl - m_mIGL) < m_sIGL) {
177 if ((
unsigned)jy >= (
unsigned)m_vCells)
return -1;
178 return jx + m_uCells * jy;