Belle II Software development
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
15using namespace Belle2;
16
18template<>
20{
21 return 0.5658682413283911;
22}
23
25template <>
27{
28 PXDTrueHit* trueHit = cluster.getRelated<PXDTrueHit>("PXDTrueHits");
29 if (trueHit == nullptr) {
30 return ROOT::Math::XYZVector();
31 } else {
32 const VxdID& vxdID = cluster.getSensorID();
33 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
34 const ROOT::Math::XYZVector& momentum = sensorInfoBase.vectorToGlobal(trueHit->getEntryMomentum(), true);
35
36 return momentum;
37 }
38}
39
41template <>
43{
44 SVDTrueHit* trueHit = cluster.getRelated<SVDTrueHit>("SVDTrueHits");
45 if (trueHit == nullptr) {
46 return ROOT::Math::XYZVector();
47 } else {
48 const VxdID& vxdID = cluster.getSensorID();
49 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
50 const ROOT::Math::XYZVector& momentum = sensorInfoBase.vectorToGlobal(trueHit->getEntryMomentum(), true);
51
52 return momentum;
53 }
54}
55
57template <>
59{
60 PXDTrueHit* trueHit = cluster.getRelated<PXDTrueHit>("PXDTrueHits");
61 if (trueHit == nullptr) {
62 return ROOT::Math::XYZVector();
63 } else {
64 const VxdID& vxdID = cluster.getSensorID();
65 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
66 const ROOT::Math::XYZVector& momentum =
67 sensorInfoBase.pointToGlobal(ROOT::Math::XYZVector(trueHit->getEntryU(), trueHit->getEntryV(), trueHit->getEntryW()), true);
68
69 return momentum;
70 }
71}
72
74template <>
76{
77 PXDTrueHit* trueHit = cluster.getRelated<PXDTrueHit>("SVDTrueHits");
78 if (trueHit == nullptr) {
79 return ROOT::Math::XYZVector();
80 } else {
81 const VxdID& vxdID = cluster.getSensorID();
82 const VXD::SensorInfoBase& sensorInfoBase = VXD::GeoCache::getInstance().getSensorInfo(vxdID);
83 const ROOT::Math::XYZVector& momentum =
84 sensorInfoBase.pointToGlobal(ROOT::Math::XYZVector(trueHit->getEntryU(), trueHit->getEntryV(), trueHit->getEntryW()), 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:29
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: SVDTrueHit.h:33
ROOT::Math::XYZVector getEntryMomentumOfMCParticle(const ClusterType &) const
Return the momentum of the simulated MCParticle at this cluster (by using the TrueHit associated with...
double getCalibration() const
For SVD the calibration is 1, for PXD (see below) it is ~0.6.
ROOT::Math::XYZVector getEntryPositionOfMCParticle(const ClusterType &) const
Return the entry position of the simulated MCParticle at this cluster (by using the TrueHit associate...
float getEntryU() const
Return local u coordinate of hit when entering silicon.
Definition: VXDTrueHit.h:80
float getEntryW() const
Return local w coordinate of the start point of the track.
Definition: VXDTrueHit.h:84
ROOT::Math::XYZVector getEntryMomentum() const
Return momentum at the start point of the track.
Definition: VXDTrueHit.h:98
float getEntryV() const
Return local v coordinate of the start point of the track.
Definition: VXDTrueHit.h:82
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
Base class to provide Sensor Information for PXD and SVD.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
ROOT::Math::XYZVector vectorToGlobal(const ROOT::Math::XYZVector &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.