예제 #1
0
logger_rt = logger_rt.get_logger(args.logLevel, logFile=None)

if args.small: args.plot_directory += "_small"
if args.normalize: args.plot_directory += "_normalize"
if args.photonPtReweighting: args.plot_directory += "_ptReweighted"

# load and define the EFT sample
from TTGammaEFT.Samples.genTuples_TTGamma_EFT_postProcessed import *
eftSample = eval(args.sample)

# settings for eft reweighting
w = WeightInfo(eftSample.reweight_pkl)
w.set_order(args.order)
variables = w.variables

print w.get_weight_string()


#Histograms
def get_weight_string(parameters):
    return w.get_weight_string(**parameters)


# define your plot selection via the python option --selection
preSelection = cutInterpreter.cutString(args.selection + "-" + args.mode)
smweightString = "(%s)*ref_weight" % get_weight_string({})
Histo = eftSample.get1DHistoFromDraw("GenPhotonCMSUnfold0_pt",
                                     binning=[15, 20, 320],
                                     selectionString=preSelection,
                                     weightString=smweightString,
                                     addOverFlowBin='upper')
예제 #2
0
from TTGammaEFT.Samples.nanoTuples_tWG_RunII_postProcessed import ST_tW

ST_tW.color = ROOT.kBlack
ST_tW.texName = "tW"

from TTGammaEFT.Samples.genTuples_TTGamma_tWG_EFT_postProcessed import tWG_2WC_ref

tWG_2WC_ref.color = ROOT.kGreen + 2
tWG_2WC_ref.texName = "tW#gamma"

w = WeightInfo(tWG_2WC_ref.reweight_pkl)
w.set_order(2)
variables = w.variables
xsecComp = 1  #.78215125 / 0.3973
eftweightString = "(%s)*ref_weight*%f" % (w.get_weight_string(), xsecComp)
print eftweightString

tWG_2WC_ref.weight = "%s*(137.2)" % (eftweightString)
ST_tW.weight = "weight*(35.92*(year==2016)+41.53*(year==2017)+59.74*(year==2018))"

gen_sel = cutInterpreter.cutString(sel)
#gen_sel2 = cutInterpreter.cutString(sel2)
print gen_sel
tWG_2WC_ref.selection = gen_sel
ST_tW.selection = gen_sel + "&&(isTWG>0)"

samples = [ST_tW, tWG_2WC_ref]


# Text on the plots