for ifile in inFileList: inf = r.TFile(path + "/" + ifile) inputFiles.append(inf) pass canvs = [] for key in inputFiles[0].GetListOfKeys(): histos = [] print key.GetName() c = r.TCanvas() for i_f in range(0, len(inputFiles)): histos.append(inputFiles[i_f].Get(key.GetName())) histos[i_f].SetMarkerColor(colors[i_f]) histos[i_f].SetLineColor(colors[i_f]) pass canvs.append( utils.MakePlot(key.GetName(), outdir, histos, legends, ".png", LogY=True, RatioType="Sequential")) pass outF = r.TFile("slicSingleMu_compMC.root", "RECREATE") outF.cd() for canv in canvs: canv.Write() outF.Close()
if "Shared" in histos[0].GetName(): y_max = 1 if ("nHits_2d" in histos[0].GetName()): y_max = histos[1].GetMaximum() * 1.3 Rmin = 0.5 Rmax = 2 xmin = 6 Norm = False basename = sel[0].split("_")[-1] utils.MakePlot(basename + "_" + particle + "_" + var + "_h", outdir, histos, legends, ".pdf", ymin=0, ymax=y_max, RatioType="Sequential", RatioMin=Rmin, RatioMax=Rmax, drawOptions="pe", Normalise=Norm, Xmin=xmin, Xmax=xmax) pass pass pass #Cutflow histos = [] for i_f in xrange(len(inputFiles)): print sel[i_f] + "/" + sel[i_f] + "cutflow" histos.append(inputFiles[i_f].Get(sel[i_f] + "/" + sel[i_f] + "_cutflow"))
#Unbias residuals for module in modules: histos = [] fits = [] histos_b = [] for i_f in xrange(len(inputFiles)): histo_u = inputFiles[i_f].Get("uresidual_GBL_module_"+module) histos.append(histo_u) #(hNewMean,hNewRMS) = utils.findMeanRMSUsingFWHM(histo_u) fitFunc = utils.singleGausRestricted(histo_u) mu = fitFunc.GetParameter(1) sigma = fitFunc.GetParameter(2) fits.append(str(mu)+" "+str(sigma)) #print "MEAN/RMS (FWHM)", hNewMean, hNewRMS histos_b.append(inputFiles[i_f].Get("bresidual_GBL_module_"+module)) pass #print "uresidual_GBL_module_"+module can = utils.MakePlot("ures_"+module,outdir,histos,legends,".pdf",xtitle="unbiased residual "+module+" [mm]",ytitle="hits-on-track",ymax=0.06,Normalise=True,additionalText=fits) utils.MakePlot("bres_"+module,outdir,histos_b,legends,".pdf",xtitle="biased residual "+module+" [mm]",ytitle="hits-on-track",ymax=0.15,Normalise=True)
ytitle.append('trk z0 [mm]') else: ytitle.append(histos2D[i_f].GetYaxis().GetTitle()) name.append(key.GetName() + '_' + legends[i_f]) histos.append(inputFiles[i_f].Get(selection[i_f]).Get(keyname)) #histos[i_f].SetMarkerColor(colors[i_f]) #histos[i_f].SetLineColor(colors[i_f]) pass canvs += utils.Make2DPlots(name, outdir, histos2D, xtitle, ytitle) canvs.append( utils.MakePlot(key.GetName(), outdir, histos, legends, ".png", LogY=False, RatioType="Sequential", Normalise=False)) canvs.append( utils.MakePlot(key.GetName() + "_log", outdir, histos, legends, ".png", LogY=True, RatioType="Sequential", Normalise=False)) pass utils.makeHTML(outdir, 'SIMPs KF vs GBL (vtxPresel)', selection)
yaxmin = -20 yaxmax = -5 if "vtx_p_svt_z_hh_mu" in keyname: xAxisT = "Vtx P [GeV]" yAxisT = "#mu_z Vtx [mm]" yaxmin = -20 yaxmax = -5 if "vtx_p_svt_z_hh_sigma" in keyname: xAxisT = "Vtx P [GeV]" yAxisT = "#sigma_z Vtx [mm]" yaxmin = 0 yaxmax = 8 print "xAxisT", xAxisT canvs.append( utils.MakePlot(key.GetName(), outdir, histos, legends, ".pdf", xtitle=xAxisT, ytitle=yAxisT, ymin=yaxmin, ymax=yaxmax, LogY=False, RatioType="Sequential", RatioMin=0.25, RatioMax=3.5, drawOptions="pe")) pass