63 fDataSetManager(NULL),
66 fNeedsRebuilding(
kTRUE ),
71 fNormalization(
"NONE" ),
73 fTrainingSumSignalWeights(-1),
74 fTrainingSumBackgrWeights(-1),
75 fTestingSumSignalWeights (-1),
76 fTestingSumBackgrWeights (-1),
80 fTargetsForMulticlass(0),
81 fLogger( new
MsgLogger(
"DataSetInfo", kINFO) )
121 if (theClass)
return theClass;
129 Log() << kHEADER <<
Form(
"[%s] : ",
fName.
Data()) <<
"Added class \"" << className <<
"\""<<
Endl;
131 Log() << kDEBUG <<
"\t with internal class number " <<
fClasses.back()->GetNumber() <<
Endl;
143 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
144 if ((*it)->GetName() ==
name)
return (*it);
194 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
223 fVariables.size()+1, varType, external, min, max, normalized ));
275 Bool_t normalized,
void* external )
305 Log() << kFATAL <<
Form(
"Dataset[%s] : ",
fName.
Data()) <<
"<FindVarIndex> Variable \'" << var <<
"\' not found." <<
Endl;
317 if (className !=
"") {
324 Log() << kWARNING <<
Form(
"Dataset[%s] : ",
fName.
Data()) <<
"No classes registered yet, cannot specify weight expression!" <<
Endl;
326 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
327 (*it)->SetWeight( expr );
344 if (className ==
"") {
345 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
346 (*it)->SetCut( cut );
360 if (className ==
"") {
361 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
362 const TCut& oldCut = (*it)->GetCut();
363 (*it)->SetCut( oldCut+cut );
377 std::vector<TString> vNames;
378 std::vector<TMVA::VariableInfo>::const_iterator viIt =
GetVariableInfos().begin();
379 for(;viIt !=
GetVariableInfos().end(); ++viIt) vNames.push_back( (*viIt).GetExpression() );
392 <<
"Correlation matrix (" << className <<
"):" <<
Endl;
409 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
410 for (
UInt_t jvar=0; jvar<nvar; jvar++) {
411 (*tm)(ivar, jvar) = (*m)(ivar,jvar);
418 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
426 for (
UInt_t ibin=1; ibin<=nvar; ibin++) {
427 for (
UInt_t jbin=1; jbin<=nvar; jbin++) {
433 const Float_t labelSize = 0.055;
468 Log() << kFATAL <<
Form(
"Dataset[%s] : ",
fName.
Data()) <<
"DataSetManager has not been set in DataSetInfo (GetDataSet() )." <<
Endl;
483 for(std::vector<VariableInfo>::const_iterator spit=
fSpectators.begin(); spit!=
fSpectators.end(); ++spit) {
484 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...
Class that contains all the information of a class.
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)
Class that contains all the data information.
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
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.
ostringstream derivative to redirect and format output
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.
Class for type info of MVA input variable.
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()
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
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