Belle II Software development
PrecisionUtil.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#pragma once
9
10#include <framework/logging/Logger.h>
11#include <functional>
12#include <cmath>
13
14namespace Belle2 {
19 namespace TrackFindingCDC {
20
26
27 public: // Auxiliary stuff
29 static constexpr int getLookupGridLevel() {return c_lookupGridLevel; };
30
32 static constexpr const int c_lookupGridLevel = 16;
33
35 static double convertRhoToPt(double curv) {return 1.5 * 0.00299792458 / fabs(curv); };
36
37 public: // Variations of precision functions
43 using PrecisionFunction = std::function<double(double)>;
44
49 static double getBasicCurvPrecision(double __attribute__((unused)) curv)
50 {
51 // 0.3 is the width of the Legendre phase-space in curvatures direction.
52 return 0.3 / pow(2, 16);
53 }
54
65 static double getOriginCurvPrecision(double curv)
66 {
67 // Convert to pt making the cut-off of that has been here before
68 double pt = convertRhoToPt(curv);
69 if (not(pt <= 3.0)) {
70 pt = 3.0;
71 }
72
73 double precision = exp(-16.1987 * pt - 5.96206) + 0.000190872 - 0.0000739319 * pt;
74
75 /* 10.5 - 0.24 * exp(-4.13118 * convertRhoToPt(curv) + 2.74); */
76 B2DEBUG(25, "origin: precision = " << precision << "; curv = " << curv);
77 return precision;
78 }
79
90 static double getNonOriginCurvPrecision(double curv)
91 {
92 // Convert to pt making the cut-off of that has been here before
93 double pt = convertRhoToPt(curv);
94 if (not(pt <= 3.0)) {
95 pt = 3.0;
96 }
97
98 double precision{};
99 if (pt < 0.36) {
100 precision = exp(-0.356965 - 0.00186066 * pt) - 0.697526;
101 } else {
102 precision = exp(-0.357335 + 0.000438872 * pt) - 0.697786;
103 }
104
105 B2DEBUG(25, "non origin: precision = " << precision << "; curv = " << curv);
106 return precision;
107 }
108 };
109 }
111}
Utility collection for functions to determine a curvature precision such at a hough box covers a cert...
static double convertRhoToPt(double curv)
convert curvature (one of the axis in Legendre phase-space) to Pt (in GeV)
static constexpr const int c_lookupGridLevel
Deepness of the trigonometrical lookup table.
static double getOriginCurvPrecision(double curv)
Function which estimates desired curvature resolution of quadtree node in the given pt region paramet...
static double getNonOriginCurvPrecision(double curv)
Function which estimates desired curvature resolution of quadtree node in the given pt region paramet...
static constexpr int getLookupGridLevel()
Returns desired deepness of the trigonometrical lookup table. Used as template parameter for the Trig...
static double getBasicCurvPrecision(double curv)
Basic function to estimate the curvature precision Takes a curvature value and returns a width that.
std::function< double(double)> PrecisionFunction
Function type which is used for resolution calculations (resolution=f(curvature)) Takes a curvature v...
Abstract base class for different kinds of events.