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