Belle II Software  release-05-01-25
VXDMomentumEstimation.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #include <tracking/vxdMomentumEstimation/VXDMomentumEstimationTools.h>
13 
14 
15 namespace Belle2 {
28  template <class ClusterType>
29  class VXDMomentumEstimation {
30 
31  private:
38 
39  public:
41  struct FitParameters {
43  double aE = 1.56173140e+07;
45  double bE = -9.89192780e+03;
47  double cE = 2.42177970e-02;
49  double dE = 2.65702553e-08;
50  };
51 
56  double aM = 0;
58  double bM = 0;
60  double cM = 0;
62  double dM = 0;
63  };
64 
67  {
68  static VXDMomentumEstimation instance;
69  return instance;
70  }
71 
74  double estimateQOverP(const ClusterType& cluster, const TVector3& momentum, const TVector3& position, short charge,
75  const FitParameters& fitParameters, const CorrectionFitParameters& correctionFitParameters) const
76  {
78 
79  const double dEdX = tools.getDEDX(cluster, momentum, position, charge);
80  const double momentumEstimation = convertDEDXToMomentum(dEdX, fitParameters, correctionFitParameters);
81  const double QOverP = charge / momentumEstimation;
82 
83  return QOverP;
84  }
85 
88  double estimateQOverPWithThickness(const ClusterType& cluster, short charge, const FitParameters& fitParameters,
89  const CorrectionFitParameters& correctionFitParameters) const
90  {
92 
93  const double dEdX = tools.getDEDXWithThickness(cluster);
94  const double momentumEstimation = convertDEDXToMomentum(dEdX, fitParameters, correctionFitParameters);
95  const double QOverP = charge / momentumEstimation;
96 
97  return QOverP;
98  }
99 
102  double convertDEDXToMomentum(double dEdX, const FitParameters& fitParameters,
103  const CorrectionFitParameters& correctionFitParameters) const
104  {
105  const double firstPart = fitParameters.aE / (dEdX - fitParameters.bE) / (dEdX - fitParameters.bE);
106  const double lastPart = fitParameters.cE + fitParameters.dE * dEdX;
107  const double estimation = firstPart + lastPart;
108 
109  const double quadPart = correctionFitParameters.aM * estimation * estimation;
110  const double linearPart = correctionFitParameters.bM * estimation;
111  const double constantPart = correctionFitParameters.cM;
112  const double cubicPart = correctionFitParameters.dM * estimation * estimation * estimation;
113  const double mediumCorrection = cubicPart + quadPart + linearPart + constantPart;
114 
115  const double estimationWithMediumCalibration = estimation - mediumCorrection;
116  return estimationWithMediumCalibration;
117  }
118 
119  };
121 }
Belle2::VXDMomentumEstimation::FitParameters::cE
double cE
c Parameter
Definition: VXDMomentumEstimation.h:55
Belle2::VXDMomentumEstimation::CorrectionFitParameters
Struct holding the parameters of the correction function to map them median of the estimation functio...
Definition: VXDMomentumEstimation.h:62
Belle2::VXDMomentumEstimation::CorrectionFitParameters::bM
double bM
b Parameter
Definition: VXDMomentumEstimation.h:66
Belle2::VXDMomentumEstimationTools::getInstance
static const VXDMomentumEstimationTools & getInstance()
Use this class as singleton.
Definition: VXDMomentumEstimationTools.h:55
Belle2::VXDMomentumEstimation::convertDEDXToMomentum
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 ...
Definition: VXDMomentumEstimation.h:110
Belle2::VXDMomentumEstimation::CorrectionFitParameters::dM
double dM
d Parameter
Definition: VXDMomentumEstimation.h:70
Belle2::VXDMomentumEstimation::estimateQOverP
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...
Definition: VXDMomentumEstimation.h:82
Belle2::VXDMomentumEstimation::FitParameters::aE
double aE
a Parameter
Definition: VXDMomentumEstimation.h:51
Belle2::VXDMomentumEstimation::CorrectionFitParameters::cM
double cM
c Parameter
Definition: VXDMomentumEstimation.h:68
Belle2::VXDMomentumEstimation
Class doing the momentum estimation from dEdX for SVDClusters and PXDClusters.
Definition: VXDMomentumEstimation.h:37
Belle2::VXDMomentumEstimation::FitParameters::dE
double dE
d Parameter
Definition: VXDMomentumEstimation.h:57
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VXDMomentumEstimation::CorrectionFitParameters::aM
double aM
a Parameter
Definition: VXDMomentumEstimation.h:64
Belle2::VXDMomentumEstimation::estimateQOverPWithThickness
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 ...
Definition: VXDMomentumEstimation.h:96
Belle2::VXDMomentumEstimation::operator=
VXDMomentumEstimation & operator=(const VXDMomentumEstimation &)
Do not copy or create.
Belle2::VXDMomentumEstimation::getInstance
static const VXDMomentumEstimation & getInstance()
Use this class as a singleton.
Definition: VXDMomentumEstimation.h:74
Belle2::VXDMomentumEstimationTools
Tools needed for the VXD momentum estimation to, e.g.
Definition: VXDMomentumEstimationTools.h:43
Belle2::VXDMomentumEstimationTools::getDEDX
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.
Definition: VXDMomentumEstimationTools.h:62
Belle2::VXDMomentumEstimation::VXDMomentumEstimation
VXDMomentumEstimation()
Do not copy or create.
Definition: VXDMomentumEstimation.h:41
Belle2::VXDMomentumEstimationTools::getDEDXWithThickness
double getDEDXWithThickness(const ClusterType &cluster) const
Return dEdX but not with dX = path length but with dX = thickness of cluster.
Definition: VXDMomentumEstimationTools.h:73
Belle2::VXDMomentumEstimation::FitParameters::bE
double bE
b Parameter
Definition: VXDMomentumEstimation.h:53