Belle II Software  release-05-01-25
PrecisionUtil.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2014 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Viktor Trusov, Thomas Hauth *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 #pragma once
11 
12 #include <framework/logging/Logger.h>
13 #include <functional>
14 #include <cmath>
15 
16 namespace Belle2 {
21  namespace TrackFindingCDC {
22 
27  class PrecisionUtil {
28 
29  public: // Auxiliary stuff
31  static constexpr int getLookupGridLevel() {return c_lookupGridLevel; };
32 
34  static constexpr const int c_lookupGridLevel = 16;
35 
37  static double convertRhoToPt(double curv) {return 1.5 * 0.00299792458 / fabs(curv); };
38 
39  public: // Variations of precision functions
45  using PrecisionFunction = std::function<double(double)>;
46 
51  static double getBasicCurvPrecision(double __attribute__((unused)) curv)
52  {
53  // 0.3 is the width of the Legendre phase-space in curvatures direction.
54  return 0.3 / pow(2, 16);
55  }
56 
67  static double getOriginCurvPrecision(double curv)
68  {
69  // Convert to pt making the cut-off of that has been here before
70  double pt = convertRhoToPt(curv);
71  if (not(pt <= 3.0)) {
72  pt = 3.0;
73  }
74 
75  double precision = exp(-16.1987 * pt - 5.96206) + 0.000190872 - 0.0000739319 * pt;
76 
77  /* 10.5 - 0.24 * exp(-4.13118 * convertRhoToPt(curv) + 2.74); */
78  B2DEBUG(100, "origin: precision = " << precision << "; curv = " << curv);
79  return precision;
80  }
81 
92  static double getNonOriginCurvPrecision(double curv)
93  {
94  // Convert to pt making the cut-off of that has been here before
95  double pt = convertRhoToPt(curv);
96  if (not(pt <= 3.0)) {
97  pt = 3.0;
98  }
99 
100  double precision{};
101  if (pt < 0.36) {
102  precision = exp(-0.356965 - 0.00186066 * pt) - 0.697526;
103  } else {
104  precision = exp(-0.357335 + 0.000438872 * pt) - 0.697786;
105  }
106 
107  B2DEBUG(100, "non origin: precision = " << precision << "; curv = " << curv);
108  return precision;
109  }
110  };
111  }
113 }
Belle2::TrackFindingCDC::PrecisionUtil::getOriginCurvPrecision
static double getOriginCurvPrecision(double curv)
Function which estimates desired curvature resolution of quadtree node in the given pt region paramet...
Definition: PrecisionUtil.h:75
Belle2::TrackFindingCDC::PrecisionUtil::convertRhoToPt
static double convertRhoToPt(double curv)
convert curvature (one of the axis in legendre phase-space) to Pt (in GeV)
Definition: PrecisionUtil.h:45
Belle2::TrackFindingCDC::PrecisionUtil::c_lookupGridLevel
static constexpr const int c_lookupGridLevel
Deepness of the trigonometrical lookup table.
Definition: PrecisionUtil.h:42
Belle2::TrackFindingCDC::PrecisionUtil::getBasicCurvPrecision
static double getBasicCurvPrecision(double __attribute__((unused)) curv)
Basic function to estimate the curvature precision Takes a curvature value and returns a width that.
Definition: PrecisionUtil.h:59
Belle2::TrackFindingCDC::PrecisionUtil::getNonOriginCurvPrecision
static double getNonOriginCurvPrecision(double curv)
Function which estimates desired curvature resolution of quadtree node in the given pt region paramet...
Definition: PrecisionUtil.h:100
Belle2::TrackFindingCDC::PrecisionUtil::getLookupGridLevel
static constexpr int getLookupGridLevel()
Returns desired deepness of the trigonometrical lookup table. Used as template parameter for the Trig...
Definition: PrecisionUtil.h:39
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::PrecisionUtil::PrecisionFunction
std::function< double(double)> PrecisionFunction
Function type which is used for resolution calculations (resolution=f(curvature)) Takes a curvature v...
Definition: PrecisionUtil.h:53