コード例 #1
0
ファイル: NLLPlot_combined.py プロジェクト: llechner/TTXPheno
# turn off graphics
ROOT.gROOT.SetBatch(True)

# RootTools
from RootTools.core.standard import *

import numpy as np

from multiprocessing import Pool
import ctypes
ROOT.gStyle.SetNumberContours(255)

# Logger
import TTXPheno.Tools.logger as logger
import RootTools.core.logger as logger_rt
logger = logger.get_logger('DEBUG', logFile=None)
logger_rt = logger_rt.get_logger('INFO', logFile=None)

# TTXPheno
from TTXPheno.samples.benchmarks import *
from TTXPheno.Tools.user import plot_directory

# get the reweighting function
from TTXPheno.Tools.WeightInfo import WeightInfo

# Arguments
import argparse

argParser = argparse.ArgumentParser(description="Argument parser")
argParser.add_argument('--version',
                       action='store',
コード例 #2
0
                       action='store_true',
                       help="remove Delphes file after postprocessing?")
argParser.add_argument('--interpolationOrder',
                       action='store',
                       nargs='?',
                       type=int,
                       default=3,
                       help="Interpolation order for EFT weights.")
args = argParser.parse_args()

#
# Logger
#
import TTXPheno.Tools.logger as _logger
import RootTools.core.logger as _logger_rt
logger = _logger.get_logger(args.logLevel, logFile=None)
logger_rt = _logger_rt.get_logger(args.logLevel, logFile=None)

# Load sample either from
if len(args.inputFiles) > 0:
    logger.info("Input files found. Ignoring 'sample' argument. Files: %r",
                args.inputFiles)
    sample = FWLiteSample(args.targetSampleName, args.inputFiles)
else:
    if args.HEPMC:
        sample_file = "$CMSSW_BASE/python/TTXPheno/samples/hepmc_samples.py"
        samples = imp.load_source("samples", os.path.expandvars(sample_file))
        sample = getattr(samples, args.sample)[args.HEPMC]
    else:
        sample_file = "$CMSSW_BASE/python/TTXPheno/samples/fwlite_benchmarks.py"
        samples = imp.load_source("samples", os.path.expandvars(sample_file))
コード例 #3
0
# RootTools
from RootTools.core.standard import *

# TTXPheno
from TTXPheno.Tools.user import results_directory

# sqlite3 sample cache file
dbFile = os.path.join(results_directory, 'sample_cache',
                      'fwlite_benchmarks.db')
overwrite = False

# Logging
if __name__ == "__main__":
    import TTXPheno.Tools.logger as logger
    logger = logger.get_logger('DEBUG')
    import RootTools.core.logger as logger_rt
    logger_rt = logger_rt.get_logger('DEBUG')

# TTZ 931 gen with weights - high stats!
fwlite_ttZ_ll_LO_highStat_scan = FWLiteSample.fromDAS(
    "fwlite_ttZ_ll_LO_highStat_scan",
    "/ttZ0j_rwgt_patch_625_highStat_slc6_amd64_gcc630_CMSSW_9_3_0_tarball/schoef-dim6top_07April18-37d73f7f997f18e72dbfd34806877f87/USER",
    "phys03",
    dbFile=dbFile,
    overwrite=overwrite,
    prefix='root://hephyse.oeaw.ac.at/')
fwlite_ttZ_ll_LO_highStat_scan.reweight_pkl = "/afs/hephy.at/data/rschoefbeck02/TopEFT/results/gridpacks/ttZ0j_rwgt_patch_625_slc6_amd64_gcc630_CMSSW_9_3_0_tarball.pkl"

# TTZ 931 gen with weights - current plane high stats!
fwlite_ttZ_ll_LO_currentplane_highStat_scan = FWLiteSample.fromDAS(
コード例 #4
0
            return christoffel
        return christoffel_symbols 

# Make a list from the bin contents from a histogram that resulted from a 'Draw' of p_C 
def histo_to_list( histo ):
    return [ histo.GetBinContent(i) for i in range( 1, histo.GetNbinsX() + 1 ) ]

if __name__ == "__main__":

    # RootTools
    from RootTools.core.standard import *
    # Logger
    import TTXPheno.Tools.logger as logger
    import RootTools.core.logger as logger_rt
    logger    = logger.get_logger(   'INFO', logFile = None)
    logger_rt = logger_rt.get_logger('INFO', logFile = None)
    # TTXPheno
    from TTXPheno.Tools.cutInterpreterGen import cutInterpreter
    from TTXPheno.samples.benchmarks import * 

    # Sample
    sample = fwlite_ttZ_ll_LO_order2_15weights_ref
    # Debug 1 event
    sample.reduceFiles( to = 1 )
    w = WeightInfo(sample.reweight_pkl)
    w.set_order( 2 )

    selection_string = cutInterpreter.cutString('lepSel3-onZ-njet3p-nbjet1p-Zpt0')
    #selection_string = "evt==955001&&run==1&&lumi==9551"
コード例 #5
0
ファイル: reHadd.py プロジェクト: llechner/TTXPheno
        nargs='?',
        choices=['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'TRACE', 'NOTSET'],
        default='INFO',
        help="Log level for logging"
        )
        
    return argParser

options = get_parser().parse_args()

if options.treeName=='': 
    options.treeName=None

# Logger
import TTXPheno.Tools.logger as logger
logger = logger.get_logger(options.logLevel, logFile = None )

# Walk the directory structure and group files in 'jobs' of [f1_0.root, f1_1.root, ...]  tootalling to approx. sizeGB
jobs = []
for dirName, subdirList, fileList in os.walk(options.dir):
    rootFiles = []
    for f in fileList:
        if f.endswith('.root'):
            full_filename = os.path.join(dirName, f)
            if not '_reHadd_' in f:
                to_skip = False
                for skip in options.skip:
                    if skip in f:
                        logger.info( "Found skip string %s in %s. Skipping.", skip, f )
                        to_skip = True
                        break