9 #ifndef VXD_SENSORINFO_H
10 #define VXD_SENSORINFO_H
12 #include <vxd/dataobjects/VxdID.h>
15 #include <TGeoMatrix.h>
62 int uCells,
int vCells,
double width2 = -1,
double splitLength = -1,
int vCells2 = 0):
194 int getUCellID(
double u,
double v = 0,
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;
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);
Base class to provide Sensor Information for PXD and SVD.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
double getUPitch(double v=0) const
Return the pitch of the sensor.
double getVSize() const
Return the length of the sensor.
const std::vector< double > & getSurfaceParameters() const
Return parameters of planar deformation.
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
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.
double getWSize() const
Return the thickness of the sensor.
SensorType getType() const
Return the Type of the Sensor.
virtual ~SensorInfoBase()
Default constructor to make class polymorph.
TGeoHMatrix m_recoTransform
Alignment-corrected transformation matrix of the Sensor for use in reconstruction.
int getVCells() const
Return number of pixel/strips in v direction.
SensorType
Enum specifing the type of sensor the SensorInfo represents.
@ VXD
Any type of VXD Sensor.
@ TEL
Testbeam telescope sensor.
int getUCells() const
Return number of pixel/strips in u direction.
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 getWidth(double v=0) const
Return the width of the sensor.
double getForwardWidth() const
Convinience Wrapper to return width at forward side.
VxdID getID() const
Return the ID of the Sensor.
double getVPitch(double v=0) const
Return the pitch of the sensor.
double getBackwardWidth() const
Convinience Wrapper to return width at backward side.
TVector3 pointToLocal(const TVector3 &global, bool reco=false) const
Convert a point from global to local coordinates.
double m_width
Width of the sensor.
TVector3 pointToGlobal(const TVector3 &local, bool reco=false) const
Convert a point from local to global coordinates.
const TGeoHMatrix & getTransformation(bool reco=false) const
Return the transformation matrix of the Sensor.
std::vector< double > m_surfaceDeformationParameters
Vector contains all parameter needed for description planar deformation of sensors.
bool inside(const TVector3 &local) const
Check wether a given point is inside the active area.
double m_thickness
Thickness of the Sensor.
void setTransformation(const TGeoHMatrix &transform, bool reco=false)
Set the transformation matrix of the Sensor.
int m_vCells
Number of strips/pixels in v direction (up to splitLength for two pixel sizes)
double getThickness() const
Return the thickness of the sensor.
unsigned short m_id
ID of the Sensor.
TVector3 vectorToGlobal(const TVector3 &local, bool reco=false) const
Convert a vector from local to global coordinates.
int getVPitchID(double v=0) const
Return the pitch ID of the sensor.
double m_deltaWidth
Difference between backward and forward width, 0 for rectangular sensors.
double getUSize(double v=0) const
Return the width of the sensor.
SensorType m_type
Type of the Sensor.
int getVCellID(double v, bool clamp=false) const
Return the corresponding pixel/strip ID of a given v coordinate.
int getVCells2() const
Return number of pixel/strips in v direction up to change pitch.
TGeoHMatrix m_transform
Nominal transformation matrix of the Sensor.
double m_length
Length of the Sensor.
void setSurfaceParameters(const std::vector< double > &planarParameters)
Fill parameters of planar deformation to vector.
int m_vCells2
Number of strips/pixels in v direction after splitLength, 0 for only one pixel size.
int getUCellID(double u, double v=0, bool clamp=false) const
Return the corresponding pixel/strip ID of a given u coordinate.
TVector3 vectorToLocal(const TVector3 &global, bool reco=false) const
Convert a vector from global to local coordinates.
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.
double getLength() const
Return the length of the sensor.
void forceInside(double &u, double &v) const
Force a position to be inside the active area.
Class to uniquely identify a any structure of the PXD and SVD.
Abstract base class for different kinds of events.