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
30Class 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
105void
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
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
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
235void 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
333void 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
360void 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
376void 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
393std::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 (fNeedsRebuilding) Log() << kINFO << "Rebuilding Dataset " << fName << Endl;
484 if (fDataSet != 0)
485 ClearDataSet();
486 // fDataSet = DataSetManager::Instance().CreateDataSet(GetName()); //DSMTEST replaced by following lines
487 if( !fDataSetManager )
488 Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << "DataSetManager has not been set in DataSetInfo (GetDataSet() )." << Endl;
489 fDataSet = fDataSetManager->CreateDataSet(GetName());
490
491 fNeedsRebuilding = kFALSE;
492 }
493 return fDataSet;
494}
495
496////////////////////////////////////////////////////////////////////////////////
497
499{
500 if(all)
501 return fSpectators.size();
502 UInt_t nsp(0);
503 for(std::vector<VariableInfo>::const_iterator spit=fSpectators.begin(); spit!=fSpectators.end(); ++spit) {
504 if(spit->GetVarType()!='C') nsp++;
505 }
506 return nsp;
507}
508
509////////////////////////////////////////////////////////////////////////////////
510
512{
513 Int_t maxL = 0;
514 for (UInt_t cl = 0; cl < GetNClasses(); cl++) {
515 if (TString(GetClassInfo(cl)->GetName()).Length() > maxL) maxL = TString(GetClassInfo(cl)->GetName()).Length();
516 }
517
518 return maxL;
519}
520
521////////////////////////////////////////////////////////////////////////////////
522
524{
525 Int_t maxL = 0;
526 for (UInt_t i = 0; i < GetNVariables(); i++) {
527 if (TString(GetVariableInfo(i).GetExpression()).Length() > maxL) maxL = TString(GetVariableInfo(i).GetExpression()).Length();
528 }
529
530 return maxL;
531}
532
533////////////////////////////////////////////////////////////////////////////////
534
536{
537 Int_t maxL = 0;
538 for (UInt_t i = 0; i < GetNTargets(); i++) {
539 if (TString(GetTargetInfo(i).GetExpression()).Length() > maxL) maxL = TString(GetTargetInfo(i).GetExpression()).Length();
540 }
541
542 return maxL;
543}
544
545////////////////////////////////////////////////////////////////////////////////
546
548 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;
549 return fTrainingSumSignalWeights;
550}
551
552////////////////////////////////////////////////////////////////////////////////
553
555 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;
556 return fTrainingSumBackgrWeights;
557}
558
559////////////////////////////////////////////////////////////////////////////////
560
562 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;
563 return fTestingSumSignalWeights ;
564}
565
566////////////////////////////////////////////////////////////////////////////////
567
569 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;
570 return fTestingSumBackgrWeights ;
571}
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
double Double_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:100
int type
Definition: TGX11.cxx:121
TMatrixT< Float_t > TMatrixF
Definition: TMatrixFfwd.h:22
char * Form(const char *fmt,...)
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition: TAttAxis.cxx:203
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
Definition: TAxis.cxx:823
A specialized string object used for TTree selections.
Definition: TCut.h:25
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
Definition: Haxis.cxx:267
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:5314
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition: TH1.h:320
TAxis * GetYaxis()
Definition: TH1.h:321
virtual void SetMaximum(Double_t maximum=-1111)
Definition: TH1.h:398
virtual void SetMinimum(Double_t minimum=-1111)
Definition: TH1.h:399
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this histogram.
Definition: TH1.cxx:8816
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition: TH1.cxx:6565
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition: TH1.cxx:8832
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:251
Service class for 2-D histogram classes.
Definition: TH2.h:30
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH2.h:88
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH2.cxx:2571
Class that contains all the information of a class.
Definition: ClassInfo.h:49
void SetCut(const TCut &cut)
Definition: ClassInfo.h:58
void SetWeight(const TString &weight)
Definition: ClassInfo.h:57
const TCut & GetCut() const
Definition: ClassInfo.h:64
void SetNumber(const UInt_t index)
Definition: ClassInfo.h:59
const TMatrixD * GetCorrelationMatrix() const
Definition: ClassInfo.h:66
Bool_t HasCuts() const
UInt_t GetNSpectators(bool all=kTRUE) const
ClassInfo * AddClass(const TString &className)
const TMatrixD * CorrelationMatrix(const TString &className) const
Int_t GetTargetNameMaxLength() const
virtual ~DataSetInfo()
destructor
Definition: DataSetInfo.cxx:83
Double_t GetTestingSumBackgrWeights()
void SetMsgType(EMsgType t) const
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
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
DataSet * GetDataSet() const
returns data set
DataSetInfo(const TString &name="Default")
constructor
Definition: DataSetInfo.cxx:56
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
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...
std::vector< TString > GetListOfVariables() const
returns list of variables
ClassInfo * GetClassInfo(Int_t clNum) const
Double_t GetTrainingSumSignalWeights()
void PrintClasses() const
Int_t GetClassNameMaxLength() const
Double_t GetTrainingSumBackgrWeights()
void PrintCorrelationMatrix(const TString &className)
calculates the correlation matrices for signal and background, prints them to standard output,...
void SetCut(const TCut &cut, const TString &className)
set the cut for the classes
Double_t GetTestingSumSignalWeights()
Int_t FindVarIndex(const TString &) const
find variable by name
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
Int_t GetVariableNameMaxLength() const
Bool_t IsSignal(const Event *ev) const
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...
void AddCut(const TCut &cut, const TString &className)
set the cut for the classes
std::vector< Float_t > * GetTargetsForMulticlass(const Event *ev)
void SetCorrelationMatrix(const TString &className, TMatrixD *matrix)
void ClearDataSet() const
Definition: DataSetInfo.cxx:98
Class that contains all the data information.
Definition: DataSet.h:58
UInt_t GetClass() const
Definition: Event.h:86
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
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
Class for type info of MVA input variable.
Definition: VariableInfo.h:47
EMsgType
Definition: Types.h:57
@ kDEBUG
Definition: Types.h:58
@ kHEADER
Definition: Types.h:65
@ kINFO
Definition: Types.h:60
@ kWARNING
Definition: Types.h:61
@ kFATAL
Definition: Types.h:63
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:136
Ssiz_t Length() const
Definition: TString.h:410
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
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:2336
static const std::string name("name")
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).
Tools & gTools()
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:158
Double_t Log(Double_t x)
Definition: TMath.h:760
auto * m
Definition: textangle.C:8