Beispiel #1
0
# Create unfolding class
m = Unfolder(bkg[""], mig[""], eff[""], truth[""])
m.setUniformPrior()
#m.setGaussianPrior()
#m.setCurvaturePrior()
#m.setEntropyPrior()
#m.setFirstDerivativePrior()

# add uncertainties
uncList = [
]  #'sjcalib1030', 'eup', 'ecup'] + ['lup'+str(x) for x in range(0, 10+1)] + ['cup'+str(x) for x in range(0, 3+1)] + ['bup'+str(x) for x in range(0, 3+1)] + ['ewkup']
for k in uncList:
    print "Getting histograms for syst. ", k
    struth, srecoWithFakes, sbkg, smig, seff, snrt = getHistograms(
        "out_ttallhad_psrw_Syst.root", k, "mttAsymm")
    m.addUncertainty(k, sbkg, smig.project('y'))

# add migration uncertainty
uncUnfList = []  #["me", "ps"]
for k in uncUnfList:
    m.addUnfoldingUncertainty(k, mig[k], eff[k])

# try a curvature-based prior
# first choose alpha using only a MAP estimate
#m.setEntropyPrior()
#m.setCurvaturePrior(1.0)
m.setFirstDerivativePrior(1.0)
#m.setGaussianPrior()

#m.setConstrainArea(True)
m.run(data)
Beispiel #2
0
m = Unfolder(bkg["A"], mig["A"], eff["A"], truth["A"])
m.setUniformPrior()

m.run(data)
m.sample(100000)

unf_orig = m.hunf
unf_orig_mode = m.hunf_mode

del m
n = None
m = Unfolder(bkg["A"], mig["A"], eff["A"], truth["A"])
m.setUniformPrior()

# use uncertainty at reconstruction level, by using the nominal truth folded with the alternative response matrix
m.addUncertainty("B", bkg["B"], recoWithoutFakes["B"])

print("Response")
print(m.response.val)
print("Bkg and reco (nominal)")
print(m.bkg.val)
print(m.recoWithoutFakes.val)
print("Uncertainties in bkg and reco")
print(m.bkg_syst['B'].val)
print(m.reco_syst['B'].val)
print("Data")
print(data.val)

m.run(data)
m.sample(100000)