 |
Belle II Software
release-05-02-19
|
11 #ifndef VXD_SENSORINFO_H
12 #define VXD_SENSORINFO_H
14 #include <vxd/dataobjects/VxdID.h>
17 #include <TGeoMatrix.h>
32 class SensorInfoBase {
64 int uCells,
int vCells,
double width2 = -1,
double splitLength = -1,
int vCells2 = 0):
195 int getUCellID(
double u,
double v = 0,
bool clamp =
false)
const
205 int getVCellID(
double v,
bool clamp =
false)
const
230 bool inside(
double u,
double v,
double uTolerance = DBL_EPSILON,
double vTolerance = DBL_EPSILON)
const
232 double nu = u / (
getWidth(v) + 2 * uTolerance) + 0.5;
233 double nv = v / (
getLength() + 2 * vTolerance) + 0.5;
234 return 0 <= nu && nu <= 1 && 0 <= nv && nv <= 1;
241 bool inside(
const TVector3& local)
const
244 return inside(local.x(), local.y()) && 0 <= nw && nw <= 1;
254 v = std::min(length, std::max(-length, v));
256 u = std::min(width, std::max(-width, u));
270 TVector3
pointToGlobal(
const TVector3& local,
bool reco =
false)
const;
277 TVector3
vectorToGlobal(
const TVector3& local,
bool reco =
false)
const;
284 TVector3
pointToLocal(
const TVector3& global,
bool reco =
false)
const;
291 TVector3
vectorToLocal(
const TVector3& global,
bool reco =
false)
const;
356 double u = local.x();
357 double v = local.y();
362 local.SetZ(std::min(thickness, std::max(-thickness, local.z())));
369 local.GetXYZ(clocal);
372 return TVector3(cmaster);
379 local.GetXYZ(clocal);
381 else m_transform.LocalToMasterVect(clocal, cmaster);
382 return TVector3(cmaster);
389 global.GetXYZ(cmaster);
392 return TVector3(clocal);
399 global.GetXYZ(cmaster);
401 else m_transform.MasterToLocalVect(cmaster, clocal);
402 return TVector3(clocal);
double getForwardWidth() const
Convinience Wrapper to return width at forward side.
TGeoHMatrix m_recoTransform
Alignment-corrected transformation matrix of the Sensor for use in reconstruction.
int m_vCells
Number of strips/pixels in v direction (up to splitLength for two pixel sizes)
const std::vector< double > & getSurfaceParameters() const
Return parameters of planar deformation.
int getUCells() const
Return number of pixel/strips in u direction.
int m_uCells
Number of strips/pixels in u direction.
std::vector< double > m_surfaceDeformationParameters
Vector contains all parameter needed for description planar deformation of sensors.
Class to uniquely identify a any structure of the PXD and SVD.
SensorType
Enum specifing the type of sensor the SensorInfo represents.
int getUCellID(double u, double v=0, bool clamp=false) const
Return the corresponding pixel/strip ID of a given u coordinate.
unsigned short m_id
ID of the Sensor.
virtual ~SensorInfoBase()
Default constructor to make class polymorph.
const TGeoHMatrix & getTransformation(bool reco=false) const
Return the transformation matrix of the Sensor.
void setSurfaceParameters(const std::vector< double > &planarParameters)
Fill parameters of planar deformation to vector.
TVector3 vectorToGlobal(const TVector3 &local, bool reco=false) const
Convert a vector from local to global coordinates.
@ VXD
Any type of VXD Sensor.
double m_width
Width of the sensor.
double getWidth(double v=0) const
Return the width of the sensor.
VxdID getID() const
Return the ID of the Sensor.
int getVPitchID(double v=0) const
Return the pitch ID of the sensor.
double getVPitch(double v=0) const
Return the pitch of the sensor.
SensorType m_type
Type of the Sensor.
void forceInside(double &u, double &v) const
Force a position to be inside the active area.
double getLength() const
Return the length of the sensor.
SensorInfoBase(SensorType type, VxdID id, double width, double length, double thickness, int uCells, int vCells, double width2=-1, double splitLength=-1, int vCells2=0)
Constructor for a SensorInfo instance.
void setTransformation(const TGeoHMatrix &transform, bool reco=false)
Set the transformation matrix of the Sensor.
int getVCellID(double v, bool clamp=false) const
Return the corresponding pixel/strip ID of a given v coordinate.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
Abstract base class for different kinds of events.
double getThickness() const
Return the thickness of the sensor.
int getVCells() const
Return number of pixel/strips in v direction.
double m_splitLength
Relative length at which second pixel size starts, 0 for only one pixel size.
double getUSize(double v=0) const
Return the width of the sensor.
TVector3 pointToGlobal(const TVector3 &local, bool reco=false) const
Convert a point from local to global coordinates.
double getWSize() const
Return the thickness of the sensor.
TVector3 pointToLocal(const TVector3 &global, bool reco=false) const
Convert a point from global to local coordinates.
double getUPitch(double v=0) const
Return the pitch of the sensor.
TGeoHMatrix m_transform
Nominal transformation matrix of the Sensor.
int getVCells2() const
Return number of pixel/strips in v direction up to change pitch.
@ TEL
Testbeam telescope sensor.
SensorType getType() const
Return the Type of the Sensor.
double m_thickness
Thickness of the Sensor.
int m_vCells2
Number of strips/pixels in v direction after splitLength, 0 for only one pixel size.
TVector3 vectorToLocal(const TVector3 &global, bool reco=false) const
Convert a vector from global to local coordinates.
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
double getVSize() const
Return the length of the sensor.
double getBackwardWidth() const
Convinience Wrapper to return width at backward side.
double m_length
Length of the Sensor.
bool inside(double u, double v, double uTolerance=DBL_EPSILON, double vTolerance=DBL_EPSILON) const
Check wether a given point is inside the active area.
double m_deltaWidth
Difference between backward and forward width, 0 for rectangular sensors.