本文整理汇总了C++中tmva::Reader::FindMVA方法的典型用法代码示例。如果您正苦于以下问题:C++ Reader::FindMVA方法的具体用法?C++ Reader::FindMVA怎么用?C++ Reader::FindMVA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tmva::Reader
的用法示例。
在下文中一共展示了Reader::FindMVA方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeclassification
void makeclassification() {
Float_t *vars = new Float_t[10];
//initialize TMVA Reader (example here is diphoton mva from higgs->gamma gamma mva analysis)
TMVA::Reader* tmva = new TMVA::Reader();
tmva->AddVariable("masserrsmeared/mass", &vars[0]);
tmva->AddVariable("masserrsmearedwrongvtx/mass", &vars[1]);
tmva->AddVariable("vtxprob", &vars[2]);
tmva->AddVariable("ph1.pt/mass", &vars[3]);
tmva->AddVariable("ph2.pt/mass", &vars[4]);
tmva->AddVariable("ph1.eta", &vars[5]);
tmva->AddVariable("ph2.eta", &vars[6]);
tmva->AddVariable("TMath::Cos(ph1.phi-ph2.phi)" , &vars[7]);
tmva->AddVariable("ph1.idmva", &vars[8]);
tmva->AddVariable("ph2.idmva", &vars[9]);
tmva->BookMVA("BDTG","/afs/cern.ch/user/b/bendavid/cmspublic/diphotonmvaApr1/HggBambu_SMDipho_Jan16_BDTG.weights.xml");
//tmva->BookMVA("BDTG","/scratch/bendavid/root/HggBambu_SMDipho_Jan16_BDTG.weights.xml");
TMVA::MethodBDT *bdt = dynamic_cast<TMVA::MethodBDT*>(tmva->FindMVA("BDTG"));
//enable root i/o for objects with reflex dictionaries in standalone root mode
ROOT::Cintex::Cintex::Enable();
//open output root file
TFile *fout = new TFile("gbrtest.root","RECREATE");
//create GBRForest from tmva object
GBRForest *gbr = new GBRForest(bdt);
//write to file
fout->WriteObject(gbr,"gbrtest");
fout->Close();
}