Exemple #1
0
parser.add_option("--m2",
                  dest="mass2",
                  type="int",
                  default=None,
                  help="Only run signal points with this value as second mass")
parser.add_option("--allowoverflow",
                  dest="allowoverflow",
                  action="store_true",
                  default=False,
                  help="Allow last bin to be overflow bin")

baseBkg = "python makeShapeCardsSusy.py {MCA} {CUTS} \"{EXPR}\" \"{BINS}\" -o SR --bin {TAG} {T} --tree {TREENAME} {MCCS} {MACROS} --s2v -f -l {LUMI} --od {O} {FRIENDS} {FLAGS} {OVERFLOWCUTS}"
baseSig = "python makeShapeCardsSusy.py [[[MCA]]] [[[CUTS]]] \\\"{EXPR}\\\" \\\"{BINS}\\\" [[[SYS]]] -o SR --bin {TAG} {T} --tree {TREENAME} {MCCS} {MACROS} --s2v -f -l {LUMI} --od [[[O]]] {FRIENDS} {FLAGS} {OVERFLOWCUTS} {POSTFIX}"
(options, args) = parser.parse_args()
options = maker.splitLists(options)
options.models = func.splitList(options.models)
mm = maker.Maker("scanmaker", baseBkg, args, options, parser.defaults)
mm.loadModels()

sl = mm.getVariable("lumi", "12.9").replace(".", "p")

combinePath = mm.getVariable("combineTool")
if options.doCheck and (not combinePath or not os.path.isdir(combinePath)
                        or combinePath[-3:] != "src"):
    combinePath = combinePath.rstrip("/")
    print "WARNING: You want to run the automatic systematics check for your datacards"
    print "but you have not given all necessary information in your configuration!"
    print "Please give the path to the 'src' directory (e.g. /usr/cheidegg/CMSSW_7_1_5/src)"
    print "of the CMSSW release where HiggsCombine is installed. You should store this"
    print "path in your configuration with the variable 'combineTool'"
    cont = raw_input(
Exemple #2
0
parser = OptionParser(usage="%prog cfg regions treedir outdir [options]")
parser = maker.addMakerOptions(parser)
parser.add_option("--modules"     , dest="modules", type="string", action="append", default=[], help="Semicolon-separated list of modules to run")
parser.add_option("--exclude"     , dest="exclude", type="string", action="append", default=[], help="Semicolon-separated list of samples to exclude (regexp)")
parser.add_option("--accept"      , dest="accept" , type="string", action="append", default=[], help="Semicolon-separated list of samples to accept (regexp)")
parser.add_option("--direct"      , dest="direct" , action="store_true", default=False, help="Do direct batch submission (default is doing the batch submission via prepareEventVariablesFriendTree.py) [useful for splitted fastsim masspoints]")
parser.add_option("--nosplit"     , dest="noSplit", action="store_true", default=False, help="Direct batch submission does a splitting of the jobs per nEvt. Give this flag to suppress it.")
parser.add_option("--bk"          , dest="bk"     , action="store_true", default=False, help="Bookkeeping option (stores friend tree producer and configuration)")
parser.add_option("--log"         , dest="log"    , action="store_true", default=False, help="Put log file into subdirectory 'log' in output directory")
parser.add_option("-F", "--force" , dest="force"  , action="store_true", default=False, help="Run the module even if it already exists")
parser.add_option("--finalize"    , dest="finalize", action="store_true", default=False, help="Merge the chunks and check if everything is correct")

base = "python prepareEventVariablesFriendTree.py {T} {O} --tree {TREENAME} --vector -T sf -d {SAMPLES} -m {MODULES} {FRIENDS} {ADDITIONAL}"
(options, args) = parser.parse_args()
options         = maker.splitLists(options)
options.modules = func.splitList(options.modules)
options.accept  = func.splitList(options.accept )
options.exclude = func.splitList(options.exclude)
mm              = maker.Maker("friendmaker", base, args, options)
mm.loadNEvtSample()


## loop on modules, submitting jobs
for module in mm.getFriendModules():

	mm.workdir = mm.cmssw +"/src/CMGTools/TTHAnalysis/macros"
	output     = mm.outdir +"/"+ module
	func.mkdir(output,False)
	func.mkdir(output +"/log",False)
	if options.bk: func.mkdir(output +"/ref",False)
Exemple #3
0
def collectPPlots(mm, plotsname, custom):
    if len(custom) > 0:
        return " ".join("--sP " + p for p in func.splitList(custom))
    if not plotsname in mm.region.plots.keys(): return ""
    return " ".join("--sP " + v for v in mm.region.plots[plotsname])
Exemple #4
0
    action="append",
    default=[],
    help=
    "Only use these samples in the skimming and ignore procs, bkgs and sigs")
parser.add_option("--allSamples",
                  dest="allSamples",
                  action="store_true",
                  default=False,
                  help="Skim all samples in the MCA")

base = "python skimTrees.py {MCA} {CUTS} {O} -P {T} --tree {TREENAME} {MCCS} {MACROS} {FRIENDS} {JSON}"
baseFriends = "python skimFTrees.py {T} {F} {O}"

(options, args) = parser.parse_args()
options = maker.splitLists(options)
options.samples = func.splitList(options.samples)
mm = maker.Maker("skimmaker", base, args, options)

## skim main tree
friends = mm.collectFriends()
mccs = mm.collectMCCs()
macros = mm.collectMacros()

for r in range(len(mm.regions)):
    mm.iterateRegion()
    mm.reloadBase(base)

    mca = makeDummyMCA(mm, options.samples, options.allSamples)

    output = mm.outdir
    func.mkdir(output)