Пример #1
0

def get_parser():
    import argparse
    argParser = argparse.ArgumentParser(
        description="Argument parser for samples file")
    argParser.add_argument('--overwrite',
                           action='store_true',
                           help="Overwrite current entry in db?")
    return argParser


# Logging
if __name__ == "__main__":
    import Samples.Tools.logger as logger
    logger = logger.get_logger("INFO", logFile=None)
    import RootTools.core.logger as logger_rt
    logger_rt = logger_rt.get_logger("INFO", logFile=None)
    options = get_parser().parse_args()
    ov = options.overwrite

else:
    import logging
    logger = logging.getLogger(__name__)
    ov = False

from Samples.Tools.config import dbDir, redirector, redirector_global
dbFile = dbDir + "DB_Fall17_Fast_miniAODv2.sql"

logger.info("Using db file: %s", dbFile)
Пример #2
0
# Logging
import Analysis.Tools.logger as logger
logdir  = "/tmp/lukas.lechner/%s/"%str(uuid.uuid4())
logFile = '%s/%s_%s_njob%s.txt'%(logdir, '_'.join(options.samples), os.environ['USER'], str(0 if options.nJobs==1 else options.job) )
if not os.path.exists( logdir ):
    try: os.makedirs( logdir )
    except: pass
logger  = logger.get_logger(options.logLevel, logFile = logFile)


import RootTools.core.logger as logger_rt
logger_rt = logger_rt.get_logger(options.logLevel, logFile = None )

import Samples.Tools.logger as logger_samples
logger_samples = logger_samples.get_logger(options.logLevel, logFile = None )

# Flags 
diMuCond               = "(Sum$(Muon_pt>=20&&abs(Muon_eta)<=2.40&&Muon_tightId)>=1)&&(Sum$(Muon_pt>=10&&abs(Muon_eta)<=2.40&&Muon_tightId)>=2)"
if options.year == 2016:
    diMuGammaCond          = "(Sum$(Photon_pt>=10&&abs(Photon_eta)<=2.5&&Photon_cutBased>=2)>=1)"
else:
    diMuGammaCond          = "(Sum$(Photon_pt>=10&&abs(Photon_eta)<=2.5&&Photon_cutBasedBitmap>=2)>=1)"

# additional conditions for testing
addCond                = "(1)"

skimConds = [diMuCond, diMuGammaCond, addCond]

#Samples: Load samples
maxNFiles = None
import ROOT

def get_parser():
    import argparse
    argParser = argparse.ArgumentParser(description = "Argument parser for samples file")
    argParser.add_argument('--overwrite',          action='store_true',    help="Overwrite current entry in db?")
    argParser.add_argument('--update',             action='store_true',    help="Update current entry in db?")
    argParser.add_argument('--check_completeness', action='store_true',    help="Check competeness?")
    argParser.add_argument('--logLevel',           action='store',         default='INFO', nargs='?', choices=['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE', 'NOTSET'], help="Log level for logging")
    return argParser
    
# Logging
if __name__=="__main__":
    options = get_parser().parse_args()
    import Samples.Tools.logger as logger
    logger = logger.get_logger(options.logLevel, logFile = None )
    import RootTools.core.logger as logger_rt
    logger_rt = logger_rt.get_logger(options.logLevel, logFile = None )
    ov = options.overwrite
    if options.update:
        ov = 'update'
else:
    import logging
    logger = logging.getLogger(__name__)
    ov = False

# Redirector
try:
    redirector = sys.modules['__main__'].redirector
except:
    if "clip" in os.getenv("HOSTNAME").lower():
Пример #4
0
    import argparse
    argParser = argparse.ArgumentParser(
        description="Argument parser for samples file")
    argParser.add_argument('--overwrite',
                           action='store_true',
                           help="Overwrite current entry in db?")
    argParser.add_argument('--update',
                           action='store_true',
                           help="Update current entry in db?")
    return argParser


# Logging
import Samples.Tools.logger as logger_samples

logger_samples = logger_samples.get_logger("INFO", logFile=None)

if __name__ == "__main__":
    import RootTools.core.logger as logger_rt
    logger_rt = logger_rt.get_logger("INFO", logFile=None)
    options = get_parser().parse_args()
    ov = options.overwrite
    if options.update:
        ov = 'update'
else:
    import logging
    logger_samples = logging.getLogger(__name__)
    ov = False

# Redirector
try: