"cpt": 0, "cpQM": 7, "res": 0.04173 }, { "cpt": 0, "cpQM": 8, "res": 0.03942 }, ] genSelection = "abs(genZ_mass-91.2)<10&&Sum$(genLep_pt>15&&abs(genLep_eta)<2.4)>=2" regionCut = "(1)" #replaceAliases( simpleStringToCutString( cut ) ) sel = genSelection #"&&".join( [ cutInterpreter.cutString( genSelection ), regionCut ] ) coeffList = w.getCoeffListFromDraw(genSignalSample, selectionString=sel) signal_genRateSM = float(w.get_weight_yield(coeffList)) dSignal_genRateSM = 0.07082 for kwargs in kwargsList: dRes = kwargs["res"] del kwargs["res"] signal_genRateEFT = w.get_weight_yield(coeffList, **kwargs) print "BSM point:", kwargs print "SM:", signal_genRateSM, "Daniel:", dSignal_genRateSM print "BSM:", signal_genRateEFT, "Daniel:", dRes print "ratio:", signal_genRateEFT / signal_genRateSM, "Daniel:", dRes / dSignal_genRateSM, "difference:", ( signal_genRateEFT / signal_genRateSM) / (dRes / dSignal_genRateSM) print
from Analysis.Tools.WeightInfo import WeightInfo # Polynomial parametrization w = WeightInfo( "/afs/hephy.at/data/cms04/ttschida/gridpacks/Yt/tWZ01j_rwgt_slc6_amd64_gcc630_CMSSW_9_3_16_tarball.pkl" ) w.set_order(2) coeffList = [ 0.00026670329502486237, 2.081775489528767e-06, 1.3883718118586788e-06 ] # reference point: cu = 0.66666 # (f-1)/0.246**2 = ctp --> f = ctp * 0.246**2 + 1 # f | yt | dim6top # ------------------------------- # 1 | 2/3 | 0 # 2 | 2/3 * 2 | 16.5 # 1.60 | 2/3 * 1.60 | 10 # -2.63 | 2/3 * -2.63 | -60 print[ w.get_weight_yield(coeffList, cu=i) / w.get_weight_yield(coeffList, cu=0.66666) for i in range(-4, 5) ]
2.1134813589872996e-09, 1.0962817494819566e-10, 9.331277080568635e-11, 1.2972883094477964e-08, 4.0596852185296585e-12, 3.879796010930543e-12, -8.5194501583099e-09, 1.5328934390084072e-09, 3.77907334677029e-09, -2.4054793152054925e-09, -2.782077652833855e-10, 1.6251621149854063e-09, -2.605930718989348e-11, -1.3785117213743656e-09, 7.789568108154926e-12, -6.306191214786165e-13, -4.383921876657152e-09, -5.046961905185436e-09, 2.5079634205246182e-09, 1.8891493791400738e-09, 5.171337727081099e-11, 8.876288750849271e-07, 2.764535425567582e-06, -2.2937870817670645e-10, 7.877522771286015e-10, -4.621797971252824e-08, -6.269944625112214e-09, 2.9662009139359443e-07, 2.9570350357738487e-08, -6.299608216364632e-07, 1.0568777132220581e-05, -2.575752355497477e-08, 4.439874939221963e-09, 1.4558902181697776e-06, 1.4607172314256233e-07, 6.59351264254367e-07, -1.0491015016306697e-08, -4.893849355913038e-07, 1.5282411754937861e-06, -1.4071385751867696e-14, -4.8681927250593194e-08, 3.1077278588403606e-09, 2.3201269625574973e-09, -1.1867889154441744e-08, -1.2202170675191848e-08, 1.5282410984457018e-06, 2.5819190152296137e-09, 4.871964577523511e-08, -6.773455745038871e-09, -6.435556788133892e-09, 3.400722072945199e-09, 3.922961628215619e-05, 1.3484018808215844e-08, -2.4758976914841877e-05, 5.583337957514964e-07, -1.898754103754632e-07, 3.909767072006596e-05, -5.710852804743346e-07, -2.40124297511079e-05, -7.145963755534071e-09, 1.0838550390946357e-05, 2.0298654688353154e-08, -3.566566818697662e-07, 1.1334672415977828e-05, 9.694004531105883e-09, 4.004471615059617e-07 ] # no reference point print[ w.get_weight_yield(coeffList, ctp=i) / w.get_weight_yield(coeffList) for i in range(-4, 5) ]
res = {"selection":args.selection, "year":args.year, "small":args.small, "region":str(region), sample.name:sample.name } if yieldDB.contains( res ): rate[region][sample.name] = float( yieldDB.getDicts( res )[0]["value"] ) logger.info("Using yield for sample %s at region %s: %f"%(sample.name, region, rate[region][sample.name])) else: logger.info("Yield for sample %s at region %s not cached! Run caching script first"%(sample.name, region)) sys.exit(1) for i_region, region in enumerate(regions): genRegion = genRegions[i_region] logger.info( "At gen region %s", genRegion ) coeffList = w.getCoeffListFromDraw( signalSample, selectionString=genRegion.cutString() ) genRateSM = float( w.get_weight_yield( coeffList ) ) for i_sample, sample in enumerate( signals ): genRateEFT = w.get_weight_yield( coeffList, **sample.params['WC'] ) genKFactor = genRateEFT / genRateSM rate[region][sample.name] = rate[region][ttGammaSample.name] * genKFactor logger.info( "Calculated k-Factor for signal sample %s: %f! Signal yield: %s"%(sample.name, genKFactor, rate[region][sample.name]) ) for i_sample, sample in enumerate( allSamples + signals ): hists[sample.name].SetBinContent(i_region+1, rate[region][sample.name]) # hists[sample.name].SetBinError(i_region+1,0) hists[sample.name].legendText = sample.texName hists[sample.name].style = sample.style