50 std::cout << std::endl <<
"==> Start TMVAClassificationCategory" << std::endl;
55 bool batchMode =
false;
58 TString outfileName(
"TMVA.root" );
63 std::string factoryOptions(
"!V:!Silent:Transformations=I;D;P;G,D" );
64 if (batchMode) factoryOptions +=
":!Color:!DrawProgressBar";
84 fname =
TString(
gROOT->GetTutorialsDir()) +
"/tmva/data/";
87 else fname +=
"toy_sigbkg_categ_varoff.root";
90 std::cout <<
"--- TMVAClassificationCategory: Accessing " << fname << std::endl;
95 std::cout <<
"ERROR: could not open data file: " << fname << std::endl;
116 "nTrain_Signal=0:nTrain_Background=0:SplitMode=Random:NormMode=NumEvents:!V" );
125 "!H:!V:TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=20:NSmoothBkg[0]=20:NSmoothBkg[1]=10:NSmooth=1:NAvEvtPerBin=50" );
131 TString theCat1Vars =
"var1:var2:var3:var4";
144 "Category_Likelihood_1",
"!H:!V:TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=20:NSmoothBkg[0]=20:NSmoothBkg[1]=10:NSmooth=1:NAvEvtPerBin=50" );
146 "Category_Likelihood_2",
"!H:!V:TransformOutput:PDFInterpol=Spline2:NSmoothSig[0]=20:NSmoothBkg[0]=20:NSmoothBkg[1]=10:NSmooth=1:NAvEvtPerBin=50" );
164 std::cout <<
"==> Wrote root file: " << outputFile->
GetName() << std::endl;
165 std::cout <<
"==> TMVAClassificationCategory is done!" << std::endl;
173 int main(
int argc,
char** argv )
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
TMVA::IMethod * AddMethod(const TCut &, const TString &theVariables, Types::EMVA theMethod, const TString &theTitle, const TString &theOptions)
adds sub-classifier for a category
int main(int argc, char **argv)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
void TMVAClassificationCategory()
void AddSpectator(const TString &expression, const TString &title="", const TString &unit="", Double_t min=0, Double_t max=0)
user inserts target in data set info
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
void AddVariable(const TString &expression, const TString &title, const TString &unit, char type='F', Double_t min=0, Double_t max=0)
user inserts discriminating variable in data set info
void TrainAllMethods()
iterates through all booked methods and calls training
void AddBackgroundTree(TTree *background, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
void TMVAGui(const char *fName="TMVA.root")
A specialized string object used for TTree selections.
R__EXTERN TSystem * gSystem
MethodBase * BookMethod(TString theMethodName, TString methodTitle, TString theOption="")
Book a classifier or regression method.
void EvaluateAllMethods(void)
iterates over all MVAs that have been booked, and calls their evaluation methods
virtual const char * GetName() const
Returns name of object.
void AddSignalTree(TTree *signal, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
A TTree object has a header with a name and a title.
void PrepareTrainingAndTestTree(const TCut &cut, const TString &splitOpt)
prepare the training and test trees -> same cuts for signal and background
virtual void Close(Option_t *option="")
Close a file.