Logo ROOT   6.08/07
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 #ifndef ROOT_Rtypes
46 #include "Rtypes.h"
47 #endif
48 
49 #ifndef ROOT_TString
50 #include "TString.h"
51 #endif
52 
53 namespace TMVA {
54 
56 
57  class MsgLogger;
58 
59  // message types for MsgLogger
60  // define outside of Types class to facilite access
61  enum EMsgType {
62  kDEBUG = 1,
63  kVERBOSE = 2,
64  kINFO = 3,
65  kWARNING = 4,
66  kERROR = 5,
67  kFATAL = 6,
68  kSILENT = 7,
69  kHEADER = 8
70  };
71 
72  enum HistType { kMVAType = 0, kProbaType = 1, kRarityType = 2, kCompareType = 3 };
73 
74  //Variable Importance type
75  enum VIType {kShort=0,kAll=1,kRandom=2};
76 
77  class Types {
78 
79  public:
80 
81  // available MVA methods
82  enum EMVA {
83  kVariable = 0,
89  kKNN ,
92  kBDT ,
93  kDT ,
95  kSVM ,
96  kMLP ,
98  kFDA ,
101  kLD ,
114  };
115 
116  // available variable transformations
126  };
127 
128  // type of analysis
135  };
136 
137  enum ESBType {
138  kSignal = 0, // Never change this number - it is elsewhere assumed to be zero !
143  };
144 
145  enum ETreeType {
148  kMaxTreeType, // also used as temporary storage for trees not yet assigned for testing;training...
149  kValidation, // these are placeholders... currently not used, but could be moved "forward" if
150  kTrainingOriginal // ever needed
151  };
152 
153  enum EBoostStage {
159  };
160 
161  public:
162 
163  static Types& Instance();
164  static void DestroyInstance();
165  ~Types();
166 
167  Types::EMVA GetMethodType( const TString& method ) const;
168  TString GetMethodName( Types::EMVA method ) const;
169 
170  Bool_t AddTypeMapping(Types::EMVA method, const TString& methodname);
171 
172  private:
173 
174  Types();
175 #if __cplusplus > 199711L
176  static std::atomic<Types*> fgTypesPtr;
177 #else
178  static Types* fgTypesPtr;
179 #endif
180 
181  private:
182 
183  std::map<TString, TMVA::Types::EMVA> fStr2type; // types-to-text map
184  mutable MsgLogger* fLogger; // message logger
185  MsgLogger& Log() const { return *fLogger; }
186 
187  };
188 }
189 
190 #endif
TString GetMethodName(Types::EMVA method) const
Definition: Types.cxx:130
VIType
Definition: Types.h:75
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
Definition: Types.cxx:64
EAnalysisType
Definition: Types.h:129
UInt_t TMVAVersion_t
Definition: Types.h:55
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
std::map< TString, TMVA::Types::EMVA > fStr2type
Definition: Types.h:183
Types::EMVA GetMethodType(const TString &method) const
Definition: Types.cxx:114
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
Definition: Types.cxx:95
MsgLogger * fLogger
Definition: Types.h:184
MsgLogger & Log() const
Definition: Types.h:185
EMsgType
Definition: Types.h:61
unsigned int UInt_t
Definition: RtypesCore.h:42
static void DestroyInstance()
"destructor" of the single instance
Definition: Types.cxx:83
static Types * fgTypesPtr
Definition: Types.h:178
HistType
Definition: Types.h:72
Abstract ClassifierFactory template that handles arbitrary types.
Types()
constructor
Definition: Types.cxx:50
EVariableTransform
Definition: Types.h:117