Belle II Software development
EFitVariance.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 <stdexcept>
11#include <string>
12
13namespace Belle2 {
18 namespace TrackFindingCDC {
19
21 enum class EFitVariance {
23 c_Unit = 0,
24
26 c_Nominal = 1,
27
29 c_DriftLength = 2,
30
32 c_Pseudo = 3,
33
35 c_Proper = 4,
36 };
37
42 inline EFitVariance getFitVariance(const std::string& fitVarianceString)
43 {
44 if (fitVarianceString == std::string("unit")) {
45 return EFitVariance::c_Unit;
46 } else if (fitVarianceString == std::string("nominal")) {
47 return EFitVariance::c_Nominal;
48 } else if (fitVarianceString == std::string("driftLength")) {
49 return EFitVariance::c_DriftLength;
50 } else if (fitVarianceString == std::string("pseudo")) {
51 return EFitVariance::c_Pseudo;
52 } else if (fitVarianceString == std::string("proper")) {
53 return EFitVariance::c_Proper;
54 } else {
55 throw std::invalid_argument("Unexpected fit variance string : '" + fitVarianceString + "'");
56 }
57 }
58
59 }
61}
Abstract base class for different kinds of events.