Belle II Software  release-05-01-25
VXDMomentumEstimationTools.cc
1 #include <tracking/vxdMomentumEstimation/VXDMomentumEstimationTools.h>
2 #include <pxd/dataobjects/PXDCluster.h>
3 #include <pxd/dataobjects/PXDTrueHit.h>
4 #include <svd/dataobjects/SVDCluster.h>
5 #include <svd/dataobjects/SVDTrueHit.h>
6 #include <vxd/geometry/GeoCache.h>
7 
8 using namespace Belle2;
9 
11 template<>
13 {
14  return 0.5658682413283911;
15 }
16 
18 template <>
20 {
21  PXDTrueHit* trueHit = cluster.getRelated<PXDTrueHit>("PXDTrueHits");
22  if (trueHit == nullptr) {
23  return TVector3();
24  } else {
25  const VxdID& vxdID = cluster.getSensorID();
26  const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
27  const TVector3& momentum = sensorInfoBase.vectorToGlobal(trueHit->getEntryMomentum(), true);
28 
29  return momentum;
30  }
31 }
32 
34 template <>
36 {
37  SVDTrueHit* trueHit = cluster.getRelated<SVDTrueHit>("SVDTrueHits");
38  if (trueHit == nullptr) {
39  return TVector3();
40  } else {
41  const VxdID& vxdID = cluster.getSensorID();
42  const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
43  const TVector3& momentum = sensorInfoBase.vectorToGlobal(trueHit->getEntryMomentum(), true);
44 
45  return momentum;
46  }
47 }
48 
50 template <>
52 {
53  PXDTrueHit* trueHit = cluster.getRelated<PXDTrueHit>("PXDTrueHits");
54  if (trueHit == nullptr) {
55  return TVector3();
56  } else {
57  const VxdID& vxdID = cluster.getSensorID();
58  const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
59  const TVector3& momentum = sensorInfoBase.pointToGlobal(TVector3(trueHit->getEntryU(), trueHit->getEntryV(), trueHit->getEntryW()),
60  true);
61 
62  return momentum;
63  }
64 }
65 
67 template <>
69 {
70  PXDTrueHit* trueHit = cluster.getRelated<PXDTrueHit>("SVDTrueHits");
71  if (trueHit == nullptr) {
72  return TVector3();
73  } else {
74  const VxdID& vxdID = cluster.getSensorID();
75  const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
76  const TVector3& momentum = sensorInfoBase.pointToGlobal(TVector3(trueHit->getEntryU(), trueHit->getEntryV(), trueHit->getEntryW()),
77  true);
78 
79  return momentum;
80  }
81 }
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::PXDTrueHit
Class PXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: PXDTrueHit.h:35
Belle2::VXDTrueHit::getEntryV
float getEntryV() const
Return local v coordinate of the start point of the track.
Definition: VXDTrueHit.h:84
Belle2::VXD::SensorInfoBase::vectorToGlobal
TVector3 vectorToGlobal(const TVector3 &local, bool reco=false) const
Convert a vector from local to global coordinates.
Definition: SensorInfoBase.h:383
Belle2::SVDTrueHit
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: SVDTrueHit.h:35
Belle2::VXD::SensorInfoBase
Base class to provide Sensor Information for PXD and SVD.
Definition: SensorInfoBase.h:40
Belle2::VXDTrueHit::getEntryW
float getEntryW() const
Return local w coordinate of the start point of the track.
Definition: VXDTrueHit.h:86
Belle2::VXDMomentumEstimationTools::getEntryPositionOfMCParticle
TVector3 getEntryPositionOfMCParticle(const ClusterType &) const
Return the entry position of the simulated MCParticle at this cluster (by using the TrueHit associate...
Definition: VXDMomentumEstimationTools.h:177
Belle2::VXD::GeoCache::getInstance
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:215
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXDCluster
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:41
Belle2::VXDTrueHit::getEntryMomentum
TVector3 getEntryMomentum() const
Return momentum at the start point of the track.
Definition: VXDTrueHit.h:100
Belle2::VXD::SensorInfoBase::pointToGlobal
TVector3 pointToGlobal(const TVector3 &local, bool reco=false) const
Convert a point from local to global coordinates.
Definition: SensorInfoBase.h:373
Belle2::VXDTrueHit::getEntryU
float getEntryU() const
Return local u coordinate of hit when entering silicon.
Definition: VXDTrueHit.h:82
Belle2::SVDCluster
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:38
Belle2::VXD::GeoCache::getSensorInfo
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:68
Belle2::VXDMomentumEstimationTools::getCalibration
double getCalibration() const
For SVD the calibration is 1, for PXD (see below) it is ~0.6.
Definition: VXDMomentumEstimationTools.h:231
Belle2::VXDMomentumEstimationTools::getEntryMomentumOfMCParticle
TVector3 getEntryMomentumOfMCParticle(const ClusterType &) const
Return the momentum of the simulated MCParticle at this cluster (by using the TrueHit associated with...
Definition: VXDMomentumEstimationTools.h:169