is_first_shybfit = False print shybfit.title print '%6.2f +/- %4.2f' % ( ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError() ), if 'srecofit' in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title)+2:], elif 'struefit' in vars() and struefit.title in plot.title: print plot.title[len(struefit.title)+2:], elif 'sgenfit' in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title)+2:], elif 'shybfit' in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title)+2:], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile('mc_sreco_FitRange%d.root' % int(fitrange)) # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
is_first_sgenfit = False print sgenfit.title elif 'shybfit' in vars() and shybfit.title in plot.title: if is_first_shybfit: is_first_shybfit = False print shybfit.title print '%6.2f +/- %4.2f' % ( ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError() ), if 'srecofit' in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title)+2:], elif 'struefit' in vars() and struefit.title in plot.title: print plot.title[len(struefit.title)+2:], elif 'sgenfit' in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title)+2:], elif 'shybfit' in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title)+2:], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots #ws1.writeToFile('test.root') #ws1.writeToFile('strue_FitRange71.root') ws1.writeToFile('strue_InitialValueFitSystematics10.root') if __name__ == "__main__": import user
m = re.search('(.*_iter)\d+', plot.name) if m: bareName = 'sFit_' + m.groups()[0] else: raise RuntimeError, "Failed to parse fit name `%s'" % plot.name for i in range(plot.niter - 1, plot.niter): ws1.loadSnapshot(bareName + '%d' % i) report.append([ '%6.2f +/- %4.2f' % (ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError()), plot.title, str(i), "%.3g" % plot.chi2s[i] ]) for line in report: print ', '.join(line) ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile('geant_versions.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
is_first_shybfit = False print shybfit.title print '%6.2f +/- %4.2f' % ( ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError() ), if 'srecofit' in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title)+2:], elif 'struefit' in vars() and struefit.title in plot.title: print plot.title[len(struefit.title)+2:], elif 'sgenfit' in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title)+2:], elif 'shybfit' in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title)+2:], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile('mc_sreco_strue_Baseline_Susan.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
is_first_shybfit = False print shybfit.title print '%6.2f +/- %4.2f' % ( ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError() ), if 'srecofit' in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title)+2:], elif 'struefit' in vars() and struefit.title in plot.title: print plot.title[len(struefit.title)+2:], elif 'sgenfit' in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title)+2:], elif 'shybfit' in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title)+2:], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile('mc_sreco_strue_Baseline_mod3.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
if is_first_shybfit: is_first_shybfit = False print shybfit.title print "%6.2f +/- %4.2f" % (ws1.var("#Deltas").getVal(), ws1.var("#Deltas").getError()), if "srecofit" in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title) + 2 :], elif "struefit" in vars() and struefit.title in plot.title: print plot.title[len(struefit.title) + 2 :], elif "sgenfit" in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title) + 2 :], elif "shybfit" in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title) + 2 :], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile("mc_mmMass80_EB_highR9_PhoEt_mmgMass87.2-95.2_cbShape.root") # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
varname = "#Deltas" if plot.pdf in ["gauss_an", "cbShape_an"]: varname = "#mu" print "%6.2f +/- %4.2f" % (ws1.var(varname).getVal(), ws1.var(varname).getError()), if "srecofit" in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title) + 2 :], elif "struefit" in vars() and struefit.title in plot.title: print plot.title[len(struefit.title) + 2 :], elif "sgenfit" in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title) + 2 :], elif "shybfit" in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title) + 2 :], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile("an_mc_sreco_strue_Baseline.root") # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
if m: bareName = 'sFit_' + m.groups()[0] else: raise RuntimeError, "Failed to parse fit name `%s'" % plot.name for i in range (plot.niter-1, plot.niter): ws1.loadSnapshot(bareName + '%d' % i) report.append([ '%6.2f +/- %4.2f' % ( ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError() ), plot.title, str(i), "%.3g" % plot.chi2s[i] ]) for line in report: print ', '.join(line) ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile('geant_versions.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user
is_first_shybfit = False print shybfit.title print '%6.2f +/- %4.2f' % ( ws1.var('#Deltas').getVal(), ws1.var('#Deltas').getError() ), if 'srecofit' in vars() and srecofit.title in plot.title: print plot.title[len(srecofit.title)+2:], elif 'struefit' in vars() and struefit.title in plot.title: print plot.title[len(struefit.title)+2:], elif 'sgenfit' in vars() and sgenfit.title in plot.title: print plot.title[len(sgenfit.title)+2:], elif 'shybfit' in vars() and shybfit.title in plot.title: print plot.title[len(shybfit.title)+2:], else: print plot.title, print i, "%.3g" % plot.chi2s[i] ## <-- loop over plots # ws1.writeToFile('test.root') # ws1.writeToFile('mc_mmMass80_EB_lowR9_PhoEt_mmgMass87.2-95.2_cbShape.root') ws1.writeToFile('an_mc_sreco_strue_Baseline.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt15-20.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt20-25.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt25-30.root') # ws1.writeToFile('mc_mmMass85_EB_lowR9_PhoEt30-100.root') if __name__ == "__main__": import user