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