Belle II Software development
VXDMomentumEstimationTools< ClusterType > Class Template Reference

Tools needed for the VXD momentum estimation to, e.g. More...

#include <VXDMomentumEstimationTools.h>

Public Member Functions

double getDEDX (const ClusterType &cluster, const ROOT::Math::XYZVector &momentum, const ROOT::Math::XYZVector &position, short charge) const
 Main function: return dEdX for a cluster and the given momentum, position and charge seeds.
 
double getDEDXWithThickness (const ClusterType &cluster) const
 Return dEdX but not with dX = path length but with dX = thickness of cluster.
 
double getThicknessOfCluster (const ClusterType &cluster) const
 Return the thickness of a cluster.
 
double getWidthOfCluster (const ClusterType &cluster) const
 Return the thickness of a cluster.
 
double getLengthOfCluster (const ClusterType &cluster) const
 Return the thickness of a cluster.
 
double getRadiusOfCluster (const ClusterType &cluster) const
 Returns the distance from the interaction point to the cluster in the r-phi-plane.
 
VxdID::baseType getLayerOfCluster (const ClusterType &cluster) const
 Return the layer of the cluster.
 
VxdID::baseType getLadderOfCluster (const ClusterType &cluster) const
 Return the ladder of the cluster.
 
VxdID::baseType getSensorNumberOfCluster (const ClusterType &cluster) const
 Return the sensor number of the cluster.
 
VxdID::baseType getSegmentNumberOfCluster (const ClusterType &cluster) const
 Return the segment number of the cluster.
 
double getCalibratedCharge (const ClusterType &cluster) const
 Return the charge of the cluster (in ADC count) calibrated with a factor of ~0.6 for pxd hits.
 
ROOT::Math::XYZVector getEntryMomentumOfMCParticle (const ClusterType &) const
 Return the momentum of the simulated MCParticle at this cluster (by using the TrueHit associated with this cluster) This method is implemented for the two cluster types differently below.
 
ROOT::Math::XYZVector getEntryPositionOfMCParticle (const ClusterType &) const
 Return the entry position of the simulated MCParticle at this cluster (by using the TrueHit associated with this cluster) This method is implemented for the two cluster types differently below.
 
double getPathLength (const ClusterType &cluster, const Helix &trajectory) const
 Return the path length of a particle with the given helix that goes through the cluster.
 
ROOT::Math::XYZVector getEntryMomentumOfMCParticle (const PXDCluster &cluster) const
 We have to handle PXD and SVD differently here.
 
ROOT::Math::XYZVector getEntryMomentumOfMCParticle (const SVDCluster &cluster) const
 We have to handle PXD and SVD differently here.
 
ROOT::Math::XYZVector getEntryPositionOfMCParticle (const PXDCluster &cluster) const
 We have to handle PXD and SVD differently here.
 
ROOT::Math::XYZVector getEntryPositionOfMCParticle (const SVDCluster &cluster) const
 We have to handle PXD and SVD differently here.
 

Static Public Member Functions

static const VXDMomentumEstimationToolsgetInstance ()
 Use this class as singleton.
 

Private Member Functions

 VXDMomentumEstimationTools ()
 Do not create this class.
 
 VXDMomentumEstimationTools (const VXDMomentumEstimationTools &)
 Do not create this class.
 
VXDMomentumEstimationToolsoperator= (const VXDMomentumEstimationTools &)
 Do not create this class.
 
double getCalibration () const
 For SVD the calibration is 1, for PXD (see below) it is ~0.6.
 
double getCalibration () const
 We only need a calibration for the PXD Clusters.
 

Private Attributes

const double m_layerPositions [6] = {1.42, 2.18, 3.81, 8.0, 10.51, 13.51}
 the layer positions in the case we do not have a SpacePoint we can look at.
 

Detailed Description

template<class ClusterType>
class Belle2::VXDMomentumEstimationTools< ClusterType >

Tools needed for the VXD momentum estimation to, e.g.

calculate the path length or properties of the hits. Can also be used for other things.

Definition at line 32 of file VXDMomentumEstimationTools.h.

Constructor & Destructor Documentation

◆ VXDMomentumEstimationTools()

VXDMomentumEstimationTools ( )
inlineprivate

Do not create this class.

Definition at line 36 of file VXDMomentumEstimationTools.h.

36{ }

Member Function Documentation

◆ getCalibratedCharge()

double getCalibratedCharge ( const ClusterType &  cluster) const
inline

Return the charge of the cluster (in ADC count) calibrated with a factor of ~0.6 for pxd hits.

This factor can be seen in data (and is calculated from that) and has probably something to do with the different readout of the hit types.

Definition at line 149 of file VXDMomentumEstimationTools.h.

150 {
151 const double charge = cluster.getCharge();
152 const double calibration = getCalibration();
153
154 return calibration * charge;
155 }
double getCalibration() const
For SVD the calibration is 1, for PXD (see below) it is ~0.6.
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

◆ getCalibration()

double getCalibration ( ) const
inlineprivate

For SVD the calibration is 1, for PXD (see below) it is ~0.6.

Definition at line 221 of file VXDMomentumEstimationTools.h.

222 {
223 return 1;
224 }

◆ getDEDX()

double getDEDX ( const ClusterType &  cluster,
const ROOT::Math::XYZVector &  momentum,
const ROOT::Math::XYZVector &  position,
short  charge 
) const
inline

Main function: return dEdX for a cluster and the given momentum, position and charge seeds.

Definition at line 51 of file VXDMomentumEstimationTools.h.

53 {
54
55 const Helix trajectory(position, momentum, charge, 1.5);
56 const double calibratedCharge = getCalibratedCharge(cluster);
57 const double pathLength = getPathLength(cluster, trajectory);
58
59 return calibratedCharge / pathLength;
60 }
double getCalibratedCharge(const ClusterType &cluster) const
Return the charge of the cluster (in ADC count) calibrated with a factor of ~0.6 for pxd hits.
double getPathLength(const ClusterType &cluster, const Helix &trajectory) const
Return the path length of a particle with the given helix that goes through the cluster.

◆ getDEDXWithThickness()

double getDEDXWithThickness ( const ClusterType &  cluster) const
inline

Return dEdX but not with dX = path length but with dX = thickness of cluster.

Definition at line 63 of file VXDMomentumEstimationTools.h.

64 {
65 const double calibratedCharge = getCalibratedCharge(cluster);
66 const double pathLength = getThicknessOfCluster(cluster);
67
68 return calibratedCharge / pathLength;
69 }
double getThicknessOfCluster(const ClusterType &cluster) const
Return the thickness of a cluster.

◆ getEntryMomentumOfMCParticle()

ROOT::Math::XYZVector getEntryMomentumOfMCParticle ( const ClusterType &  ) const
inline

Return the momentum of the simulated MCParticle at this cluster (by using the TrueHit associated with this cluster) This method is implemented for the two cluster types differently below.

Definition at line 159 of file VXDMomentumEstimationTools.h.

160 {
161 B2FATAL("Can not deal with this cluster type!");
162 return ROOT::Math::XYZVector();
163 }

◆ getEntryPositionOfMCParticle()

ROOT::Math::XYZVector getEntryPositionOfMCParticle ( const ClusterType &  ) const
inline

Return the entry position of the simulated MCParticle at this cluster (by using the TrueHit associated with this cluster) This method is implemented for the two cluster types differently below.

Definition at line 167 of file VXDMomentumEstimationTools.h.

168 {
169 B2FATAL("Can not deal with this cluster type!");
170 return ROOT::Math::XYZVector();
171 }

◆ getInstance()

static const VXDMomentumEstimationTools & getInstance ( )
inlinestatic

Use this class as singleton.

Definition at line 44 of file VXDMomentumEstimationTools.h.

45 {
46 static VXDMomentumEstimationTools instance;
47 return instance;
48 }
VXDMomentumEstimationTools()
Do not create this class.

◆ getLadderOfCluster()

VxdID::baseType getLadderOfCluster ( const ClusterType &  cluster) const
inline

Return the ladder of the cluster.

Definition at line 123 of file VXDMomentumEstimationTools.h.

124 {
125 VxdID vxdID = cluster.getSensorID();
126 VxdID::baseType ladder = vxdID.getLadderNumber();
127 return ladder;
128 }
unsigned short baseType
The base integer type for VxdID.
Definition: VxdID.h:36

◆ getLayerOfCluster()

VxdID::baseType getLayerOfCluster ( const ClusterType &  cluster) const
inline

Return the layer of the cluster.

Definition at line 115 of file VXDMomentumEstimationTools.h.

116 {
117 VxdID vxdID = cluster.getSensorID();
118 VxdID::baseType layer = vxdID.getLayerNumber();
119 return layer;
120 }

◆ getLengthOfCluster()

double getLengthOfCluster ( const ClusterType &  cluster) const
inline

Return the thickness of a cluster.

Definition at line 88 of file VXDMomentumEstimationTools.h.

89 {
90 const VxdID& vxdID = cluster.getSensorID();
91 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
92 return sensorInfoBase.getLength();
93 }
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
double getLength() const
Return the length of the sensor.

◆ getPathLength()

double getPathLength ( const ClusterType &  cluster,
const Helix trajectory 
) const
inline

Return the path length of a particle with the given helix that goes through the cluster.

If the helix does not pass the cluster, return the thickness of the cluster instead. It is assumed that the cluster is passed from bottom to top and not transverse or something. Also we assume every cluster to not be tilted. This is wrong for the wedge cluster. We have to find a way to handle those cases correctly!

Definition at line 179 of file VXDMomentumEstimationTools.h.

180 {
181 // This is not quite correct but we can not do better without doing an extrapolation with material effects.
182 // If the distance_3D is nan, it means that the helix does not reach into the cluster or curls that much
183 // that it does not reach the far end of the cluster. The first case is strange
184 // because the track is associated with the cluster (so it should normally reach it). The second case should be
185 // really rare (because the clusters are that thin), but we have to deal with it.
186 // There is also the possibility that the track curls that much that it interacts with the same sensor twice.
187 // This can not be handled properly in this stage.
188
189 const double thickness = getThicknessOfCluster(cluster);
190 const double radius = getRadiusOfCluster(cluster);
191 const double width = getWidthOfCluster(cluster);
192 const double length = getLengthOfCluster(cluster);
193
194 const double perp_s_at_cluster_entry = trajectory.getArcLength2DAtCylindricalR(radius);
195
196 if (std::isnan(perp_s_at_cluster_entry)) {
197 // This case is really strange. I do not know how to deal with it probably.
198 return thickness;
199 }
200
201 const ROOT::Math::XYZVector& position_at_inner_radius = trajectory.getPositionAtArcLength2D(perp_s_at_cluster_entry);
202
203 const double perp_s_at_cluster_exit = trajectory.getArcLength2DAtCylindricalR(radius + thickness);
204
205 if (std::isnan(perp_s_at_cluster_exit)) {
206 return std::min(width, length);
207 }
208
209 const ROOT::Math::XYZVector& position_at_outer_radius = trajectory.getPositionAtArcLength2D(perp_s_at_cluster_exit);
210
211 const double distance_3D = (position_at_outer_radius - position_at_inner_radius).R();
212
213 return distance_3D;
214 }
double R
typedef autogenerated by FFTW
double getLengthOfCluster(const ClusterType &cluster) const
Return the thickness of a cluster.
double getRadiusOfCluster(const ClusterType &cluster) const
Returns the distance from the interaction point to the cluster in the r-phi-plane.
double getWidthOfCluster(const ClusterType &cluster) const
Return the thickness of a cluster.

◆ getRadiusOfCluster()

double getRadiusOfCluster ( const ClusterType &  cluster) const
inline

Returns the distance from the interaction point to the cluster in the r-phi-plane.

Definition at line 96 of file VXDMomentumEstimationTools.h.

97 {
98 const SpacePoint* spacePoint = cluster.template getRelated<SpacePoint>("SpacePoints");
99
100 double radius = 0;
101 if (spacePoint == nullptr) {
102 // Fallback function
103 VxdID vxdID = cluster.getSensorID();
104 VxdID::baseType layer = vxdID.getLayerNumber();
105 radius = m_layerPositions[layer - 1] / 100.0;
106 B2WARNING("Could not determine SpacePoint for this cluster. Falling back to geometrical information.");
107 } else {
108 // The positions is the one with w = 0 which is the one on the lowest detector plane.
109 radius = spacePoint->getPosition().Perp();
110 }
111 return radius;
112 }
const double m_layerPositions[6]
the layer positions in the case we do not have a SpacePoint we can look at.

◆ getSegmentNumberOfCluster()

VxdID::baseType getSegmentNumberOfCluster ( const ClusterType &  cluster) const
inline

Return the segment number of the cluster.

Definition at line 139 of file VXDMomentumEstimationTools.h.

140 {
141 VxdID vxdID = cluster.getSensorID();
142 VxdID::baseType segmentNumber = vxdID.getSegmentNumber();
143 return segmentNumber;
144 }

◆ getSensorNumberOfCluster()

VxdID::baseType getSensorNumberOfCluster ( const ClusterType &  cluster) const
inline

Return the sensor number of the cluster.

Definition at line 131 of file VXDMomentumEstimationTools.h.

132 {
133 VxdID vxdID = cluster.getSensorID();
134 VxdID::baseType sensorNumber = vxdID.getSensorNumber();
135 return sensorNumber;
136 }

◆ getThicknessOfCluster()

double getThicknessOfCluster ( const ClusterType &  cluster) const
inline

Return the thickness of a cluster.

Definition at line 72 of file VXDMomentumEstimationTools.h.

73 {
74 const VxdID& vxdID = cluster.getSensorID();
75 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
76 return sensorInfoBase.getThickness();
77 }
double getThickness() const
Return the thickness of the sensor.

◆ getWidthOfCluster()

double getWidthOfCluster ( const ClusterType &  cluster) const
inline

Return the thickness of a cluster.

Definition at line 80 of file VXDMomentumEstimationTools.h.

81 {
82 const VxdID& vxdID = cluster.getSensorID();
83 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
84 return sensorInfoBase.getWidth();
85 }
double getWidth(double v=0) const
Return the width of the sensor.

Member Data Documentation

◆ m_layerPositions

const double m_layerPositions[6] = {1.42, 2.18, 3.81, 8.0, 10.51, 13.51}
private

the layer positions in the case we do not have a SpacePoint we can look at.

Definition at line 218 of file VXDMomentumEstimationTools.h.


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