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>
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))));
39 double Ez = 2 * depletionVoltage * (point.Z() - gateZ) /
m_thickness
41 ROOT::Math::XYZVector
E(0, 0, Ez);
47 ROOT::Math::XYZVector pointGlobal =
pointToGlobal(point,
true);
53const ROOT::Math::XYZVector
55 const ROOT::Math::XYZVector& B)
const
61 ROOT::Math::XYZVector EcrossB =
E.Cross(B);
62 ROOT::Math::XYZVector BEdotB =
E.Dot(B) * B;
63 ROOT::Math::XYZVector v = mobility *
E + mobility * mobilityH * EcrossB
64 + mobility * mobilityH * mobilityH * BEdotB;
65 v *= 1.0 / (1.0 + mobilityH * mobilityH * B.Mag2());
85 if (std::fabs(vPitch - 0.0055) < 0.0001)
87 else if (std::fabs(vPitch - 0.0060) < 0.0001)
89 else if (std::fabs(vPitch - 0.0070) < 0.0001)
91 else if (std::fabs(vPitch - 0.0085) < 0.0001)
94 B2FATAL(
"Unexpected pixel vPitch.");
102 const double alphaGL = 1.0 / 3.0 *
sqrt(5.0 + 2.0 *
sqrt(10.0 / 7.0));
103 const double betaGL = 1.0 / 3.0 *
sqrt(5.0 - 2.0 *
sqrt(10.0 / 7.0));
104 const double walpha = (322 - 13.0 *
sqrt(70)) / 900;
105 const double wbeta = (322 + 13.0 *
sqrt(70)) / 900;
107 const double midpoint = 0.5 * distanceToPlane;
108 const double h = 0.5 * distanceToPlane;
109 const double weightGL[5] = {
110 h * walpha, h * wbeta, h * 128.0 / 225.0, h * wbeta, h* walpha
112 const double zKnots[5] = {
113 midpoint - alphaGL * h, midpoint - betaGL * h, midpoint, midpoint + betaGL * h, midpoint + alphaGL* h
116 ROOT::Math::XYZVector position(u, v, 0);
117 ROOT::Math::XYZVector currentBField =
getBField(position);
118 for (
int iz = 0; iz < 5; ++iz) {
120 ROOT::Math::XYZVector currentEField =
getEField(ROOT::Math::XYZVector(0, 0, zKnots[iz]));
121 ROOT::Math::XYZVector velocity =
getDriftVelocity(currentEField, currentBField);
122 position += weightGL[iz] / velocity.Z() * velocity;
125 position.SetX(position.X() - u);
126 position.SetY(position.Y() - v);
153 double ix = floor(x *
m_iup + huCells);
155 double x0 = (ix + 0.5 - huCells) *
m_up;
157 if (fabs(x - x0) <
m_hxIG) {
158 if ((
unsigned)jx >= (unsigned)
m_uCells)
return -1;
161 double iy = floor(ys *
m_ivp2);
165 double yl = fabs(ys - y0);
167 if ((
unsigned)jy >= (
unsigned)
m_vCells2)
return -1;
173 double iy = floor(ys *
m_ivp);
177 double yl = fabs(ys - y0);
179 if ((
unsigned)jy >= (
unsigned)
m_vCells)
return -1;
static const double permSi
Permittivity of Silicon.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
double m_vp2
small pixel pitch in v direction
double m_iup
the reciprocal of the pixel pitch in u direction
double m_hallFactor
The bulk doping of the Silicon sensor.
double m_ivp2
the reciprocal of the small pixel pitch in v direction
double m_bulkDoping
Doping concentration of the silicon bulk.
double m_up
pixel pitch in u direction
double m_ivp
the reciprocal of the large pixel pitch in v direction
double m_sIGS
size in v direction of the internal gate trapping region for small pixels
double m_vsplit
v coordinate which splits small and large pixel regions
double m_clearBorderSmallPitch
The distance between the clear side of the pixel and the start of the Gate, small pitch area
double getElectronMobility(double E) const
Calculate electron mobility at a given electric field.
double m_sourceBorderLargePitch
The distance between the source side of the pixel and the start of the Gate, large pitch area.
double m_vp
large pixel pitch in v direction
double m_mIGS
middle of the internal gate trapping region for small pixels
double m_drainBorderLargePitch
The distance between the drain side of the pixel and the start of the Gate, large pitch area
double m_hxIG
size in u direction of the internal gate trapping region
double m_mIGL
middle of the internal gate trapping region for large pixels
double m_sourceBorderSmallPitch
The distance between the source side of the pixel and the start of the Gate, small pitch area.
int getTrappedID(double x, double y) const
Get pixel number if the given coordinate is in the correspondin internal gate trapping region or -1 o...
double m_gateDepth
Return depth of the surface where the electrons will be collected.
const ROOT::Math::XYZVector getEField(const ROOT::Math::XYZVector &point) const
Model of the E field inside the sensor.
double m_drainBorderSmallPitch
The distance between the drain side of the pixel and the start of the Gate, small pitch area
const ROOT::Math::XYZVector getLorentzShift(double u, double v) const
Calculate Lorentz shift.
int getPixelKindNew(const VxdID &sensorID, int vID) const
Return pixel kind ID.
const ROOT::Math::XYZVector getBField(const ROOT::Math::XYZVector &point) const
Get B field value from the field map.
void cook()
calculate constants in advance
int getPixelKind(const VxdID sensorID, double v) const
Return pixel kind ID.
const ROOT::Math::XYZVector getDriftVelocity(const ROOT::Math::XYZVector &E, const ROOT::Math::XYZVector &B) const
Calculate drift velocity of an electron.
double m_temperature
The temperature of the sensor.
double m_sIGL
size in v direction of the internal gate trapping region for large pixels
static const double e
Standard of [electric charge].
static const double V
[voltage]
static const double cm
Standard units with the value = 1.
static const double s
[second]
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
ROOT::Math::XYZVector vectorToLocal(const ROOT::Math::XYZVector &global, bool reco=false) const
Convert a vector from global to local coordinates.
VxdID getID() const
Return the ID of the Sensor.
double getVPitch(double v=0) const
Return the pitch of the sensor.
double m_width
Width of the sensor.
double m_thickness
Thickness of the Sensor.
int m_vCells
Number of strips/pixels in v direction (up to splitLength for two pixel sizes)
int getVPitchID(double v=0) const
Return the pitch ID of the sensor.
double m_length
Length of the Sensor.
int m_vCells2
Number of strips/pixels in v direction after splitLength, 0 for only one pixel size.
int m_uCells
Number of strips/pixels in u direction.
double m_splitLength
Relative length at which second pixel size starts, 0 for only one pixel size.
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.
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
double sqrt(double a)
sqrt for double
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.