sample.style = styles.lineStyle(sample.color, width=2)
    sample.scale = lumi_scale
#    sample.weight = lambda event, sample: event.weight

if args.small:
    for sample in stack.samples:
        sample.normalization = 1.
        sample.reduceFiles(factor=10)
        sample.scale /= sample.normalization

weight_ = lambda event, sample: event.weight

# Use some defaults (set defaults before you create/import list of Plots!!)
Plot.setDefaults(stack=stack,
                 weight=staticmethod(weight_),
                 selectionString=cutInterpreter.cutString(
                     args.selection))  #, addOverFlowBin='upper' )

# Import plots list (AFTER setDefaults!!)
plotListFile = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                            'plotLists', args.plotFile + '.py')
if not os.path.isfile(plotListFile):
    logger.info("Plot file not found: %s", plotListFile)
    sys.exit(1)

plotModule = imp.load_source("plotLists", os.path.expandvars(plotListFile))
from plotLists import plotListDataMC as plotList

# plotList
addPlots = []

addPlots.append(
Exemple #2
0
for sample in stack.samples:
    sample.style = styles.lineStyle( sample.color, width=2  )
    sample.scale = lumi_scale
#    sample.weight = lambda event, sample: event.weight

if args.small:
    for sample in stack.samples:
        sample.normalization=1.
        sample.reduceFiles( factor=10 )
        sample.scale /= sample.normalization

weight_ = lambda event, sample: event.weight

# Use some defaults (set defaults before you create/import list of Plots!!)
Plot.setDefaults( stack=stack, weight=staticmethod( weight_ ), selectionString=cutInterpreter.cutString( args.selection ) )#, addOverFlowBin='upper' )

# Import plots list (AFTER setDefaults!!)
plotListFile = os.path.join( os.path.dirname( os.path.realpath( __file__ ) ), 'plotLists', args.plotFile + '.py' )
if not os.path.isfile( plotListFile ):
    logger.info( "Plot file not found: %s", plotListFile )
    sys.exit(1)

plotModule = imp.load_source( "plotLists", os.path.expandvars( plotListFile ) )
from plotLists import plotListDataMC as plotList

# plotList
addPlots = []

# Loop over channels
yields   = {}
Exemple #3
0
stackList = [[s] for s in signals]
stack = Stack(*stackList)

if args.small:
    for sample in stack.samples:
        sample.normalization = 1.
        sample.reduceFiles(factor=10)
        sample.scale /= sample.normalization

weight_ = lambda event, sample: 1

# Use some defaults (set defaults before you create/import list of Plots!!)
Plot.setDefaults(stack=stack,
                 weight=staticmethod(weight_),
                 selectionString=cutInterpreter.cutString(args.selection),
                 addOverFlowBin='upper')

# Import plots list (AFTER setDefaults!!)
plotListFile = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                            'plotLists', args.plotFile + '.py')
if not os.path.isfile(plotListFile):
    logger.info("Plot file not found: %s", plotListFile)
    sys.exit(1)

plotModule = imp.load_source("plotLists", os.path.expandvars(plotListFile))
from plotLists import plotListDataMC as plotList

# Loop over channels
yields = {}
allPlots = {}
Exemple #4
0
for sample in stack.samples:
    sample.scale = lumi_scale

if args.small:
    for sample in stack.samples:
        sample.normalization = 1.
        sample.reduceFiles(factor=10)
        sample.scale /= sample.normalization

weight_ = lambda event, sample: 0.001  #event.genWeight

# Use some defaults (set defaults before you create/import list of Plots!!)
Plot.setDefaults(stack=stack,
                 weight=staticmethod(weight_),
                 selectionString=cutInterpreter.cutString(args.selection),
                 histo_class=ROOT.TH1F)

allplots = []
allplots.append(
    Plot(
        name='genJet0_pt',
        texX='p_{T}(gen-jet_{0}) (GeV)',
        texY='Number of Events',
        attribute=lambda event, sample: event.GenJet0_pt,
        binning=[10, 0, 300],
    ))

allplots.append(
    Plot(
        name='genJet1_pt',