7 #if not defined(__CINT__) || defined(__MAKECINT__)
9 #include "TMVA/Factory.h"
10 #include "TMVA/Tools.h"
16 TChain *all =
new TChain(treename.c_str());
18 for (
int i = 0;
i < filecount; ++
i)
23 temp = name+
string(s.str())+extension;
24 all->Add(temp.c_str());
33 TString jobname(factoryname.c_str());
34 TFile *targetFile =
new TFile(outfile.c_str(),
"RECREATE");
35 Factory *factory =
new Factory(jobname,targetFile,
"AnalysisType=Regression");
36 factory->AddRegressionTree(signalTree,1.0);
37 factory->AddVariable(
"track1_pt",
'F');
38 factory->AddVariable(
"track2_pt",
'F');
39 factory->AddVariable(
"track1_phi",
'F');
40 factory->AddVariable(
"track1_phi-track2_phi",
"d#phi",
"rad");
41 factory->AddVariable(
"track1_eta",
'F');
42 factory->AddVariable(
"track1_eta-track2_eta",
"d#eta",
"rad");
43 factory->AddVariable(
"vtx_radius",
"radius",
"cm");
44 factory->AddTarget(
"tvtx_radius",
"radius",
"cm");
46 string track_pT_cut =
"";
49 string tCutInitializer = track_pT_cut;
50 TCut preTraingCuts(tCutInitializer.c_str());
51 factory->PrepareTrainingAndTestTree(preTraingCuts,
"nTrain_Regression=0:nTest_Regression=0");
52 factory->BookMethod(Types::kMLP,
"MLP_ANN",
"HiddenLayers=500");
57 factory->TrainAllMethods();
58 factory->TestAllMethods();
59 factory->EvaluateAllMethods();
67 string treePath =
"/sphenix/user/vassalli/gammasample/conversiononlineanalysis";
68 string treeExtension =
".root";
69 string outname =
"/direct/phenix+u/vassalli/sphenix/single/Training/condorout/vtxTrainNN.root";
70 unsigned int nFiles=200;
72 TChain *signalTree =
handleFile(treePath,treeExtension,
"vtxingTree",nFiles);