Belle II Software  release-05-02-19
AlgoritmType.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jakob Lettenbichler *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 // framework:
13 #include <framework/logging/Logger.h>
14 
15 // stl:
16 #include <string>
17 #include <map>
18 
19 
20 
21 namespace Belle2 {
27  class AlgoritmType {
28  public:
29 
31  enum Type {
32  UnknownType, // defines unknown types
37  AnalyzingAlgorithmValuePY,
38  AnalyzingAlgorithmValuePZ,
69  NTypes // number of analyzingAlgorithmTypes available
70  };
71 
72 
74  static bool isValidType(AlgoritmType::Type type)
75  {
76  return ((AlgoritmType::s_fromTypeToString.find(type) == AlgoritmType::s_fromTypeToString.end()) ? false : true);
77  }
78 
79 
81  static bool isValidName(std::string type)
82  {
83  return ((AlgoritmType::s_fromStringToType.find(type) == AlgoritmType::s_fromStringToType.end()) ? false : true);
84  }
85 
86 
88  static std::string getTypeName(AlgoritmType::Type type)
89  {
90  auto pos = AlgoritmType::s_fromTypeToString.find(type);
91  if (pos == AlgoritmType::s_fromTypeToString.end()) {
92  B2ERROR("AlgoritmType::getTypeName(): given iD " << type << " is not a valid AlgoritmType, return AlgoritmType::UnknownType!");
93  return AlgoritmType::s_fromTypeToString[UnknownType];
94  }
95  return pos->second;
96  }
97 
98 
100  static AlgoritmType::Type getTypeEnum(std::string type)
101  {
102  auto pos = AlgoritmType::s_fromStringToType.find(type);
103  if (pos == AlgoritmType::s_fromStringToType.end()) {
104  B2ERROR("AlgoritmType::getTypeName(): given iD " << type << " is not a valid AlgoritmType, return AlgoritmType::UnknownType!");
105  return AlgoritmType::s_fromStringToType[std::string("UnknownType")];
106  }
107  return pos->second;
108  }
109 
110 
112  static bool isValueDoubleType(AlgoritmType::Type aType)
113  { return aType < AlgoritmType::AnalyzingAlgorithmResidualPX and aType > AlgoritmType::AnalyzingAlgorithmBase; }
114 
116  static bool isResidualDoubleType(AlgoritmType::Type aType)
117  { return aType < AlgoritmType::AnalyzingAlgorithmLostUClusters and aType > AlgoritmType::AnalyzingAlgorithmValueQI; }
118 
121  { return aType > AlgoritmType::AnalyzingAlgorithmResidualPositionXY and aType < AlgoritmType::AnalyzingAlgorithmLostUEDep; }
122 
125  { return aType > AlgoritmType::AnalyzingAlgorithmTotalVClusters and aType < AlgoritmType::NTypes; }
126 
127  protected:
129  static std::map<Type, std::string> s_fromTypeToString;
130 
132  static std::map<std::string, Type> s_fromStringToType;
133  };
134 
135 
136 
138 
139 }
Belle2::AnalyzingAlgorithmLostVEDep
Class for storing an algorithm to find out the energy deposit of v-type-clusters the testTC lost comp...
Definition: AnalyzingAlgorithmClusterBased.h:162
Belle2::AlgoritmType::AnalyzingAlgorithmLostUClusters
@ AnalyzingAlgorithmLostUClusters
value type hit (with access to clusters via relations), stores int. defined in ..tracking/trackFindin...
Definition: AlgoritmType.h:68
Belle2::AlgoritmType::s_fromTypeToString
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:137
Belle2::AnalyzingAlgorithmResidualPAngle
Class for storing an algorithm determining the residual (ref-test) of momentum in its angle (directio...
Definition: AnalyzingAlgorithmResiduals.h:163
Belle2::AnalyzingAlgorithmValueQI
Class for storing an algorithm determining the quality indicator of the TC.
Definition: AnalyzingAlgorithmValues.h:182
Belle2::AnalyzingAlgorithmResidualPZ
Class for storing an algorithm determining the residual (ref-test) of momentum in Z.
Definition: AnalyzingAlgorithmResiduals.h:73
Belle2::AnalyzingAlgorithmTotalVClusters
Class for storing an algorithm to find out how many v-type-clusters the given TC had.
Definition: AnalyzingAlgorithmClusterBased.h:213
Belle2::AnalyzingAlgorithmTotalUClusters
Class for storing an algorithm to find out how many u-type-clusters the given TC had.
Definition: AnalyzingAlgorithmClusterBased.h:193
Belle2::AlgoritmType::AnalyzingAlgorithmBase
@ AnalyzingAlgorithmBase
base type, template for all the other analyzing algorithms, contains essential functions for all algo...
Definition: AlgoritmType.h:42
Belle2::AnalyzingAlgorithmResidualP
Class for storing an algorithm determining the residual (ref-test) of momentum in |p|.
Definition: AnalyzingAlgorithmResiduals.h:109
Belle2::AlgoritmType::isValidName
static bool isValidName(std::string type)
checks if the name given is a valid name for an AlgoritmType
Definition: AlgoritmType.h:89
Belle2::AnalyzingAlgorithmValuePPhi
Class for storing an algorithm determining the momentum in phi (in degrees)
Definition: AnalyzingAlgorithmValues.h:123
Belle2::AlgoritmType::isValueDoubleType
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:120
Belle2::AlgoritmType::getTypeName
static std::string getTypeName(AlgoritmType::Type type)
for given AlgoritmType the corresponding string-name will be returned.
Definition: AlgoritmType.h:96
Belle2::AnalyzingAlgorithmResidualPY
Class for storing an algorithm determining the residual (ref-test) of momentum in Y.
Definition: AnalyzingAlgorithmResiduals.h:55
Belle2::AlgoritmType::s_fromStringToType
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:140
Belle2::AnalyzingAlgorithmTotalVEDep
Class for storing an algorithm to find out the energy deposit of v-type-clusters the given TC had.
Definition: AnalyzingAlgorithmClusterBased.h:257
Belle2::AlgoritmType::isValidType
static bool isValidType(AlgoritmType::Type type)
checks if a type given is a valid type for an AlgoritmType
Definition: AlgoritmType.h:82
Belle2::AlgoritmType::AnalyzingAlgorithmValuePX
@ AnalyzingAlgorithmValuePX
value type, stores double. defined in ..tracking/trackFindingVXD/analyzingTools/algorithms/AnalyzingA...
Definition: AlgoritmType.h:44
Belle2::AnalyzingAlgorithmResidualPTAngle
Class for storing an algorithm determining the residual (ref-test) of pT in angle (transverse directi...
Definition: AnalyzingAlgorithmResiduals.h:181
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::AnalyzingAlgorithmValuePT
Class for storing an algorithm determining the momentum in pT.
Definition: AnalyzingAlgorithmValues.h:80
Belle2::AlgoritmType::AnalyzingAlgorithmLostUEDep
@ AnalyzingAlgorithmLostUEDep
value type hit (with access to clusters via relations), stores vector< double >. defined in ....
Definition: AlgoritmType.h:73
Belle2::AlgoritmType::isHitValueVecDoubleType
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:132
Belle2::AnalyzingAlgorithmValueDistSeed2IPZ
Class for storing an algorithm determining the distance seedHit to IP in XY (=r)
Definition: AnalyzingAlgorithmValues.h:168
Belle2::AnalyzingAlgorithmTotalUEDep
Class for storing an algorithm to find out the energy deposit of u-type-clusters the given TC had.
Definition: AnalyzingAlgorithmClusterBased.h:233
Belle2::AlgoritmType::isResidualDoubleType
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:124
Belle2::AnalyzingAlgorithmValueDistSeed2IPXY
Class for storing an algorithm determining the distance seedHit to IP in XY (=r)
Definition: AnalyzingAlgorithmValues.h:154
Belle2::AnalyzingAlgorithmValueDistSeed2IP
Class for storing an algorithm determining the the distance seedHit to IP in 3D.
Definition: AnalyzingAlgorithmValues.h:139
Belle2::AnalyzingAlgorithmResidualPositionXY
Class for storing an algorithm determining the residual (ref-test) of the seed position in XY (=r)
Definition: AnalyzingAlgorithmResiduals.h:221
Belle2::AnalyzingAlgorithmLostVClusters
Class for storing an algorithm to find out how many v-type-clusters the testTC lost compared to the r...
Definition: AnalyzingAlgorithmClusterBased.h:114
Belle2::AnalyzingAlgorithmResidualPT
Class for storing an algorithm determining the residual (ref-test) of momentum in pT.
Definition: AnalyzingAlgorithmResiduals.h:91
Belle2::AnalyzingAlgorithmValuePTheta
Class for storing an algorithm determining the momentum in theta (in degrees)
Definition: AnalyzingAlgorithmValues.h:108
Belle2::AnalyzingAlgorithmResidualPPhi
Class for storing an algorithm determining the residual (ref-test) of momentum in phi (in degrees)
Definition: AnalyzingAlgorithmResiduals.h:145
Belle2::AlgoritmType::getTypeEnum
static AlgoritmType::Type getTypeEnum(std::string type)
for given string name of a AlgoritmType the corresponding AlgoritmType will be returned.
Definition: AlgoritmType.h:108
Belle2::AlgoritmType::isHitValueIntType
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:128
Belle2::AnalyzingAlgorithmResidualPTheta
Class for storing an algorithm determining the residual (ref-test) of momentum in theta (in degrees)
Definition: AnalyzingAlgorithmResiduals.h:127
Belle2::AnalyzingAlgorithmValueP
Class for storing an algorithm determining the momentum in |p|.
Definition: AnalyzingAlgorithmValues.h:94
Belle2::AlgoritmType::Type
Type
allows classifying Analyzing algorithms
Definition: AlgoritmType.h:39
Belle2::AlgoritmType::AnalyzingAlgorithmResidualPX
@ AnalyzingAlgorithmResidualPX
residual type, stores double. defined in ..tracking/trackFindingVXD/analyzingTools/algorithms/Analyzi...
Definition: AlgoritmType.h:56
Belle2::AnalyzingAlgorithmResidualPosition
Class for storing an algorithm determining the residual (ref-test) of the seed position in 3D.
Definition: AnalyzingAlgorithmResiduals.h:203