ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Config.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Fredrik Tegenfeldt, Helge Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : Config *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * GLobal configuration settings (singleton) *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
16  * Fredrik Tegenfeldt <Fredrik.Tegenfeldt@cern.ch> - Iowa State U., USA *
17  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, GER *
18  * *
19  * Copyright (c) 2006: *
20  * CERN, Switzerland *
21  * Iowa State U., USA *
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_Config
30 #define ROOT_TMVA_Config
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // Config //
35 // //
36 // Singleton class for global configuration settings used by TMVA //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 #if __cplusplus > 199711L
40 #include <atomic>
41 #endif
42 #ifndef ROOT_Rtypes
43 #include "Rtypes.h"
44 #endif
45 #ifndef ROOT_TString
46 #include "TString.h"
47 #endif
48 
49 namespace TMVA {
50 
51  class MsgLogger;
52 
53  class Config {
54 
55  public:
56 
57  static Config& Instance();
58  static void DestroyInstance();
59 
60  Bool_t UseColor() const { return fUseColoredConsole; }
61  void SetUseColor( Bool_t uc ) { fUseColoredConsole = uc; }
62 
63  Bool_t IsSilent() const { return fSilent; }
64  void SetSilent( Bool_t s ) { fSilent = s; }
65 
68 
71 
72  public:
73 
74  class VariablePlotting;
75  class IONames;
76 
78  IONames& GetIONames() { return fIONames; }
79 
80  // publicly accessible global settings
82  // data collection class to configure plotting of variables
83  public:
84 
92 
93  } fVariablePlotting; // Customisable plotting properties
94 
95  // for file names and similar
96  class IONames {
97 
98  public:
99 
103  } fIONames; // Customisable weight file properties
104 
105 
106  private:
107 
108  // private constructor
109  Config();
110  Config( const Config& );
111  Config& operator=( const Config&);
112  virtual ~Config();
113 #if __cplusplus > 199711L
114  static std::atomic<Config*> fgConfigPtr;
115 #else
117 #endif
118  private:
119 
120 #if __cplusplus > 199711L
121  std::atomic<Bool_t> fUseColoredConsole; // coloured standard output
122  std::atomic<Bool_t> fSilent; // no output at all
123  std::atomic<Bool_t> fWriteOptionsReference; // if set true: Configurable objects write file with option reference
124  std::atomic<Bool_t> fDrawProgressBar; // draw progress bar to indicate training evolution
125 #else
126  Bool_t fUseColoredConsole; // coloured standard output
127  Bool_t fSilent; // no output at all
128  Bool_t fWriteOptionsReference; // if set true: Configurable objects write file with option reference
129  Bool_t fDrawProgressBar; // draw progress bar to indicate training evolution
130 #endif
131  mutable MsgLogger* fLogger; // message logger
132  MsgLogger& Log() const { return *fLogger; }
133 
134  ClassDef(Config,0) // Singleton class for global configuration settings
135  };
136 
137  // global accessor
138  Config& gConfig();
139 }
140 
141 #endif
TString fOptionsReferenceFileDir
Definition: Config.h:102
Int_t fMaxNumOfAllowedVariablesForScatterPlots
Definition: Config.h:88
void SetWriteOptionsReference(Bool_t w)
Definition: Config.h:67
Bool_t UseColor() const
Definition: Config.h:60
Bool_t IsSilent() const
Definition: Config.h:63
Bool_t fSilent
Definition: Config.h:127
Bool_t DrawProgressBar() const
Definition: Config.h:69
float Float_t
Definition: RtypesCore.h:53
Config & gConfig()
static Config & Instance()
static function: returns TMVA instance
Definition: Config.cxx:93
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
MsgLogger * fLogger
Definition: Config.h:131
Bool_t fUseColoredConsole
Definition: Config.h:126
MsgLogger & Log() const
Definition: Config.h:132
#define ClassDef(name, id)
Definition: Rtypes.h:254
int d
Definition: tornado.py:11
TString fWeightFileDir
Definition: Config.h:100
IONames & GetIONames()
Definition: Config.h:78
class TMVA::Config::IONames fIONames
void SetDrawProgressBar(Bool_t d)
Definition: Config.h:70
static Config * fgConfigPtr
Definition: Config.h:116
Bool_t fDrawProgressBar
Definition: Config.h:129
TString fWeightFileExtension
Definition: Config.h:101
class TMVA::Config::VariablePlotting fVariablePlotting
tuple w
Definition: qtexample.py:51
Config & operator=(const Config &)
static void DestroyInstance()
static function: destroy TMVA instance
Definition: Config.cxx:81
void SetUseColor(Bool_t uc)
Definition: Config.h:61
void SetSilent(Bool_t s)
Definition: Config.h:64
Bool_t WriteOptionsReference() const
Definition: Config.h:66
VariablePlotting & GetVariablePlotting()
Definition: Config.h:77
virtual ~Config()
destructor
Definition: Config.cxx:73
Bool_t fWriteOptionsReference
Definition: Config.h:128
Config()
constructor - set defaults
Definition: Config.cxx:48