Logo ROOT  
Reference Guide
Tools.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : Tools *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Global auxiliary applications and data treatment routines *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <peter.speckmayer@cern.ch> - CERN, Switzerland *
16  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
17  * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
18  * *
19  * Copyright (c) 2005: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
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://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_Tools
30 #define ROOT_TMVA_Tools
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // Tools (namespace) //
35 // //
36 // Global auxiliary applications and data treatment routines //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 
40 #include <vector>
41 #include <string>
42 #include <sstream>
43 #include <iostream>
44 #if __cplusplus > 199711L
45 #include <atomic>
46 #endif
47 
48 #include "TXMLEngine.h"
49 
50 #include "TMatrixDSymfwd.h"
51 
52 #include "TMatrixDfwd.h"
53 
54 #include "TVectorDfwd.h"
55 
56 #include "TMVA/Types.h"
57 
59 
60 #include "TString.h"
61 
62 #include "TMVA/MsgLogger.h"
63 
64 class TList;
65 class TTree;
66 class TH1;
67 class TH2;
68 class TH2F;
69 class TSpline;
70 class TXMLEngine;
71 
72 namespace TMVA {
73 
74  class Event;
75  class PDF;
76  class MsgLogger;
77 
78  class Tools {
79 
80  private:
81 
82  Tools();
83 
84  public:
85 
86  // destructor
87  ~Tools();
88 
89  // accessor to single instance
90  static Tools& Instance();
91  static void DestroyInstance();
92 
93 
94  template <typename T> Double_t Mean(Long64_t n, const T *a, const Double_t *w=0);
95  template <typename Iterator, typename WeightIterator> Double_t Mean ( Iterator first, Iterator last, WeightIterator w);
96 
97  template <typename T> Double_t RMS(Long64_t n, const T *a, const Double_t *w=0);
98  template <typename Iterator, typename WeightIterator> Double_t RMS(Iterator first, Iterator last, WeightIterator w);
99 
100 
101  // simple statistics operations on tree entries
102  void ComputeStat( const std::vector<TMVA::Event*>&,
103  std::vector<Float_t>*,
105  Double_t&, Double_t&, Double_t&, Int_t signalClass,
106  Bool_t norm = kFALSE );
107 
108  // compute variance from sums
109  inline Double_t ComputeVariance( Double_t sumx2, Double_t sumx, Int_t nx );
110 
111  // creates histograms normalized to one
112  TH1* projNormTH1F( TTree* theTree, const TString& theVarName,
113  const TString& name, Int_t nbins,
114  Double_t xmin, Double_t xmax, const TString& cut );
115 
116  // normalize histogram by its integral
117  Double_t NormHist( TH1* theHist, Double_t norm = 1.0 );
118 
119  // parser for TString phrase with items separated by a character
120  TList* ParseFormatLine( TString theString, const char * sep = ":" );
121 
122  // parse option string for ANN methods
123  std::vector<Int_t>* ParseANNOptionString( TString theOptions, Int_t nvar,
124  std::vector<Int_t>* nodes );
125 
126  // returns the square-root of a symmetric matrix: symMat = sqrtMat*sqrtMat
128 
129  // returns the covariance matrix of of the different classes (and the sum)
130  // given the event sample
131  std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector<Event*>& events, Int_t maxCls, VariableTransformBase* transformBase=0 );
132  std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector<const Event*>& events, Int_t maxCls, VariableTransformBase* transformBase=0 );
133 
134 
135  // turns covariance into correlation matrix
136  const TMatrixD* GetCorrelationMatrix( const TMatrixD* covMat );
137 
138  // check spline quality by comparison with initial histogram
139  Bool_t CheckSplines( const TH1*, const TSpline* );
140 
141  // normalization of variable output
143 
144  // return separation of two histograms
145  Double_t GetSeparation( TH1* S, TH1* B ) const;
146  Double_t GetSeparation( const PDF& pdfS, const PDF& pdfB ) const;
147 
148  // vector rescaling
149  std::vector<Double_t> MVADiff( std::vector<Double_t>&, std::vector<Double_t>& );
150  void Scale( std::vector<Double_t>&, Double_t );
151  void Scale( std::vector<Float_t>&, Float_t );
152 
153  // re-arrange a vector of arrays (vectors) in a way such that the first array
154  // is ordered, and the other arrays reshuffled accordingly
155  void UsefulSortDescending( std::vector< std::vector<Double_t> >&, std::vector<TString>* vs = 0 );
156  void UsefulSortAscending ( std::vector< std::vector<Double_t> >&, std::vector<TString>* vs = 0 );
157 
158  void UsefulSortDescending( std::vector<Double_t>& );
159  void UsefulSortAscending ( std::vector<Double_t>& );
160 
161  Int_t GetIndexMaxElement ( std::vector<Double_t>& );
162  Int_t GetIndexMinElement ( std::vector<Double_t>& );
163 
164  // check if input string contains regular expression
166  TString ReplaceRegularExpressions( const TString& s, const TString& replace = "+" );
167 
168  // routines for formatted output -----------------
169  void FormattedOutput( const std::vector<Double_t>&, const std::vector<TString>&,
170  const TString titleVars, const TString titleValues, MsgLogger& logger,
171  TString format = "%+1.3f" );
172  void FormattedOutput( const TMatrixD&, const std::vector<TString>&, MsgLogger& logger );
173  void FormattedOutput( const TMatrixD&, const std::vector<TString>& vert, const std::vector<TString>& horiz,
174  MsgLogger& logger );
175 
176  void WriteFloatArbitraryPrecision( Float_t val, std::ostream& os );
177  void ReadFloatArbitraryPrecision ( Float_t& val, std::istream& is );
178 
179  // for histogramming
180  TString GetXTitleWithUnit( const TString& title, const TString& unit );
181  TString GetYTitleWithUnit( const TH1& h, const TString& unit, Bool_t normalised );
182 
183  // Mutual Information method for non-linear correlations estimates in 2D histogram
184  // Author: Moritz Backes, Geneva (2009)
186 
187  // Correlation Ratio method for non-linear correlations estimates in 2D histogram
188  // Author: Moritz Backes, Geneva (2009)
190  TH2F* TransposeHist ( const TH2F& );
191 
192  // check if "silent" or "verbose" option in configuration string
193  Bool_t CheckForSilentOption ( const TString& ) const;
194  Bool_t CheckForVerboseOption( const TString& ) const;
195 
196  // color information
197  const TString& Color( const TString& );
198 
199  // print welcome message (to be called from, eg, .TMVAlogon)
209 
210  // print TMVA citation (to be called from, eg, .TMVAlogon)
211  enum ECitation { kPlainText = 1,
215 
216  void TMVAWelcomeMessage();
218  void TMVAVersionMessage( MsgLogger& logger );
219  void ROOTVersionMessage( MsgLogger& logger );
220 
221  void TMVACitation( MsgLogger& logger, ECitation citType = kPlainText );
222 
223  // string tools
224 
225  std::vector<TString> SplitString( const TString& theOpt, const char separator ) const;
226 
227  // variables
229  mutable MsgLogger* fLogger;
230  MsgLogger& Log() const { return *fLogger; }
231 #if __cplusplus > 199711L
232  static std::atomic<Tools*> fgTools;
233 #else
234  static Tools* fgTools;
235 #endif
236 
237  // xml tools
238 
241  void WriteTMatrixDToXML ( void* node, const char* name, TMatrixD* mat );
242  void WriteTVectorDToXML ( void* node, const char* name, TVectorD* vec );
243  void ReadTMatrixDFromXML( void* node, const char* name, TMatrixD* mat );
244  void ReadTVectorDFromXML( void* node, const char* name, TVectorD* vec );
246 
247  Bool_t HasAttr ( void* node, const char* attrname );
248  template<typename T>
249  inline void ReadAttr ( void* node, const char* , T& value );
250  void ReadAttr ( void* node, const char* attrname, TString& value );
251  void ReadAttr(void *node, const char *, float &value);
252  void ReadAttr(void *node, const char *, int &value);
253  void ReadAttr(void *node, const char *, short &value);
254 
255  template<typename T>
256  void AddAttr ( void* node, const char* , const T& value, Int_t precision = 16 );
257  void AddAttr ( void* node, const char* attrname, const char* value );
258  void* AddChild ( void* parent, const char* childname, const char* content = 0, bool isRootNode = false );
259  Bool_t AddRawLine ( void* node, const char * raw );
260  Bool_t AddComment ( void* node, const char* comment );
261 
262  void* GetParent( void* child);
263  void* GetChild ( void* parent, const char* childname=0 );
264  void* GetNextChild( void* prevchild, const char* childname=0 );
265  const char* GetContent ( void* node );
266  const char* GetName ( void* node );
267 
270  void SetXMLEngineBufferSize(int buffer) { fXMLBufferSize = buffer; }
272 
274 
275  private:
276 
277  int fXMLBufferSize = 10000000;
278  // utilities for correlation ratio
279  Double_t GetYMean_binX( const TH2& , Int_t bin_x );
280 
281  }; // Common tools
282 
283  Tools& gTools(); // global accessor
284 
285  //
286  // Adapts a TRandom random number generator to the interface of the ones in the
287  // standard library (STL) so that TRandom derived generators can be used with
288  // STL algorithms such as `std::shuffle`.
289  //
290  // Example:
291  // ```
292  // std::vector<double> v {0, 1, 2, 3, 4, 5};
293  // TRandom3StdEngine rng(seed);
294  // std::shuffle(v.begin(), v.end(), rng);
295  // ```
296  //
297  // Or at a lower level:
298  // ```
299  // std::vector<double> v {0, 1, 2, 3, 4, 5};
300  // RandomGenerator<TRandom3> rng(seed);
301  // std::shuffle(v.begin(), v.end(), rng);
302  // ```
303  //
304  template <typename TRandomLike, typename UIntType = UInt_t, UIntType max_val = kMaxUInt>
306  public:
307  using result_type = UIntType;
308 
309  RandomGenerator(UIntType s = 0) { fRandom.SetSeed(s); }
310 
311  static constexpr UIntType min() { return 0; }
312  static constexpr UIntType max() { return max_val; }
313 
314  void seed(UIntType s = 0) { fRandom.SetSeed(s); }
315 
316  UIntType operator()() { return fRandom.Integer(max()); }
317 
318  void discard(unsigned long long z)
319  {
320  double r;
321  for (unsigned long long i = 0; i < z; ++i)
322  r = fRandom.Rndm();
323  (void) r; /* avoid unused variable warning */
324  }
325 
326  private:
327  TRandomLike fRandom; // random generator
328  };
329 
330 } // namespace TMVA
331 
332 ////////////////////////////////////////////////////////////////////////////////
333 /// read attribute from xml
334 
335 template<typename T> void TMVA::Tools::ReadAttr( void* node, const char* attrname, T& value )
336 {
337  // read attribute from xml
338  const char *val = xmlengine().GetAttr(node, attrname);
339  if (val == 0) {
340  const char *nodename = xmlengine().GetNodeName(node);
341  Log() << kFATAL << "Trying to read non-existing attribute '" << attrname << "' from xml node '" << nodename << "'"
342  << Endl;
343  }
344  std::stringstream s(val);
345  // coverity[tainted_data_argument]
346  s >> value;
347 }
348 
349 ////////////////////////////////////////////////////////////////////////////////
350 /// add attribute to xml
351 
352 template<typename T>
353 void TMVA::Tools::AddAttr( void* node, const char* attrname, const T& value, Int_t precision )
354 {
355  std::stringstream s;
356  s.precision( precision );
357  s << std::scientific << value;
358  AddAttr( node, attrname, s.str().c_str() );
359 }
360 
361 ////////////////////////////////////////////////////////////////////////////////
362 /// compute variance from given sums
363 
365 {
366  if (nx<2) return 0;
367  return (sumx2 - ((sumx*sumx)/static_cast<Double_t>(nx)))/static_cast<Double_t>(nx-1);
368 }
369 
370 #endif
TMVA::Tools::GetIndexMinElement
Int_t GetIndexMinElement(std::vector< Double_t > &)
find index of minimum entry in vector
Definition: Tools.cxx:777
TMatrixDfwd.h
TMVA::Tools::CheckForSilentOption
Bool_t CheckForSilentOption(const TString &) const
check for "silence" option in configuration option string
Definition: Tools.cxx:703
TMVA::Tools::fRegexp
const TString fRegexp
Definition: Tools.h:228
ROOT::TMetaUtils::propNames::separator
static const std::string separator("@@@")
m
auto * m
Definition: textangle.C:8
n
const Int_t n
Definition: legend1.C:16
TMVA::Tools::NormVariable
Double_t NormVariable(Double_t x, Double_t xmin, Double_t xmax)
normalise to output range: [-1, 1]
Definition: Tools.cxx:122
TMVA::Tools::AddComment
Bool_t AddComment(void *node, const char *comment)
Definition: Tools.cxx:1144
first
Definition: first.py:1
TMVA::Tools::NormHist
Double_t NormHist(TH1 *theHist, Double_t norm=1.0)
normalises histogram
Definition: Tools.cxx:395
TMVA::Tools::GetChild
void * GetChild(void *parent, const char *childname=0)
get child node
Definition: Tools.cxx:1162
TMVA::Tools::kLeanWelcomeMsg
@ kLeanWelcomeMsg
Definition: Tools.h:203
TMVA::Tools::WriteFloatArbitraryPrecision
void WriteFloatArbitraryPrecision(Float_t val, std::ostream &os)
writes a float value with the available precision to a stream
Definition: Tools.cxx:1070
TMVA::Tools::GetMutualInformation
Double_t GetMutualInformation(const TH2F &)
Mutual Information method for non-linear correlations estimates in 2D histogram Author: Moritz Backes...
Definition: Tools.cxx:601
TMVA::Tools::GetContent
const char * GetContent(void *node)
XML helpers.
Definition: Tools.cxx:1186
TMVA::Tools::SplitString
std::vector< TString > SplitString(const TString &theOpt, const char separator) const
splits the option string at 'separator' and fills the list 'splitV' with the primitive strings
Definition: Tools.cxx:1211
TMVA::Tools::MVADiff
std::vector< Double_t > MVADiff(std::vector< Double_t > &, std::vector< Double_t > &)
computes difference between two vectors
Definition: Tools.cxx:518
TMVA::Tools::ReadTVectorDFromXML
void ReadTVectorDFromXML(void *node, const char *name, TVectorD *vec)
Definition: Tools.cxx:1279
TH2F
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:251
TMVA::RandomGenerator::min
static constexpr UIntType min()
Definition: Tools.h:311
TMVA::RandomGenerator::result_type
UIntType result_type
Definition: Tools.h:307
TMVA::Tools::UsefulSortAscending
void UsefulSortAscending(std::vector< std::vector< Double_t > > &, std::vector< TString > *vs=0)
sort 2D vector (AND in parallel a TString vector) in such a way that the "first vector is sorted" and...
Definition: Tools.cxx:550
TMVA::Tools::fgTools
static Tools * fgTools
Definition: Tools.h:234
TXMLEngine::GetAttr
const char * GetAttr(XMLNodePointer_t xmlnode, const char *name)
returns value of attribute for xmlnode
Definition: TXMLEngine.cxx:552
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TMVA::Tools::GetIndexMaxElement
Int_t GetIndexMaxElement(std::vector< Double_t > &)
find index of maximum entry in vector
Definition: Tools.cxx:760
xmax
float xmax
Definition: THbookFile.cxx:95
TMVA::Tools::Tools
Tools()
constructor
Definition: Tools.cxx:103
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TMVA::Tools::DestroyInstance
static void DestroyInstance()
Definition: Tools.cxx:90
TMVA::RandomGenerator
Definition: Tools.h:305
TTree
A TTree represents a columnar dataset.
Definition: TTree.h:79
TMVA::Tools::projNormTH1F
TH1 * projNormTH1F(TTree *theTree, const TString &theVarName, const TString &name, Int_t nbins, Double_t xmin, Double_t xmax, const TString &cut)
projects variable from tree into normalised histogram
Definition: Tools.cxx:378
TMVA::Tools::AddChild
void * AddChild(void *parent, const char *childname, const char *content=0, bool isRootNode=false)
add child node
Definition: Tools.cxx:1136
TMVA::Tools::GetName
const char * GetName(void *node)
XML helpers.
Definition: Tools.cxx:1194
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TMVA::Tools::GetSeparation
Double_t GetSeparation(TH1 *S, TH1 *B) const
compute "separation" defined as
Definition: Tools.cxx:133
TMVA::Tools::ComputeStat
void ComputeStat(const std::vector< TMVA::Event * > &, std::vector< Float_t > *, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Int_t signalClass, Bool_t norm=kFALSE)
sanity check
Definition: Tools.cxx:214
x
Double_t x[n]
Definition: legend1.C:17
TMVA::Tools::Mean
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
Return the weighted mean of an array a with length n.
Definition: Tools.cxx:1703
TSpline
Base class for spline implementation containing the Draw/Paint methods.
Definition: TSpline.h:31
RooFitShortHand::S
RooArgSet S(const RooAbsArg &v1)
Definition: RooGlobalFunc.cxx:348
TMVA::Tools::GetSQRootMatrix
TMatrixD * GetSQRootMatrix(TMatrixDSym *symMat)
square-root of symmetric matrix of course the resulting sqrtMat is also symmetric,...
Definition: Tools.cxx:283
TMVA::Tools::fXMLBufferSize
int fXMLBufferSize
Definition: Tools.h:277
TMatrixTSym< Double_t >
TMVA::Tools::kSmall1WelcomeMsg
@ kSmall1WelcomeMsg
Definition: Tools.h:205
TMVA::RandomGenerator::RandomGenerator
RandomGenerator(UIntType s=0)
Definition: Tools.h:309
TVectorDfwd.h
TMVA::RandomGenerator::max
static constexpr UIntType max()
Definition: Tools.h:312
TMVA::Tools::ParseANNOptionString
std::vector< Int_t > * ParseANNOptionString(TString theOptions, Int_t nvar, std::vector< Int_t > *nodes)
parse option string for ANN methods default settings (should be defined in theOption string)
Definition: Tools.cxx:455
TMVA::VariableTransformBase
Linear interpolation class.
Definition: VariableTransformBase.h:54
VariableTransformBase.h
TString
Basic string class.
Definition: TString.h:136
TMatrixT< Double_t >
TMVA::Tools::xmlenginebuffersize
int xmlenginebuffersize()
Definition: Tools.h:269
TString.h
bool
TMVA::Tools::kBlockWelcomeMsg
@ kBlockWelcomeMsg
Definition: Tools.h:202
TMVA::Tools::xmlengine
TXMLEngine & xmlengine()
Definition: Tools.h:268
TMVA::Tools::kOriginalWelcomeMsgColor
@ kOriginalWelcomeMsgColor
Definition: Tools.h:207
TMVA::Tools::CheckSplines
Bool_t CheckSplines(const TH1 *, const TSpline *)
check quality of splining by comparing splines and histograms in each bin
Definition: Tools.cxx:491
TMVA::Tools::AddAttr
void AddAttr(void *node, const char *, const T &value, Int_t precision=16)
add attribute to xml
Definition: Tools.h:353
TMVA::Tools::ReplaceRegularExpressions
TString ReplaceRegularExpressions(const TString &s, const TString &replace="+")
replace regular expressions helper function to remove all occurrences "$!%^&()'<>?...
Definition: Tools.cxx:810
TMVA::Tools::~Tools
~Tools()
destructor
Definition: Tools.cxx:113
TMVA::RandomGenerator::seed
void seed(UIntType s=0)
Definition: Tools.h:314
TMVA::Tools::TMVAVersionMessage
void TMVAVersionMessage(MsgLogger &logger)
prints the TMVA release number and date
Definition: Tools.cxx:1328
TMVA::Tools::HistoHasEquidistantBins
Bool_t HistoHasEquidistantBins(const TH1 &h)
Definition: Tools.cxx:1499
TMVA::Tools::ParseFormatLine
TList * ParseFormatLine(TString theString, const char *sep=":")
Parse the string and cut into labels separated by ":".
Definition: Tools.cxx:413
TMVA::Tools::GetCorrelationRatio
Double_t GetCorrelationRatio(const TH2F &)
Compute Correlation Ratio of 2D histogram to estimate functional dependency between two variables Aut...
Definition: Tools.cxx:632
TXMLEngine.h
MsgLogger.h
TMVA::Tools::FormattedOutput
void FormattedOutput(const std::vector< Double_t > &, const std::vector< TString > &, const TString titleVars, const TString titleValues, MsgLogger &logger, TString format="%+1.3f")
formatted output of simple table
Definition: Tools.cxx:899
xmin
float xmin
Definition: THbookFile.cxx:95
TMVA::Tools::kSmall2WelcomeMsg
@ kSmall2WelcomeMsg
Definition: Tools.h:206
h
#define h(i)
Definition: RSha256.hxx:106
TXMLEngine
Definition: TXMLEngine.h:26
TMVA::Tools::GetXTitleWithUnit
TString GetXTitleWithUnit(const TString &title, const TString &unit)
histogramming utility
Definition: Tools.cxx:1052
TMVA::Tools::CheckForVerboseOption
Bool_t CheckForVerboseOption(const TString &) const
check if verbosity "V" set in option
Definition: Tools.cxx:720
a
auto * a
Definition: textangle.C:12
TMVA::Tools::HasAttr
Bool_t HasAttr(void *node, const char *attrname)
add attribute from xml
Definition: Tools.cxx:1106
TMVA::Tools::kLogoWelcomeMsg
@ kLogoWelcomeMsg
Definition: Tools.h:204
TMatrixDSymfwd.h
TMVA::Tools::RMS
Double_t RMS(Long64_t n, const T *a, const Double_t *w=0)
Return the Standard Deviation of an array a with length n.
Definition: Tools.cxx:1759
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
Long_t
long Long_t
Definition: RtypesCore.h:54
TMVA::Tools::ReadAttr
void ReadAttr(void *node, const char *, T &value)
read attribute from xml
Definition: Tools.h:335
TMVA::Tools
Global auxiliary applications and data treatment routines.
Definition: Tools.h:78
TMVA::Tools::TransposeHist
TH2F * TransposeHist(const TH2F &)
Transpose quadratic histogram.
Definition: Tools.cxx:669
TH2
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
TMVA::Tools::ECitation
ECitation
Definition: Tools.h:211
TMVA::RandomGenerator::operator()
UIntType operator()()
Definition: Tools.h:316
TMVA::Tools::ROOTVersionMessage
void ROOTVersionMessage(MsgLogger &logger)
prints the ROOT release number and date
Definition: Tools.cxx:1337
TMVA::Tools::kOriginalWelcomeMsgBW
@ kOriginalWelcomeMsgBW
Definition: Tools.h:208
TMVA::Tools::StringFromInt
TString StringFromInt(Long_t i)
string tools
Definition: Tools.cxx:1235
TMVA::Tools::WriteTVectorDToXML
void WriteTVectorDToXML(void *node, const char *name, TVectorD *vec)
Definition: Tools.cxx:1271
Types.h
TMVA::Tools::kPlainText
@ kPlainText
Definition: Tools.h:211
TMVA::RandomGenerator::fRandom
TRandomLike fRandom
Definition: Tools.h:327
void
typedef void((*Func_t)())
TMVA::Tools::Log
MsgLogger & Log() const
Definition: Tools.h:230
TMVA::Endl
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:158
TMVA::Tools::EWelcomeMessage
EWelcomeMessage
Definition: Tools.h:200
TMVA::Tools::fXMLEngine
TXMLEngine * fXMLEngine
Definition: Tools.h:271
TMVA::Tools::StringFromDouble
TString StringFromDouble(Double_t d)
string tools
Definition: Tools.cxx:1245
TMVA::Tools::Color
const TString & Color(const TString &)
human readable color strings
Definition: Tools.cxx:840
TMVA::PDF
PDF wrapper for histograms; uses user-defined spline interpolation.
Definition: PDF.h:63
TMVA::Tools::UsefulSortDescending
void UsefulSortDescending(std::vector< std::vector< Double_t > > &, std::vector< TString > *vs=0)
sort 2D vector (AND in parallel a TString vector) in such a way that the "first vector is sorted" and...
Definition: Tools.cxx:576
TMVA::Tools::Instance
static Tools & Instance()
Definition: Tools.cxx:75
TVectorT< Double_t >
TMVA::Tools::GetYMean_binX
Double_t GetYMean_binX(const TH2 &, Int_t bin_x)
Compute the mean in Y for a given bin X of a 2D histogram.
Definition: Tools.cxx:654
TMVA::Tools::GetParent
void * GetParent(void *child)
get parent node
Definition: Tools.cxx:1152
TMVA::Tools::SetXMLEngineBufferSize
void SetXMLEngineBufferSize(int buffer)
Definition: Tools.h:270
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MsgLogger
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
TMVA::Tools::GetNextChild
void * GetNextChild(void *prevchild, const char *childname=0)
XML helpers.
Definition: Tools.cxx:1174
TMVA::Tools::kLaTeX
@ kLaTeX
Definition: Tools.h:213
TMVA::Tools::CalcCovarianceMatrices
std::vector< TMatrixDSym * > * CalcCovarianceMatrices(const std::vector< Event * > &events, Int_t maxCls, VariableTransformBase *transformBase=0)
compute covariance matrices
Definition: Tools.cxx:1526
TH1
TH1 is the base class of all histogramm classes in ROOT.
Definition: TH1.h:58
name
char name[80]
Definition: TGX11.cxx:110
ROOT::Math::Chebyshev::T
double T(double x)
Definition: ChebyshevPol.h:34
d
#define d(i)
Definition: RSha256.hxx:102
TMVA::Tools::kBibTeX
@ kBibTeX
Definition: Tools.h:212
TMVA::Tools::fLogger
MsgLogger * fLogger
Definition: Tools.h:229
TMVA::Tools::GetCorrelationMatrix
const TMatrixD * GetCorrelationMatrix(const TMatrixD *covMat)
turns covariance into correlation matrix
Definition: Tools.cxx:336
TMVA::Tools::ComputeVariance
Double_t ComputeVariance(Double_t sumx2, Double_t sumx, Int_t nx)
compute variance from given sums
Definition: Tools.h:364
TMVA::Tools::GetCumulativeDist
TH1 * GetCumulativeDist(TH1 *h)
get the cumulative distribution of a histogram
Definition: Tools.cxx:1772
TMVA::Tools::WriteTMatrixDToXML
void WriteTMatrixDToXML(void *node, const char *name, TMatrixD *mat)
XML helpers.
Definition: Tools.cxx:1255
TMVA::Tools::kIsometricWelcomeMsg
@ kIsometricWelcomeMsg
Definition: Tools.h:201
TMVA::Tools::Scale
void Scale(std::vector< Double_t > &, Double_t)
scales double vector
Definition: Tools.cxx:531
TMVA::RandomGenerator::discard
void discard(unsigned long long z)
Definition: Tools.h:318
ROOT::TMetaUtils::propNames::comment
static const std::string comment("comment")
ROOT::Math::Cephes::B
static double B[]
Definition: SpecFuncCephes.cxx:178
TMVA::Tools::ContainsRegularExpression
Bool_t ContainsRegularExpression(const TString &s)
check if regular expression helper function to search for "$!%^&()'<>?= " in a string
Definition: Tools.cxx:796
TMVA::Tools::ReadTMatrixDFromXML
void ReadTMatrixDFromXML(void *node, const char *name, TMatrixD *mat)
Definition: Tools.cxx:1288
TMVA::Tools::GetYTitleWithUnit
TString GetYTitleWithUnit(const TH1 &h, const TString &unit, Bool_t normalised)
histogramming utility
Definition: Tools.cxx:1060
ROOT::Math::detail::sep
@ sep
Definition: GenVectorIO.h:35
TXMLEngine::GetNodeName
const char * GetNodeName(XMLNodePointer_t xmlnode)
returns name of xmlnode
Definition: TXMLEngine.cxx:1072
TMVA::gTools
Tools & gTools()
TMVA::Tools::kStandardWelcomeMsg
@ kStandardWelcomeMsg
Definition: Tools.h:200
TMVA::Tools::TMVACitation
void TMVACitation(MsgLogger &logger, ECitation citType=kPlainText)
kinds of TMVA citation
Definition: Tools.cxx:1453
TMVA::Tools::TMVAWelcomeMessage
void TMVAWelcomeMessage()
direct output, eg, when starting ROOT session -> no use of Logger here
Definition: Tools.cxx:1314
TMVA::Tools::AddRawLine
Bool_t AddRawLine(void *node, const char *raw)
XML helpers.
Definition: Tools.cxx:1202
TList
A doubly linked list.
Definition: TList.h:44
TMVA::Tools::kHtmlLink
@ kHtmlLink
Definition: Tools.h:214
TMVA::Tools::ReadFloatArbitraryPrecision
void ReadFloatArbitraryPrecision(Float_t &val, std::istream &is)
reads a float value with the available precision from a stream
Definition: Tools.cxx:1085
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int