Logo ROOT   6.10/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 #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 ,
110  };
111 
112  // available variable transformations
122  };
123 
124  // type of analysis
131  };
132 
133  enum ESBType {
134  kSignal = 0, // Never change this number - it is elsewhere assumed to be zero !
139  };
140 
141  enum ETreeType {
144  kMaxTreeType, // also used as temporary storage for trees not yet assigned for testing;training...
145  kValidation, // these are placeholders... currently not used, but could be moved "forward" if
146  kTrainingOriginal // ever needed
147  };
148 
149  enum EBoostStage {
155  };
156 
157  public:
158 
159  static Types& Instance();
160  static void DestroyInstance();
161  ~Types();
162 
163  Types::EMVA GetMethodType( const TString& method ) const;
164  TString GetMethodName( Types::EMVA method ) const;
165 
166  Bool_t AddTypeMapping(Types::EMVA method, const TString& methodname);
167 
168  private:
169 
170  Types();
171 #if __cplusplus > 199711L
172  static std::atomic<Types*> fgTypesPtr;
173 #else
174  static Types* fgTypesPtr;
175 #endif
176 
177  private:
178 
179  std::map<TString, TMVA::Types::EMVA> fStr2type; // types-to-text map
180  mutable MsgLogger* fLogger; // message logger
181  MsgLogger& Log() const { return *fLogger; }
182 
183  };
184 }
185 
186 #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:125
Basic string class.
Definition: TString.h:129
bool Bool_t
Definition: RtypesCore.h:59
std::map< TString, TMVA::Types::EMVA > fStr2type
Definition: Types.h:179
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:180
MsgLogger & Log() const
Definition: Types.h:181
unsigned int UInt_t
Definition: RtypesCore.h:42
static void DestroyInstance()
"destructor" of the single instance
Definition: Types.cxx:90
static Types * fgTypesPtr
Definition: Types.h:174
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
Abstract ClassifierFactory template that handles arbitrary types.
Types()
constructor
Definition: Types.cxx:56
EVariableTransform
Definition: Types.h:113