9 #include <pxd/geometry/SensorInfo.h>
10 #include <framework/gearbox/Unit.h>
11 #include <framework/gearbox/Const.h>
12 #include <framework/geometry/BFieldManager.h>
13 #include <vxd/geometry/GeoCache.h>
20 double SensorInfo::getElectronMobility(
double E)
const
23 static double vmElec = 1.53 * pow(m_temperature, -0.87) * 1.E9 * Unit::cm
25 static double EcElec = 1.01 * pow(m_temperature, +1.55) * Unit::V
27 static double betaElec = 2.57 * pow(m_temperature, +0.66) * 1.E-2;
29 return (vmElec / EcElec * 1.
30 / (pow(1. + pow((fabs(E) / EcElec), betaElec), (1. / betaElec))));
33 const TVector3 SensorInfo::getEField(
const TVector3& point)
const
36 double depletionVoltage = 0.5 * Unit::e * m_bulkDoping
37 / Const::permSi * m_thickness * m_thickness;
38 double gateZ = 0.5 * m_thickness - m_gateDepth;
39 double Ez = 2 * depletionVoltage * (point.Z() - gateZ) / m_thickness
45 const TVector3 SensorInfo::getBField(
const TVector3& point)
const
47 TVector3 pointGlobal = pointToGlobal(point,
true);
48 TVector3 bGlobal = BFieldManager::getField(pointGlobal);
49 TVector3 bLocal = vectorToLocal(bGlobal,
true);
53 const TVector3 SensorInfo::getDriftVelocity(
const TVector3& E,
54 const TVector3& B)
const
57 double mobility = -getElectronMobility(E.Mag());
58 double mobilityH = m_hallFactor * mobility;
60 TVector3 EcrossB = E.Cross(B);
61 TVector3 BEdotB = E.Dot(B) * B;
62 TVector3 v = mobility * E + mobility * mobilityH * EcrossB
63 + mobility * mobilityH * mobilityH * BEdotB;
64 v *= 1.0 / (1.0 + mobilityH * mobilityH * B.Mag2());
68 int SensorInfo::getPixelKind(
const VxdID sensorID,
double v)
const
77 int SensorInfo::getPixelKindNew(
const VxdID& sensorID,
int vID)
const
84 if (std::fabs(vPitch - 0.0055) < 0.0001)
86 else if (std::fabs(vPitch - 0.0060) < 0.0001)
88 else if (std::fabs(vPitch - 0.0070) < 0.0001)
90 else if (std::fabs(vPitch - 0.0085) < 0.0001)
93 B2FATAL(
"Unexpected pixel vPitch.");
98 const TVector3 SensorInfo::getLorentzShift(
double u,
double v)
const
101 const double alphaGL = 1.0 / 3.0 * sqrt(5.0 + 2.0 * sqrt(10.0 / 7.0));
102 const double betaGL = 1.0 / 3.0 * sqrt(5.0 - 2.0 * sqrt(10.0 / 7.0));
103 const double walpha = (322 - 13.0 * sqrt(70)) / 900;
104 const double wbeta = (322 + 13.0 * sqrt(70)) / 900;
105 const double distanceToPlane = 0.5 * m_thickness - m_gateDepth;
106 const double midpoint = 0.5 * distanceToPlane;
107 const double h = 0.5 * distanceToPlane;
108 const double weightGL[5] = {
109 h * walpha, h * wbeta, h * 128.0 / 225.0, h * wbeta, h* walpha
111 const double zKnots[5] = {
112 midpoint - alphaGL * h, midpoint - betaGL * h, midpoint, midpoint + betaGL * h, midpoint + alphaGL* h
115 TVector3 position(u, v, 0);
116 TVector3 currentBField = getBField(position);
117 for (
int iz = 0; iz < 5; ++iz) {
119 TVector3 currentEField = getEField(TVector3(0, 0, zKnots[iz]));
120 TVector3 velocity = getDriftVelocity(currentEField, currentBField);
121 position += weightGL[iz] / velocity.Z() * velocity;
124 position.SetX(position.X() - u);
125 position.SetY(position.Y() - v);
129 void SensorInfo::cook()
131 m_iup = m_uCells / m_width;
132 m_up = m_width / m_uCells;
134 m_vsplit = m_length * (m_splitLength - 0.5);
136 m_vp = m_length * m_splitLength / m_vCells;
139 m_vp2 = m_length * (1 - m_splitLength) / m_vCells2;
142 m_hxIG = 0.5 * m_up - m_clearBorderSmallPitch;
143 m_mIGL = 0.5 * (m_vp - m_sourceBorderLargePitch + m_drainBorderLargePitch);
144 m_sIGL = 0.5 * (m_vp - m_sourceBorderLargePitch - m_drainBorderLargePitch);
145 m_mIGS = 0.5 * (m_vp2 - m_sourceBorderSmallPitch + m_drainBorderSmallPitch);
146 m_sIGS = 0.5 * (m_vp2 - m_sourceBorderSmallPitch - m_drainBorderSmallPitch);
149 int SensorInfo::getTrappedID(
double x,
double y)
const
151 double huCells = 0.5 * m_uCells;
152 double ix = floor(x * m_iup + huCells);
154 double x0 = (ix + 0.5 - huCells) * m_up;
156 if (fabs(x - x0) < m_hxIG) {
157 if ((
unsigned)jx >= (unsigned)m_uCells)
return -1;
158 double ys = y - m_vsplit;
160 double iy = floor(ys * m_ivp2);
163 double y0 = iy * m_vp2 * 2 + m_vp2;
164 double yl = fabs(ys - y0);
165 if (fabs(yl - m_mIGS) < m_sIGS) {
166 if ((
unsigned)jy >= (
unsigned)m_vCells2)
return -1;
167 return jx + m_uCells * (jy + m_vCells);
171 ys = y + 0.5 * m_length;
172 double iy = floor(ys * m_ivp);
175 double y0 = iy * m_vp * 2 + m_vp;
176 double yl = fabs(ys - y0);
177 if (fabs(yl - m_mIGL) < m_sIGL) {
178 if ((
unsigned)jy >= (
unsigned)m_vCells)
return -1;
179 return jx + m_uCells * jy;
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
VxdID getID() const
Return the ID of the Sensor.
double getVPitch(double v=0) const
Return the pitch of the sensor.
int getVPitchID(double v=0) const
Return the pitch ID of the sensor.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getSensorNumber() const
Get the sensor id.
baseType getLayerNumber() const
Get the layer id.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.