Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
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
42
43std::atomic<TMVA::Config*> TMVA::Config::fgConfigPtr{ 0 };
44
46
47////////////////////////////////////////////////////////////////////////////////
48/// constructor - set defaults
49
51 fDrawProgressBar ( kFALSE ),
52 fNWorkers (1),
53 fUseColoredConsole ( kTRUE ),
54 fSilent ( kFALSE ),
55 fWriteOptionsReference( kFALSE ),
56 fLogger (new MsgLogger("Config"))
57{
58 // plotting
59 fVariablePlotting.fTimesRMS = 8.0;
60 fVariablePlotting.fNbins1D = 40;
61 fVariablePlotting.fNbins2D = 300;
62 fVariablePlotting.fMaxNumOfAllowedVariables = 200;
63 fVariablePlotting.fMaxNumOfAllowedVariablesForScatterPlots = 20;
64
65 fVariablePlotting.fNbinsMVAoutput = 40;
66 fVariablePlotting.fNbinsXOfROCCurve = 100;
67 fVariablePlotting.fUsePaperStyle = 0;
68 fVariablePlotting.fPlotFormat = VariablePlotting::kPNG; // format for plotting (use when fUsePaperStyle ==0)
69
70 // IO names
71 fIONames.fWeightFileDirPrefix = "";
72 fIONames.fWeightFileDir = "weights";
73 fIONames.fWeightFileExtension = "weights";
74 fIONames.fOptionsReferenceFileDir = "optionInfo";
75
76}
77
78////////////////////////////////////////////////////////////////////////////////
79/// destructor
80
82{
83 delete fLogger;
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// static function: destroy TMVA instance
88
90{
91 delete fgConfigPtr.exchange(0);
92}
93
94////////////////////////////////////////////////////////////////////////////////
95/// static function: returns TMVA instance
96
98{
99 if(!fgConfigPtr) {
100 TMVA::Config* tmp = new Config();
102 if(! fgConfigPtr.compare_exchange_strong(expected,tmp) ) {
103 //another thread beat us to the switch
104 delete tmp;
105 }
106 }
107 return *fgConfigPtr;
108}
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
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:43
static void DestroyInstance()
static function: destroy TMVA instance
Definition Config.cxx:89
virtual ~Config()
destructor
Definition Config.cxx:81
static Config & Instance()
static function: returns TMVA instance
Definition Config.cxx:97
Config()
constructor - set defaults
Definition Config.cxx:50
class TMVA::Config::VariablePlotting fVariablePlotting
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
Config & gConfig()