9#include <tracking/roiFinding/ROIDetPlane.h>
11#include <vxd/geometry/GeoCache.h>
12#include <vxd/geometry/SensorInfoBase.h>
13#include <framework/logging/Logger.h>
14#include <framework/geometry/VectorUtil.h>
19ROIDetPlane::ROIDetPlane(
const VxdID& vxdID,
double toleranceZ,
double tolerancePhi)
20 : m_vxdID(vxdID), m_orthoVec_upper(0, 0, 0), m_orthoVec_lower(0, 0, 0)
25 ROOT::Math::XYZVector local(0, 0, 0);
26 ROOT::Math::XYZVector uVector(1, 0, 0);
27 ROOT::Math::XYZVector vVector(0, 1, 0);
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);
41 if (tolerancePhi >= 0 && tolerancePhi < M_PI / 2.0) {
42 maxDistU += fabs(std::tan(tolerancePhi) * globalSensorPos.Rho());
44 B2WARNING(
"No valid value for the phi tolerance given! Will use 0 tolerance!" <<
LogVar(
"tolerance phi", tolerancePhi));
49 ROOT::Math::XYZVector edgepoint_upper = globalSensorPos + maxDistU * globaluVector;
50 ROOT::Math::XYZVector edgepoint_lower = globalSensorPos - maxDistU * globaluVector;
58 ROOT::Math::XYZVector minVecV(0, -aSensorInfo.
getVSize() / 2.0, 0);
59 ROOT::Math::XYZVector maxVecV(0, aSensorInfo.
getVSize() / 2.0, 0);
73 double trackZ = trackPosition.Z();
double m_sensorZMax
max of allowed global z range
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
double m_sensorZMin
min of allowed global z range
bool isSensorInRange(const ROOT::Math::XYZVector &trackPosition, int layer)
determine if the sensor is in range
VxdID m_vxdID
the sensor ID
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
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
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 uniquely identify a any structure of the PXD and SVD.
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.
Abstract base class for different kinds of events.