示例#1
0
''' Plot script WC parameter LogLikelihood
'''

from TTZRun2EFT.Tools.genCutInterpreter import cutInterpreter
from Analysis.Tools.WeightInfo import WeightInfo
from TTZRun2EFT.Samples.genTuples_TTZ_postProcessed import *

genSignalSample = ttZ_ll_LO_order2_15weights_ref
#genSignalSample = ttZ_ll_LO_order3_8weights
genSignalSample.setWeightString("ref_lumiweight1fb")

w = WeightInfo(genSignalSample.reweight_pkl)
w.set_order(2)

kwargsList = [
    {
        "cpt": 0,
        "cpQM": 0,
        "res": 0.07082
    },
    {
        "cpt": -24.5,
        "cpQM": -8,
        "res": 0.1497
    },
    {
        "cpt": -24.5,
        "cpQM": 4,
        "res": 0.1093
    },
    {
elif args.year == 2017:
    import TTGammaEFT.Samples.nanoTuples_Fall17_private_semilep_postProcessed as mc_samples
    if not args.noData:
        from TTGammaEFT.Samples.nanoTuples_Run2017_14Dec2018_semilep_postProcessed import Run2017 as data_sample

elif args.year == 2018:
    import TTGammaEFT.Samples.nanoTuples_Autumn18_private_semilep_postProcessed as mc_samples
    if not args.noData:
        from TTGammaEFT.Samples.nanoTuples_Run2018_14Dec2018_semilep_postProcessed import Run2018 as data_sample

# define some colors
colors = [ROOT.kRed + 1, ROOT.kGreen - 2, ROOT.kOrange + 1, ROOT.kAzure + 4]

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


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


selection = cutInterpreter.cutString(args.selection + "-" + args.mode)

smweightstring = smweightString = get_weight_string({})
Histo = eftSample.get1DHistoFromDraw("GenPhotonCMSUnfold0_pt",
                                     binning=[20, 20, 400],
                                     selectionString=selection,
                                     weightString=smweightString,
示例#3
0
    "mllgamma/F",
]

read_variables += ["GenBj0_" + var for var in genJetVarString.split(",")]
read_variables += ["GenBj1_" + var for var in genJetVarString.split(",")]

read_variables_EFT = [
    "ref_weight/F",
    VectorTreeVariable.fromString('p[C/F]', nMax=100)
]

# Sequence
sequence = []

w = WeightInfo(signalSample.reweight_pkl)
w.set_order(int(args.order))
variables = w.variables

lumi_scale = 136.6

signals = []
# Sample definition
for i, param in enumerate(params):
    sample = copy.deepcopy(signalSample)
    sample.params = param
    if param["legendText"] == "SM":
        sample.style = styles.lineStyle(param["color"], width=3)
    else:
        sample.style = styles.lineStyle(param["color"], width=2, dashed=True)
    sample.texName = param["legendText"]
    sample.weight = get_reweight(param, sample)