Logo ROOT   6.10/09
Reference Guide
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 #include "Rtypes.h"
43 #include "TString.h"
44 
45 namespace TMVA {
46 
47  class MsgLogger;
48 
49  class Config {
50 
51  public:
52 
53  static Config& Instance();
54  static void DestroyInstance();
55 
56  Bool_t UseColor() const { return fUseColoredConsole; }
57  void SetUseColor( Bool_t uc ) { fUseColoredConsole = uc; }
58 
59  Bool_t IsSilent() const { return fSilent; }
60  void SetSilent( Bool_t s ) { fSilent = s; }
61 
64 
67 
68  public:
69 
70  class VariablePlotting;
71  class IONames;
72 
74  IONames& GetIONames() { return fIONames; }
75 
76  // publicly accessible global settings
78  // data collection class to configure plotting of variables
79  public:
80 
88 
89  } fVariablePlotting; // Customisable plotting properties
90 
91  // for file names and similar
92  class IONames {
93 
94  public:
95 
99  } fIONames; // Customisable weight file properties
100 
101 
102  private:
103 
104  // private constructor
105  Config();
106  Config( const Config& );
107  Config& operator=( const Config&);
108  virtual ~Config();
109 #if __cplusplus > 199711L
110  static std::atomic<Config*> fgConfigPtr;
111 #else
113 #endif
114  private:
115 
116 #if __cplusplus > 199711L
117  std::atomic<Bool_t> fUseColoredConsole; // coloured standard output
118  std::atomic<Bool_t> fSilent; // no output at all
119  std::atomic<Bool_t> fWriteOptionsReference; // if set true: Configurable objects write file with option reference
120  std::atomic<Bool_t> fDrawProgressBar; // draw progress bar to indicate training evolution
121 #else
122  Bool_t fUseColoredConsole; // coloured standard output
123  Bool_t fSilent; // no output at all
124  Bool_t fWriteOptionsReference; // if set true: Configurable objects write file with option reference
125  Bool_t fDrawProgressBar; // draw progress bar to indicate training evolution
126 #endif
127  mutable MsgLogger* fLogger; // message logger
128  MsgLogger& Log() const { return *fLogger; }
129 
130  ClassDef(Config,0); // Singleton class for global configuration settings
131  };
132 
133  // global accessor
134  Config& gConfig();
135 }
136 
137 #endif
TString fOptionsReferenceFileDir
Definition: Config.h:98
Int_t fMaxNumOfAllowedVariablesForScatterPlots
Definition: Config.h:84
void SetWriteOptionsReference(Bool_t w)
Definition: Config.h:63
Bool_t fSilent
Definition: Config.h:123
float Float_t
Definition: RtypesCore.h:53
static Config * fgConfigPtr
Definition: Config.h:112
Config & gConfig()
static Config & Instance()
static function: returns TMVA instance
Definition: Config.cxx:100
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
MsgLogger * fLogger
Definition: Config.h:127
Bool_t fUseColoredConsole
Definition: Config.h:122
Bool_t DrawProgressBar() const
Definition: Config.h:65
Singleton class for global configuration settings used by TMVA.
Definition: Config.h:49
#define ClassDef(name, id)
Definition: Rtypes.h:297
TString fWeightFileDir
Definition: Config.h:96
IONames & GetIONames()
Definition: Config.h:74
class TMVA::Config::IONames fIONames
void SetDrawProgressBar(Bool_t d)
Definition: Config.h:66
Bool_t fDrawProgressBar
Definition: Config.h:125
MsgLogger & Log() const
Definition: Config.h:128
TString fWeightFileExtension
Definition: Config.h:97
class TMVA::Config::VariablePlotting fVariablePlotting
Config & operator=(const Config &)
Bool_t WriteOptionsReference() const
Definition: Config.h:62
static void DestroyInstance()
static function: destroy TMVA instance
Definition: Config.cxx:88
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
void SetUseColor(Bool_t uc)
Definition: Config.h:57
Abstract ClassifierFactory template that handles arbitrary types.
Bool_t IsSilent() const
Definition: Config.h:59
void SetSilent(Bool_t s)
Definition: Config.h:60
Bool_t UseColor() const
Definition: Config.h:56
VariablePlotting & GetVariablePlotting()
Definition: Config.h:73
virtual ~Config()
destructor
Definition: Config.cxx:80
Bool_t fWriteOptionsReference
Definition: Config.h:124
Config()
constructor - set defaults
Definition: Config.cxx:55