Logo ROOT   master
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 
49 namespace 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 {
79  kVariable = 0,
85  kKNN ,
88  kBDT ,
89  kDT ,
91  kSVM ,
92  kMLP ,
94  kFDA ,
97  kLD ,
101  kDL ,
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 
143  enum ETreeType {
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 
151  enum EBoostStage {
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
176  static Types* fgTypesPtr;
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
Singleton class for Global types used by TMVA.
Definition: Types.h:73
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
EAnalysisType
Definition: Types.h:127
Basic string class.
Definition: TString.h:131
bool Bool_t
Definition: RtypesCore.h:61
std::map< TString, TMVA::Types::EMVA > fStr2type
Definition: Types.h:181
Types::EMVA GetMethodType(const TString &method) const
returns the method type (enum) for a given method (string)
Definition: Types.cxx:121
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
Definition: Types.cxx:101
MsgLogger * fLogger
Definition: Types.h:182
MsgLogger & Log() const
Definition: Types.h:183
unsigned int UInt_t
Definition: RtypesCore.h:44
static void DestroyInstance()
"destructor" of the single instance
Definition: Types.cxx:90
static Types * fgTypesPtr
Definition: Types.h:176
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
create variable transformations
Types()
constructor
Definition: Types.cxx:56
EVariableTransform
Definition: Types.h:115