Skip to content
Snippets Groups Projects
Commit a2c685c4 authored by Eckhard von Toerne's avatar Eckhard von Toerne
Browse files

copying recent macro work from dev to trunk

git-svn-id: http://root.cern.ch/svn/root/trunk@37191 27541ba8-7e3a-0410-8455-c3a389f83636
parent 52d4488c
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,7 @@ void TMVARegression( TString myMethodList = "" )
if (Use["BDTG"])
factory->BookMethod( TMVA::Types::kBDT, "BDTG",
"!H:!V:NTrees=1000::BoostType=Grad:Shrinkage=0.3:!UseBaggedGrad:SeparationType=GiniIndex:nCuts=20:NNodesMax=10" );
"!H:!V:NTrees=2000::BoostType=Grad:Shrinkage=0.1:UseBaggedGrad:GradBaggingFraction=0.1:SeparationType=RegressionVariance:nCuts=20:MaxDepth=3:NNodesMax=15" );
// --------------------------------------------------------------------------------------------------
// ---- Now you can tell the factory to train, test, and evaluate the MVAs
......
......@@ -250,7 +250,7 @@ int main( int argc, char** argv )
if (Use["BDTG"])
factory->BookMethod( TMVA::Types::kBDT, "BDTG",
"!H:!V:NTrees=1000::BoostType=Grad:Shrinkage=0.3:!UseBaggedGrad:SeparationType=GiniIndex:nCuts=20:NNodesMax=10" );
"!H:!V:NTrees=2000::BoostType=Grad:Shrinkage=0.1:UseBaggedGrad:GradBaggingFraction=0.1:SeparationType=RegressionVariance:nCuts=20:MaxDepth=3:NNodesMax=15" );
// --------------------------------------------------------------------------------------------------
// ---- Now you can tell the factory to train, test, and evaluate the MVAs
......
......@@ -131,7 +131,7 @@ class StatDialogMVAEffs {
RQ_OBJECT("StatDialogMVAEffs")
public:
public:
StatDialogMVAEffs(const TGWindow* p, Float_t ns, Float_t nb);
virtual ~StatDialogMVAEffs();
......@@ -376,26 +376,26 @@ void StatDialogMVAEffs::ReadHistograms(TFile* file)
TIter keyIt(mDir->GetListOfKeys());
TKey *titkey;
while((titkey = (TKey*)keyIt())) {
if( ! gROOT->GetClass(titkey->GetClassName())->InheritsFrom("TDirectory") ) continue;
if( ! gROOT->GetClass(titkey->GetClassName())->InheritsFrom("TDirectory") ) continue;
MethodInfo* info = new MethodInfo();
TDirectory* titDir = (TDirectory *)titkey->ReadObj();
MethodInfo* info = new MethodInfo();
TDirectory* titDir = (TDirectory *)titkey->ReadObj();
TMVAGlob::GetMethodName(info->methodName,key);
TMVAGlob::GetMethodTitle(info->methodTitle,titDir);
if (info->methodTitle.Length() > maxLenTitle) maxLenTitle = info->methodTitle.Length();
TString hname = "MVA_" + info->methodTitle;
TMVAGlob::GetMethodName(info->methodName,key);
TMVAGlob::GetMethodTitle(info->methodTitle,titDir);
if (info->methodTitle.Length() > maxLenTitle) maxLenTitle = info->methodTitle.Length();
TString hname = "MVA_" + info->methodTitle;
cout << "--- Classifier: " << info->methodTitle << endl;
cout << "--- Classifier: " << info->methodTitle << endl;
info->sig = dynamic_cast<TH1*>(titDir->Get( hname + "_S" ));
info->bgd = dynamic_cast<TH1*>(titDir->Get( hname + "_B" ));
info->origSigE = dynamic_cast<TH1*>(titDir->Get( hname + "_effS" ));
info->origBgdE = dynamic_cast<TH1*>(titDir->Get( hname + "_effB" ));
if (info->origSigE==0 || info->origBgdE==0) { delete info; continue; }
info->SetResultHists();
fInfoList->Add(info);
info->sig = dynamic_cast<TH1*>(titDir->Get( hname + "_S" ));
info->bgd = dynamic_cast<TH1*>(titDir->Get( hname + "_B" ));
info->origSigE = dynamic_cast<TH1*>(titDir->Get( hname + "_effS" ));
info->origBgdE = dynamic_cast<TH1*>(titDir->Get( hname + "_effB" ));
if (info->origSigE==0 || info->origBgdE==0) { delete info; continue; }
info->SetResultHists();
fInfoList->Add(info);
}
}
return;
......@@ -433,11 +433,11 @@ void StatDialogMVAEffs::DrawHistograms()
// and the signal purity and quality
info->effpurS->SetTitle("Cut efficiencies and optimal cut value");
if (info->methodTitle.Contains("Cuts")){
info->effpurS->GetXaxis()->SetTitle( "Signal Efficiency" );
if (info->methodTitle.Contains("Cuts")) {
info->effpurS->GetXaxis()->SetTitle( "Signal Efficiency" );
}
else {
info->effpurS->GetXaxis()->SetTitle( info->methodTitle + " output" );
info->effpurS->GetXaxis()->SetTitle( TString("Cut value applied on ") + info->methodTitle + " output" );
}
info->effpurS->GetYaxis()->SetTitle( "Efficiency (Purity)" );
TMVAGlob::SetFrameStyle( info->effpurS );
......@@ -494,12 +494,12 @@ void StatDialogMVAEffs::DrawHistograms()
info->line1 = tl.DrawLatex( 0.15, 0.23, Form("For %1.0f signal and %1.0f background", fNSignal, fNBackground));
tl.DrawLatex( 0.15, 0.19, "events the maximum S / #sqrt{S+B} is");
info->line2 = tl.DrawLatex( 0.15, 0.15, Form("%3.4f when cutting at %3.4f",
info->maxSignificance,
info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
info->maxSignificance,
info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
// add comment for Method cuts
if (info->methodTitle.Contains("Cuts")){
tl.DrawLatex( 0.13, 0.77, "Method Cuts provides a bundle of cut selections, each tuned to a");
tl.DrawLatex(0.13, 0.74, "different signal efficiency. Shown is the purity for each cut selection.");
tl.DrawLatex( 0.13, 0.77, "Method Cuts provides a bundle of cut selections, each tuned to a");
tl.DrawLatex(0.13, 0.74, "different signal efficiency. Shown is the purity for each cut selection.");
}
// save canvas to file
c->Update();
......@@ -534,7 +534,6 @@ void StatDialogMVAEffs::PrintResults( const MethodInfo* info )
info->line1->SetText( 0.15, 0.23, Form("For %1.0f signal and %1.0f background", fNSignal, fNBackground));
if (info->line2 !=0 ) {
Int_t maxbin = info->sSig->GetMaximumBin();
info->line2->SetText( 0.15, 0.15, Form("%3.4f when cutting at %3.4f", info->maxSignificance,
info->sSig->GetXaxis()->GetBinCenter(maxbin)) );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment