Logo ROOT  
Reference Guide
DataSetInfo.cxx
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Joerg Stelzer, Peter Speckmeier
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : DataSetInfo *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Implementation (see header for description) *
12  * *
13  * Authors (alphabetical): *
14  * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland *
15  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - DESY, Germany *
16  * *
17  * Copyright (c) 2008: *
18  * CERN, Switzerland *
19  * MPI-K Heidelberg, Germany *
20  * DESY Hamburg, Germany *
21  * *
22  * Redistribution and use in source and binary forms, with or without *
23  * modification, are permitted according to the terms listed in LICENSE *
24  * (http://tmva.sourceforge.net/LICENSE) *
25  **********************************************************************************/
26 
27 /*! \class TMVA::DataSetInfo
28 \ingroup TMVA
29 
30 Class that contains all the data information.
31 
32 */
33 
34 #include <vector>
35 
36 #include "TEventList.h"
37 #include "TH2.h"
38 #include "TRandom3.h"
39 #include "TMatrixF.h"
40 #include "TVectorF.h"
41 #include "TROOT.h"
42 
43 #include "TMVA/MsgLogger.h"
44 #include "TMVA/Tools.h"
45 #include "TMVA/DataSet.h"
46 #include "TMVA/DataSetInfo.h"
47 #include "TMVA/DataSetManager.h"
48 #include "TMVA/Event.h"
49 
50 #include "TMVA/Types.h"
51 #include "TMVA/VariableInfo.h"
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// constructor
55 
57  : TObject(),
58  fDataSetManager(NULL),
59  fName(name),
60  fDataSet( 0 ),
61  fNeedsRebuilding( kTRUE ),
62  fVariables(),
63  fTargets(),
64  fSpectators(),
65  fClasses( 0 ),
66  fNormalization( "NONE" ),
67  fSplitOptions(""),
68  fTrainingSumSignalWeights(-1),
69  fTrainingSumBackgrWeights(-1),
70  fTestingSumSignalWeights (-1),
71  fTestingSumBackgrWeights (-1),
72  fOwnRootDir(0),
73  fVerbose( kFALSE ),
74  fSignalClass(0),
75  fTargetsForMulticlass(0),
76  fLogger( new MsgLogger("DataSetInfo", kINFO) )
77 {
78 }
79 
80 ////////////////////////////////////////////////////////////////////////////////
81 /// destructor
82 
84 {
85  ClearDataSet();
86 
87  for(UInt_t i=0, iEnd = fClasses.size(); i<iEnd; ++i) {
88  delete fClasses[i];
89  }
90 
91  delete fTargetsForMulticlass;
92 
93  delete fLogger;
94 }
95 
96 ////////////////////////////////////////////////////////////////////////////////
97 
99 {
100  if(fDataSet!=0) { delete fDataSet; fDataSet=0; }
101 }
102 
103 ////////////////////////////////////////////////////////////////////////////////
104 
105 void
106 TMVA::DataSetInfo::SetMsgType( EMsgType t ) const
107 {
108  fLogger->SetMinType(t);
109 }
110 
111 ////////////////////////////////////////////////////////////////////////////////
112 
114 {
115  ClassInfo* theClass = GetClassInfo(className);
116  if (theClass) return theClass;
117 
118 
119  fClasses.push_back( new ClassInfo(className) );
120  fClasses.back()->SetNumber(fClasses.size()-1);
121 
122  //Log() << kHEADER << Endl;
123 
124  Log() << kHEADER << Form("[%s] : ",fName.Data()) << "Added class \"" << className << "\""<< Endl;
125 
126  Log() << kDEBUG <<"\t with internal class number " << fClasses.back()->GetNumber() << Endl;
127 
128 
129  if (className == "Signal") fSignalClass = fClasses.size()-1; // store the signal class index ( for comparison reasons )
130 
131  return fClasses.back();
132 }
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 
137 {
138  for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
139  if ((*it)->GetName() == name) return (*it);
140  }
141  return 0;
142 }
143 
144 ////////////////////////////////////////////////////////////////////////////////
145 
147 {
148  try {
149  return fClasses.at(cls);
150  }
151  catch(...) {
152  return 0;
153  }
154 }
155 
156 ////////////////////////////////////////////////////////////////////////////////
157 
159 {
160  for (UInt_t cls = 0; cls < GetNClasses() ; cls++) {
161  Log() << kINFO << Form("Dataset[%s] : ",fName.Data()) << "Class index : " << cls << " name : " << GetClassInfo(cls)->GetName() << Endl;
162  }
163 }
164 
165 ////////////////////////////////////////////////////////////////////////////////
166 
168 {
169  return (ev->GetClass() == fSignalClass);
170 }
171 
172 ////////////////////////////////////////////////////////////////////////////////
173 
174 std::vector<Float_t>* TMVA::DataSetInfo::GetTargetsForMulticlass( const TMVA::Event* ev )
175 {
176  if( !fTargetsForMulticlass ) fTargetsForMulticlass = new std::vector<Float_t>( GetNClasses() );
177  // fTargetsForMulticlass->resize( GetNClasses() );
178  fTargetsForMulticlass->assign( GetNClasses(), 0.0 );
179  fTargetsForMulticlass->at( ev->GetClass() ) = 1.0;
180  return fTargetsForMulticlass;
181 }
182 
183 
184 ////////////////////////////////////////////////////////////////////////////////
185 
187 {
188  Bool_t hasCuts = kFALSE;
189  for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
190  if( TString((*it)->GetCut()) != TString("") ) hasCuts = kTRUE;
191  }
192  return hasCuts;
193 }
194 
195 ////////////////////////////////////////////////////////////////////////////////
196 
197 const TMatrixD* TMVA::DataSetInfo::CorrelationMatrix( const TString& className ) const
198 {
199  ClassInfo* ptr = GetClassInfo(className);
200  return ptr?ptr->GetCorrelationMatrix():0;
201 }
202 
203 ////////////////////////////////////////////////////////////////////////////////
204 /// add a variable (can be a complex expression) to the set of
205 /// variables used in the MV analysis
206 
208  const TString& title,
209  const TString& unit,
210  Double_t min, Double_t max,
211  char varType,
212  Bool_t normalized,
213  void* external )
214 {
215  TString regexpr = expression; // remove possible blanks
216  regexpr.ReplaceAll(" ", "" );
217  fVariables.push_back(VariableInfo( regexpr, title, unit,
218  fVariables.size()+1, varType, external, min, max, normalized ));
219  fNeedsRebuilding = kTRUE;
220  return fVariables.back();
221 }
222 
223 ////////////////////////////////////////////////////////////////////////////////
224 /// add variable with given VariableInfo
225 
227  fVariables.push_back(VariableInfo( varInfo ));
228  fNeedsRebuilding = kTRUE;
229  return fVariables.back();
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// add an array of variables identified by an expression corresponding to an array entry in the tree
234 
235 void TMVA::DataSetInfo::AddVariablesArray(const TString &expression, Int_t size, const TString &title, const TString &unit,
236  Double_t min, Double_t max, char varType, Bool_t normalized,
237  void *external)
238 {
239  TString regexpr = expression; // remove possible blanks
240  regexpr.ReplaceAll(" ", "");
241  fVariables.reserve(fVariables.size() + size);
242  for (int i = 0; i < size; ++i) {
243  TString newTitle = title + TString::Format("[%d]", i);
244 
245  fVariables.emplace_back(regexpr, newTitle, unit, fVariables.size() + 1, varType, external, min, max, normalized);
246  // set corresponding bit indicating is a variable from an array
247  fVariables.back().SetBit(kIsArrayVariable);
248  TString newVarName = fVariables.back().GetInternalName() + TString::Format("[%d]", i);
249  fVariables.back().SetInternalName(newVarName);
250  }
251  fVarArrays[regexpr] = size;
252  fNeedsRebuilding = kTRUE;
253 }
254 
255 ////////////////////////////////////////////////////////////////////////////////
256 /// add a variable (can be a complex expression) to the set of
257 /// variables used in the MV analysis
258 
260  const TString& title,
261  const TString& unit,
262  Double_t min, Double_t max,
263  Bool_t normalized,
264  void* external )
265 {
266  TString regexpr = expression; // remove possible blanks
267  regexpr.ReplaceAll(" ", "" );
268  char type='F';
269  fTargets.push_back(VariableInfo( regexpr, title, unit,
270  fTargets.size()+1, type, external, min,
271  max, normalized ));
272  fNeedsRebuilding = kTRUE;
273  return fTargets.back();
274 }
275 
276 ////////////////////////////////////////////////////////////////////////////////
277 /// add target with given VariableInfo
278 
280  fTargets.push_back(VariableInfo( varInfo ));
281  fNeedsRebuilding = kTRUE;
282  return fTargets.back();
283 }
284 
285 ////////////////////////////////////////////////////////////////////////////////
286 /// add a spectator (can be a complex expression) to the set of spectator variables used in
287 /// the MV analysis
288 
290  const TString& title,
291  const TString& unit,
292  Double_t min, Double_t max, char type,
293  Bool_t normalized, void* external )
294 {
295  TString regexpr = expression; // remove possible blanks
296  regexpr.ReplaceAll(" ", "" );
297  fSpectators.push_back(VariableInfo( regexpr, title, unit,
298  fSpectators.size()+1, type, external, min, max, normalized ));
299  fNeedsRebuilding = kTRUE;
300  return fSpectators.back();
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 /// add spectator with given VariableInfo
305 
307  fSpectators.push_back(VariableInfo( varInfo ));
308  fNeedsRebuilding = kTRUE;
309  return fSpectators.back();
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// find variable by name
314 
316 {
317  for (UInt_t ivar=0; ivar<GetNVariables(); ivar++)
318  if (var == GetVariableInfo(ivar).GetInternalName()) return ivar;
319 
320  for (UInt_t ivar=0; ivar<GetNVariables(); ivar++)
321  Log() << kINFO << Form("Dataset[%s] : ",fName.Data()) << GetVariableInfo(ivar).GetInternalName() << Endl;
322 
323  Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << "<FindVarIndex> Variable \'" << var << "\' not found." << Endl;
324 
325  return -1;
326 }
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// set the weight expressions for the classes
330 /// if class name is specified, set only for this class
331 /// if class name is unknown, register new class with this name
332 
333 void TMVA::DataSetInfo::SetWeightExpression( const TString& expr, const TString& className )
334 {
335  if (className != "") {
336  TMVA::ClassInfo* ci = AddClass(className);
337  ci->SetWeight( expr );
338  }
339  else {
340  // no class name specified, set weight for all classes
341  if (fClasses.empty()) {
342  Log() << kWARNING << Form("Dataset[%s] : ",fName.Data()) << "No classes registered yet, cannot specify weight expression!" << Endl;
343  }
344  for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
345  (*it)->SetWeight( expr );
346  }
347  }
348 }
349 
350 ////////////////////////////////////////////////////////////////////////////////
351 
353 {
354  GetClassInfo(className)->SetCorrelationMatrix(matrix);
355 }
356 
357 ////////////////////////////////////////////////////////////////////////////////
358 /// set the cut for the classes
359 
360 void TMVA::DataSetInfo::SetCut( const TCut& cut, const TString& className )
361 {
362  if (className == "") { // if no className has been given set the cut for all the classes
363  for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
364  (*it)->SetCut( cut );
365  }
366  }
367  else {
368  TMVA::ClassInfo* ci = AddClass(className);
369  ci->SetCut( cut );
370  }
371 }
372 
373 ////////////////////////////////////////////////////////////////////////////////
374 /// set the cut for the classes
375 
376 void TMVA::DataSetInfo::AddCut( const TCut& cut, const TString& className )
377 {
378  if (className == "") { // if no className has been given set the cut for all the classes
379  for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
380  const TCut& oldCut = (*it)->GetCut();
381  (*it)->SetCut( oldCut+cut );
382  }
383  }
384  else {
385  TMVA::ClassInfo* ci = AddClass(className);
386  ci->SetCut( ci->GetCut()+cut );
387  }
388 }
389 
390 ////////////////////////////////////////////////////////////////////////////////
391 /// returns list of variables
392 
393 std::vector<TString> TMVA::DataSetInfo::GetListOfVariables() const
394 {
395  std::vector<TString> vNames;
396  std::vector<TMVA::VariableInfo>::const_iterator viIt = GetVariableInfos().begin();
397  for(;viIt != GetVariableInfos().end(); ++viIt) vNames.push_back( (*viIt).GetInternalName() );
398 
399  return vNames;
400 }
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 /// calculates the correlation matrices for signal and background,
404 /// prints them to standard output, and fills 2D histograms
405 
407 {
408 
409  Log() << kHEADER //<< Form("Dataset[%s] : ",fName.Data())
410  << "Correlation matrix (" << className << "):" << Endl;
411  gTools().FormattedOutput( *CorrelationMatrix( className ), GetListOfVariables(), Log() );
412 }
413 
414 ////////////////////////////////////////////////////////////////////////////////
415 
417  const TString& hName,
418  const TString& hTitle ) const
419 {
420  if (m==0) return 0;
421 
422  const UInt_t nvar = GetNVariables();
423 
424  // workaround till the TMatrix templates are commonly used
425  // this keeps backward compatibility
426  TMatrixF* tm = new TMatrixF( nvar, nvar );
427  for (UInt_t ivar=0; ivar<nvar; ivar++) {
428  for (UInt_t jvar=0; jvar<nvar; jvar++) {
429  (*tm)(ivar, jvar) = (*m)(ivar,jvar);
430  }
431  }
432 
433  TH2F* h2 = new TH2F( *tm );
434  h2->SetNameTitle( hName, hTitle );
435 
436  for (UInt_t ivar=0; ivar<nvar; ivar++) {
437  h2->GetXaxis()->SetBinLabel( ivar+1, GetVariableInfo(ivar).GetTitle() );
438  h2->GetYaxis()->SetBinLabel( ivar+1, GetVariableInfo(ivar).GetTitle() );
439  }
440 
441  // present in percent, and round off digits
442  // also, use absolute value of correlation coefficient (ignore sign)
443  h2->Scale( 100.0 );
444  for (UInt_t ibin=1; ibin<=nvar; ibin++) {
445  for (UInt_t jbin=1; jbin<=nvar; jbin++) {
446  h2->SetBinContent( ibin, jbin, Int_t(h2->GetBinContent( ibin, jbin )) );
447  }
448  }
449 
450  // style settings
451  const Float_t labelSize = 0.055;
452  h2->SetStats( 0 );
453  h2->GetXaxis()->SetLabelSize( labelSize );
454  h2->GetYaxis()->SetLabelSize( labelSize );
455  h2->SetMarkerSize( 1.5 );
456  h2->SetMarkerColor( 0 );
457  h2->LabelsOption( "d" ); // diagonal labels on x axis
458  h2->SetLabelOffset( 0.011 );// label offset on x axis
459  h2->SetMinimum( -100.0 );
460  h2->SetMaximum( +100.0 );
461 
462  // -------------------------------------------------------------------------------------
463  // just in case one wants to change the position of the color palette axis
464  // -------------------------------------------------------------------------------------
465  // gROOT->SetStyle("Plain");
466  // TStyle* gStyle = gROOT->GetStyle( "Plain" );
467  // gStyle->SetPalette( 1, 0 );
468  // TPaletteAxis* paletteAxis
469  // = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject( "palette" );
470  // -------------------------------------------------------------------------------------
471 
472  Log() << kDEBUG << Form("Dataset[%s] : ",fName.Data()) << "Created correlation matrix as 2D histogram: " << h2->GetName() << Endl;
473 
474  return h2;
475 }
476 
477 ////////////////////////////////////////////////////////////////////////////////
478 /// returns data set
479 
481 {
482  if (fDataSet==0 || fNeedsRebuilding) {
483  if(fDataSet!=0) ClearDataSet();
484  // fDataSet = DataSetManager::Instance().CreateDataSet(GetName()); //DSMTEST replaced by following lines
485  if( !fDataSetManager )
486  Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << "DataSetManager has not been set in DataSetInfo (GetDataSet() )." << Endl;
487  fDataSet = fDataSetManager->CreateDataSet(GetName());
488 
489  fNeedsRebuilding = kFALSE;
490  }
491  return fDataSet;
492 }
493 
494 ////////////////////////////////////////////////////////////////////////////////
495 
497 {
498  if(all)
499  return fSpectators.size();
500  UInt_t nsp(0);
501  for(std::vector<VariableInfo>::const_iterator spit=fSpectators.begin(); spit!=fSpectators.end(); ++spit) {
502  if(spit->GetVarType()!='C') nsp++;
503  }
504  return nsp;
505 }
506 
507 ////////////////////////////////////////////////////////////////////////////////
508 
510 {
511  Int_t maxL = 0;
512  for (UInt_t cl = 0; cl < GetNClasses(); cl++) {
513  if (TString(GetClassInfo(cl)->GetName()).Length() > maxL) maxL = TString(GetClassInfo(cl)->GetName()).Length();
514  }
515 
516  return maxL;
517 }
518 
519 ////////////////////////////////////////////////////////////////////////////////
520 
522 {
523  Int_t maxL = 0;
524  for (UInt_t i = 0; i < GetNVariables(); i++) {
525  if (TString(GetVariableInfo(i).GetExpression()).Length() > maxL) maxL = TString(GetVariableInfo(i).GetExpression()).Length();
526  }
527 
528  return maxL;
529 }
530 
531 ////////////////////////////////////////////////////////////////////////////////
532 
534 {
535  Int_t maxL = 0;
536  for (UInt_t i = 0; i < GetNTargets(); i++) {
537  if (TString(GetTargetInfo(i).GetExpression()).Length() > maxL) maxL = TString(GetTargetInfo(i).GetExpression()).Length();
538  }
539 
540  return maxL;
541 }
542 
543 ////////////////////////////////////////////////////////////////////////////////
544 
546  if (fTrainingSumSignalWeights<0) Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << " asking for the sum of training signal event weights which is not initialized yet" << Endl;
547  return fTrainingSumSignalWeights;
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 
553  if (fTrainingSumBackgrWeights<0) Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << " asking for the sum of training backgr event weights which is not initialized yet" << Endl;
554  return fTrainingSumBackgrWeights;
555 }
556 
557 ////////////////////////////////////////////////////////////////////////////////
558 
560  if (fTestingSumSignalWeights<0) Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << " asking for the sum of testing signal event weights which is not initialized yet" << Endl;
561  return fTestingSumSignalWeights ;
562 }
563 
564 ////////////////////////////////////////////////////////////////////////////////
565 
567  if (fTestingSumBackgrWeights<0) Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << " asking for the sum of testing backgr event weights which is not initialized yet" << Endl;
568  return fTestingSumBackgrWeights ;
569 }
TAttMarker::SetMarkerSize
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
TH1::LabelsOption
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Sort bins with labels or set option(s) to draw axis with labels.
Definition: TH1.cxx:5290
m
auto * m
Definition: textangle.C:8
TMVA::DataSetInfo::ClearDataSet
void ClearDataSet() const
Definition: DataSetInfo.cxx:98
TCut
A specialized string object used for TTree selections.
Definition: TCut.h:25
TMVA::DataSetInfo::FindVarIndex
Int_t FindVarIndex(const TString &) const
find variable by name
Definition: DataSetInfo.cxx:315
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
DataSetManager.h
TMVA::DataSetInfo::AddVariablesArray
void AddVariablesArray(const TString &expression, Int_t size, const TString &title="", const TString &unit="", Double_t min=0, Double_t max=0, char type='F', Bool_t normalized=kTRUE, void *external=0)
add an array of variables identified by an expression corresponding to an array entry in the tree
Definition: DataSetInfo.cxx:235
TMVA::DataSetInfo::IsSignal
Bool_t IsSignal(const Event *ev) const
Definition: DataSetInfo.cxx:167
TMVA::DataSetInfo::AddSpectator
VariableInfo & AddSpectator(const TString &expression, const TString &title, const TString &unit, Double_t min, Double_t max, char type='F', Bool_t normalized=kTRUE, void *external=0)
add a spectator (can be a complex expression) to the set of spectator variables used in the MV analys...
Definition: DataSetInfo.cxx:289
TMVA::DataSetInfo::SetCut
void SetCut(const TCut &cut, const TString &className)
set the cut for the classes
Definition: DataSetInfo.cxx:360
TH1::SetMinimum
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:399
TMVA::ClassInfo
Class that contains all the information of a class.
Definition: ClassInfo.h:49
ROOT::AddClass
void AddClass(const char *cname, Version_t id, const std::type_info &info, DictFuncPtr_t dict, Int_t pragmabits)
Global function called by the ctor of a class's init class (see the ClassImp macro).
Definition: TClassTable.cxx:763
TMVA::DataSetInfo::GetTrainingSumBackgrWeights
Double_t GetTrainingSumBackgrWeights()
Definition: DataSetInfo.cxx:552
TH2::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH2.h:88
TH2F
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:251
TH1::SetNameTitle
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this histogram.
Definition: TH1.cxx:8740
DataSetInfo.h
Form
char * Form(const char *fmt,...)
TMVA::DataSetInfo::GetDataSet
DataSet * GetDataSet() const
returns data set
Definition: DataSetInfo.cxx:480
TMVA::Event::GetClass
UInt_t GetClass() const
Definition: Event.h:86
TMath::Log
Double_t Log(Double_t x)
Definition: TMath.h:760
TMVA::DataSetInfo::GetTargetNameMaxLength
Int_t GetTargetNameMaxLength() const
Definition: DataSetInfo.cxx:533
TMVA::DataSetInfo::GetTargetsForMulticlass
std::vector< Float_t > * GetTargetsForMulticlass(const Event *ev)
Definition: DataSetInfo.cxx:174
TMVA::DataSetInfo::GetNSpectators
UInt_t GetNSpectators(bool all=kTRUE) const
Definition: DataSetInfo.cxx:496
Float_t
float Float_t
Definition: RtypesCore.h:57
VariableInfo.h
TMVA::DataSetInfo::HasCuts
Bool_t HasCuts() const
Definition: DataSetInfo.cxx:186
Int_t
int Int_t
Definition: RtypesCore.h:45
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TMVA::DataSetInfo::GetTrainingSumSignalWeights
Double_t GetTrainingSumSignalWeights()
Definition: DataSetInfo.cxx:545
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
TString
Basic string class.
Definition: TString.h:136
TMatrixT< Double_t >
TMVA::DataSetInfo::CorrelationMatrix
const TMatrixD * CorrelationMatrix(const TString &className) const
Definition: DataSetInfo.cxx:197
bool
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TROOT.h
TMVA::DataSetInfo::SetWeightExpression
void SetWeightExpression(const TString &exp, const TString &className="")
set the weight expressions for the classes if class name is specified, set only for this class if cla...
Definition: DataSetInfo.cxx:333
TMVA::DataSetInfo::PrintCorrelationMatrix
void PrintCorrelationMatrix(const TString &className)
calculates the correlation matrices for signal and background, prints them to standard output,...
Definition: DataSetInfo.cxx:406
TAttAxis::SetLabelSize
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition: TAttAxis.cxx:203
TMVA::DataSetInfo::AddCut
void AddCut(const TCut &cut, const TString &className)
set the cut for the classes
Definition: DataSetInfo.cxx:376
TMVA::ClassInfo::SetWeight
void SetWeight(const TString &weight)
Definition: ClassInfo.h:57
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
TH1::GetYaxis
TAxis * GetYaxis()
Definition: TH1.h:321
TAttMarker::SetMarkerColor
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
TMVA::DataSetInfo::GetVariableNameMaxLength
Int_t GetVariableNameMaxLength() const
Definition: DataSetInfo.cxx:521
TMVA::DataSetInfo::GetClassInfo
ClassInfo * GetClassInfo(Int_t clNum) const
Definition: DataSetInfo.cxx:146
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TMVA::VariableInfo
Class for type info of MVA input variable.
Definition: VariableInfo.h:47
TH1::SetMaximum
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:398
TMVA::DataSetInfo::GetTestingSumBackgrWeights
Double_t GetTestingSumBackgrWeights()
Definition: DataSetInfo.cxx:566
TMVA::DataSet
Class that contains all the data information.
Definition: DataSet.h:58
Event.h
TMVA::DataSetInfo::~DataSetInfo
virtual ~DataSetInfo()
destructor
Definition: DataSetInfo.cxx:83
TH2
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
TRandom3.h
TMVA::DataSetInfo::SetMsgType
void SetMsgType(EMsgType t) const
Definition: DataSetInfo.cxx:106
Types.h
TH1::SetStats
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition: TH1.cxx:8756
TH2.h
TMVA::DataSetInfo::DataSetInfo
DataSetInfo(const TString &name="Default")
constructor
Definition: DataSetInfo.cxx:56
TMVA::Endl
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:158
unsigned int
TMVA::ClassInfo::GetCut
const TCut & GetCut() const
Definition: ClassInfo.h:64
TH1::SetLabelOffset
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
Definition: Haxis.cxx:267
TMVA::DataSetInfo::AddVariable
VariableInfo & AddVariable(const TString &expression, const TString &title="", const TString &unit="", Double_t min=0, Double_t max=0, char varType='F', Bool_t normalized=kTRUE, void *external=0)
add a variable (can be a complex expression) to the set of variables used in the MV analysis
Definition: DataSetInfo.cxx:207
TMVA::DataSetInfo::SetCorrelationMatrix
void SetCorrelationMatrix(const TString &className, TMatrixD *matrix)
Definition: DataSetInfo.cxx:352
TAxis::SetBinLabel
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
Definition: TAxis.cxx:823
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::DataSetInfo::GetTestingSumSignalWeights
Double_t GetTestingSumSignalWeights()
Definition: DataSetInfo.cxx:559
TMVA::MsgLogger
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
TMVA::DataSetInfo::CreateCorrelationMatrixHist
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
Definition: DataSetInfo.cxx:416
TMVA::DataSetInfo::AddClass
ClassInfo * AddClass(const TString &className)
Definition: DataSetInfo.cxx:113
TMVA::ClassInfo::SetNumber
void SetNumber(const UInt_t index)
Definition: ClassInfo.h:59
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TMVA::Event
Definition: Event.h:51
TMVA::DataSetInfo::PrintClasses
void PrintClasses() const
Definition: DataSetInfo.cxx:158
name
char name[80]
Definition: TGX11.cxx:110
TVectorF.h
TMVA::ClassInfo::SetCut
void SetCut(const TCut &cut)
Definition: ClassInfo.h:58
TMVA::ClassInfo::GetCorrelationMatrix
const TMatrixD * GetCorrelationMatrix() const
Definition: ClassInfo.h:66
Tools.h
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
type
int type
Definition: TGX11.cxx:121
TMVA::DataSetInfo::AddTarget
VariableInfo & AddTarget(const TString &expression, const TString &title, const TString &unit, Double_t min, Double_t max, Bool_t normalized=kTRUE, void *external=0)
add a variable (can be a complex expression) to the set of variables used in the MV analysis
Definition: DataSetInfo.cxx:259
TH1::GetXaxis
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:320
TMVA::gTools
Tools & gTools()
TMVA::DataSetInfo::GetClassNameMaxLength
Int_t GetClassNameMaxLength() const
Definition: DataSetInfo.cxx:509
DataSet.h
TMatrixF
TMatrixT< Float_t > TMatrixF
Definition: TMatrixFfwd.h:22
TMatrixF.h
TH1::Scale
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition: TH1.cxx:6541
TH2::SetBinContent
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH2.cxx:2507
TMVA::DataSetInfo::GetListOfVariables
std::vector< TString > GetListOfVariables() const
returns list of variables
Definition: DataSetInfo.cxx:393
int
TEventList.h