Exemplo n.º 1
0
#w.get_diff_weight_yield( 'x', coeffLists[0], x=3) # 2*3 = 6
#w.get_fisherInformation_matrix( coeffLists[0], x=2.) # -> 1/5.*(2*2)**2
#w.get_christoffels( coeffLists )
#
## christoffel
#christoffels = w.get_christoffels( coeffLists )
#christoffels(0, (3.) ) # 0.5*1/(1/(10.)*(6.)**2)*(1/10.*(6)**3+2/10.**2*6*2) = 3.0333333333333337

# Make a 2nd oder dummy parametrization
#./make_reweight_card.py --overwrite --filename out_xy.dat --couplings 2 x 1 y 1

# Load parametrization
from TTXPheno.Tools.WeightInfo import WeightInfo
w = WeightInfo(
    "/afs/hephy.at/data/rschoefbeck01/TTXPheno/test_param/out_xy.pkl")
w.set_order(2)

variables = ('x', 'y')

# Specify a parametrization 1/x/y/x^2/xy/y^2
#1+x**2
coeffLists = [[0, 1, 1, 0, 1, 0]]

# correct->
w.get_total_weight_yield(coeffLists, x=1, y=1)  # 1+1**2 = 2
w.get_total_weight_yield(coeffLists, x=2)  # 1+2**2 = 5
w.get_diff_weight_yield('x', coeffLists[0], x=3)  # 2*3 = 6
w.get_fisherInformation_matrix(coeffLists[0], x=2.)  # -> 1/5.*(2*2)**2
w.get_christoffels(coeffLists)

# christoffel
Exemplo n.º 2
0
    # signal: ttgamma events with isolated gamma from gluon or top (cat a1)

elif args.processFile.split('_')[0] == 'ttZ':
    ttZISRSample  = copy.deepcopy( ttXSample ) #select ttgamma events with isolated gamma from ISR (cat a2)
    ttZISRSample.name = 'fwlite_ttZ_(non-t)_LO_order2_15weights_ref'

if args.processFile == 'ttZ_3l': bg = [ ttZISRSample, WZSample, tWZSample, tZqSample, ttgammaSample ]
elif args.processFile == 'ttZ_4l': bg = [ ttZISRSample, WZSample, tWZSample, tZqSample, ttgammaSample ]
elif args.processFile == 'ttgamma_1l': bg = [ ttgammaIsrSample, ttgammaLepSample, ttgammabSample, ttSample, ttgammaFakeSample, tWSample, tWZSample, tZqSample, ZgammaSample ]
elif args.processFile == 'ttgamma_2l': bg = [ ttgammaIsrSample, ttgammaLepSample, ttgammabSample, ttSample, ttgammaFakeSample, tWSample, tWZSample, tZqSample, ZgammaSample ]
else: bg = [ ttgammaIsrSample, ttgammaLepSample, ttgammabSample, ttSample, ttgammaFakeSample, tWSample, tWZSample, tZqSample, ZgammaSample ]

# Polynomial parametrization
# ATTENTION IF U USE MORE THAN ONE SIGNAL SAMPLE!!!
w = WeightInfo(ttXSample.reweight_pkl)
w.set_order(int(args.order))
if len(args.variables) == 0: args.variables = w.variables

def checkReferencePoint( sample ):
    ''' check if sample is simulated with a reference point
    '''
    return pickle.load(file(sample.reweight_pkl))['ref_point'] != {}

# somehow this has to be done first, not in the next loop
if args.small:
    for s in [ttXSample] + bg:
        s.reduceFiles( to = 1 )


# configure samples
for s in [ttXSample] + bg:
Exemplo n.º 3
0
#
# Logger
#
import TTXPheno.Tools.logger as logger
import RootTools.core.logger as logger_rt
logger    = logger.get_logger(   args.logLevel, logFile = None)
logger_rt = logger_rt.get_logger(args.logLevel, logFile = None)

if args.small: args.plot_directory += "_small"

# Import samples
from TTXPheno.samples.benchmarks import *
sample = fwlite_ttZ_ll_LO_order3_8weights 
w = WeightInfo(sample.reweight_pkl)
w.set_order(3)

params = [  
    {'legendText':'SM',  'color':ROOT.kBlue, 'WC':{}},
   ] 
params += [ {'legendText':'ctZI %i'%ctZI, 'color':ROOT.kRed,  'WC':{'ctZI':ctZI} } for ctZI in range(-6,7)]

#samples = []
#for i_param, param in enumerate(params):
#    samples.append(sample)
#    samples[-1].name+='_%i'%i_param
#    print param
#    samples[-1].style = styles.lineStyle( param['color'] )
#    samples[-1].texName = param['legendText']
#    #samples[-1].ttreeFormula = ROOT.TTreeFormula("weightstring_%i"%i_param,  w.get_weight_string(**param['WC']), samples[-1].chain )
#    samples[-1].paramWeightFunc =  w.get_weight_func(**param['WC'])