コード例 #1
0
from RecoTauTag.TauAnalysisTools.fakeRate.makeHistograms import make_plots
from RecoTauTag.TauAnalysisTools.TriggerReport import TriggerReport
# Get our configuration
from RecoTauTag.TauAnalysisTools.fakeRate.histogramConfiguration import makeCuts
# Get the configuration parameters
from sources import denominator, sources
import glob

from optparse import OptionParser

parser = OptionParser()

parser.add_option('-n', '--njobs', help="Specify how many jobs to split the input into", type="int")
parser.add_option('-j', '--job', help="Specify the job index to run", type="int")
parser.add_option('-l', '--ls', help="Only print out the number of events", action='store_true')
parser.add_option('-s', '--source', help="Name of the ntuple source to use.  Currently configured: %s" % sources.keys())

(options, args) = parser.parse_args()     

def normalizeToOneInverseNanoBarn(xSection, nEvents, filterEff):
    ''' Return a normalization factor to one nb-1 

    xSection should be given in picobarns

    L = nEvents/(xSection*filterEff)
    '''
    # in pb-1
    uncorrectedLumi = float(nEvents)/(xSection*filterEff)
    # pb-1 = 1e3 * nb-1
    nbLumi = 1e-3*uncorrectedLumi
    weight = 1.0/nbLumi
コード例 #2
0
                  '--njobs',
                  help="Specify how many jobs to split the input into",
                  type="int")
parser.add_option('-j',
                  '--job',
                  help="Specify the job index to run",
                  type="int")
parser.add_option('-l',
                  '--ls',
                  help="Only print out the number of events",
                  action='store_true')
parser.add_option(
    '-s',
    '--source',
    help="Name of the ntuple source to use.  Currently configured: %s" %
    sources.keys())

(options, args) = parser.parse_args()


def normalizeToOneInverseNanoBarn(xSection, nEvents, filterEff):
    ''' Return a normalization factor to one nb-1 

    xSection should be given in picobarns

    L = nEvents/(xSection*filterEff)
    '''
    # in pb-1
    uncorrectedLumi = float(nEvents) / (xSection * filterEff)
    # pb-1 = 1e3 * nb-1
    nbLumi = 1e-3 * uncorrectedLumi
コード例 #3
0
#!/usr/bin/env python

'''

Script to submit histogram production to LXBatch

Author: Evan Friis

'''

import os
import string
import subprocess
from sources import sources

samples_to_submit = sources.keys()

cmssw_base = os.environ['CMSSW_BASE']
working_dir = os.path.join(cmssw_base, 'src/RecoTauTag/TauAnalysisTools/test/fakeRate')

job_template = string.Template('''
#!/bin/bash
cd $working_dir
eval `scram ru -sh`
./batch_histograms.py -n $maxJobs -j $jobID -s $sample
''')

jobs_per_sample=50

for sample in samples_to_submit:
    for jobID in range(jobs_per_sample):