Example #1
0
def directories(args) :
    ## prepare structure of parent directories
    dirs = []
    for dir in args :
        if is_number(get_mass(dir)) or get_mass(dir) == "common" :
            dir = dir[:dir.rstrip('/').rfind('/')]
        if not dir in dirs :
            dirs.append(dir)
    ## prepare mapping of masses per parent directory
    masses = {}
    for dir in dirs :
        buffer = []
        for path in args :
            if dir+'/' in path :
                if is_number(get_mass(path)) :
                    mass = get_mass(path)
                    if not contained(mass, buffer) :
                        buffer.append(mass)
        masses[dir] = list(buffer)
    return (dirs, masses)
def directories(args) :
    ## prepare structure of parent directories
    dirs = []
    for dir in args :
        if is_number(get_mass(dir)) or get_mass(dir) == "common" :
            dir = dir[:dir.rstrip('/').rfind('/')]
        if not dir in dirs :
            dirs.append(dir)
    ## prepare mapping of masses per parent directory
    masses = {}
    for dir in dirs :
        buffer = []
        for path in args :
            if dir+'/' in path :
                if is_number(get_mass(path)) :
                    mass = get_mass(path)
                    if not contained(mass, buffer) :
                        buffer.append(mass)
        masses[dir] = list(buffer)
    return (dirs, masses)
Example #3
0
                JOBNAME=jobname, DIR=inputs.rstrip(), QUEUE=options.queue, METHOD=cmd, OPTS=opts.rstrip(), SYS=sys, CONDOR="--condor" if options.condor else ""))
            ## execute
            if not options.condor:
                os.system("./{JOBNAME}_submit.sh".format(JOBNAME=jobname))
            else:
                os.system("condor_submit {JOBNAME}_submit.sh".format(JOBNAME=jobname))
            ## store
            os.system("mv {JOBNAME}_submit.sh {JOBNAME}".format(JOBNAME=jobname))

##
## MAX-LIKELIHOOD
##
if options.optMLFit :
    if options.interactive :
        for dir in args :
            mass = get_mass(dir)
            if mass == 'common' :
                continue
            if options.printOnly :
                print"limit.py --max-likelihood --stable --rMin -5 --rMax 5 {DIR}".format(DIR=dir)
            else :
                os.system("limit.py --max-likelihood --stable --rMin -5 --rMax 5 {USER} {DIR}".format(USER=options.opt, DIR=dir))
    else :
        ## directories and mases per directory
        struct = directories(args)
        lxb_submit(struct[0], struct[1], "--max-likelihood", "--stable --rMin -5 --rMax 5 {USER}".format(USER=options.opt))
##
## LIKELIHOOD-SCAN
##
if options.optNLLScan :
    ## add the footprint of the scan