Belle II Software development
ROIDetPlane Class Reference

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

#include <ROIDetPlane.h>

Inheritance diagram for ROIDetPlane:

Public Member Functions

 ROIDetPlane (const VxdID &vxdID, double toleranceZ, double tolerancePhi)
 the constructor
 
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
 

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
 

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 19 of file ROIDetPlane.cc.

20 : m_vxdID(vxdID), m_orthoVec_upper(0, 0, 0), m_orthoVec_lower(0, 0, 0)
21{
23 m_vxdID);
25 ROOT::Math::XYZVector local(0, 0, 0);
26 ROOT::Math::XYZVector uVector(1, 0, 0);
27 ROOT::Math::XYZVector vVector(0, 1, 0);
28
29 ROOT::Math::XYZVector globalSensorPos = aSensorInfo.pointToGlobal(local, true);
30 ROOT::Math::XYZVector globaluVector = aSensorInfo.vectorToGlobal(uVector, true);
31 ROOT::Math::XYZVector globalvVector = aSensorInfo.vectorToGlobal(vVector, true);
32
33 setO(XYZToTVector(globalSensorPos));
34 setUV(XYZToTVector(globaluVector), XYZToTVector(globalvVector));
35
36
37 // the maximum distance in u-direction for hit to be considered to lie on the sensor (for wedge take the maximum width)
38 double maxDistU = std::max(aSensorInfo.getForwardWidth(), aSensorInfo.getBackwardWidth()) / 2.0;
39
40 // 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.
41 if (tolerancePhi >= 0 && tolerancePhi < M_PI / 2.0) {
42 maxDistU += fabs(std::tan(tolerancePhi) * globalSensorPos.Rho());
43 } else {
44 B2WARNING("No valid value for the phi tolerance given! Will use 0 tolerance!" << LogVar("tolerance phi", tolerancePhi));
45 }
46
47
48 // get points at upper and lower edge of the sensor
49 ROOT::Math::XYZVector edgepoint_upper = globalSensorPos + maxDistU * globaluVector;
50 ROOT::Math::XYZVector edgepoint_lower = globalSensorPos - maxDistU * globaluVector;
51 /* Get the orthogonal vectors, no need to normalize as we only test for the sign.
52 These two vectors are defined so that they are orthogonal to the plane spanned by the z-axis and the vector going from
53 the origin to the upper/lower edge of the sensor (global coordinates).*/
54 m_orthoVec_upper = ROOT::Math::XYZVector(0, 0, 1).Cross(edgepoint_upper);
55 m_orthoVec_lower = ROOT::Math::XYZVector(0, 0, 1).Cross(edgepoint_lower);
56
57 //setting acceptance in z for the sensor
58 ROOT::Math::XYZVector minVecV(0, -aSensorInfo.getVSize() / 2.0, 0);
59 ROOT::Math::XYZVector maxVecV(0, aSensorInfo.getVSize() / 2.0, 0);
60 m_sensorZMin = aSensorInfo.pointToGlobal(minVecV, true).Z() - toleranceZ;
61 m_sensorZMax = aSensorInfo.pointToGlobal(maxVecV, true).Z() + toleranceZ;
62
63 m_layer = (aSensorInfo.getID()).getLayerNumber();
64}
double m_sensorZMax
max of allowed global z range
Definition: ROIDetPlane.h:57
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:52
double m_sensorZMin
min of allowed global z range
Definition: ROIDetPlane.h:56
VxdID m_vxdID
the sensor ID
Definition: ROIDetPlane.h:48
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:54
int m_layer
layer number
Definition: ROIDetPlane.h:59
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

Member Function Documentation

◆ getSharedPlanePtr()

genfit::SharedPlanePtr getSharedPlanePtr ( )
inline

return the shared-plane pointer

Definition at line 45 of file ROIDetPlane.h.

45{return m_sharedPlanePtr;};
genfit::SharedPlanePtr m_sharedPlanePtr
the shared plane pointer
Definition: ROIDetPlane.h:61

◆ getVxdID()

VxdID getVxdID ( )
inline

return the sensor ID

Definition at line 37 of file ROIDetPlane.h.

37{return m_vxdID;};

◆ isSensorInRange()

bool isSensorInRange ( const ROOT::Math::XYZVector &  trackPosition,
int  layer 
)

determine if the sensor is in range

Definition at line 67 of file ROIDetPlane.cc.

68{
69 // check for correct layer
70 if (layer != m_layer)
71 return false;
72
73 double trackZ = trackPosition.Z();
74 // check whether genfit track is in z range
75 if (m_sensorZMin > trackZ || m_sensorZMax < trackZ) {
76 return false;
77 }
78
79 /* Positions on the sensor have to lie between the planes that go through the upper edge of the sensor
80 and the lower edge of the senor (all w.r.t. the origin 0,0,0, and in r-phi-direction). That means for vectors pointing to the sensor
81 it has to be "below" (w.r.t. the plane) the plane going through the upper edge defined by its
82 orthogonal vector m_orthoVec_upper and
83 the origin (which means the dot product of m_orthoVec_upper and the position is smaller 0) and "above" the lower plane
84 defined by its orthogonal vector m_orthoVec_lower vector and the origin (which means the dot product with m_orthoVec_lower
85 is greater 0) */
86 if (trackPosition.Dot(m_orthoVec_upper) > 0 || trackPosition.Dot(m_orthoVec_lower) < 0) {
87 return false;
88 }
89
90 // fullfilled all conditions
91 return true;
92}

◆ setSharedPlanePtr()

void setSharedPlanePtr ( genfit::SharedPlanePtr  spp)
inline

assign the shared-plane pointer

Definition at line 43 of file ROIDetPlane.h.

43{m_sharedPlanePtr = spp;};

Member Data Documentation

◆ m_layer

int m_layer = 0
private

layer number

Definition at line 59 of file ROIDetPlane.h.

◆ m_orthoVec_lower

ROOT::Math::XYZVector m_orthoVec_lower
private

vector normal to the vector from 0,0,0 to a point on the lower edge of the sensor in x-y-plane

Definition at line 54 of file ROIDetPlane.h.

◆ m_orthoVec_upper

ROOT::Math::XYZVector m_orthoVec_upper
private

vector normal to the vector from 0,0,0 to a point on the upper edge of the sensor in x-y-plane

Definition at line 52 of file ROIDetPlane.h.

◆ m_sensorZMax

double m_sensorZMax = 0
private

max of allowed global z range

Definition at line 57 of file ROIDetPlane.h.

◆ m_sensorZMin

double m_sensorZMin = 0
private

min of allowed global z range

Definition at line 56 of file ROIDetPlane.h.

◆ m_sharedPlanePtr

genfit::SharedPlanePtr m_sharedPlanePtr
private

the shared plane pointer

Definition at line 61 of file ROIDetPlane.h.

◆ m_vxdID

VxdID m_vxdID
private

the sensor ID

Definition at line 48 of file ROIDetPlane.h.


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