 |
Belle II Software
release-05-02-19
|
12 #include <framework/geometry/B2Vector3.h>
13 #include <framework/datastore/RelationsObject.h>
14 #include <framework/logging/Logger.h>
16 #include <vxd/geometry/GeoCache.h>
17 #include <vxd/geometry/SensorInfoBase.h>
19 #include <pxd/dataobjects/PXDCluster.h>
21 #include <svd/dataobjects/SVDCluster.h>
23 #include <genfit/PlanarMeasurement.h>
53 explicit SpacePoint(
const PXDCluster* pxdCluster,
54 const VXD::SensorInfoBase* aSensorInfo =
nullptr);
61 explicit SpacePoint(std::vector<SVDCluster const*>& clusters,
62 VXD::SensorInfoBase
const* aSensorInfo =
nullptr);
82 SpacePoint(
const B2Vector3<double>& pos,
const B2Vector3<double>& posError, std::pair<double, double> normalizedLocal,
84 double UClusterTime = 0. ,
double VClusterTime = 0.) :
97 friend std::ostream&
operator<< (std::ostream& out,
const SpacePoint& aSP) {
return out << aSP.getName();}
113 return !(*
this == b);
117 std::string
getName()
const override
169 if (
m_sensorType == VXD::SensorInfoBase::SensorType::SVD &&
265 static double getUWedged(
const std::pair<double, double>& hitLocalUnwedged,
VxdID vxdID,
269 return (aSensorInfo->getWidth(hitLocalUnwedged.second) / aSensorInfo->getWidth()) * hitLocalUnwedged.first;
284 return (aSensorInfo->getWidth() / aSensorInfo->getWidth(hitLocalWedged.second)) * hitLocalWedged.first;
298 static void boundaryEnforce(
double& value,
const double& otherValue,
double lower = 0,
double higher = 1,
unsigned int side = 0,
304 double sloppyTerm = 1e-3;
305 if (value < lower - sloppyTerm) {
306 B2WARNING(
"SpacePoint::boundaryEnforce: value had to be moved (lowerCheck)! old: " << value <<
", new: " << lower);
307 B2WARNING(
"On sensor: " << vxdID <<
" side: " << (side == 0 ?
" U " :
" V") <<
308 " when the other coordinate is: " << otherValue);
312 if (value > higher + sloppyTerm) {
313 B2WARNING(
"SpacePoint::boundaryEnforce: value had to be moved (higherCheck)! old: " << value <<
", new: " << higher);
314 B2WARNING(
"On sensor: " << vxdID <<
" side: " << (side == 0 ?
" U " :
" V") <<
315 " when the other coordinate is: " << otherValue);
324 void setPositionError(
double uSigma,
double vSigma,
const VXD::SensorInfoBase* aSensorInfo)
virtual std::vector< genfit::PlanarMeasurement > getGenfitCompatible() const
returns a vector of genfit::PlanarMeasurement, which is needed for genfit::track.
double TimeV() const
return the time in ns of the cluster on the V side
VxdID::baseType m_vxdID
Stores the VxdID.
Class to uniquely identify a any structure of the PXD and SVD.
SensorType
Enum specifing the type of sensor the SensorInfo represents.
B2Vector3< double > m_positionError
Global position error vector in sigma.
B2Vector3< double > m_position
Global position vector.
std::pair< bool, bool > m_clustersAssigned
The bool value is true, when correct information of the coordinate exists.
double X() const
return the x-value of the global position of the SpacePoint
double TimeU() const
return the time in ns of the cluster on the U side
friend std::ostream & operator<<(std::ostream &out, const SpacePoint &aSP)
overloaded '<<' stream operator.
void setPositionError(double uSigma, double vSigma, const VXD::SensorInfoBase *aSensorInfo)
Setter for global position error from on-sensor sigmas.
double Z() const
return the z-value of the global position of the SpacePoint
virtual ~SpacePoint()
Currently SpacePoint is used as base class for test beam related TBSpacePoint.
float m_qualityIndicator
Stores a quality indicator.
std::pair< bool, bool > getIfClustersAssigned() const
Returns, if u(v)-coordinate is based on cluster information.
Base class to provide Sensor Information for PXD and SVD.
static double getUUnwedged(const std::pair< double, double > &hitLocalWedged, VxdID::baseType vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
takes a wedged uCoordinate, and transforms it to general uCoordinate.
DataType Z() const
access variable Z (= .at(2) without boundary check)
bool operator==(const SpacePoint &b) const
Compare, if two SpacePoints are the same one.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
const B2Vector3< double > & getPosition() const
return the position vector in global coordinates
void setAssignmentState(bool isAssigned) const
Setter for association with a track.
std::string getName() const override
Print out some info for this SpacePoint.
double Y() const
return the y-value of the global position of the SpacePoint
void setQualityEstimationError(double qualityIndicatorError)
Setter for the spacePoint quality index error.
unsigned short baseType
The base integer type for VxdID.
static B2Vector3< double > getGlobalCoordinates(const std::pair< double, double > &hitLocal, VxdID vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
converts a local hit on a given sensor into global coordinates.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Abstract base class for different kinds of events.
float getQualityEstimation() const
Getter for the quality of this SpacePoint.
bool m_isAssigned
Stores whether this SpacePoint is connected to a track.
bool getAssignmentState() const
Getter for status of assignment to a track.
bool isUOnly() const
Returns true if the SP is single clustered and the cluster is a u cluster.
void Sqrt()
calculates the square root of the absolute values of the coordinates element-wise
double getNormalizedLocalV() const
Return normalized local coordinates of the cluster in v (0 <= posV <= 1).
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
float m_qualityIndicatorError
Stores the error on the quality indicator.
bool isUAndV() const
Returns true if the SP is not single clustered.
bool operator!=(const SpacePoint &b) const
Comparison for inequality with another SpacePoint.
bool isVOnly() const
Returns true if the SP is single clustered and the cluster is a v cluster.
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
void setQualityEstimation(float qualityIndicator)
Setter for the quality of this SpacePoint.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
double m_VClusterTime
Time of the cluster on the V side in ns.
DataType X() const
access variable X (= .at(0) without boundary check)
float getQualityEstimationError() const
Getter for the spacePoint quality index error.
Belle2::VXD::SensorInfoBase::SensorType getType() const
Return SensorType (PXD, SVD, ...) on which the SpacePoint lives.
unsigned short getNClustersAssigned() const
Returns the number of Clusters assigned to this SpacePoint.
std::pair< double, double > m_normalizedLocal
Local position vector normalized to sensor size (0 <= x <= 1).
SpacePoint()
Default constructor for the ROOT IO.
DataType Y() const
access variable Y (= .at(1) without boundary check)
VXD::SensorInfoBase::SensorType m_sensorType
Stores the SensorType using the scheme of SensorInfoBase.
static std::pair< double, double > convertLocalToNormalizedCoordinates(const std::pair< double, double > &hitLocal, VxdID vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
converts a local hit into sensor-independent relative coordinates.
static void boundaryEnforce(double &value, const double &otherValue, double lower=0, double higher=1, unsigned int side=0, VxdID vxdID=VxdID())
Enforce.
const B2Vector3< double > & getPositionError() const
return the hitErrors in sigma of the global position
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the SpacePoint lives.
static std::pair< double, double > convertNormalizedToLocalCoordinates(const std::pair< double, double > &hitNormalized, Belle2::VxdID vxdID, const Belle2::VXD::SensorInfoBase *aSensorInfo=nullptr)
converts a hit in sensor-independent relative coordinates into local coordinate of given sensor.
double getNormalizedLocalU() const
Return normalized local coordinates of the cluster in u (0 <= posU <= 1).
static double getUWedged(const std::pair< double, double > &hitLocalUnwedged, VxdID vxdID, const VXD::SensorInfoBase *aSensorInfo=nullptr)
takes a general uCoordinate, and transforms it to corrected uCoordinate for wedged sensors.
double m_UClusterTime
Time of the cluster on the U side in ns.