116 if (theClass)
return theClass;
124 Log() << kHEADER <<
Form(
"[%s] : ",
fName.Data()) <<
"Added class \"" << className <<
"\""<<
Endl;
126 Log() << kDEBUG <<
"\t with internal class number " <<
fClasses.back()->GetNumber() <<
Endl;
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) {
218 fVariables.size()+1, varType, external, min, max, normalized ));
242 for (
int i = 0; i <
size; ++i) {
245 fVariables.emplace_back(regexpr, newTitle, unit,
fVariables.size() + 1, varType, external, min, max, normalized);
249 fVariables.back().SetInternalName(newVarName);
252 if (varType ==
'F') {
253 float *ptr = (
float *)external;
255 external = (
void *)ptr;
256 }
else if (varType ==
'I') {
257 int *ptr = (
int *)external;
259 external = (
void *)ptr;
261 Error(
"TMVA::DataSetInfo::AddVariablesArray",
"'%c' variable type is not supported", varType);
283 fTargets.size()+1, type, external, min,
306 Bool_t normalized,
void* external )
311 fSpectators.size()+1, type, external, min, max, normalized ));
336 Log() << kFATAL <<
Form(
"Dataset[%s] : ",
fName.Data()) <<
"<FindVarIndex> Variable \'" << var <<
"\' not found." <<
Endl;
348 if (className !=
"") {
355 Log() << kWARNING <<
Form(
"Dataset[%s] : ",
fName.Data()) <<
"No classes registered yet, cannot specify weight expression!" <<
Endl;
357 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
358 (*it)->SetWeight( expr );
375 if (className ==
"") {
376 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
377 (*it)->SetCut( cut );
391 if (className ==
"") {
392 for (std::vector<ClassInfo*>::iterator it =
fClasses.begin(); it <
fClasses.end(); ++it) {
393 const TCut& oldCut = (*it)->GetCut();
394 (*it)->SetCut( oldCut+cut );
408 std::vector<TString> vNames;
409 std::vector<TMVA::VariableInfo>::const_iterator viIt =
GetVariableInfos().begin();
410 for(;viIt !=
GetVariableInfos().end(); ++viIt) vNames.push_back( (*viIt).GetInternalName() );
423 <<
"Correlation matrix (" << className <<
"):" <<
Endl;
440 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
441 for (
UInt_t jvar=0; jvar<nvar; jvar++) {
442 (*tm)(ivar, jvar) = (*
m)(ivar,jvar);
449 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
457 for (
UInt_t ibin=1; ibin<=nvar; ibin++) {
458 for (
UInt_t jbin=1; jbin<=nvar; jbin++) {
464 const Float_t labelSize = 0.055;
485 Log() << kDEBUG <<
Form(
"Dataset[%s] : ",
fName.Data()) <<
"Created correlation matrix as 2D histogram: " << h2->
GetName() <<
Endl;
501 Log() << kFATAL <<
Form(
"Dataset[%s] : ",
fName.Data()) <<
"DataSetManager has not been set in DataSetInfo (GetDataSet() )." <<
Endl;
516 for(std::vector<VariableInfo>::const_iterator spit=
fSpectators.begin(); spit!=
fSpectators.end(); ++spit) {
517 if(spit->GetVarType()!=
'C') nsp++;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
TMatrixT< Double_t > TMatrixD
TMatrixT< Float_t > TMatrixF
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetBinLabel(Int_t bin, const char *label)
Set label for bin.
A specialized string object used for TTree selections.
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Sort bins with labels or set option(s) to draw axis with labels.
void SetNameTitle(const char *name, const char *title) override
Change the name and title of this histogram.
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetMinimum(Double_t minimum=-1111)
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a float per channel (see TH1 documentation)
Service class for 2-D histogram classes.
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Double_t GetBinContent(Int_t binx, Int_t biny) const override
Class that contains all the information of a class.
const TMatrixD * GetCorrelationMatrix() const
const TCut & GetCut() const
void SetCut(const TCut &cut)
void SetWeight(const TString &weight)
std::vector< VariableInfo > & GetVariableInfos()
UInt_t GetNVariables() 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
TDirectory * fOwnRootDir
ROOT output dir.
std::map< TString, int > fVarArrays
ClassInfo * AddClass(const TString &className)
const TMatrixD * CorrelationMatrix(const TString &className) const
std::vector< ClassInfo * > fClasses
name and other infos of the classes
Double_t fTrainingSumBackgrWeights
Int_t GetTargetNameMaxLength() const
virtual ~DataSetInfo()
destructor
Double_t fTestingSumSignalWeights
Double_t GetTestingSumBackgrWeights()
void SetMsgType(EMsgType t) const
UInt_t GetNClasses() const
UInt_t GetNTargets() const
Bool_t fNeedsRebuilding
flag if rebuilding of dataset is needed (after change of cuts, vars, etc.)
std::vector< VariableInfo > fSpectators
list of spectators expressions/internal names
Bool_t fVerbose
Verbosity.
DataSet * GetDataSet() const
returns data set
DataSetInfo(const TString &name="Default")
constructor
MsgLogger * fLogger
! message logger
TH2 * CreateCorrelationMatrixHist(const TMatrixD *m, const TString &hName, const TString &hTitle) const
std::vector< TString > GetListOfVariables() const
returns list of variables
DataSet * fDataSet
dataset, owned by this datasetinfo object
const char * GetName() const override
Returns name of object.
ClassInfo * GetClassInfo(Int_t clNum) const
Double_t GetTrainingSumSignalWeights()
Double_t fTrainingSumSignalWeights
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,...
std::vector< VariableInfo > fTargets
list of targets expressions/internal names
std::vector< Float_t > * fTargetsForMulticlass
-> all targets 0 except the one with index==classNumber
UInt_t fSignalClass
index of the class with the name signal
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 & GetVariableInfo(Int_t i)
std::vector< VariableInfo > fVariables
list of variable expressions/internal names
Int_t GetVariableNameMaxLength() const
Double_t fTestingSumBackgrWeights
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...
VariableInfo & GetTargetInfo(Int_t i)
TMVA::DataSetManager * fDataSetManager
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)
TString fName
name of the dataset info object
void SetCorrelationMatrix(const TString &className, TMatrixD *matrix)
void ClearDataSet() const
Class that contains all the data information.
ostringstream derivative to redirect and format output
Class for type info of MVA input variable.
const char * GetName() const override
Returns name of object.
virtual const char * GetTitle() const
Returns title of object.
TObject()
TObject constructor.
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
MsgLogger & Endl(MsgLogger &ml)