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

ROIDetPlane describes the plane containing a sensor. More...

#include <ROIDetPlane.h>

Inheritance diagram for ROIDetPlane:
Collaboration diagram for ROIDetPlane:

Public Member Functions

 ROIDetPlane (const VxdID &vxdID, double toleranceZ, double tolerancePhi)
 the constructor More...
 
 ROIDetPlane (const VxdID &vxdID)
 the constructor - needed for testbeam package
 
VxdID getVxdID ()
 return the sensor ID
 
bool isSensorInRange (const ROOT::Math::XYZVector &trackPosition, int layer)
 determine if the sensor is in range
 
void setSharedPlanePtr (genfit::SharedPlanePtr spp)
 assign the shared-plane pointer
 
genfit::SharedPlanePtr getSharedPlanePtr ()
 return the shared-plane pointer
 
void swap (DetPlane &other)
 
const TVector3 & getO () const
 
const TVector3 & getU () const
 
const TVector3 & getV () const
 
void set (const TVector3 &o, const TVector3 &u, const TVector3 &v)
 
void setO (const TVector3 &o)
 
void setO (double, double, double)
 
void setU (const TVector3 &u)
 
void setU (double, double, double)
 
void setV (const TVector3 &v)
 
void setV (double, double, double)
 
void setUV (const TVector3 &u, const TVector3 &v)
 
void setON (const TVector3 &o, const TVector3 &n)
 
void setFinitePlane (AbsFinitePlane *finite)
 Optionally, set the finite plane definition. More...
 
TVector3 getNormal () const
 
void setNormal (const TVector3 &n)
 
void setNormal (double, double, double)
 
void setNormal (const double &theta, const double &phi)
 
TVector2 project (const TVector3 &x) const
 projecting a direction onto the plane:
 
TVector2 LabToPlane (const TVector3 &x) const
 transform from Lab system into plane
 
TVector3 toLab (const TVector2 &x) const
 transform from plane coordinates to lab system
 
TVector3 dist (const TVector3 &point) const
 
TVector2 straightLineToPlane (const TVector3 &point, const TVector3 &dir) const
 gives u,v coordinates of the intersection point of a straight line with plane
 
void straightLineToPlane (const double &posX, const double &posY, const double &posZ, const double &dirX, const double &dirY, const double &dirZ, double &u, double &v) const
 gives u,v coordinates of the intersection point of a straight line with plane
 
void Print (const Option_t *="") const
 
double distance (const TVector3 &point) const
 absolute distance from a point to the plane
 
double distance (double, double, double) const
 
bool isInActive (const TVector3 &point, const TVector3 &dir) const
 intersect in the active area? C.f. AbsFinitePlane
 
bool isInActive (const double &posX, const double &posY, const double &posZ, const double &dirX, const double &dirY, const double &dirZ) const
 intersect in the active area? C.f. AbsFinitePlane
 
bool isInActive (double u, double v) const
 isInActive methods refer to finite plane. C.f. AbsFinitePlane
 
bool isInActive (const TVector2 &v) const
 isInActive methods refer to finite plane. C.f. AbsFinitePlane
 
bool isFinite () const
 
void rotate (double angle)
 rotate u and v around normal. Angle is in rad. More for debugging than for actual use.
 
void reset ()
 delete finitePlane_ and set O, U, V to default values
 

Private Member Functions

void sane ()
 ensures orthonormal coordinates
 

Private Attributes

VxdID m_vxdID
 the sensor ID
 
ROOT::Math::XYZVector m_orthoVec_upper
 vector normal to the vector from 0,0,0 to a point on the upper edge of the sensor in x-y-plane
 
ROOT::Math::XYZVector m_orthoVec_lower
 vector normal to the vector from 0,0,0 to a point on the lower edge of the sensor in x-y-plane
 
double m_sensorZMin = 0
 min of allowed global z range
 
double m_sensorZMax = 0
 max of allowed global z range
 
int m_layer = 0
 layer number
 
genfit::SharedPlanePtr m_sharedPlanePtr
 the shared plane pointer
 
TVector3 o_
 
TVector3 u_
 
TVector3 v_
 
std::unique_ptr< AbsFinitePlane > finitePlane_
 

Detailed Description

ROIDetPlane describes the plane containing a sensor.

Definition at line 26 of file ROIDetPlane.h.

Constructor & Destructor Documentation

◆ ROIDetPlane()

ROIDetPlane ( const VxdID vxdID,
double  toleranceZ,
double  tolerancePhi 
)

the constructor

< reference to sensor info in geometry

Definition at line 24 of file ROIDetPlane.cc.

25  : m_vxdID(vxdID), m_orthoVec_upper(0, 0, 0), m_orthoVec_lower(0, 0, 0)
26 {
28  m_vxdID);
30  ROOT::Math::XYZVector local(0, 0, 0);
31  ROOT::Math::XYZVector uVector(1, 0, 0);
32  ROOT::Math::XYZVector vVector(0, 1, 0);
33 
34  ROOT::Math::XYZVector globalSensorPos = aSensorInfo.pointToGlobal(local, true);
35  ROOT::Math::XYZVector globaluVector = aSensorInfo.vectorToGlobal(uVector, true);
36  ROOT::Math::XYZVector globalvVector = aSensorInfo.vectorToGlobal(vVector, true);
37 
38  setO(XYZToTVector(globalSensorPos));
39  setUV(XYZToTVector(globaluVector), XYZToTVector(globalvVector));
40 
41 
42  // the maximum distance in u-direction for hit to be considered to lie on the sensor (for wedge take the maximum width)
43  double maxDistU = std::max(aSensorInfo.getForwardWidth(), aSensorInfo.getBackwardWidth()) / 2.0;
44 
45  // translate the phi-tolerance into a tolerance in u, NOTE: this is only approximate as it uses the center and not the edge of the sensor.
46  if (tolerancePhi >= 0 && tolerancePhi < M_PI / 2.0) {
47  maxDistU += fabs(std::tan(tolerancePhi) * globalSensorPos.Rho());
48  } else {
49  B2WARNING("No valid value for the phi tolerance given! Will use 0 tolerance!" << LogVar("tolerance phi", tolerancePhi));
50  }
51 
52 
53  // get points at upper and lower edge of the sensor
54  ROOT::Math::XYZVector edgepoint_upper = globalSensorPos + maxDistU * globaluVector;
55  ROOT::Math::XYZVector edgepoint_lower = globalSensorPos - maxDistU * globaluVector;
56  /* Get the orthogonal vectors, no need to normalize as we only test for the sign.
57  These two vectors are defined so that they are orthogonal to the plane spanned by the z-axis and the vector going from
58  the origin to the upper/lower edge of the sensor (global coordinates).*/
59  m_orthoVec_upper = ROOT::Math::XYZVector(0, 0, 1).Cross(edgepoint_upper);
60  m_orthoVec_lower = ROOT::Math::XYZVector(0, 0, 1).Cross(edgepoint_lower);
61 
62  //setting acceptance in z for the sensor
63  ROOT::Math::XYZVector minVecV(0, -aSensorInfo.getVSize() / 2.0, 0);
64  ROOT::Math::XYZVector maxVecV(0, aSensorInfo.getVSize() / 2.0, 0);
65  m_sensorZMin = aSensorInfo.pointToGlobal(minVecV, true).Z() - toleranceZ;
66  m_sensorZMax = aSensorInfo.pointToGlobal(maxVecV, true).Z() + toleranceZ;
67 
68  m_layer = (aSensorInfo.getID()).getLayerNumber();
69 }
double m_sensorZMax
max of allowed global z range
Definition: ROIDetPlane.h:59
ROOT::Math::XYZVector m_orthoVec_upper
vector normal to the vector from 0,0,0 to a point on the upper edge of the sensor in x-y-plane
Definition: ROIDetPlane.h:54
double m_sensorZMin
min of allowed global z range
Definition: ROIDetPlane.h:58
VxdID m_vxdID
the sensor ID
Definition: ROIDetPlane.h:47
ROOT::Math::XYZVector m_orthoVec_lower
vector normal to the vector from 0,0,0 to a point on the lower edge of the sensor in x-y-plane
Definition: ROIDetPlane.h:56
int m_layer
layer number
Definition: ROIDetPlane.h:61
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Base class to provide Sensor Information for PXD and SVD.
double getVSize() const
Return the length of the sensor.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
double getForwardWidth() const
Convinience Wrapper to return width at forward side.
VxdID getID() const
Return the ID of the Sensor.
double getBackwardWidth() const
Convinience Wrapper to return width at backward side.
ROOT::Math::XYZVector vectorToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a vector from local to global coordinates.
Class to store variables with their name which were sent to the logging service.
static constexpr auto XYZToTVector
Helper function to convert XYZVector to TVector3.
Definition: VectorUtil.h:24
double tan(double a)
tan for double
Definition: beamHelpers.h:31

Member Function Documentation

◆ setFinitePlane()

void setFinitePlane ( AbsFinitePlane finite)
inlineinherited

Optionally, set the finite plane definition.

This is most important for avoiding fake intersection points in fitting of curlers. This should be implemented for silicon detectors most importantly.

Definition at line 103 of file DetPlane.h.

103 {finitePlane_.reset(finite);}

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