Belle II Software development
AlgoritmType.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// framework:
11#include <framework/logging/Logger.h>
12
13// stl:
14#include <string>
15#include <map>
16
17
18
19namespace Belle2 {
26 public:
27
29 enum Type {
30 UnknownType, // defines unknown types
67 NTypes // number of analyzingAlgorithmTypes available
68 };
69
70
73 {
74 return ((AlgoritmType::s_fromTypeToString.find(type) == AlgoritmType::s_fromTypeToString.end()) ? false : true);
75 }
76
77
79 static bool isValidName(std::string type)
80 {
81 return ((AlgoritmType::s_fromStringToType.find(type) == AlgoritmType::s_fromStringToType.end()) ? false : true);
82 }
83
84
86 static std::string getTypeName(AlgoritmType::Type type)
87 {
88 auto pos = AlgoritmType::s_fromTypeToString.find(type);
89 if (pos == AlgoritmType::s_fromTypeToString.end()) {
90 B2ERROR("AlgoritmType::getTypeName(): given iD " << type << " is not a valid AlgoritmType, return AlgoritmType::UnknownType!");
91 return AlgoritmType::s_fromTypeToString[UnknownType];
92 }
93 return pos->second;
94 }
95
96
98 static AlgoritmType::Type getTypeEnum(std::string type)
99 {
100 auto pos = AlgoritmType::s_fromStringToType.find(type);
101 if (pos == AlgoritmType::s_fromStringToType.end()) {
102 B2ERROR("AlgoritmType::getTypeName(): given iD " << type << " is not a valid AlgoritmType, return AlgoritmType::UnknownType!");
103 return AlgoritmType::s_fromStringToType[std::string("UnknownType")];
104 }
105 return pos->second;
106 }
107
108
111 { return aType < AlgoritmType::AnalyzingAlgorithmResidualPX and aType > AlgoritmType::AnalyzingAlgorithmBase; }
112
115 { return aType < AlgoritmType::AnalyzingAlgorithmLostUClusters and aType > AlgoritmType::AnalyzingAlgorithmValueQI; }
116
119 { return aType > AlgoritmType::AnalyzingAlgorithmResidualPositionXY and aType < AlgoritmType::AnalyzingAlgorithmLostUEDep; }
120
123 { return aType > AlgoritmType::AnalyzingAlgorithmTotalVClusters and aType < AlgoritmType::NTypes; }
124
125 protected:
127 static std::map<Type, std::string> s_fromTypeToString;
128
130 static std::map<std::string, Type> s_fromStringToType;
131 };
132
133
134
136
137}
Small class for classifying types of analyzing algorithms.
Definition: AlgoritmType.h:25
static std::map< std::string, Type > s_fromStringToType
static map allowing translation from a given name stored as a string to its type
Definition: AlgoritmType.h:130
static bool isValidName(std::string type)
checks if the name given is a valid name for an AlgoritmType
Definition: AlgoritmType.h:79
static bool isHitValueIntType(AlgoritmType::Type aType)
returns true if given AlgoritmType is a an algorithm which calculates a value in int based on hits of...
Definition: AlgoritmType.h:118
Type
allows classifying Analyzing algorithms
Definition: AlgoritmType.h:29
@ AnalyzingAlgorithmResidualPX
residual type, stores double. defined in ..tracking/trackFindingVXD/analyzingTools/algorithms/Analyzi...
Definition: AlgoritmType.h:46
@ AnalyzingAlgorithmBase
base type, template for all the other analyzing algorithms, contains essential functions for all algo...
Definition: AlgoritmType.h:32
@ AnalyzingAlgorithmLostUEDep
value type hit (with access to clusters via relations), stores vector< double >. defined in ....
Definition: AlgoritmType.h:63
@ AnalyzingAlgorithmLostUClusters
value type hit (with access to clusters via relations), stores int. defined in ..tracking/trackFindin...
Definition: AlgoritmType.h:58
@ AnalyzingAlgorithmValuePX
value type, stores double. defined in ..tracking/trackFindingVXD/analyzingTools/algorithms/AnalyzingA...
Definition: AlgoritmType.h:34
static bool isValueDoubleType(AlgoritmType::Type aType)
returns true if given AlgoritmType is a an algorithm which calculates a value in double for each TC p...
Definition: AlgoritmType.h:110
static bool isResidualDoubleType(AlgoritmType::Type aType)
returns true if given AlgoritmType is a an algorithm which calculates a residual in double for each T...
Definition: AlgoritmType.h:114
static std::map< Type, std::string > s_fromTypeToString
static map allowing translation from a given type to its name stored as a string
Definition: AlgoritmType.h:127
static bool isHitValueVecDoubleType(AlgoritmType::Type aType)
returns true if given AlgoritmType is a an algorithm which calculates a value in vector< double> base...
Definition: AlgoritmType.h:122
static std::string getTypeName(AlgoritmType::Type type)
for given AlgoritmType the corresponding string-name will be returned.
Definition: AlgoritmType.h:86
static AlgoritmType::Type getTypeEnum(std::string type)
for given string name of a AlgoritmType the corresponding AlgoritmType will be returned.
Definition: AlgoritmType.h:98
static bool isValidType(AlgoritmType::Type type)
checks if a type given is a valid type for an AlgoritmType
Definition: AlgoritmType.h:72
Class for storing an algorithm to find out how many v-type-clusters the testTC lost compared to the r...
Class for storing an algorithm to find out the energy deposit of v-type-clusters the testTC lost comp...
Class for storing an algorithm determining the residual (ref-test) of momentum in its angle (directio...
Class for storing an algorithm determining the residual (ref-test) of momentum in phi (in degrees)
Class for storing an algorithm determining the residual (ref-test) of pT in angle (transverse directi...
Class for storing an algorithm determining the residual (ref-test) of momentum in pT.
Class for storing an algorithm determining the residual (ref-test) of momentum in theta (in degrees)
Class for storing an algorithm determining the residual (ref-test) of momentum in Y.
Class for storing an algorithm determining the residual (ref-test) of momentum in Z.
Class for storing an algorithm determining the residual (ref-test) of momentum in |p|.
Class for storing an algorithm determining the residual (ref-test) of the seed position in XY (=r)
Class for storing an algorithm determining the residual (ref-test) of the seed position in 3D.
Class for storing an algorithm to find out how many u-type-clusters the given TC had.
Class for storing an algorithm to find out the energy deposit of u-type-clusters the given TC had.
Class for storing an algorithm to find out how many v-type-clusters the given TC had.
Class for storing an algorithm to find out the energy deposit of v-type-clusters the given TC had.
Class for storing an algorithm determining the distance seedHit to IP in XY (=r)
Class for storing an algorithm determining the distance seedHit to IP in XY (=r)
Class for storing an algorithm determining the the distance seedHit to IP in 3D.
Class for storing an algorithm determining the momentum in phi (in degrees)
Class for storing an algorithm determining the momentum in pT.
Class for storing an algorithm determining the momentum in theta (in degrees)
Class for storing an algorithm determining the momentum in Y.
Class for storing an algorithm determining the momentum in Z.
Class for storing an algorithm determining the momentum in |p|.
Class for storing an algorithm determining the quality indicator of the TC.
Abstract base class for different kinds of events.