Belle II Software  release-08-01-10
SensorInfoBase Class Reference

Base class to provide Sensor Information for PXD and SVD. More...

#include <SensorInfoBase.h>

Inheritance diagram for SensorInfoBase:
Collaboration diagram for SensorInfoBase:

Public Types

enum  SensorType {
  PXD = 0 ,
  SVD = 1 ,
  TEL = 2 ,
  VXD = -1
}
 Enum specifing the type of sensor the SensorInfo represents. More...
 

Public Member Functions

 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. More...
 
virtual ~SensorInfoBase ()
 Default constructor to make class polymorph.
 
SensorType getType () const
 Return the Type of the Sensor.
 
VxdID getID () const
 Return the ID of the Sensor.
 
double getWidth (double v=0) const
 Return the width of the sensor. More...
 
double getBackwardWidth () const
 Convinience Wrapper to return width at backward side. More...
 
double getForwardWidth () const
 Convinience Wrapper to return width at forward side. More...
 
double getLength () const
 Return the length of the sensor. More...
 
double getThickness () const
 Return the thickness of the sensor. More...
 
double getUSize (double v=0) const
 Return the width of the sensor. More...
 
double getVSize () const
 Return the length of the sensor. More...
 
double getWSize () const
 Return the thickness of the sensor. More...
 
double getUPitch (double v=0) const
 Return the pitch of the sensor. More...
 
double getVPitch (double v=0) const
 Return the pitch of the sensor. More...
 
int getVPitchID (double v=0) const
 Return the pitch ID of the sensor. More...
 
double getUCellPosition (int uID, int vID=-1) const
 Return the position of a specific strip/pixel in u direction. More...
 
double getVCellPosition (int vID) const
 Return the position of a specific strip/pixel in v direction. More...
 
int getUCellID (double u, double v=0, bool clamp=false) const
 Return the corresponding pixel/strip ID of a given u coordinate. More...
 
int getVCellID (double v, bool clamp=false) const
 Return the corresponding pixel/strip ID of a given v coordinate. More...
 
int getUCells () const
 Return number of pixel/strips in u direction.
 
int getVCells () const
 Return number of pixel/strips in v direction.
 
int getVCells2 () const
 Return number of pixel/strips in v direction up to change pitch.
 
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. More...
 
bool inside (const ROOT::Math::XYZVector &local) const
 Check wether a given point is inside the active area. More...
 
void forceInside (double &u, double &v) const
 Force a position to be inside the active area. More...
 
void forceInside (ROOT::Math::XYZVector &local) const
 Force a given point inside the active area. More...
 
ROOT::Math::XYZVector pointToGlobal (const ROOT::Math::XYZVector &local, bool reco=false) const
 Convert a point from local to global coordinates. More...
 
ROOT::Math::XYZVector vectorToGlobal (const ROOT::Math::XYZVector &local, bool reco=false) const
 Convert a vector from local to global coordinates. More...
 
ROOT::Math::XYZVector pointToLocal (const ROOT::Math::XYZVector &global, bool reco=false) const
 Convert a point from global to local coordinates. More...
 
ROOT::Math::XYZVector vectorToLocal (const ROOT::Math::XYZVector &global, bool reco=false) const
 Convert a vector from global to local coordinates. More...
 
void setTransformation (const TGeoHMatrix &transform, bool reco=false)
 Set the transformation matrix of the Sensor. More...
 
const TGeoHMatrix & getTransformation (bool reco=false) const
 Return the transformation matrix of the Sensor. More...
 
void setSurfaceParameters (const std::vector< double > &planarParameters)
 Fill parameters of planar deformation to vector.
 
const std::vector< double > & getSurfaceParameters () const
 Return parameters of planar deformation.
 

Protected Attributes

SensorType m_type
 Type of the Sensor.
 
unsigned short m_id
 ID of the Sensor.
 
double m_width
 Width of the sensor.
 
double m_length
 Length of the Sensor.
 
double m_thickness
 Thickness of the Sensor.
 
double m_deltaWidth
 Difference between backward and forward width, 0 for rectangular sensors.
 
double m_splitLength
 Relative length at which second pixel size starts, 0 for only one pixel size.
 
int m_uCells
 Number of strips/pixels in u direction.
 
int m_vCells
 Number of strips/pixels in v direction (up to splitLength for two pixel sizes)
 
int m_vCells2
 Number of strips/pixels in v direction after splitLength, 0 for only one pixel size.
 
TGeoHMatrix m_transform
 Nominal transformation matrix of the Sensor.
 
TGeoHMatrix m_recoTransform
 Alignment-corrected transformation matrix of the Sensor for use in reconstruction.
 
std::vector< double > m_surfaceDeformationParameters = std::vector<double>(12, 0.0)
 Vector contains all parameter needed for description planar deformation of sensors.
 

Detailed Description

Base class to provide Sensor Information for PXD and SVD.

This class is meant to provide the basic services like length/thickness parameters, pixel/stip ID and position calculation and coordinate transformation.

Definition at line 29 of file SensorInfoBase.h.

Member Enumeration Documentation

◆ SensorType

enum SensorType

Enum specifing the type of sensor the SensorInfo represents.

Enumerator
PXD 

PXD Sensor.

SVD 

SVD Sensor.

TEL 

Testbeam telescope sensor.

VXD 

Any type of VXD Sensor.

Definition at line 32 of file SensorInfoBase.h.

Constructor & Destructor Documentation

◆ SensorInfoBase()

SensorInfoBase ( SensorType  type,
VxdID  id,
double  width,
double  length,
double  thickness,
int  uCells,
int  vCells,
double  width2 = -1,
double  splitLength = -1,
int  vCells2 = 0 
)
inline

Constructor for a SensorInfo instance.

this class holds all the information to calculate pixel/strip positions and ids. it can accomodate rectangular and trapezoidal shapes and also has the possibility to segment the strip/pixelsize once in v, thus having two different pixel sizes in one sensor: vcells pixels from start to splitlength and vcells2 pixels from splitlength to length.

Parameters
typeType of the Sensor, one of PXD or SVD
idVxdID of the Sensor
widthWidth of the Sensor in default units
lengthLength of the Sensor in default units
thicknessThickness of the Sensor in default units
uCellsNumber of Pixels/Strips in u direction (local x)
vCellsNumber of Pixels/Strips in v direction (local y)
width2Width of trapezoidal sensor on positive side, <=0 means rectangular
splitLengthLength at which the pixel size changes, starting at 0. <=0 means only one pixel/strip size in v
vCells2Number of pixels in v direction after split length.

Definition at line 60 of file SensorInfoBase.h.

Member Function Documentation

◆ forceInside() [1/2]

void forceInside ( double &  u,
double &  v 
) const
inline

Force a position to be inside the active area.

Parameters
uu coordinate to be forced inside
vv coordinate to be forced inside

Definition at line 250 of file SensorInfoBase.h.

◆ forceInside() [2/2]

void forceInside ( ROOT::Math::XYZVector &  local) const
inline

Force a given point inside the active area.

Parameters
localpoint in local coordinates, will be modified to lie inside or at the border of the sensor

Definition at line 353 of file SensorInfoBase.h.

◆ getBackwardWidth()

double getBackwardWidth ( ) const
inline

Convinience Wrapper to return width at backward side.

Returns
width of the sensor at the backward side

Definition at line 89 of file SensorInfoBase.h.

◆ getForwardWidth()

double getForwardWidth ( ) const
inline

Convinience Wrapper to return width at forward side.

Returns
width of the sensor at the forward side

Definition at line 97 of file SensorInfoBase.h.

◆ getLength()

double getLength ( void  ) const
inline

Return the length of the sensor.

Returns
length of the sensor

Definition at line 105 of file SensorInfoBase.h.

◆ getThickness()

double getThickness ( ) const
inline

Return the thickness of the sensor.

Returns
thickness of the sensor

Definition at line 110 of file SensorInfoBase.h.

◆ getTransformation()

const TGeoHMatrix& getTransformation ( bool  reco = false) const
inline

Return the transformation matrix of the Sensor.

Returns
Transformation matrix of the Sensor
Parameters
recoGet transformation for reconstruction (true) or nominal (false)

Definition at line 306 of file SensorInfoBase.h.

◆ getUCellID()

int getUCellID ( double  u,
double  v = 0,
bool  clamp = false 
) const
inline

Return the corresponding pixel/strip ID of a given u coordinate.

Parameters
uu coordinate of the pixel/strip
vv coordinate of the pixel/strip, ignored for rectangular sensors
clampflag for clamp
Returns
ID of the pixel/strip covering the given coordinate

Definition at line 193 of file SensorInfoBase.h.

◆ getUCellPosition()

double getUCellPosition ( int  uID,
int  vID = -1 
) const
inline

Return the position of a specific strip/pixel in u direction.

Parameters
uIDid of the strip/pixel in u coordinates
vIDid of the strip/pixel in v coordinates, ignored for rectangular sensors
Returns
Pixel/Strip position in u direction

Definition at line 168 of file SensorInfoBase.h.

◆ getUPitch()

double getUPitch ( double  v = 0) const
inline

Return the pitch of the sensor.

Parameters
vv-coordinate where to determine the pitch, ignored for rectangular sensors
Returns
Pixel/Strip size in u direction

Definition at line 132 of file SensorInfoBase.h.

◆ getUSize()

double getUSize ( double  v = 0) const
inline

Return the width of the sensor.

Parameters
vv-coordinate where to determine the width, ignored for recangular sensors
Returns
width of the Sensor

Definition at line 116 of file SensorInfoBase.h.

◆ getVCellID()

int getVCellID ( double  v,
bool  clamp = false 
) const
inline

Return the corresponding pixel/strip ID of a given v coordinate.

Parameters
vv coordinate of the pixel/strip
clampflag for clamp
Returns
ID of the pixel/strip covering the given coordinate

Definition at line 204 of file SensorInfoBase.h.

◆ getVCellPosition()

double getVCellPosition ( int  vID) const
inline

Return the position of a specific strip/pixel in v direction.

Parameters
vIDid of the strip/pixel in v coordinates
Returns
Pixel/Strip position in v direction

Definition at line 180 of file SensorInfoBase.h.

◆ getVPitch()

double getVPitch ( double  v = 0) const
inline

Return the pitch of the sensor.

Parameters
vv-coordinate where to determine the pitch, only used for sensors with two different pixel sizes along v
Returns
Pixel/Strip size in v direction

Definition at line 139 of file SensorInfoBase.h.

◆ getVPitchID()

int getVPitchID ( double  v = 0) const
inline

Return the pitch ID of the sensor.

Parameters
vv-coordinate where to determine the pitchID only used for PXD sensors with two different pixel sizes along v
Returns
Pixel/Strip ID in v direction: 0 for pitch at smaller v, 1 for bigger v Attention: Pitch ID depend from sensor position For PXD it swap for sensor=1 vs. seensor=2 Sensor=1: bigger pitch = 0, smaller = 1 Sensor=2: smaller pitch = 0, bigger = 1

Definition at line 156 of file SensorInfoBase.h.

◆ getVSize()

double getVSize ( ) const
inline

Return the length of the sensor.

Returns
length of the sensor

Definition at line 121 of file SensorInfoBase.h.

◆ getWidth()

double getWidth ( double  v = 0) const
inline

Return the width of the sensor.

Parameters
vv-coordinate where to determine the width, ignored for recangular sensors
Returns
width of the Sensor

Definition at line 80 of file SensorInfoBase.h.

◆ getWSize()

double getWSize ( ) const
inline

Return the thickness of the sensor.

Returns
thickness of the sensor

Definition at line 126 of file SensorInfoBase.h.

◆ inside() [1/2]

bool inside ( const ROOT::Math::XYZVector &  local) const
inline

Check wether a given point is inside the active area.

Parameters
localpoint in local coordinates
Returns
true if inside active area, false otherwise

Definition at line 240 of file SensorInfoBase.h.

◆ inside() [2/2]

bool inside ( double  u,
double  v,
double  uTolerance = DBL_EPSILON,
double  vTolerance = DBL_EPSILON 
) const
inline

Check wether a given point is inside the active area.

Optionally, one can specify a tolerance which should be added to the sensor edges to still be considered inside

Parameters
uu coordinate to check, supply 0 if not interested
vv coordinate to check, supply 0 if not interested
uTolerancetolerance to be added on each side of the sensor in u direction
vTolerancetolerance to be added on each side of the sensor in u direction
Returns
true if inside active area, false otherwise

Definition at line 229 of file SensorInfoBase.h.

◆ pointToGlobal()

ROOT::Math::XYZVector pointToGlobal ( const ROOT::Math::XYZVector &  local,
bool  reco = false 
) const
inline

Convert a point from local to global coordinates.

Parameters
localpoint in local coordinates
recoUse sensor position in reconstruction (true) or in nominal geometry (false)
Returns
point in global coordinates

Definition at line 364 of file SensorInfoBase.h.

◆ pointToLocal()

ROOT::Math::XYZVector pointToLocal ( const ROOT::Math::XYZVector &  global,
bool  reco = false 
) const
inline

Convert a point from global to local coordinates.

Parameters
globalpoint in global coordinates
recoUse sensor position in reconstruction (true) or in nominal geometry (false)
Returns
point in local coordinates

Definition at line 384 of file SensorInfoBase.h.

◆ setTransformation()

void setTransformation ( const TGeoHMatrix &  transform,
bool  reco = false 
)
inline

Set the transformation matrix of the Sensor.

Parameters
transformTransformation matrix of the Sensor
recoSet transformation for reconstruction (true) or nominal (false)

Definition at line 296 of file SensorInfoBase.h.

◆ vectorToGlobal()

ROOT::Math::XYZVector vectorToGlobal ( const ROOT::Math::XYZVector &  local,
bool  reco = false 
) const
inline

Convert a vector from local to global coordinates.

Parameters
localvector in local coordinates
recoUse sensor position in reconstruction (true) or in nominal geometry (false)
Returns
vector in global coordinates

Definition at line 374 of file SensorInfoBase.h.

◆ vectorToLocal()

ROOT::Math::XYZVector vectorToLocal ( const ROOT::Math::XYZVector &  global,
bool  reco = false 
) const
inline

Convert a vector from global to local coordinates.

Parameters
globalvector in global coordinates
recoUse sensor position in reconstruction (true) or in nominal geometry (false)
Returns
vector in local coordinates

Definition at line 394 of file SensorInfoBase.h.


The documentation for this class was generated from the following file: