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 65 fDataSetManager(
NULL),
68 fNeedsRebuilding(
kTRUE ),
73 fNormalization(
"NONE" ),
75 fTrainingSumSignalWeights(-1),
76 fTrainingSumBackgrWeights(-1),
77 fTestingSumSignalWeights (-1),
78 fTestingSumBackgrWeights (-1),
82 fTargetsForMulticlass(0),
121 if (theClass)
return theClass;
126 Log() <<
kINFO <<
"Added class \"" << className <<
"\"\t with internal class number " 138 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
139 if ((*it)->GetName() ==
name)
return (*it);
189 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
270 Bool_t normalized,
void* external )
300 Log() <<
kFATAL <<
"<FindVarIndex> Variable \'" << var <<
"\' not found." <<
Endl;
312 if (className !=
"") {
319 Log() <<
kWARNING <<
"No classes registered yet, cannot specify weight expression!" <<
Endl;
321 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
322 (*it)->SetWeight( expr );
339 if (className ==
"") {
340 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
341 (*it)->SetCut( cut );
355 if (className ==
"") {
356 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); it++) {
357 const TCut& oldCut = (*it)->GetCut();
358 (*it)->SetCut( oldCut+cut );
372 std::vector<TString> vNames;
373 std::vector<TMVA::VariableInfo>::const_iterator viIt =
GetVariableInfos().begin();
374 for(;viIt !=
GetVariableInfos().end(); viIt++) vNames.push_back( (*viIt).GetExpression() );
385 Log() <<
kINFO <<
"Correlation matrix (" << className <<
"):" <<
Endl;
402 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
403 for (
UInt_t jvar=0; jvar<nvar; jvar++) {
404 (*tm)(ivar, jvar) = (*m)(ivar,jvar);
411 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
419 for (
UInt_t ibin=1; ibin<=nvar; ibin++) {
420 for (
UInt_t jbin=1; jbin<=nvar; jbin++) {
426 const Float_t labelSize = 0.055;
461 Log() <<
kFATAL <<
"DataSetManager has not been set in DataSetInfo (GetDataSet() )." <<
Endl;
476 for(std::vector<VariableInfo>::const_iterator spit=
fSpectators.begin(); spit!=
fSpectators.end(); ++spit) {
477 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
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
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
list of variable expressions/internal names
DataSet * CreateDataSet(const TString &dsiName)
Creates the singleton dataset.
virtual void SetMinimum(Double_t minimum=-1111)
std::vector< ClassInfo * > fClasses
list of spectators expressions/internal names
void ClearDataSet() const
UInt_t GetNClasses() const
std::vector< VariableInfo > fSpectators
list of targets expressions/internal names
void AddCut(const TCut &cut, const TString &className)
set the cut for the classes
std::vector< VariableInfo > fVariables
flag if rebuilding of dataset is needed (after change of cuts, vars, etc.)
Double_t GetTrainingSumSignalWeights()
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...
DataSet * fDataSet
name of the dataset info object
const TString & GetName() const
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)
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)
MsgLogger * fLogger
all targets 0 except the one with index==classNumber
Double_t fTrainingSumBackgrWeights
Double_t GetTestingSumSignalWeights()
Service class for 2-Dim histogram classes.
ClassInfo * GetClassInfo(Int_t clNum) const
const TMatrixD * CorrelationMatrix(const TString &className) const
2-D histogram with a float per channel (see TH1 documentation)}
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...
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)
Int_t FindVarIndex(const TString &) const
find variable by name
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.
UInt_t fSignalClass
Verbosity.
ClassInfo * AddClass(const TString &className)
Int_t GetClassNameMaxLength() const
virtual const char * GetName() const
Returns name of object.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Mother of all ROOT objects.
virtual const char * GetTitle() const
Returns title of object.
std::vector< Float_t > * fTargetsForMulticlass
index of the class with the name signal
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.
Bool_t fNeedsRebuilding
dataset, owned by this datasetinfo object
Double_t fTestingSumBackgrWeights
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.