Пример #1
0
def demo3():
    dc = card('hww-19.47fb.mH110.sf_vh2j_shape.txt')
    dc.write()
    dc.remShape(
        'data_obs', '*'
    )  # or remShape('data_obs')  (= remove everything with data_obs inside)
    dc.write()
Пример #2
0
def demo1():
	dc = card('hww-19.47fb.mH110.sf_vh2j_shape.txt')
	dc2 = card('hwwsf_0j_cut_7TeV.txt')
	info('examples of reading card')
	print 'read sf_vh2j, ggH, CMS_8TeV_eff_l, shape', dc.getSyst(bin='sf_vh2j',process='ggH', syst='shapeN2', tag='CMS_8TeV_eff_l')
	print 'read sf_vh2j, ggH, Gen_pow_WW, shape', dc.getSyst(bin='sf_vh2j',process='WW', syst='shapeN2', tag='Gen_pow_WW')
	print 'read sf_vh2j, ggH, Gen_pow_WW, shape', dc.getSyst(bin='sf_vh2j',process='VV', syst='shapeN2', tag='Gen_pow_WW')
	print
	info('examples of adding columns')
	print 'adding column of dc2 to dc (new names):'
	dc.setCol(content=dc2.getCol(bin='j0sf7tev',process='ZH'),bin='addedbin',process='addedprocess',processId='99')
	print 'adding column of dc2 to dc (orig names):'
	dc.setCol(content=dc2.getCol(bin='j0sf7tev',process='ZH'))
	dc.write()
def demo1():
	dc = card('hww-19.47fb.mH110.sf_vh2j_shape.txt')
	dc2 = card('hwwsf_0j_cut_7TeV.txt')
	info('examples of reading card')
	print 'read sf_vh2j, ggH, CMS_8TeV_eff_l, shape', dc.getSyst(bin='sf_vh2j',process='ggH', syst='shapeN2', tag='CMS_8TeV_eff_l')
	print 'read sf_vh2j, ggH, Gen_pow_WW, shape', dc.getSyst(bin='sf_vh2j',process='WW', syst='shapeN2', tag='Gen_pow_WW')
	print 'read sf_vh2j, ggH, Gen_pow_WW, shape', dc.getSyst(bin='sf_vh2j',process='VV', syst='shapeN2', tag='Gen_pow_WW')
	print
	info('examples of adding columns')
	print 'adding column of dc2 to dc (new names):'
	dc.setCol(content=dc2.getCol(bin='j0sf7tev',process='ZH'),bin='addedbin',process='addedprocess',processId='99')
	print 'adding column of dc2 to dc (orig names):'
	dc.setCol(content=dc2.getCol(bin='j0sf7tev',process='ZH'))
	dc.write()
Пример #4
0
def demo4():
	dc = card('hww-19.47fb.mH110.sf_vh2j_shape.txt')
	dc.write()
	dc.remCol(process='WW')
	dc.write()
	dc.remCol(processId='2')
	dc.write()
Пример #5
0
def demo4():
    dc = card('hww-19.47fb.mH110.sf_vh2j_shape.txt')
    dc.write()
    dc.remCol(process='WW')
    dc.write()
    dc.remCol(processId='2')
    dc.write()
Пример #6
0
def demo0():
	dc = card('datacard_mbbCor_m115_CATMIN1_Binned_adapted.txt')
	####################
	info('Example printout of scanned card:')
	dc.write()
	print
	####################
	info('Example of reading and setting rate:')
	print 'read CAT1, signal, rate: \t', dc.getRate(bin='CAT1', process='signal')
	print 'read CAT1, 0, rate: \t', dc.getRate(bin='CAT1', processId='0')
	print 'read CAT1, background, rate: \t', dc.getRate(bin='CAT1', process='background')
	print 'set CAT1, background, rate to 1.111'
	dc.setRate(bin='CAT1', process='background',value='1.111')
	print 'read CAT, background, rate: \t', dc.getRate(bin='CAT1', process='background')
	print
	####################
	info('Example of reading and setting systematic (lnN):')
	print 'read CAT1, signal, lnN, lumi:\t', dc.getSyst(bin='CAT1', process='signal', syst='lnN', tag='lumi')
	print 'read CAT3, signal, lnN, trigEff:\t', dc.getSyst(bin='CAT3', process='signal', syst='lnN', tag='trigEff')
	print 'read CAT3, 0, lnN, trigEff:\t', dc.getSyst(bin='CAT3', processId='0', syst='lnN', tag='trigEff')
	print 'set CAT3, 0, lnN, trigEff to 1.111'
	dc.setSyst(bin='CAT3', processId='0', syst='lnN', tag='trigEff',value='1.111')
	print 'read CAT3, 0, lnN, trigEff:\t', dc.getSyst(bin='CAT3', processId='0', syst='lnN', tag='trigEff')
	print
	####################
	info('Example of reading and setting systematic (gmN):')
	print 'read CAT1, signal, gmN, blablabla: \t', dc.getSyst(bin='CAT1', process='signal', syst='gmN', tag='blablabla')
	print 
	####################
	info('Example of reading and setting systematic (param):')
	print 'read nzjet_CAT1, column 0: \t', dc.getSyst(syst='param',tag='nzjet_CAT1',col=0)
	print 'set nzjet_CAT1, column 0 to 9.9999'
	dc.setSyst(syst='param',tag='nzjet_CAT1',col=0,value='9.9999')
	print 'read nzjet_CAT1, column 0: \t', dc.getSyst(syst='param',tag='nzjet_CAT1',col=0)
	print
	####################
	info('Example of adding shape:')
	dc.addShape('signal2','*','bla','blablabla')
	print
	####################
	info('Example of adding column:')
	dc.addCol('CAT5','signal','0','22.55','-1')
	dc.addCol('CAT5','background','1','33.44','-1')
	####################
	info('Example of filling new column:')
	dc.setSyst(bin='CAT5', process='signal',syst='lnN',tag='trigEff',value='1.033')
	dc.setSyst(bin='CAT5', process='signal',syst='lnN',tag='lumi',value=dc.getSyst(bin='CAT1',process='signal',syst='lnN',tag='lumi'))
	print
	####################
	info('Example printout of edited card (to screen):')
	dc.write()
	#####################
	#info('Example printout of edited card (to dataCard_new.txt):')
	#dc.write('dataCard_new.txt')
	print
	####################
	info('Example getCol()')
	dc.setCol(content=dc.getCol(bin='CAT1',process='signal',processId='0'),bin='CAT17',process='signal',processId='0')
	dc.write()
def demo0():
	dc = card('datacard_mbbCor_m115_CATMIN1_Binned_adapted.txt')
	####################
	info('Example printout of scanned card:')
	dc.write()
	print
	####################
	info('Example of reading and setting rate:')
	print 'read CAT1, signal, rate: \t', dc.getRate(bin='CAT1', process='signal')
	print 'read CAT1, 0, rate: \t', dc.getRate(bin='CAT1', processId='0')
	print 'read CAT1, background, rate: \t', dc.getRate(bin='CAT1', process='background')
	print 'set CAT1, background, rate to 1.111'
	dc.setRate(bin='CAT1', process='background',value='1.111')
	print 'read CAT, background, rate: \t', dc.getRate(bin='CAT1', process='background')
	print
	####################
	info('Example of reading and setting systematic (lnN):')
	print 'read CAT1, signal, lnN, lumi:\t', dc.getSyst(bin='CAT1', process='signal', syst='lnN', tag='lumi')
	print 'read CAT3, signal, lnN, trigEff:\t', dc.getSyst(bin='CAT3', process='signal', syst='lnN', tag='trigEff')
	print 'read CAT3, 0, lnN, trigEff:\t', dc.getSyst(bin='CAT3', processId='0', syst='lnN', tag='trigEff')
	print 'set CAT3, 0, lnN, trigEff to 1.111'
	dc.setSyst(bin='CAT3', processId='0', syst='lnN', tag='trigEff',value='1.111')
	print 'read CAT3, 0, lnN, trigEff:\t', dc.getSyst(bin='CAT3', processId='0', syst='lnN', tag='trigEff')
	print
	####################
	info('Example of reading and setting systematic (gmN):')
	print 'read CAT1, signal, gmN, blablabla: \t', dc.getSyst(bin='CAT1', process='signal', syst='gmN', tag='blablabla')
	print 
	####################
	info('Example of reading and setting systematic (param):')
	print 'read nzjet_CAT1, column 0: \t', dc.getSyst(syst='param',tag='nzjet_CAT1',col=0)
	print 'set nzjet_CAT1, column 0 to 9.9999'
	dc.setSyst(syst='param',tag='nzjet_CAT1',col=0,value='9.9999')
	print 'read nzjet_CAT1, column 0: \t', dc.getSyst(syst='param',tag='nzjet_CAT1',col=0)
	print
	####################
	info('Example of adding shape:')
	dc.addShape('signal2','*','bla','blablabla')
	print
	####################
	info('Example of adding column:')
	dc.addCol('CAT5','signal','0','22.55','-1')
	dc.addCol('CAT5','background','1','33.44','-1')
	####################
	info('Example of filling new column:')
	dc.setSyst(bin='CAT5', process='signal',syst='lnN',tag='trigEff',value='1.033')
	dc.setSyst(bin='CAT5', process='signal',syst='lnN',tag='lumi',value=dc.getSyst(bin='CAT1',process='signal',syst='lnN',tag='lumi'))
	print
	####################
	info('Example printout of edited card (to screen):')
	dc.write()
	#####################
	#info('Example printout of edited card (to dataCard_new.txt):')
	#dc.write('dataCard_new.txt')
	print
	####################
	info('Example getCol()')
	dc.setCol(content=dc.getCol(bin='CAT1',process='signal',processId='0'),bin='CAT17',process='signal',processId='0')
	dc.write()
Пример #8
0
def demo3():
	dc = card('hww-19.47fb.mH110.sf_vh2j_shape.txt')
	dc.write()
	dc.remShape('data_obs','*') # or remShape('data_obs')  (= remove everything with data_obs inside)
	dc.write()
Пример #9
0
def demo2():
	dc = card('hwwsf_0j_cut_7TeV.txt')
	dc.write()
Пример #10
0
def demo5():
	dc = card('datacard_mbbCor_m115_CATMIN1_Binned.txt')
	dc.write()
	dc.addSystLine(systtype='param',tag='systparam')
	dc.write()
	dc.addSystLine(systtype='gmN',tag='systgmN')
	dc.setgmN0('systgmN','12.5')
	dc.write()
	dc.addSystLine(systtype='shapeN2',tag='systshapeN2')
	dc.write()
	dc.addSystLine(systtype='lnN',tag='systlnN')
	dc.write()
	dc.remSystLine(systtype='lnN',tag='sgnAcc_pdf')
	dc.write()
Пример #11
0
def demo2():
    dc = card('hwwsf_0j_cut_7TeV.txt')
    dc.write()
def demo5():
	dc = card('datacard_mbbCor_m115_CATMIN1_Binned.txt')
	dc.write()
	dc.addSystLine(systtype='param',tag='systparam')
	dc.write()
	dc.addSystLine(systtype='gmN',tag='systgmN')
	dc.setgmN0('systgmN','12.5')
	dc.write()
	dc.addSystLine(systtype='shapeN2',tag='systshapeN2')
	dc.write()
	dc.addSystLine(systtype='lnN',tag='systlnN')
	dc.write()
	dc.remSystLine(systtype='lnN',tag='sgnAcc_pdf')
	dc.write()