Config.h

Go to the documentation of this file.
00001 // @(#)root/tmva $Id: Config.h 33931 2010-06-15 16:49:02Z stelzer $   
00002 // Author: Andreas Hoecker, Joerg Stelzer, Fredrik Tegenfeldt, Helge Voss
00003 
00004 /**********************************************************************************
00005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
00006  * Package: TMVA                                                                  *
00007  * Class  : Config                                                                *
00008  * Web    : http://tmva.sourceforge.net                                           *
00009  *                                                                                *
00010  * Description:                                                                   *
00011  *      GLobal configuration settings (singleton)                                 *
00012  *                                                                                *
00013  * Authors (alphabetical):                                                        *
00014  *      Andreas Hoecker    <Andreas.Hocker@cern.ch>     - CERN, Switzerland       *
00015  *      Joerg Stelzer      <Joerg.Stelzer@cern.ch>      - CERN, Switzerland       *
00016  *      Fredrik Tegenfeldt <Fredrik.Tegenfeldt@cern.ch> - Iowa State U., USA      *
00017  *      Helge Voss         <Helge.Voss@cern.ch>         - MPI-K Heidelberg, GER   *
00018  *                                                                                *
00019  * Copyright (c) 2006:                                                            *
00020  *      CERN, Switzerland                                                         *
00021  *      Iowa State U., USA                                                        *
00022  *      MPI-K Heidelberg, Germany                                                 *
00023  *                                                                                *
00024  * Redistribution and use in source and binary forms, with or without             *
00025  * modification, are permitted according to the terms listed in LICENSE           *
00026  * (http://mva.sourceforge.net/license.txt)                                       *
00027  **********************************************************************************/
00028 
00029 #ifndef ROOT_TMVA_Config
00030 #define ROOT_TMVA_Config
00031 
00032 //////////////////////////////////////////////////////////////////////////
00033 //                                                                      //
00034 // Config                                                               //
00035 //                                                                      //
00036 // Singleton class for global configuration settings used by TMVA       //
00037 //                                                                      //
00038 //////////////////////////////////////////////////////////////////////////
00039 
00040 #ifndef ROOT_Rtypes
00041 #include "Rtypes.h"
00042 #endif
00043 #ifndef ROOT_TString
00044 #include "TString.h"
00045 #endif
00046 
00047 namespace TMVA {
00048 
00049    class MsgLogger;
00050 
00051    class Config {
00052                
00053    public:
00054 
00055       static Config& Instance();
00056       static void    DestroyInstance();
00057 
00058       Bool_t UseColor() const { return fUseColoredConsole; }
00059       void   SetUseColor( Bool_t uc ) { fUseColoredConsole = uc; }
00060 
00061       Bool_t IsSilent() const { return fSilent; }
00062       void   SetSilent( Bool_t s ) { fSilent = s; }
00063 
00064       Bool_t WriteOptionsReference() const { return fWriteOptionsReference; }
00065       void   SetWriteOptionsReference( Bool_t w ) { fWriteOptionsReference = w; }
00066 
00067       Bool_t DrawProgressBar() const { return fDrawProgressBar; }
00068       void   SetDrawProgressBar( Bool_t d ) { fDrawProgressBar = d; }
00069 
00070    public:
00071 
00072       class VariablePlotting;
00073       class IONames;
00074 
00075       VariablePlotting& GetVariablePlotting() { return fVariablePlotting; }
00076       IONames&          GetIONames()          { return fIONames; }
00077 
00078       // publicly accessible global settings
00079       class VariablePlotting {
00080          // data collection class to configure plotting of variables
00081       public:
00082 
00083          Float_t fTimesRMS;
00084          Int_t   fNbins1D;
00085          Int_t   fNbins2D;
00086          Int_t   fMaxNumOfAllowedVariablesForScatterPlots;
00087          Int_t   fNbinsXOfROCCurve;
00088       } fVariablePlotting; // Customisable plotting properties
00089 
00090       // for file names and similar
00091       class IONames {
00092 
00093       public:
00094 
00095          TString fWeightFileDir;
00096          TString fWeightFileExtension;
00097          TString fOptionsReferenceFileDir;
00098       } fIONames; // Customisable weight file properties
00099          
00100       
00101    private:
00102 
00103       // private constructor
00104       Config();
00105       virtual ~Config();
00106       static Config* fgConfigPtr;
00107                   
00108    private:
00109 
00110       Bool_t fUseColoredConsole;     // coloured standard output
00111       Bool_t fSilent;                // no output at all
00112       Bool_t fWriteOptionsReference; // if set true: Configurable objects write file with option reference
00113       Bool_t fDrawProgressBar;       // draw progress bar to indicate training evolution
00114 
00115       mutable MsgLogger* fLogger;   // message logger
00116       MsgLogger& Log() const { return *fLogger; }
00117          
00118       ClassDef(Config,0) // Singleton class for global configuration settings
00119    };
00120 
00121    // global accessor
00122    Config& gConfig();
00123 }
00124 
00125 #endif

Generated on Tue Jul 5 14:27:19 2011 for ROOT_528-00b_version by  doxygen 1.5.1