ROOT  6.06/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  };
70 
71  enum HistType { kMVAType = 0, kProbaType = 1, kRarityType = 2, kCompareType = 3 };
72 
73 
74  class Types {
75 
76  public:
77 
78  // available MVA methods
79  enum EMVA {
80  kVariable = 0,
86  kKNN ,
89  kBDT ,
90  kDT ,
92  kSVM ,
93  kMLP ,
95  kFDA ,
98  kLD ,
109  };
110 
111  // available variable transformations
121  };
122 
123  // type of analysis
130  };
131 
132  enum ESBType {
133  kSignal = 0, // Never change this number - it is elsewhere assumed to be zero !
138  };
139 
140  enum ETreeType {
143  kMaxTreeType, // also used as temporary storage for trees not yet assigned for testing;training...
144  kValidation, // these are placeholders... currently not used, but could be moved "forward" if
145  kTrainingOriginal // ever needed
146  };
147 
148  enum EBoostStage {
154  };
155 
156  public:
157 
158  static Types& Instance();
159  static void DestroyInstance();
160  ~Types();
161 
162  Types::EMVA GetMethodType( const TString& method ) const;
163  TString GetMethodName( Types::EMVA method ) const;
164 
165  Bool_t AddTypeMapping(Types::EMVA method, const TString& methodname);
166 
167  private:
168 
169  Types();
170 #if __cplusplus > 199711L
171  static std::atomic<Types*> fgTypesPtr;
172 #else
173  static Types* fgTypesPtr;
174 #endif
175 
176  private:
177 
178  std::map<TString, TMVA::Types::EMVA> fStr2type; // types-to-text map
179  mutable MsgLogger* fLogger; // message logger
180  MsgLogger& Log() const { return *fLogger; }
181 
182  };
183 }
184 
185 #endif
EAnalysisType
Definition: Types.h:124
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:178
static Types & Instance()
the the single instance of "Types" if existin already, or create it (Signleton)
Definition: Types.cxx:61
Bool_t AddTypeMapping(Types::EMVA method, const TString &methodname)
Definition: Types.cxx:92
Types()
constructor
Definition: Types.cxx:47
MsgLogger * fLogger
Definition: Types.h:179
static Types * fgTypesPtr
Definition: Types.h:173
TString GetMethodName(Types::EMVA method) const
Definition: Types.cxx:127
EMsgType
Definition: Types.h:61
Types::EMVA GetMethodType(const TString &method) const
Definition: Types.cxx:111
unsigned int UInt_t
Definition: RtypesCore.h:42
static void DestroyInstance()
"destructor" of the single instance
Definition: Types.cxx:80
MsgLogger & Log() const
Definition: Types.h:180
HistType
Definition: Types.h:71
Abstract ClassifierFactory template that handles arbitrary types.
EVariableTransform
Definition: Types.h:112