Exemple #1
0
def createOptionParser(lepDefault=None, lhcDefault=None, lhcasyDefault=None):
    return commonLimitTools.createOptionParser(lepDefault, lhcDefault,
                                               lhcasyDefault)
Exemple #2
0
                    settings.getDatacardPattern(
                        commonLimitTools.LimitProcessType.TAUJETS)
                ],
                rootfilePatterns=[
                    settings.getRootfilePattern(
                        commonLimitTools.LimitProcessType.TAUJETS)
                ],
                clsType=combine.LHCTypeAsymptotic(opts),
                postfix=pfix)
        else:
            return False
    return True


if __name__ == "__main__":
    parser = commonLimitTools.createOptionParser(lepType, lhcType,
                                                 lhcTypeAsymptotic)
    parser.add_option("--postfix",
                      dest="postfix",
                      default="",
                      help="Postfix to add to output directory name")
    opts = commonLimitTools.parseOptionParser(parser)
    # General settings

    myDirs = opts.dirs[:]
    if len(myDirs) == 0:
        myDirs.append(".")

    for myDir in myDirs:
        print "Considering directory:", myDir
        settings = commonLimitTools.GeneralSettings(myDir, opts.masspoints)
        print "The following masses are considered:", settings.getMassPoints(
Exemple #3
0
                if "%s_error" % item in masspoints[k]["expected"]:
                    a = float(masspoints[k]["expected"]["%s_error" % item])
                    b = float(masspoints[k]["expected"][item])
                    r = 0.0
                    if b > 0:
                        r = a / b
                    line += " %9.4f" % (r)
                else:
                    line += "      n.a."
            print line
        myFile.close()


if __name__ == "__main__":
    parser = commonLimitTools.createOptionParser(lepDefault=None,
                                                 lhcDefault=False,
                                                 lhcasyDefault=False,
                                                 fullOptions=False)
    parser.add_option("--printonly",
                      dest="printonly",
                      action="store_true",
                      default=False,
                      help="Print only the ready results")
    parser.add_option("--combination",
                      dest="combination",
                      action="store_true",
                      default=False,
                      help="Run combination instead of only taunu fully hadr.")
    opts = commonLimitTools.parseOptionParser(parser)

    # Obtain directory list
    myDirs = opts.dirs[:]
Exemple #4
0
        print "br(tb) uncert: minus: %f-%f, plus %f-%f"%(brTBUncertMinusMin,brTBUncertMinusMax,brTBUncertPlusMin,brTBUncertPlusMax)
        print "br(taunu+tb) uncert: minus: %f-%f, plus %f-%f"%(brCombUncertMinusMin,brCombUncertMinusMax,brCombUncertPlusMin,brCombUncertPlusMax)
  

if __name__ == "__main__":

    def addToDatacards(myDir, massPoints, dataCardList, rootFileList, dataCardPattern, rootFilePattern):
        m = DatacardReader.getMassPointsForDatacardPattern(myDir, dataCardPattern)
        if len(m) > 0:
            m = DatacardReader.getMassPointsForDatacardPattern(myDir, dataCardPattern, massPoints)
            del massPoints[:]
            massPoints.extend(m)
            dataCardList.append(dataCardPattern)
            rootFileList.append(rootFilePattern)

    parser = commonLimitTools.createOptionParser(False, False, True)
    parser.add_option("--scen", dest="scenarios", action="append", default=[], help="MSSM scenarios")
    parser.add_option("-t", "--tanbeta", dest="tanbeta", action="append", default=[], help="tanbeta values (will scan only these)")
    parser.add_option("--tanbetarangemin", dest="tanbetarangemin", action="append", default=[], help="tanbeta values minimum range")
    parser.add_option("--tanbetarangemax", dest="tanbetarangemax", action="append", default=[], help="tanbeta values maximum range")
    parser.add_option("--evalUuncert", dest="evaluateUncertainties", action="store_true", default=False, help="Make plots of theoretical uncertainties")
    parser.add_option("--creategridjobs", dest="creategridjobs", action="store_true", default=False, help="Create crab task dirs for running on grid")
    parser.add_option("--gridmassive", dest="gridRunAllMassesInOneJob", action="store_true", default=False, help="Crab jobs run all masses in one job (default=1 job / mass)")
    opts = commonLimitTools.parseOptionParser(parser)
    if opts.rmin == None:
        opts.rmin = "0"
    if opts.rmax == None:
        opts.rmax = "1" # To facilitate the search for different tan beta values
    
    if opts.creategridjobs:
        print "*** Start creating individual crab job directories for grid submission ... ***"
if __name__ == "__main__":
    def addToDatacards(myDir, massPoints, dataCardList, rootFileList, dataCardPattern, rootFilePattern):
        if rootFilePattern != None and "%s" in dataCardPattern:
            m = DatacardReader.getMassPointsForDatacardPattern(myDir, dataCardPattern)
            if len(m) > 0:
                m = DatacardReader.getMassPointsForDatacardPattern(myDir, dataCardPattern, massPoints)
                del massPoints[:]
                massPoints.extend(m)
                dataCardList.append(dataCardPattern)
                rootFileList.append(rootFilePattern)
        else:
            if os.path.exists(dataCardPattern):
                dataCardList.append(dataCardPattern)
                rootFileList.append(rootFilePattern)

    parser = commonLimitTools.createOptionParser(lepType, lhcType, lhcTypeAsymptotic)
    opts = commonLimitTools.parseOptionParser(parser)
    # General settings

    myDirs = opts.dirs[:]
    if len(myDirs) == 0:
        myDirs.append(".")

    for myDir in myDirs:
        print "Considering directory:",myDir
        datacardPatterns = []
        rootFilePatterns = []
        myMassPoints = []
        if len(opts.masspoints) > 0:
            myMassPoints = opts.masspoints[:]
        # taunu, tau+jets final state
def createOptionParser(lepDefault=None, lhcDefault=None, lhcasyDefault=None):
    return commonLimitTools.createOptionParser(lepDefault, lhcDefault, lhcasyDefault)
Exemple #7
0
                line += " %9.5f"%(float(masspoints[k]["expected"][item]))
            for item in myKeys:
                if "%s_error"%item in masspoints[k]["expected"]:
                    a = float(masspoints[k]["expected"]["%s_error"%item])
                    b = float(masspoints[k]["expected"][item])
                    r = 0.0
                    if b > 0:
                        r = a/b
                    line += " %9.4f"%(r)
                else:
                    line += "      n.a."
            print line
        myFile.close()

if __name__ == "__main__":
    parser = commonLimitTools.createOptionParser(lepDefault=None, lhcDefault=False, lhcasyDefault=False, fullOptions=False)
    parser.add_option("--printonly", dest="printonly", action="store_true", default=False, help="Print only the ready results")
    parser.add_option("--combination", dest="combination", action="store_true", default=False, help="Run combination instead of only taunu fully hadr.")
    opts = commonLimitTools.parseOptionParser(parser)

    # Obtain directory list
    myDirs = opts.dirs[:]
    if len(myDirs) == 0 or (len(myDirs) == 1 and myDirs[0] == "."):
        myDirs = []
        for dirname, dirnames, filenames in os.walk('.'):
            for subdirname in dirnames:
                #if "LandSMultiCrab" in subdirname:
                if "datacards_" in subdirname:
                    myDirs.append(os.path.join(dirname, subdirname))
        if len(myDirs) == 0:
            raise Exception("Error: Could not find any sub directories starting with 'datacards_' below this directory!")