Esempio n. 1
0
#                     ('eemu', '2D') : ('15to20', '20to25', '25to30', '30to40', '40to50', '55to100'),
#                     ('emumu', '1D') : ('15to30', '30to55'),
#                     ('emumu', '2D') : ('15to20', '20to25', '25to30', '30to40', '40to50', '55to100'),
#                     ('mumumu', '1D') : ['integral'],
#                     ('mumumu', '2D') : ['integral']}

#     var = {('pt', '1D') : (lambda c : c._lPt[c.l3],                                 np.arange(5., 40., 5.),                 ('p_{T}(trailing) [GeV]', 'Events')),
#            ('eta', '1D') : (lambda c : abs(c._lEta[c.l1]),                          np.arange(0., 3., .5),                  ('|#eta|(leading) [GeV]', 'Events')),
#            ('pt', '2D') : (lambda c : (c._lPt[c.l3], c._lPt[c.l2]),                     (np.arange(5., 40., 5.), np.arange(5., 40., 5.)), ('p_{T}(trailing) [GeV]', 'p_{T}(subleading) [GeV]')),
#            ('eta', '2D') : (lambda c : (abs(c._lEta[c.l3]), abs(c._lEta[c.l2])),      (np.arange(0., 3., .5), np.arange(0., 3., .5)), ('|#eta|(trailing) [GeV]', '|#eta|(subleading) [GeV]'))}

# Use categorization as defined in eventCategorization.py

from HNL.Tools.helpers import getMassRange

mass_range = getMassRange(sample_manager.sample_names)

category_map = {}
for c in categories:
    # category_map[c] = ['integral', '15to30', '30to55', '15to20', '20to25', '25to30', '30to40', '40to50', '55to100']   
    category_map[c] = ['integral']   
    # category_map[c] = ('15to30', '30to55') 
    # category_map[c] = ('15to20', '20to25', '25to30', '30to40', '40to50', '55to100') 

var = {'l1pt' : (lambda c : c.l_pt[0],                          np.arange(0., 100., 15.),                 ('p_{T}(l1) [GeV]', 'Efficiency')),
        'l2pt' : (lambda c : c.l_pt[1],                          np.arange(0., 100., 15.),                  ('p_{T}(l2) [GeV]', 'Efficiency')),
        'l3pt' : (lambda c : c.l_pt[2],                          np.arange(0., 100., 15.),                  ('p_{T}(l3) [GeV]', 'Efficiency')),
        'l1eta' : (lambda c : abs(c.l_eta[0]),                          np.arange(0., 3., .5),                  ('|#eta|(l1) [GeV]', 'Efficiency')),
        'l2eta' : (lambda c : abs(c.l_eta[1]),                          np.arange(0., 3., .5),                  ('|#eta|(l2) [GeV]', 'Efficiency')),
        'l3eta' : (lambda c : abs(c.l_eta[2]),                          np.arange(0., 3., .5),                  ('|#eta|(l3) [GeV]', 'Efficiency')),
        'l1-2D' : (lambda c : (c.l_pt[0], abs(c.l_eta[0])),      (np.arange(0., 100., 15.), np.arange(0., 3., .5)), ('p_{T}(l1) [GeV]', '|#eta|(l1)')),
Esempio n. 2
0
#
# Load in the sample list 
#
from HNL.Samples.sampleManager import SampleManager
sample_manager = SampleManager(args.year, 'noskim', 'signallist_'+str(args.year))


#
# Calculate the range for the histograms. These are as a function of the mass of the signal samples.
# This function looks at the names of all samples and returns an array with all values right the middle of those
# It assumes the samples are ordered by mass in the input list
#
from HNL.Tools.helpers import getMassRange
from HNL.Tools.histogram import Histogram

mass_range = getMassRange([sample_name for sample_name in sample_manager.sample_names if '-'+args.flavor+'-' in sample_name])

#
# Define the variables and axis name of the variable to fill and create efficiency objects
#
import numpy as np
var = {'HNLmass': (lambda c : c.HNLmass,        np.array(mass_range),   ('m_{N} [GeV]', 'Cross Section (pb)'))}

hist = Histogram('xsec', var['HNLmass'][0], var['HNLmass'][2], var['HNLmass'][1])

for sample in sample_manager.sample_list:
    if sample.name not in sample_manager.sample_names: continue
    if '-'+args.flavor+'-' not in sample.name: continue
    #
    # Load in sample and chain
    #