Logo ROOT  
Reference Guide
Types.h
Go to the documentation of this file.
1// @(#)root/tmva $Id$
2// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
3
4/**********************************************************************************
5 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6 * Package: TMVA *
7 * Class : Types *
8 * Web : http://tmva.sourceforge.net *
9 * *
10 * Description: *
11 * GLobal types (singleton class) *
12 * *
13 * Authors (alphabetical): *
14 * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15 * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland *
16 * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17 * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
18 * *
19 * Copyright (c) 2005: *
20 * CERN, Switzerland *
21 * U. of Victoria, Canada *
22 * MPI-K Heidelberg, Germany *
23 * *
24 * Redistribution and use in source and binary forms, with or without *
25 * modification, are permitted according to the terms listed in LICENSE *
26 * (http://mva.sourceforge.net/license.txt) *
27 **********************************************************************************/
28
29#ifndef ROOT_TMVA_Types
30#define ROOT_TMVA_Types
31
32//////////////////////////////////////////////////////////////////////////
33// //
34// Types //
35// //
36// Singleton class for Global types used by TMVA //
37// //
38//////////////////////////////////////////////////////////////////////////
39
40#include <map>
41#if __cplusplus > 199711L
42#include <atomic>
43#endif
44
45#include "Rtypes.h"
46
47#include "TString.h"
48
49namespace TMVA {
50
51 typedef UInt_t TMVAVersion_t;
52
53 class MsgLogger;
54
55 // message types for MsgLogger
56 // define outside of Types class to facilite access
57 enum EMsgType {
58 kDEBUG = 1,
59 kVERBOSE = 2,
60 kINFO = 3,
61 kWARNING = 4,
62 kERROR = 5,
63 kFATAL = 6,
64 kSILENT = 7,
65 kHEADER = 8
66 };
67
68 enum HistType { kMVAType = 0, kProbaType = 1, kRarityType = 2, kCompareType = 3 };
69
70 //Variable Importance type
71 enum VIType {kShort=0,kAll=1,kRandom=2};
72
73 class Types {
74
75 public:
76
77 // available MVA methods
78 enum EMVA {
112 };
113
114 // available variable transformations
124 };
125
126 // type of analysis
133 };
134
135 enum ESBType {
136 kSignal = 0, // Never change this number - it is elsewhere assumed to be zero !
141 };
142
146 kMaxTreeType, // also used as temporary storage for trees not yet assigned for testing;training...
147 kValidation, // these are placeholders... currently not used, but could be moved "forward" if
148 kTrainingOriginal // ever needed
149 };
150
157 };
158
159 public:
160
161 static Types& Instance();
162 static void DestroyInstance();
163 ~Types();
164
165 Types::EMVA GetMethodType( const TString& method ) const;
166 TString GetMethodName( Types::EMVA method ) const;
167
168 Bool_t AddTypeMapping(Types::EMVA method, const TString& methodname);
169
170 private:
171
172 Types();
173#if __cplusplus > 199711L && !defined _MSC_VER
174 static std::atomic<Types*> fgTypesPtr;
175#else
177#endif
178
179 private:
180
181 std::map<TString, TMVA::Types::EMVA> fStr2type; // types-to-text map
182 mutable MsgLogger* fLogger; // message logger
183 MsgLogger& Log() const { return *fLogger; }
184
185 };
186}
187
188#endif
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
Singleton class for Global types used by TMVA.
Definition: Types.h:73
static void DestroyInstance()
"destructor" of the single instance
Definition: Types.cxx:90
@ kBoostProcBegin
Definition: Types.h:152
@ kBeforeBoosting
Definition: Types.h:154
@ kAfterBoosting
Definition: Types.h:155
@ kBoostProcEnd
Definition: Types.h:156
@ kBeforeTraining
Definition: Types.h:153
TString GetMethodName(Types::EMVA method) const
Definition: Types.cxx:136
static Types & Instance()
the the single instance of "Types" if existing already, or create it (Singleton)
Definition: Types.cxx:70
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
Definition: Types.cxx:101
@ kSignal
Definition: Types.h:136
@ kTrueType
Definition: Types.h:140
@ kBackground
Definition: Types.h:137
@ kSBBoth
Definition: Types.h:138
@ kMaxSBType
Definition: Types.h:139
@ kFisher
Definition: Types.h:84
@ kCategory
Definition: Types.h:99
@ kPyRandomForest
Definition: Types.h:102
@ kPyKeras
Definition: Types.h:105
@ kTMlpANN
Definition: Types.h:87
@ kCrossValidation
Definition: Types.h:110
@ kFDA
Definition: Types.h:94
@ kBDT
Definition: Types.h:88
@ kPDERS
Definition: Types.h:82
@ kRSNNS
Definition: Types.h:107
@ kPDEFoam
Definition: Types.h:96
@ kLikelihood
Definition: Types.h:81
@ kCuts
Definition: Types.h:80
@ kPyAdaBoost
Definition: Types.h:103
@ kVariable
Definition: Types.h:79
@ kBayesClassifier
Definition: Types.h:93
@ kHMatrix
Definition: Types.h:83
@ kBoost
Definition: Types.h:95
@ kSVM
Definition: Types.h:91
@ kRuleFit
Definition: Types.h:90
@ kCFMlpANN
Definition: Types.h:86
@ kMaxMethod
Definition: Types.h:111
@ kPyGTB
Definition: Types.h:104
@ kKNN
Definition: Types.h:85
@ kMLP
Definition: Types.h:92
@ kPlugins
Definition: Types.h:98
std::map< TString, TMVA::Types::EMVA > fStr2type
Definition: Types.h:181
EVariableTransform
Definition: Types.h:115
@ kUniform
Definition: Types.h:122
@ kNormalized
Definition: Types.h:118
@ kRearranged
Definition: Types.h:120
@ kGauss
Definition: Types.h:121
@ kIdentity
Definition: Types.h:116
@ kMaxVariableTransform
Definition: Types.h:123
@ kDecorrelated
Definition: Types.h:117
Types::EMVA GetMethodType(const TString &method) const
returns the method type (enum) for a given method (string)
Definition: Types.cxx:121
EAnalysisType
Definition: Types.h:127
@ kMulticlass
Definition: Types.h:130
@ kNoAnalysisType
Definition: Types.h:131
@ kClassification
Definition: Types.h:128
@ kMaxAnalysisType
Definition: Types.h:132
@ kRegression
Definition: Types.h:129
MsgLogger * fLogger
Definition: Types.h:182
@ kMaxTreeType
Definition: Types.h:146
@ kTrainingOriginal
Definition: Types.h:148
@ kTraining
Definition: Types.h:144
@ kValidation
Definition: Types.h:147
@ kTesting
Definition: Types.h:145
MsgLogger & Log() const
Definition: Types.h:183
Types()
constructor
Definition: Types.cxx:56
static Types * fgTypesPtr
Definition: Types.h:176
Basic string class.
Definition: TString.h:131
create variable transformations