Example #1
0

#!! Close the output file to avoid memory leak
'''


#WRITE INFOFILE
infofile = open(MVAdir+factoryname+'_'+MVAname+'.info','w')
print '@DEBUG: output infofile name'
print infofile

info=mvainfo(MVAname)
info.factoryname=factoryname
info.factorysettings=factorysettings
info.MVAtype=MVAtype
info.MVAsettings=MVAsettings
info.weightfilepath=MVAdir
info.path=path
info.varset=treeVarSet
info.vars=MVA_Vars['Nominal']
pickle.dump(info,infofile)
infofile.close()

print '\n-----> Output File: ', fnameOutput





# Open the GUi
#temp_string = 'root -l ../src/TMVAGui.C\(\"test.root\"\)'
Example #2
0
#    cur = con.cursor()
#    cur.execute("create table if not exists trainings (Roc_integral real, Separation real, Significance real, Ks_signal real, Ks_background real, Roc_integral_train real, Separation_train real, MVASettings text)");
#    cur.execute("insert into trainings values(?,?,?,?,?,?,?,?)",(roc_integral_test,separation_test,significance,ks_signal,ks_bkg,roc_integral_train,separation_train,MVAsettings));
##!! here is unlocked
#
##!! Close the output file to avoid memory leak
#output.Close()

#WRITE INFOFILE
infofile = open(MVAdir + factoryname + '_' + MVAname + '.info', 'w')
print '@DEBUG: output infofile name'
print infofile

info = mvainfo(MVAname)
info.factoryname = factoryname
info.factorysettings = factorysettings
info.MVAtype = MVAtype
info.MVAsettings = MVAsettings
info.weightfilepath = MVAdir
info.path = path
info.varset = treeVarSet
info.vars = MVA_Vars['Nominal']
pickle.dump(info, infofile)
infofile.close()

# open the TMVA Gui
#if gui == True:
#    ROOT.gROOT.ProcessLine( ".L myutils/TMVAGui.C")
#    ROOT.gROOT.ProcessLine( "TMVAGui(\"%s\")" % fnameOutput )
#    ROOT.gApplication.Run()