Logo ROOT   6.07/09
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 ,
113  };
114 
115  // available variable transformations
125  };
126 
127  // type of analysis
134  };
135 
136  enum ESBType {
137  kSignal = 0, // Never change this number - it is elsewhere assumed to be zero !
142  };
143 
144  enum ETreeType {
147  kMaxTreeType, // also used as temporary storage for trees not yet assigned for testing;training...
148  kValidation, // these are placeholders... currently not used, but could be moved "forward" if
149  kTrainingOriginal // ever needed
150  };
151 
152  enum EBoostStage {
158  };
159 
160  public:
161 
162  static Types& Instance();
163  static void DestroyInstance();
164  ~Types();
165 
166  Types::EMVA GetMethodType( const TString& method ) const;
167  TString GetMethodName( Types::EMVA method ) const;
168 
169  Bool_t AddTypeMapping(Types::EMVA method, const TString& methodname);
170 
171  private:
172 
173  Types();
174 #if __cplusplus > 199711L
175  static std::atomic<Types*> fgTypesPtr;
176 #else
177  static Types* fgTypesPtr;
178 #endif
179 
180  private:
181 
182  std::map<TString, TMVA::Types::EMVA> fStr2type; // types-to-text map
183  mutable MsgLogger* fLogger; // message logger
184  MsgLogger& Log() const { return *fLogger; }
185 
186  };
187 }
188 
189 #endif
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:128
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:182
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
Definition: Types.cxx:95
MsgLogger * fLogger
Definition: Types.h:183
Types::EMVA GetMethodType(const TString &method) const
Definition: Types.cxx:114
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:177
TString GetMethodName(Types::EMVA method) const
Definition: Types.cxx:130
MsgLogger & Log() const
Definition: Types.h:184
HistType
Definition: Types.h:72
Abstract ClassifierFactory template that handles arbitrary types.
Types()
constructor
Definition: Types.cxx:50
EVariableTransform
Definition: Types.h:116