## Customize below struefit.applyDefinitions([DimuonMassMax(80)]) struefits =[] # models = ('gauss lognormal bifurGauss cbShape gamma'.split() + # 'cruijff gsh bifurGsh bw sumGaussGauss'.split()) models = 'bifurGauss'.split() # models += 'sumGaussGauss sumGauss3 sumCruijffGauss sumBwGauss'.split() for subdet_r9_cat in subdet_r9_categories: for lo, hi in BinEdges([10, 12, 15, 20, 25, 30, 100]): ## for lo, hi in BinEdges([10, 12, 15]): for model in models: fit = struefit.clone().applyDefinitions([subdet_r9_cat, PhoEtBin(lo, hi), Model(model)]) if ('EB_lowR9_PhoEt10-12' in fit.name or 'EB_lowR9_PhoEt12-15' in fit.name): fit.fitRangeFraction -= 0.2 if 'EE' in fit.name: fit.fitRangeFraction += 0.1 fit.binContentMax = 100 if fit.fitRangeFraction > 1.: fit.fitRangeFraction = 1. fit.labels.append('Fit Range Coverage: %.0f%%' % (100 * fit.fitRangeFraction)) # fit.labels.append('Fit Range: (%.0f, %.0f)%%' % fit.fitRange) struefits.append(fit) _fits = struefits
struefit = srecofit.clone( name = 'strue_mc', title = 'strue-Fit, Powheg S4', labels = ['Powheg S4'], source = _chains['z'], xName = 's', xTitle = 's_{true} = E^{#gamma}_{reco}/E^{#gamma}_{gen} - 1', xExpression = '100 * (phoE/phoGenE - 1)', cuts = ['isFSR', 'phoGenE > 0'], xRange = (-50, 100), xUnit = '%', nBins = 150, pdf = 'bifurGaus', graphicsExtensions = ['png'], massWindowScale = 1.5, massWindow = (87.2, 95.2), fitScale = 1.2, fitRange = (-50,100), doAutoBinning = True, binContentMax = 200, binContentMin = 35, canvasStyle = 'landscape', doAutoXRange = True, doAutoXRangeZoom = True, doAutoFitRange = True, xRangeSigmaLevel = 5, xRangeSigmaLevelZoom = 2, fitRangeMode = 'Fraction', fitRangeSigmaLevel = 2.0, fitRangeNumberOfEntries = 3000, fitRangeFraction = 0.68, paramLayout = (0.57, 0.92, 0.92), useCustomChi2Calculator = True, )
kRatioGen = 'kRatio({mmgMass}, {mmMass})'.format(mmgMass=mmgMassGen, mmMass=mmMassGen) ## ---------------------------------------------------------------------------- ## Customize below #srecofit.applyDefinitions([Model('cbShape')]) srecofit.applyDefinitions([DimuonMassMax(80)]) _fits = [] for subdet_r9_cat in list(subdet_r9_categories)[:]: for lo, hi in list(BinEdges([10, 12, 15, 20, 25, 30, 100]))[:]: for model in 'gauss cbShape bifurGauss cruijff'.split(): print '+++++', model fit = srecofit.clone() fit.applyDefinitions([subdet_r9_cat, PhoEtBin(lo, hi), Model(model)]) _fits.append(fit) maxIterations = 1 fSigma = 1.5 pullEpsilon = 0.1 mwindows = {} ## Loop over plots for fitter in _fits[:]: ## Log the current fit configuration print "++ Processing", fitter.title print "++ Configuration:" print fitter.pydump()
xUnit='%', nBins=120, fitRange=(-10, 5), pdf='sech', # graphicsExtensions = ['png'], graphicsExtensions=[], paramLayout=(.25, 0.55, 0.92), # x1, x2, y1 labelsLayout=(.25, 0.6), # x1, y1 ) ## ---------------------------------------------------------------------------- ## Customize below _fits = [] for geant in 'g93p01 g94p02 g94cms'.split(): for lo, hi in BinEdges([0.8, 1.2, 1.5, 2, 2.5, 3, 3.5, 4, 5, 10]): fit = srawfit.clone(source=_chains[geant]) fit.name = '_'.join([fit.name, geant]) fit.title = ', '.join([fit.title, geant]) fit.labels.append(geant) fit.applyDefinitions([BremBin(lo, hi)]) _fits.append(fit) maxIterations = 10 fSigma = 2.0 pullEpsilon = 0.01 mwindows = {} ## Loop over plots for fitter in _fits[:4]: ## Log the current fit configuration print "++ Processing", fitter.title
# fitRange = (-50, 100), pdf="gauss", graphicsExtensions=["png"], # graphicsExtensions = [], massWindowScale=1.5, massWindow=(87.2, 95.2), fitScale=1.2, ) ## Default fit of strue = Ereco / Egen - 1 struefit = srecofit.clone( name="strue_mc", title="strue-Fit, Powheg S4", xTitle="s_{true} = E^{#gamma}_{reco}/E^{#gamma}_{gen} - 1", xExpression="100 * (phoE/phoGenE - 1)", xRange=(-20, 40), nBins=(120), fitRange=(-20, 40), fitScale=1.2, cuts=["isFSR", "phoGenE > 0"], ) ## Default fit of sgeb = Egen / Ekingen - 1 mu1 = "mu1Pt,mu1Eta,mu1Phi,0.1056" mu2 = "mu2Pt,mu2Eta,mu2Phi,0.1056" mu1gen = "mu1GenPt,mu1GenEta,mu1GenPhi,0.1056" mu2gen = "mu2GenPt,mu2GenEta,mu2GenPhi,0.1056" phogen = "phoGenEt,phoGenEta,phoGenPhi,0" mmMassGen = "twoBodyMass({mu1}, {mu2})".format(mu1=mu1gen, mu2=mu2gen) mmgMassGen = "threeBodyMass({mu1}, {mu2}, {pho})".format(mu1=mu1gen, mu2=mu2gen, pho=phogen) mmgMassHybrid = "threeBodyMass({mu1}, {mu2}, {pho})".format(mu1=mu1, mu2=mu2, pho=phogen)
struefit = srecofit.clone( name="strue_mc", title="strue-Fit, Powheg S4", labels=[], source=_chains["z"], xName="s", xTitle="E/E_{true} - 1", xExpression="100 * (phoE/phoGenE - 1)", cuts=["isFSR", "phoGenE > 0"], xRange=(-50, 100), xUnit="%", nBins=150, pdf="gauss_an", graphicsExtensions=["eps"], massWindowScale=1.5, massWindow=(70, 110), fitScale=1.2, fitRange=(-50, 100), doAutoBinning=True, binContentMax=200, binContentMin=35, canvasStyle="landscape", doAutoXRange=True, doAutoXRangeZoom=True, doAutoFitRange=True, xRangeSigmaLevel=5, xRangeSigmaLevelZoom=2, fitRangeMode="Fraction", fitRangeSigmaLevel=2.0, fitRangeNumberOfEntries=3000, fitRangeFraction=1.0, paramLayout=(0.65, 0.92, 0.85), useCustomChi2Calculator=True, )
xUnit = '%', nBins = 120, fitRange = (-10, 5), pdf = 'sech', # graphicsExtensions = ['png'], graphicsExtensions = [], paramLayout = (.25, 0.55, 0.92), # x1, x2, y1 labelsLayout = (.25, 0.6), # x1, y1 ) ## ---------------------------------------------------------------------------- ## Customize below _fits = [] for geant in 'g93p01 g94p02 g94cms'.split(): for lo, hi in BinEdges([0.8,1.2,1.5,2,2.5,3,3.5,4,5,10]): fit = srawfit.clone(source = _chains[geant]) fit.name = '_'.join([fit.name, geant]) fit.title = ', '.join([fit.title, geant]) fit.labels.append(geant) fit.applyDefinitions([BremBin(lo, hi)]) _fits.append(fit) maxIterations = 10 fSigma = 2.0 pullEpsilon = 0.01 mwindows = {} ## Loop over plots for fitter in _fits[:4]: ## Log the current fit configuration print "++ Processing", fitter.title
) ## ---------------------------------------------------------------------------- ## Customize below _fits = [] pdfs = [ROOT.TNamed('bifurGsh', 'Bifur. GSH'), #ROOT.TNamed('gsh', 'GSH'), #ROOT.TNamed('sech', 'Hyperbolic Secant'), #ROOT.TNamed('cruijff', 'Cruijff'), #ROOT.TNamed('cbShape', 'Crystal Ball'), ROOT.TNamed('gauss', 'Gaussian'),] for geant in 'g93p01 g94p02 g94cms'.split(): for pdf in pdfs: for lo, hi in BinEdges([0.8,1.2,1.5,2,2.5,3,3.5,4,5,10]): fit = sfit.clone(source = _chains[geant], pdf = pdf.GetName()) fit.name = '_'.join([fit.name, geant, fit.pdf]) fit.title = ', '.join([fit.title, geant, pdf.GetTitle()]) fit.labels.extend([geant, pdf.GetTitle()]) fit.applyDefinitions([BremBin(lo, hi)]) _fits.append(fit) maxIterations = 1 fSigma = 2.0 pullEpsilon = 0.01 mwindows = {} ## Loop over plots for fitter in _fits[:9]: ## Log the current fit configuration print "++ Processing", fitter.title