11#include <tracking/spacePointCreation/SpacePoint.h>
12#include <vxd/dataobjects/VxdID.h>
13#include <framework/geometry/B2Vector3.h>
14#include <framework/dataobjects/Helix.h>
15#include <vxd/geometry/GeoCache.h>
16#include <vxd/geometry/SensorInfoBase.h>
19#include <framework/logging/Logger.h>
31 template <
class ClusterType>
51 double getDEDX(
const ClusterType& cluster,
const ROOT::Math::XYZVector& momentum,
const ROOT::Math::XYZVector& position,
55 const Helix trajectory(position, momentum, charge, 1.5);
59 return calibratedCharge / pathLength;
68 return calibratedCharge / pathLength;
74 const VxdID& vxdID = cluster.getSensorID();
82 const VxdID& vxdID = cluster.getSensorID();
90 const VxdID& vxdID = cluster.getSensorID();
98 const SpacePoint* spacePoint = cluster.template getRelated<SpacePoint>(
"SpacePoints");
101 if (spacePoint ==
nullptr) {
103 VxdID vxdID = cluster.getSensorID();
106 B2WARNING(
"Could not determine SpacePoint for this cluster. Falling back to geometrical information.");
117 VxdID vxdID = cluster.getSensorID();
125 VxdID vxdID = cluster.getSensorID();
133 VxdID vxdID = cluster.getSensorID();
141 VxdID vxdID = cluster.getSensorID();
143 return segmentNumber;
151 const double charge = cluster.getCharge();
154 return calibration * charge;
161 B2FATAL(
"Can not deal with this cluster type!");
162 return ROOT::Math::XYZVector();
169 B2FATAL(
"Can not deal with this cluster type!");
170 return ROOT::Math::XYZVector();
194 const double perp_s_at_cluster_entry = trajectory.getArcLength2DAtCylindricalR(radius);
196 if (std::isnan(perp_s_at_cluster_entry)) {
201 const ROOT::Math::XYZVector& position_at_inner_radius = trajectory.getPositionAtArcLength2D(perp_s_at_cluster_entry);
203 const double perp_s_at_cluster_exit = trajectory.getArcLength2DAtCylindricalR(radius + thickness);
205 if (std::isnan(perp_s_at_cluster_exit)) {
206 return std::min(width, length);
209 const ROOT::Math::XYZVector& position_at_outer_radius = trajectory.getPositionAtArcLength2D(perp_s_at_cluster_exit);
211 const double distance_3D = (position_at_outer_radius - position_at_inner_radius).
R();
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
const B2Vector3D & getPosition() const
return the position vector in global coordinates
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 getWidth(double v=0) const
Return the width of the sensor.
double getThickness() const
Return the thickness of the sensor.
double getLength() const
Return the length of the sensor.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getSensorNumber() const
Get the sensor id.
baseType getSegmentNumber() const
Get the sensor segment.
unsigned short baseType
The base integer type for VxdID.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
Abstract base class for different kinds of events.