 |
Belle II Software
release-05-02-19
|
13 #include <framework/geometry/B2Vector3.h>
14 #include <framework/datastore/RelationsObject.h>
15 #include <framework/logging/Logger.h>
17 #include <vxd/geometry/GeoCache.h>
18 #include <vxd/geometry/SensorInfoBase.h>
20 #include <svd/dataobjects/SVDCluster.h>
22 #include <vxd/dataobjects/VxdID.h>
53 VXD::SensorInfoBase
const* aSensorInfo =
nullptr);
68 DATCONSVDSpacePoint(B2Vector3<double>& pos,
const std::pair<double, double>& normalizedLocal,
135 if (
m_sensorType == VXD::SensorInfoBase::SensorType::SVD &&
204 static double getUWedged(
const std::pair<double, double>& hitLocalUnwedged,
VxdID vxdID,
208 return (aSensorInfo->getWidth(hitLocalUnwedged.second) / aSensorInfo->getWidth()) * hitLocalUnwedged.first;
218 const VXD::SensorInfoBase* aSensorInfo =
nullptr)
221 return (aSensorInfo->getWidth() / aSensorInfo->getWidth(hitLocalWedged.second)) * hitLocalWedged.first;
236 static void boundaryEnforce(
double& value,
const double& otherValue,
double lower = 0,
double higher = 1,
unsigned int side = 0,
242 double sloppyTerm = 1e-3;
243 if (value < lower - sloppyTerm) {
244 B2WARNING(
"DATCONSVDSpacePoint::boundaryEnforce: value had to be moved (lowerCheck)! old: " << value <<
", new: " << lower);
245 B2WARNING(
"On sensor: " << vxdID <<
" side: " << (side == 0 ?
" U " :
" V") <<
246 " when the other coordinate is: " << otherValue);
250 if (value > higher + sloppyTerm) {
251 B2WARNING(
"DATCONSVDSpacePoint::boundaryEnforce: value had to be moved (higherCheck)! old: " << value <<
", new: " << higher);
252 B2WARNING(
"On sensor: " << vxdID <<
" side: " << (side == 0 ?
" U " :
" V") <<
253 " when the other coordinate is: " << otherValue);
const B2Vector3< double > & getPosition() const
return the position vector in global coordinates
DATCONSVDSpacePoint typically is build from 1-2 DATCONSimpleSVDClusters.
Class to uniquely identify a any structure of the PXD and SVD.
SensorType
Enum specifing the type of sensor the SensorInfo represents.
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.
DATCONSVDSpacePoint()
Default constructor for the ROOT IO.
unsigned short getNClustersAssigned() const
Returns the number of Clusters assigned to this DATCONSVDSpacePoint.
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.
std::vector< SVDCluster > m_assignedDATCONSVDClusters
Vector containing the DATCONSVDClusters assigned to this DATCONSVDSpacePoint.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
static void boundaryEnforce(double &value, const double &otherValue, double lower=0, double higher=1, unsigned int side=0, VxdID vxdID=VxdID())
Enforce.
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.
Base class to provide Sensor Information for PXD and SVD.
DataType Z() const
access variable Z (= .at(2) without boundary check)
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.
VxdID getVxdID() const
Return the VxdID of the sensor on which the the cluster of the DATCONSVDSpacePoint lives.
double Z() const
return the z-value of the global position of the DATCONSVDSpacePoint
double getNormalizedLocalV() const
Return normalized local coordinates of the cluster in v (0 <= posV <= 1).
unsigned short baseType
The base integer type for VxdID.
bool m_isAssigned
Stores whether this DATCONSVDSpacePoint is connected to a track.
double getNormalizedLocalU() const
Return normalized local coordinates of the cluster in u (0 <= posU <= 1).
bool operator==(const DATCONSVDSpacePoint &b) const
Compare, if two DATCONSVDSpacePoints are the same one.
friend std::ostream & operator<<(std::ostream &out, const DATCONSVDSpacePoint &aSP)
overloaded '<<' stream operator.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Abstract base class for different kinds of events.
double Y() const
return the y-value of the global position of the DATCONSVDSpacePoint
bool isUOnly() const
Returns true if the SP is single clustered and the cluster is a u cluster.
VXD::SensorInfoBase::SensorType m_sensorType
Stores the SensorType using the scheme of SensorInfoBase.
VxdID::baseType m_vxdID
Stores the VxdID.
std::pair< double, double > m_normalizedLocal
Local position vector normalized to sensor size (0 <= x <= 1).
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
bool operator!=(const DATCONSVDSpacePoint &b) const
Comparison for inequality with another DATCONSVDSpacePoint.
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.
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.
std::pair< bool, bool > getIfClustersAssigned() const
Returns, if u(v)-coordinate is based on cluster information.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
B2Vector3< double > m_position
Global position vector.
double X() const
return the x-value of the global position of the DATCONSVDSpacePoint
void setAssignmentState(bool isAssigned) const
Setter for association with a track.
DataType X() const
access variable X (= .at(0) without boundary check)
std::pair< bool, bool > m_clustersAssigned
The bool value is true, when correct information of the coordinate exists.
bool getAssignmentState() const
Getter for status of assignment to a track.
Belle2::VXD::SensorInfoBase::SensorType getType() const
Return SensorType (PXD, SVD, ...) on which the DATCONSVDSpacePoint lives.
DataType Y() const
access variable Y (= .at(1) without boundary check)
bool isUAndV() const
Returns true if the SP is not single clustered.
std::vector< SVDCluster > getAssignedDATCONSVDClusters()
Getter function for the DATCONSVDClusters assigned to this DATCONSVDSpacePoint.