Belle II Software  release-06-02-00
VXDMomentumEstimation.h
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 
9 #pragma once
10 #include <tracking/vxdMomentumEstimation/VXDMomentumEstimationTools.h>
11 
12 
13 namespace Belle2 {
26  template <class ClusterType>
28 
29  private:
36 
37  public:
39  struct FitParameters {
41  double aE = 1.56173140e+07;
43  double bE = -9.89192780e+03;
45  double cE = 2.42177970e-02;
47  double dE = 2.65702553e-08;
48  };
49 
54  double aM = 0;
56  double bM = 0;
58  double cM = 0;
60  double dM = 0;
61  };
62 
65  {
66  static VXDMomentumEstimation instance;
67  return instance;
68  }
69 
72  double estimateQOverP(const ClusterType& cluster, const TVector3& momentum, const TVector3& position, short charge,
73  const FitParameters& fitParameters, const CorrectionFitParameters& correctionFitParameters) const
74  {
76 
77  const double dEdX = tools.getDEDX(cluster, momentum, position, charge);
78  const double momentumEstimation = convertDEDXToMomentum(dEdX, fitParameters, correctionFitParameters);
79  const double QOverP = charge / momentumEstimation;
80 
81  return QOverP;
82  }
83 
86  double estimateQOverPWithThickness(const ClusterType& cluster, short charge, const FitParameters& fitParameters,
87  const CorrectionFitParameters& correctionFitParameters) const
88  {
90 
91  const double dEdX = tools.getDEDXWithThickness(cluster);
92  const double momentumEstimation = convertDEDXToMomentum(dEdX, fitParameters, correctionFitParameters);
93  const double QOverP = charge / momentumEstimation;
94 
95  return QOverP;
96  }
97 
100  double convertDEDXToMomentum(double dEdX, const FitParameters& fitParameters,
101  const CorrectionFitParameters& correctionFitParameters) const
102  {
103  const double firstPart = fitParameters.aE / (dEdX - fitParameters.bE) / (dEdX - fitParameters.bE);
104  const double lastPart = fitParameters.cE + fitParameters.dE * dEdX;
105  const double estimation = firstPart + lastPart;
106 
107  const double quadPart = correctionFitParameters.aM * estimation * estimation;
108  const double linearPart = correctionFitParameters.bM * estimation;
109  const double constantPart = correctionFitParameters.cM;
110  const double cubicPart = correctionFitParameters.dM * estimation * estimation * estimation;
111  const double mediumCorrection = cubicPart + quadPart + linearPart + constantPart;
112 
113  const double estimationWithMediumCalibration = estimation - mediumCorrection;
114  return estimationWithMediumCalibration;
115  }
116 
117  };
119 }
Tools needed for the VXD momentum estimation to, e.g.
static const VXDMomentumEstimationTools & getInstance()
Use this class as singleton.
double getDEDX(const ClusterType &cluster, const TVector3 &momentum, const TVector3 &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.
Class doing the momentum estimation from dEdX for SVDClusters and PXDClusters.
VXDMomentumEstimation & operator=(const VXDMomentumEstimation &)
Do not copy or create.
VXDMomentumEstimation(const VXDMomentumEstimation &)
Do not copy or create.
double estimateQOverP(const ClusterType &cluster, const TVector3 &momentum, const TVector3 &position, short charge, const FitParameters &fitParameters, const CorrectionFitParameters &correctionFitParameters) const
Main function: Estimate p over q for the given cluster and the path length calculated using the given...
double estimateQOverPWithThickness(const ClusterType &cluster, short charge, const FitParameters &fitParameters, const CorrectionFitParameters &correctionFitParameters) const
Main function: Estimate p over q for the given cluster and the thickness of the cluster with the fit ...
double convertDEDXToMomentum(double dEdX, const FitParameters &fitParameters, const CorrectionFitParameters &correctionFitParameters) const
After calculating dEdX we need to map this to p using a predefined function and parameters that were ...
static const VXDMomentumEstimation & getInstance()
Use this class as a singleton.
VXDMomentumEstimation()
Do not copy or create.
Abstract base class for different kinds of events.
Struct holding the parameters of the correction function to map them median of the estimation functio...
Struct holding the parameters of the estimation function which maps dEdX to p.