Belle II Software development
TCType Class Reference

Small class for classifying types of reconstructed track candidates. More...

#include <TCType.h>

Public Types

enum  Type {
  UnknownType ,
  Unclassified ,
  Lost ,
  RefOutlier ,
  Ghost ,
  SmallStump ,
  Clone ,
  Contaminated ,
  Clean ,
  Perfect ,
  AllTCTypes ,
  Reference ,
  NTypes
}
 allows classifying TCs More...
 

Static Public Member Functions

static bool isValidType (TCType::Type type)
 checks if a type given is a valid type for a TCType
 
static bool isValidName (std::string type)
 checks if the name given is a valid name for a TCType
 
static std::string getTypeName (TCType::Type type)
 for given TCType the corresponding string-name will be returned.
 
static TCType::Type getTypeEnum (std::string type)
 for given string name of a TCType the corresponding TCType will be returned.
 
static bool isReference (TCType::Type aType)
 returns true if given TCType is a reference-Type, false if not
 
static bool isTestTC (TCType::Type aType)
 returns true if given TCType is a testTC-Type, false if not
 
static bool isGoodTestTC (TCType::Type aType)
 returns true if given TCType is a testTC-Type and did successfully reconstruct a track
 

Static Protected Attributes

static std::map< Type, std::string > s_fromTypeToString
 static map allowing translation from a given type to its name stored as a string
 
static std::map< std::string, Types_fromStringToType
 static map allowing translation from a given name stored as a string to its type
 

Detailed Description

Small class for classifying types of reconstructed track candidates.

Contains enums and converter from and to strings

Definition at line 25 of file TCType.h.

Member Enumeration Documentation

◆ Type

enum Type

allows classifying TCs

Definition at line 29 of file TCType.h.

29 {
30 UnknownType, // the type of this TC is not even unclassified but completely unknown, normally a hint for errors
31 Unclassified, // a TC which was not classified yet
32 Lost, // reference TCs which were not found by test TF
33 RefOutlier, // reference TC which was rejected by some cuts or thresholds set by some classifier
34 Ghost, // did not reach m_PARAMqiThreshold
35 SmallStump, // TC too short
36 Clone, // reached threshold but for the same reference TC a better partner was already found
37 Contaminated, // more than m_PARAMqiThreshold in purity
38 Clean, // test TC has 100% purity for the particle type but not all hits of reference TC were found
39 Perfect, // test TC is identical with a reference TC (have exactly the same hits and no extra ones)
40 AllTCTypes, // all other test types are smaller than this value
41 Reference, // reference TC
42 NTypes // number of tcTypes available
43 };

Member Function Documentation

◆ getTypeEnum()

static TCType::Type getTypeEnum ( std::string  type)
inlinestatic

for given string name of a TCType the corresponding TCType will be returned.

For invalid types, UnknownType will be passed

Definition at line 74 of file TCType.h.

75 {
76 auto pos = TCType::s_fromStringToType.find(type);
77 if (pos == TCType::s_fromStringToType.end()) {
78 B2ERROR("TCType::getTypeName(): given iD " << type << " is not a valid TCType, returnint TCType::UnknownType!");
79 return TCType::s_fromStringToType[std::string("UnknownType")];
80 }
81 return pos->second;
82 }
static std::map< std::string, Type > s_fromStringToType
static map allowing translation from a given name stored as a string to its type
Definition: TCType.h:115

◆ getTypeName()

static std::string getTypeName ( TCType::Type  type)
inlinestatic

for given TCType the corresponding string-name will be returned.

For invalid types, UnknownType will be passed

Definition at line 62 of file TCType.h.

63 {
64 auto pos = TCType::s_fromTypeToString.find(type);
65 if (pos == TCType::s_fromTypeToString.end()) {
66 B2ERROR("TCType::getTypeName(): given iD " << type << " is not a valid TCType, returnint TCType::UnknownType!");
67 return TCType::s_fromTypeToString[UnknownType];
68 }
69 return pos->second;
70 }
static std::map< Type, std::string > s_fromTypeToString
static map allowing translation from a given type to its name stored as a string
Definition: TCType.h:112

◆ isGoodTestTC()

static bool isGoodTestTC ( TCType::Type  aType)
inlinestatic

returns true if given TCType is a testTC-Type and did successfully reconstruct a track

Definition at line 103 of file TCType.h.

104 {
105 return aType > TCType::Clone
106 and aType < TCType::AllTCTypes;
107 }

◆ isReference()

static bool isReference ( TCType::Type  aType)
inlinestatic

returns true if given TCType is a reference-Type, false if not

Definition at line 86 of file TCType.h.

87 {
88 return aType == TCType::Reference
89 or aType == TCType::Lost
90 or aType == TCType::RefOutlier;
91 }

◆ isTestTC()

static bool isTestTC ( TCType::Type  aType)
inlinestatic

returns true if given TCType is a testTC-Type, false if not

Definition at line 95 of file TCType.h.

96 {
97 return aType > TCType::RefOutlier
98 and aType < TCType::AllTCTypes;
99 }

◆ isValidName()

static bool isValidName ( std::string  type)
inlinestatic

checks if the name given is a valid name for a TCType

Definition at line 55 of file TCType.h.

56 {
57 return ((TCType::s_fromStringToType.find(type) == TCType::s_fromStringToType.end()) ? false : true);
58 }

◆ isValidType()

static bool isValidType ( TCType::Type  type)
inlinestatic

checks if a type given is a valid type for a TCType

Definition at line 48 of file TCType.h.

49 {
50 return ((TCType::s_fromTypeToString.find(type) == TCType::s_fromTypeToString.end()) ? false : true);
51 }

Member Data Documentation

◆ s_fromStringToType

std::map< std::string, Belle2::TCType::Type > s_fromStringToType
staticprotected
Initial value:
= {
{std::string("UnknownType"), Belle2::TCType::UnknownType},
{std::string("Unclassified"), Belle2::TCType::Unclassified},
{std::string("Lost"), Belle2::TCType::Lost},
{std::string("RefOutlier"), Belle2::TCType::RefOutlier},
{std::string("Ghost"), Belle2::TCType::Ghost},
{std::string("SmallStump"), Belle2::TCType::SmallStump},
{std::string("Clone"), Belle2::TCType::Clone},
{std::string("Contaminated"), Belle2::TCType::Contaminated},
{std::string("Clean"), Belle2::TCType::Clean},
{std::string("Perfect"), Belle2::TCType::Perfect},
{std::string("AllTCTypes"), Belle2::TCType::AllTCTypes},
{std::string("Reference"), Belle2::TCType::Reference},
{std::string("NTypes"), Belle2::TCType::NTypes}
}

static map allowing translation from a given name stored as a string to its type

setting static dictionary translating string -> type

Definition at line 115 of file TCType.h.

◆ s_fromTypeToString

std::map< Belle2::TCType::Type, std::string > s_fromTypeToString
staticprotected
Initial value:
= {
{Belle2::TCType::UnknownType, std::string("UnknownType")},
{Belle2::TCType::Unclassified, std::string("Unclassified")},
{Belle2::TCType::Lost, std::string("Lost")},
{Belle2::TCType::RefOutlier, std::string("RefOutlier")},
{Belle2::TCType::Ghost, std::string("Ghost")},
{Belle2::TCType::SmallStump, std::string("SmallStump")},
{Belle2::TCType::Clone, std::string("Clone")},
{Belle2::TCType::Contaminated, std::string("Contaminated")},
{Belle2::TCType::Clean, std::string("Clean")},
{Belle2::TCType::Perfect, std::string("Perfect")},
{Belle2::TCType::AllTCTypes, std::string("AllTCTypes")},
{Belle2::TCType::Reference, std::string("Reference")},
{Belle2::TCType::NTypes, std::string("NTypes")}
}

static map allowing translation from a given type to its name stored as a string

setting static dictionary translating type -> string

Definition at line 112 of file TCType.h.


The documentation for this class was generated from the following files: