def main(): print "# --------------------------------------------------------------------------------------" print "# Blinding datacards. " print "# --------------------------------------------------------------------------------------" print "# You are using the following configuration: " print "# --update-file :", options.update_file print "# --recycle-templates :", options.recycle_templates print "# --seed :", options.seed print "# --inject-signal :", options.inject_signal print "# --injected-scale :", options.injected_scale print "# --injected-mass :", options.injected_mass print "# --extra-templates :", options.extra_templates print "# --blacklist :", blacklist print "# Check option --help in case of doubt about the meaning of one or more of these confi-" print "# guration parameters. " print "# --------------------------------------------------------------------------------------" cardMaker = AsimovDatacard(options, options.update_file, options.seed, options.inject_signal, options.injected_mass, options.injected_scale, options.extra_templates, blacklist) for dir in args: ## clean up directory from former trials if not options.recycle_templates: cardMaker.cleanup(dir, '_asimov') cardMaker.make_asimov_datacards(dir, options.recycle_templates)
def main() : print "# --------------------------------------------------------------------------------------" print "# Blinding datacards. " print "# --------------------------------------------------------------------------------------" print "# You are using the following configuration: " print "# --update-file :", options.update_file print "# --seed :", options.seed print "# --inject-signal :", options.inject_signal print "# --injected-scale :", options.injected_scale print "# --injected-mass :", options.injected_mass print "# Check option --help in case of doubt about the meaning of one or more of these confi-" print "# guration parameters. " print "# --------------------------------------------------------------------------------------" cardMaker = AsimovDatacard(options, options.update_file, options.seed, options.inject_signal, options.injected_mass, options.injected_scale, options.extra_templates) ## clean up directory from former trials cardMaker.cleanup(args[0], '_asimov') cardMaker.make_asimov_datacards(args[0])
os.system("perl -pi -e 's/ggH_hww/ggH_hww{MASS}/g' {FILE}".format(MASS=options.hww_mass, FILE=file)) os.system("perl -pi -e 's/qqH_hww/qqH_hww{MASS}/g' {FILE}".format(MASS=options.hww_mass, FILE=file)) for file in glob.glob("{DIR}/{ANA}/sm/vhtt/vhtt_*.txt".format(DIR=dir, ANA=ana)) : os.system("perl -pi -e 's/WH_hww/WH_hww{MASS}/g' {FILE}".format(MASS=options.hww_mass, FILE=file)) os.system("perl -pi -e 's/ZH_hww/ZH_hww{MASS}/g' {FILE}".format(MASS=options.hww_mass, FILE=file)) ## fix the problem in the datacards, that the massindex is already contained in the process name if not options.hww_mass == '' : file = "{DIR}/{ANA}/sm/htt_{em,vhtt}/{htt_em,vhtt}_*.txt".format(DIR=dir, ANA=ana) os.system("sed -i -e '/_hww125/ s/$PROCESS$MASS/$PROCESS/g' {FILE}".format(MASS=options.hww_mass, FILE=file)) ## blind datacards if options.blind_datacards : for chn in channels : cardMaker = AsimovDatacard('', True, -1, False, '125', '1.0',options.extra_templates) for dir in '{DIR}/{ANA}/sm/{CHN}'.format(DIR=dir, ANA=ana, CHN=chn if chn == 'vhtt' else 'htt_'+chn): cardMaker.cleanup(dir, '_asimov') cardMaker.make_asimov_datacards(dir, False) if options.update_limits : print "##" print "## update LIMITS directory:" print "##" ## setup directory structure dir = "{CMSSW_BASE}/src/LIMITS{LABEL}".format(CMSSW_BASE=cmssw_base, LABEL=options.label) if os.path.exists(dir) : if os.path.exists(dir.replace('src/', 'src/backup/')): os.system("rm -r "+dir.replace('src/', 'src/backup/')) os.system("mv {DIR} {CMSSW_BASE}/src/backup/".format(DIR=dir, CMSSW_BASE=cmssw_base)) os.system("mkdir -p {DIR}".format(DIR=dir)) for ana in analyses : if ':' in ana : ana = ana[ana.find(':')+1:]
file = "{DIR}/{ANA}/sm/htt_{em,vhtt}/{htt_em,vhtt}_*.txt".format( DIR=dir, ANA=ana) os.system( "sed -i -e '/_hww125/ s/$PROCESS$MASS/$PROCESS/g' {FILE}". format(MASS=options.hww_mass, FILE=file)) ## blind datacards if options.blind_datacards: for chn in channels: cardMaker = AsimovDatacard('', True, -1, False, '125', '1.0', options.extra_templates) for dir in '{DIR}/{ANA}/sm/{CHN}'.format( DIR=dir, ANA=ana, CHN=chn if chn == 'vhtt' else 'htt_' + chn): cardMaker.cleanup(dir, '_asimov') cardMaker.make_asimov_datacards(dir, False) if options.update_limits: print "##" print "## update LIMITS directory:" print "##" ## setup directory structure dir = "{CMSSW_BASE}/src/LIMITS{LABEL}".format(CMSSW_BASE=cmssw_base, LABEL=options.label) if os.path.exists(dir): if os.path.exists(dir.replace('src/', 'src/backup/')): os.system("rm -r " + dir.replace('src/', 'src/backup/')) os.system("mv {DIR} {CMSSW_BASE}/src/backup/".format( DIR=dir, CMSSW_BASE=cmssw_base)) os.system("mkdir -p {DIR}".format(DIR=dir)) for ana in analyses: