Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
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 * (see tmva/doc/LICENSE) *
25 **********************************************************************************/
26
27/*! \class TMVA::DataSetInfo
28\ingroup TMVA
29
30Class that contains all the data information.
31
32*/
33
34#include "TH2.h"
35#include "TMatrixF.h"
36
37#include "TMVA/MsgLogger.h"
38#include "TMVA/Tools.h"
39#include "TMVA/DataSet.h"
40#include "TMVA/DataSetInfo.h"
41#include "TMVA/DataSetManager.h"
42#include "TMVA/Event.h"
43
44#include "TMVA/Types.h"
45#include "TMVA/VariableInfo.h"
46
47#include <vector>
48
49////////////////////////////////////////////////////////////////////////////////
50/// constructor
51
53 : TObject(),
54 fDataSetManager(NULL),
55 fName(name),
56 fDataSet( 0 ),
57 fNeedsRebuilding( kTRUE ),
58 fVariables(),
59 fTargets(),
60 fSpectators(),
61 fClasses( 0 ),
62 fNormalization( "NONE" ),
63 fSplitOptions(""),
64 fTrainingSumSignalWeights(-1),
65 fTrainingSumBackgrWeights(-1),
66 fTestingSumSignalWeights (-1),
67 fTestingSumBackgrWeights (-1),
68 fOwnRootDir(0),
69 fVerbose( kFALSE ),
70 fSignalClass(0),
71 fTargetsForMulticlass(0),
72 fLogger( new MsgLogger("DataSetInfo", kINFO) )
73{
74}
75
76////////////////////////////////////////////////////////////////////////////////
77/// destructor
78
80{
81 ClearDataSet();
82
83 for(UInt_t i=0, iEnd = fClasses.size(); i<iEnd; ++i) {
84 if (fClasses[i]) delete fClasses[i];
85 }
86
87 if (fTargetsForMulticlass) delete fTargetsForMulticlass;
88
89 delete fLogger;
90}
91
92////////////////////////////////////////////////////////////////////////////////
93
95{
96 if(fDataSet) { delete fDataSet; fDataSet=nullptr; }
97}
98
99////////////////////////////////////////////////////////////////////////////////
100
101void
103{
104 fLogger->SetMinType(t);
105}
106
107////////////////////////////////////////////////////////////////////////////////
108
110{
111 ClassInfo* theClass = GetClassInfo(className);
112 if (theClass) return theClass;
113
114
115 fClasses.push_back( new ClassInfo(className) );
116 fClasses.back()->SetNumber(fClasses.size()-1);
117
118 //Log() << kHEADER << Endl;
119
120 Log() << kHEADER << Form("[%s] : ",fName.Data()) << "Added class \"" << className << "\""<< Endl;
121
122 Log() << kDEBUG <<"\t with internal class number " << fClasses.back()->GetNumber() << Endl;
123
124
125 if (className == "Signal") fSignalClass = fClasses.size()-1; // store the signal class index ( for comparison reasons )
126
127 return fClasses.back();
128}
129
130////////////////////////////////////////////////////////////////////////////////
131
133{
134 for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
135 if ((*it)->GetName() == name) return (*it);
136 }
137 return 0;
138}
139
140////////////////////////////////////////////////////////////////////////////////
141
143{
144 try {
145 return fClasses.at(cls);
146 }
147 catch(...) {
148 return 0;
149 }
150}
151
152////////////////////////////////////////////////////////////////////////////////
153
155{
156 for (UInt_t cls = 0; cls < GetNClasses() ; cls++) {
157 Log() << kINFO << Form("Dataset[%s] : ",fName.Data()) << "Class index : " << cls << " name : " << GetClassInfo(cls)->GetName() << Endl;
158 }
159}
160
161////////////////////////////////////////////////////////////////////////////////
162
164{
165 return (ev->GetClass() == fSignalClass);
166}
167
168////////////////////////////////////////////////////////////////////////////////
169
171{
172 if( !fTargetsForMulticlass ) fTargetsForMulticlass = new std::vector<Float_t>( GetNClasses() );
173 // fTargetsForMulticlass->resize( GetNClasses() );
174 fTargetsForMulticlass->assign( GetNClasses(), 0.0 );
175 fTargetsForMulticlass->at( ev->GetClass() ) = 1.0;
176 return fTargetsForMulticlass;
177}
178
179
180////////////////////////////////////////////////////////////////////////////////
181
183{
185 for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
186 if( TString((*it)->GetCut()) != TString("") ) hasCuts = kTRUE;
187 }
188 return hasCuts;
189}
190
191////////////////////////////////////////////////////////////////////////////////
192
194{
195 ClassInfo* ptr = GetClassInfo(className);
196 return ptr?ptr->GetCorrelationMatrix():0;
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// add a variable (can be a complex expression) to the set of
201/// variables used in the MV analysis
202
204 const TString& title,
205 const TString& unit,
206 Double_t min, Double_t max,
207 char varType,
209 void* external )
210{
211 TString regexpr = expression; // remove possible blanks
212 regexpr.ReplaceAll(" ", "" );
213 fVariables.push_back(VariableInfo( regexpr, title, unit,
214 fVariables.size()+1, varType, external, min, max, normalized ));
215 fNeedsRebuilding = kTRUE;
216 return fVariables.back();
217}
218
219////////////////////////////////////////////////////////////////////////////////
220/// add variable with given VariableInfo
221
223 fVariables.push_back(VariableInfo( varInfo ));
224 fNeedsRebuilding = kTRUE;
225 return fVariables.back();
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// add an array of variables identified by an expression corresponding to an array entry in the tree
230
231void TMVA::DataSetInfo::AddVariablesArray(const TString &expression, Int_t size, const TString &title, const TString &unit,
232 Double_t min, Double_t max, char varType, Bool_t normalized,
233 void *external)
234{
235 TString regexpr = expression; // remove possible blanks
236 regexpr.ReplaceAll(" ", "");
237 fVariables.reserve(fVariables.size() + size);
238 for (int i = 0; i < size; ++i) {
239 TString newTitle = title + TString::Format("[%d]", i);
240
241 fVariables.emplace_back(regexpr, newTitle, unit, fVariables.size() + 1, varType, external, min, max, normalized);
242 // set corresponding bit indicating is a variable from an array
243 fVariables.back().SetBit(kIsArrayVariable);
244 TString newVarName = fVariables.back().GetInternalName() + TString::Format("[%d]", i);
245 fVariables.back().SetInternalName(newVarName);
246
247 // move "external" pointer to the next variable in the array
248 if (varType == 'F') {
249 float *ptr = (float *)external;
250 ++ptr;
251 external = (void *)ptr;
252 } else if (varType == 'I') {
253 int *ptr = (int *)external;
254 ++ptr;
255 external = (void *)ptr;
256 } else {
257 Error("TMVA::DataSetInfo::AddVariablesArray", "'%c' variable type is not supported", varType);
258 }
259 }
260 fVarArrays[regexpr] = size;
261 fNeedsRebuilding = kTRUE;
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// add a variable (can be a complex expression) to the set of
266/// variables used in the MV analysis
267
269 const TString& title,
270 const TString& unit,
271 Double_t min, Double_t max,
273 void* external )
274{
275 TString regexpr = expression; // remove possible blanks
276 regexpr.ReplaceAll(" ", "" );
277 char type='F';
278 fTargets.push_back(VariableInfo( regexpr, title, unit,
279 fTargets.size()+1, type, external, min,
280 max, normalized ));
281 fNeedsRebuilding = kTRUE;
282 return fTargets.back();
283}
284
285////////////////////////////////////////////////////////////////////////////////
286/// add target with given VariableInfo
287
289 fTargets.push_back(VariableInfo( varInfo ));
290 fNeedsRebuilding = kTRUE;
291 return fTargets.back();
292}
293
294////////////////////////////////////////////////////////////////////////////////
295/// add a spectator (can be a complex expression) to the set of spectator variables used in
296/// the MV analysis
297
299 const TString& title,
300 const TString& unit,
301 Double_t min, Double_t max, char type,
302 Bool_t normalized, void* external )
303{
304 TString regexpr = expression; // remove possible blanks
305 regexpr.ReplaceAll(" ", "" );
306 fSpectators.push_back(VariableInfo( regexpr, title, unit,
307 fSpectators.size()+1, type, external, min, max, normalized ));
308 fNeedsRebuilding = kTRUE;
309 return fSpectators.back();
310}
311
312////////////////////////////////////////////////////////////////////////////////
313/// add spectator with given VariableInfo
314
316 fSpectators.push_back(VariableInfo( varInfo ));
317 fNeedsRebuilding = kTRUE;
318 return fSpectators.back();
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// find variable by name
323
325{
326 for (UInt_t ivar=0; ivar<GetNVariables(); ivar++)
327 if (var == GetVariableInfo(ivar).GetInternalName()) return ivar;
328
329 for (UInt_t ivar=0; ivar<GetNVariables(); ivar++)
330 Log() << kINFO << Form("Dataset[%s] : ",fName.Data()) << GetVariableInfo(ivar).GetInternalName() << Endl;
331
332 Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << "<FindVarIndex> Variable \'" << var << "\' not found." << Endl;
333
334 return -1;
335}
336
337////////////////////////////////////////////////////////////////////////////////
338/// set the weight expressions for the classes
339/// if class name is specified, set only for this class
340/// if class name is unknown, register new class with this name
341
343{
344 if (className != "") {
345 TMVA::ClassInfo* ci = AddClass(className);
346 ci->SetWeight( expr );
347 }
348 else {
349 // no class name specified, set weight for all classes
350 if (fClasses.empty()) {
351 Log() << kWARNING << Form("Dataset[%s] : ",fName.Data()) << "No classes registered yet, cannot specify weight expression!" << Endl;
352 }
353 for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
354 (*it)->SetWeight( expr );
355 }
356 }
357}
358
359////////////////////////////////////////////////////////////////////////////////
360
362{
363 GetClassInfo(className)->SetCorrelationMatrix(matrix);
364}
365
366////////////////////////////////////////////////////////////////////////////////
367/// set the cut for the classes
368
369void TMVA::DataSetInfo::SetCut( const TCut& cut, const TString& className )
370{
371 if (className == "") { // if no className has been given set the cut for all the classes
372 for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
373 (*it)->SetCut( cut );
374 }
375 }
376 else {
377 TMVA::ClassInfo* ci = AddClass(className);
378 ci->SetCut( cut );
379 }
380}
381
382////////////////////////////////////////////////////////////////////////////////
383/// set the cut for the classes
384
385void TMVA::DataSetInfo::AddCut( const TCut& cut, const TString& className )
386{
387 if (className == "") { // if no className has been given set the cut for all the classes
388 for (std::vector<ClassInfo*>::iterator it = fClasses.begin(); it < fClasses.end(); ++it) {
389 const TCut& oldCut = (*it)->GetCut();
390 (*it)->SetCut( oldCut+cut );
391 }
392 }
393 else {
394 TMVA::ClassInfo* ci = AddClass(className);
395 ci->SetCut( ci->GetCut()+cut );
396 }
397}
398
399////////////////////////////////////////////////////////////////////////////////
400/// returns list of variables
401
402std::vector<TString> TMVA::DataSetInfo::GetListOfVariables() const
403{
404 std::vector<TString> vNames;
405 std::vector<TMVA::VariableInfo>::const_iterator viIt = GetVariableInfos().begin();
406 for(;viIt != GetVariableInfos().end(); ++viIt) vNames.push_back( (*viIt).GetInternalName() );
407
408 return vNames;
409}
410
411////////////////////////////////////////////////////////////////////////////////
412/// calculates the correlation matrices for signal and background,
413/// prints them to standard output, and fills 2D histograms
414
416{
417
418 Log() << kHEADER //<< Form("Dataset[%s] : ",fName.Data())
419 << "Correlation matrix (" << className << "):" << Endl;
420 gTools().FormattedOutput( *CorrelationMatrix( className ), GetListOfVariables(), Log() );
421}
422
423////////////////////////////////////////////////////////////////////////////////
424
426 const TString& hName,
427 const TString& hTitle ) const
428{
429 if (m==0) return 0;
430
431 const UInt_t nvar = GetNVariables();
432
433 // workaround till the TMatrix templates are commonly used
434 // this keeps backward compatibility
435 TMatrixF* tm = new TMatrixF( nvar, nvar );
436 for (UInt_t ivar=0; ivar<nvar; ivar++) {
437 for (UInt_t jvar=0; jvar<nvar; jvar++) {
438 (*tm)(ivar, jvar) = (*m)(ivar,jvar);
439 }
440 }
441
442 TH2F* h2 = new TH2F( *tm );
443 h2->SetNameTitle( hName, hTitle );
444
445 for (UInt_t ivar=0; ivar<nvar; ivar++) {
446 h2->GetXaxis()->SetBinLabel( ivar+1, GetVariableInfo(ivar).GetTitle() );
447 h2->GetYaxis()->SetBinLabel( ivar+1, GetVariableInfo(ivar).GetTitle() );
448 }
449
450 // present in percent, and round off digits
451 // also, use absolute value of correlation coefficient (ignore sign)
452 h2->Scale( 100.0 );
453 for (UInt_t ibin=1; ibin<=nvar; ibin++) {
454 for (UInt_t jbin=1; jbin<=nvar; jbin++) {
456 }
457 }
458
459 // style settings
460 const Float_t labelSize = 0.055;
461 h2->SetStats( 0 );
464 h2->SetMarkerSize( 1.5 );
465 h2->SetMarkerColor( 0 );
466 h2->LabelsOption( "d" ); // diagonal labels on x axis
467 h2->SetLabelOffset( 0.011 );// label offset on x axis
468 h2->SetMinimum( -100.0 );
469 h2->SetMaximum( +100.0 );
470
471 // -------------------------------------------------------------------------------------
472 // just in case one wants to change the position of the color palette axis
473 // -------------------------------------------------------------------------------------
474 // gROOT->SetStyle("Plain");
475 // TStyle* gStyle = gROOT->GetStyle( "Plain" );
476 // gStyle->SetPalette( 1, 0 );
477 // TPaletteAxis* paletteAxis
478 // = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject( "palette" );
479 // -------------------------------------------------------------------------------------
480
481 Log() << kDEBUG << Form("Dataset[%s] : ",fName.Data()) << "Created correlation matrix as 2D histogram: " << h2->GetName() << Endl;
482
483 return h2;
484}
485
486////////////////////////////////////////////////////////////////////////////////
487/// returns data set
488
490{
491 if (fDataSet==0 || fNeedsRebuilding) {
492 if (fNeedsRebuilding) Log() << kINFO << "Rebuilding Dataset " << fName << Endl;
493 if (fDataSet != 0)
494 ClearDataSet();
495 // fDataSet = DataSetManager::Instance().CreateDataSet(GetName()); //DSMTEST replaced by following lines
496 if( !fDataSetManager )
497 Log() << kFATAL << Form("Dataset[%s] : ",fName.Data()) << "DataSetManager has not been set in DataSetInfo (GetDataSet() )." << Endl;
498 fDataSet = fDataSetManager->CreateDataSet(GetName());
499
500 fNeedsRebuilding = kFALSE;
501 }
502 return fDataSet;
503}
504
505////////////////////////////////////////////////////////////////////////////////
506
508{
509 if(all)
510 return fSpectators.size();
511 UInt_t nsp(0);
512 for(std::vector<VariableInfo>::const_iterator spit=fSpectators.begin(); spit!=fSpectators.end(); ++spit) {
513 if(spit->GetVarType()!='C') nsp++;
514 }
515 return nsp;
516}
517
518////////////////////////////////////////////////////////////////////////////////
519
521{
522 Int_t maxL = 0;
523 for (UInt_t cl = 0; cl < GetNClasses(); cl++) {
524 if (TString(GetClassInfo(cl)->GetName()).Length() > maxL) maxL = TString(GetClassInfo(cl)->GetName()).Length();
525 }
526
527 return maxL;
528}
529
530////////////////////////////////////////////////////////////////////////////////
531
533{
534 Int_t maxL = 0;
535 for (UInt_t i = 0; i < GetNVariables(); i++) {
536 if (TString(GetVariableInfo(i).GetExpression()).Length() > maxL) maxL = TString(GetVariableInfo(i).GetExpression()).Length();
537 }
538
539 return maxL;
540}
541
542////////////////////////////////////////////////////////////////////////////////
543
545{
546 Int_t maxL = 0;
547 for (UInt_t i = 0; i < GetNTargets(); i++) {
548 if (TString(GetTargetInfo(i).GetExpression()).Length() > maxL) maxL = TString(GetTargetInfo(i).GetExpression()).Length();
549 }
550
551 return maxL;
552}
553
554////////////////////////////////////////////////////////////////////////////////
555
557 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;
558 return fTrainingSumSignalWeights;
559}
560
561////////////////////////////////////////////////////////////////////////////////
562
564 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;
565 return fTrainingSumBackgrWeights;
566}
567
568////////////////////////////////////////////////////////////////////////////////
569
571 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;
572 return fTestingSumSignalWeights ;
573}
574
575////////////////////////////////////////////////////////////////////////////////
576
578 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;
579 return fTestingSumBackgrWeights ;
580}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:148
TMatrixT< Float_t > TMatrixF
Definition TMatrixFfwd.h:23
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2570
const_iterator begin() const
const_iterator end() const
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
Definition TAttAxis.cxx:184
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition TAttMarker.h:41
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition TAttMarker.h:48
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
Definition TAxis.cxx:891
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:5560
void SetNameTitle(const char *name, const char *title) override
Change the name and title of this histogram.
Definition TH1.cxx:9207
TAxis * GetXaxis()
Definition TH1.h:571
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:652
TAxis * GetYaxis()
Definition TH1.h:572
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:653
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6815
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:9223
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:345
Service class for 2-D histogram classes.
Definition TH2.h:30
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Definition TH2.cxx:2604
Double_t GetBinContent(Int_t binx, Int_t biny) const override
Definition TH2.h:97
Class that contains all the information of a class.
Definition ClassInfo.h:49
const TMatrixD * GetCorrelationMatrix() const
Definition ClassInfo.h:66
Bool_t HasCuts() const
UInt_t GetNSpectators(bool all=kTRUE) const
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=nullptr)
add a variable (can be a complex expression) to the set of variables used in the MV analysis
ClassInfo * AddClass(const TString &className)
const TMatrixD * CorrelationMatrix(const TString &className) const
Int_t GetTargetNameMaxLength() const
virtual ~DataSetInfo()
destructor
Double_t GetTestingSumBackgrWeights()
void SetMsgType(EMsgType t) const
DataSet * GetDataSet() const
returns data set
DataSetInfo(const TString &name="Default")
constructor
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
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()
VariableInfo & AddTarget(const TString &expression, const TString &title, const TString &unit, Double_t min, Double_t max, Bool_t normalized=kTRUE, void *external=nullptr)
add a variable (can be a complex expression) to the set of variables used in the MV analysis
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
Int_t GetVariableNameMaxLength() const
Bool_t IsSignal(const Event *ev) 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=nullptr)
add a spectator (can be a complex expression) to the set of spectator variables used in the MV analys...
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
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=nullptr)
add an array of variables identified by an expression corresponding to an array entry in the tree
std::vector< Float_t > * GetTargetsForMulticlass(const Event *ev)
void SetCorrelationMatrix(const TString &className, TMatrixD *matrix)
void ClearDataSet() const
Class that contains all the data information.
Definition DataSet.h:58
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
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:862
Class for type info of MVA input variable.
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
Mother of all ROOT objects.
Definition TObject.h:42
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:427
std::size_t size() const
Definition TString.h:428
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:2459
Tools & gTools()
MsgLogger & Endl(MsgLogger &ml)
Definition MsgLogger.h:148
TMarker m
Definition textangle.C:8