Logo ROOT  
Reference Guide
Config.cxx
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 * Implementation *
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/*! \class TMVA::Config
30\ingroup TMVA
31
32Singleton class for global configuration settings used by TMVA.
33
34*/
35
36#include "TMVA/Config.h"
37#include "TMVA/MsgLogger.h"
38
39#include "Rtypes.h"
40#include "TString.h"
41
43
44std::atomic<TMVA::Config*> TMVA::Config::fgConfigPtr{ 0 };
45
47
48////////////////////////////////////////////////////////////////////////////////
49/// constructor - set defaults
50
52 fDrawProgressBar ( kFALSE ),
53 fNWorkers (1),
54 fUseColoredConsole ( kTRUE ),
55 fSilent ( kFALSE ),
56 fWriteOptionsReference( kFALSE ),
57 fLogger (new MsgLogger("Config"))
58{
59 // plotting
65
69 fVariablePlotting.fPlotFormat = VariablePlotting::kPNG; // format for plotting (use when fUsePaperStyle ==0)
70
71 // IO names
73 fIONames.fWeightFileDir = "weights";
76
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// destructor
81
83{
84 delete fLogger;
85}
86
87////////////////////////////////////////////////////////////////////////////////
88/// static function: destroy TMVA instance
89
91{
92 delete fgConfigPtr.exchange(0);
93}
94
95////////////////////////////////////////////////////////////////////////////////
96/// static function: returns TMVA instance
97
99{
100 if(!fgConfigPtr) {
101 TMVA::Config* tmp = new Config();
102 TMVA::Config* expected = 0;
103 if(! fgConfigPtr.compare_exchange_strong(expected,tmp) ) {
104 //another thread beat us to the switch
105 delete tmp;
106 }
107 }
108 return *fgConfigPtr;
109}
const Bool_t kFALSE
Definition: RtypesCore.h:101
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:364
TString fWeightFileDir
Definition: Config.h:124
TString fOptionsReferenceFileDir
Definition: Config.h:126
TString fWeightFileDirPrefix
Definition: Config.h:123
TString fWeightFileExtension
Definition: Config.h:125
Int_t fMaxNumOfAllowedVariablesForScatterPlots
Definition: Config.h:109
Singleton class for global configuration settings used by TMVA.
Definition: Config.h:49
class TMVA::Config::IONames fIONames
static std::atomic< Config * > fgConfigPtr
Definition: Config.h:137
static void DestroyInstance()
static function: destroy TMVA instance
Definition: Config.cxx:90
virtual ~Config()
destructor
Definition: Config.cxx:82
static Config & Instance()
static function: returns TMVA instance
Definition: Config.cxx:98
Config()
constructor - set defaults
Definition: Config.cxx:51
class TMVA::Config::VariablePlotting fVariablePlotting
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:57
Config & gConfig()