ROOT logo
// @(#)root/tmva $Id: Config.h 33931 2010-06-15 16:49:02Z stelzer $   
// Author: Andreas Hoecker, Joerg Stelzer, Fredrik Tegenfeldt, Helge Voss

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Class  : Config                                                                *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description:                                                                   *
 *      GLobal configuration settings (singleton)                                 *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      Andreas Hoecker    <Andreas.Hocker@cern.ch>     - CERN, Switzerland       *
 *      Joerg Stelzer      <Joerg.Stelzer@cern.ch>      - CERN, Switzerland       *
 *      Fredrik Tegenfeldt <Fredrik.Tegenfeldt@cern.ch> - Iowa State U., USA      *
 *      Helge Voss         <Helge.Voss@cern.ch>         - MPI-K Heidelberg, GER   *
 *                                                                                *
 * Copyright (c) 2006:                                                            *
 *      CERN, Switzerland                                                         *
 *      Iowa State U., USA                                                        *
 *      MPI-K Heidelberg, Germany                                                 *
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://mva.sourceforge.net/license.txt)                                       *
 **********************************************************************************/

#ifndef ROOT_TMVA_Config
#define ROOT_TMVA_Config

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// Config                                                               //
//                                                                      //
// Singleton class for global configuration settings used by TMVA       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif

namespace TMVA {

   class MsgLogger;

   class Config {
               
   public:

      static Config& Instance();
      static void    DestroyInstance();

      Bool_t UseColor() const { return fUseColoredConsole; }
      void   SetUseColor( Bool_t uc ) { fUseColoredConsole = uc; }

      Bool_t IsSilent() const { return fSilent; }
      void   SetSilent( Bool_t s ) { fSilent = s; }

      Bool_t WriteOptionsReference() const { return fWriteOptionsReference; }
      void   SetWriteOptionsReference( Bool_t w ) { fWriteOptionsReference = w; }

      Bool_t DrawProgressBar() const { return fDrawProgressBar; }
      void   SetDrawProgressBar( Bool_t d ) { fDrawProgressBar = d; }

   public:

      class VariablePlotting;
      class IONames;

      VariablePlotting& GetVariablePlotting() { return fVariablePlotting; }
      IONames&          GetIONames()          { return fIONames; }

      // publicly accessible global settings
      class VariablePlotting {
         // data collection class to configure plotting of variables
      public:

         Float_t fTimesRMS;
         Int_t   fNbins1D;
         Int_t   fNbins2D;
         Int_t   fMaxNumOfAllowedVariablesForScatterPlots;
         Int_t   fNbinsXOfROCCurve;
      } fVariablePlotting; // Customisable plotting properties

      // for file names and similar
      class IONames {

      public:

         TString fWeightFileDir;
         TString fWeightFileExtension;
         TString fOptionsReferenceFileDir;
      } fIONames; // Customisable weight file properties
         
      
   private:

      // private constructor
      Config();
      virtual ~Config();
      static Config* fgConfigPtr;
                  
   private:

      Bool_t fUseColoredConsole;     // coloured standard output
      Bool_t fSilent;                // no output at all
      Bool_t fWriteOptionsReference; // if set true: Configurable objects write file with option reference
      Bool_t fDrawProgressBar;       // draw progress bar to indicate training evolution

      mutable MsgLogger* fLogger;   // message logger
      MsgLogger& Log() const { return *fLogger; }
         
      ClassDef(Config,0) // Singleton class for global configuration settings
   };

   // global accessor
   Config& gConfig();
}

#endif
 Config.h:1
 Config.h:2
 Config.h:3
 Config.h:4
 Config.h:5
 Config.h:6
 Config.h:7
 Config.h:8
 Config.h:9
 Config.h:10
 Config.h:11
 Config.h:12
 Config.h:13
 Config.h:14
 Config.h:15
 Config.h:16
 Config.h:17
 Config.h:18
 Config.h:19
 Config.h:20
 Config.h:21
 Config.h:22
 Config.h:23
 Config.h:24
 Config.h:25
 Config.h:26
 Config.h:27
 Config.h:28
 Config.h:29
 Config.h:30
 Config.h:31
 Config.h:32
 Config.h:33
 Config.h:34
 Config.h:35
 Config.h:36
 Config.h:37
 Config.h:38
 Config.h:39
 Config.h:40
 Config.h:41
 Config.h:42
 Config.h:43
 Config.h:44
 Config.h:45
 Config.h:46
 Config.h:47
 Config.h:48
 Config.h:49
 Config.h:50
 Config.h:51
 Config.h:52
 Config.h:53
 Config.h:54
 Config.h:55
 Config.h:56
 Config.h:57
 Config.h:58
 Config.h:59
 Config.h:60
 Config.h:61
 Config.h:62
 Config.h:63
 Config.h:64
 Config.h:65
 Config.h:66
 Config.h:67
 Config.h:68
 Config.h:69
 Config.h:70
 Config.h:71
 Config.h:72
 Config.h:73
 Config.h:74
 Config.h:75
 Config.h:76
 Config.h:77
 Config.h:78
 Config.h:79
 Config.h:80
 Config.h:81
 Config.h:82
 Config.h:83
 Config.h:84
 Config.h:85
 Config.h:86
 Config.h:87
 Config.h:88
 Config.h:89
 Config.h:90
 Config.h:91
 Config.h:92
 Config.h:93
 Config.h:94
 Config.h:95
 Config.h:96
 Config.h:97
 Config.h:98
 Config.h:99
 Config.h:100
 Config.h:101
 Config.h:102
 Config.h:103
 Config.h:104
 Config.h:105
 Config.h:106
 Config.h:107
 Config.h:108
 Config.h:109
 Config.h:110
 Config.h:111
 Config.h:112
 Config.h:113
 Config.h:114
 Config.h:115
 Config.h:116
 Config.h:117
 Config.h:118
 Config.h:119
 Config.h:120
 Config.h:121
 Config.h:122
 Config.h:123
 Config.h:124
 Config.h:125