41 #ifndef ROOT_TMVA_MsgLogger 44 #ifndef ROOT_TMVA_Tools 47 #ifndef ROOT_TMVA_DataSet 50 #ifndef ROOT_TMVA_DataSetInfo 53 #ifndef ROOT_TMVA_DataSetManager 56 #ifndef ROOT_TMVA_Event 69 fDataSetManager(
NULL),
72 fNeedsRebuilding(
kTRUE ),
77 fNormalization(
"NONE" ),
79 fTrainingSumSignalWeights(-1),
80 fTrainingSumBackgrWeights(-1),
81 fTestingSumSignalWeights (-1),
82 fTestingSumBackgrWeights (-1),
86 fTargetsForMulticlass(0),
125 if (theClass)
return theClass;
147 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
148 if ((*it)->GetName() ==
name)
return (*it);
198 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
227 fVariables.size()+1, varType, external, min, max, normalized ));
279 Bool_t normalized,
void* external )
321 if (className !=
"") {
330 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
331 (*it)->SetWeight( expr );
348 if (className ==
"") {
349 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
350 (*it)->SetCut( cut );
364 if (className ==
"") {
365 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
366 const TCut& oldCut = (*it)->GetCut();
367 (*it)->SetCut( oldCut+cut );
381 std::vector<TString> vNames;
382 std::vector<TMVA::VariableInfo>::const_iterator viIt =
GetVariableInfos().begin();
383 for(;viIt !=
GetVariableInfos().end(); viIt++) vNames.push_back( (*viIt).GetExpression() );
396 <<
"Correlation matrix (" << className <<
"):" <<
Endl;
413 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
414 for (
UInt_t jvar=0; jvar<nvar; jvar++) {
415 (*tm)(ivar, jvar) = (*m)(ivar,jvar);
422 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
430 for (
UInt_t ibin=1; ibin<=nvar; ibin++) {
431 for (
UInt_t jbin=1; jbin<=nvar; jbin++) {
437 const Float_t labelSize = 0.055;
472 Log() <<
kFATAL <<
Form(
"Dataset[%s] : ",
fName.
Data()) <<
"DataSetManager has not been set in DataSetInfo (GetDataSet() )." <<
Endl;
487 for(std::vector<VariableInfo>::const_iterator spit=
fSpectators.begin(); spit!=
fSpectators.end(); ++spit) {
488 if(spit->GetVarType()!=
'C') nsp++;
virtual const char * GetName() const
Returns name of object.
virtual void SetNameTitle(const char *name, const char *title)
Change the name and title of this histogram.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
UInt_t GetNVariables() const
MsgLogger & Endl(MsgLogger &ml)
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 ...
virtual void SetMaximum(Double_t maximum=-1111)
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Set option(s) to draw axis with labels.
const TString & GetInternalName() const
void SetCut(const TCut &cut, const TString &className)
set the cut for the classes
TMatrixT< Float_t > TMatrixF
TString & ReplaceAll(const TString &s1, const TString &s2)
std::vector< TString > GetListOfVariables() const
returns list of variables
std::vector< VariableInfo > fTargets
DataSet * CreateDataSet(const TString &dsiName)
Creates the singleton dataset.
Int_t GetTargetNameMaxLength() const
virtual void SetMinimum(Double_t minimum=-1111)
std::vector< ClassInfo * > fClasses
void ClearDataSet() const
UInt_t GetNClasses() const
std::vector< VariableInfo > fSpectators
void AddCut(const TCut &cut, const TString &className)
set the cut for the classes
std::vector< VariableInfo > fVariables
Double_t GetTrainingSumSignalWeights()
const TString & GetExpression() 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...
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
void SetWeight(const TString &weight)
virtual ~DataSetInfo()
destructor
Double_t fTrainingSumSignalWeights
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
MsgLogger & Log() const
message logger
void PrintCorrelationMatrix(const TString &className)
calculates the correlation matrices for signal and background, prints them to standard output...
void SetMinType(EMsgType minType)
Double_t fTestingSumSignalWeights
DataSetInfo(const TString &name="Default")
constructor
A specialized string object used for TTree selections.
void SetCorrelationMatrix(const TString &className, TMatrixD *matrix)
void SetCorrelationMatrix(TMatrixD *matrix)
Double_t fTrainingSumBackgrWeights
UInt_t GetNTargets() const
Double_t GetTestingSumSignalWeights()
Service class for 2-Dim histogram classes.
ClassInfo * GetClassInfo(Int_t clNum) const
const TMatrixD * CorrelationMatrix(const TString &className) const
tomato 2-D histogram with a float per channel (see TH1 documentation)}
VariableInfo & GetTargetInfo(Int_t i)
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...
char * Form(const char *fmt,...)
UInt_t GetNSpectators(bool all=kTRUE) const
void SetMsgType(EMsgType t) const
void PrintClasses() const
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels The size is expressed in per cent of the pad width.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Int_t FindVarIndex(const TString &) const
find variable by name
Int_t GetVariableNameMaxLength() const
Double_t GetTrainingSumBackgrWeights()
const TMatrixD * GetCorrelationMatrix() const
void SetCut(const TCut &cut)
VariableInfo & GetVariableInfo(Int_t i)
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
ClassInfo * AddClass(const TString &className)
Int_t GetClassNameMaxLength() const
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetTitle() const
Returns title of object.
std::vector< Float_t > * fTargetsForMulticlass
const TCut & GetCut() const
TMVA::DataSetManager * fDataSetManager
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
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 ...
Bool_t IsSignal(const Event *ev) const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Double_t fTestingSumBackgrWeights
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
DataSet * GetDataSet() const
returns data set
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
std::vector< VariableInfo > & GetVariableInfos()
Double_t GetTestingSumBackgrWeights()
std::vector< Float_t > * GetTargetsForMulticlass(const Event *ev)
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
const char * Data() const