Example #1
0
    def __init__(self, sample, sample_manager):
        self.sample = sample
        self.sample_manager = sample_manager

        #lumi weights
        self.lumiweighter = LumiWeight(sample, sample_manager)

        #pu weights
        if not sample.is_data:
            self.puReweighting = getReweightingFunction(
                sample.chain.year, 'central')
            self.puReweightingUp = getReweightingFunction(
                sample.chain.year, 'up')
            self.puReweightingDown = getReweightingFunction(
                sample.chain.year, 'down')

        self.fakerate_collection = None
Example #2
0
    #
    # Set range of events to process
    #
    if args.isTest:
        max_events = 20000
        event_range = xrange(max_events) if max_events < len(
            sample.getEventRange(args.subJob)) else sample.getEventRange(
                args.subJob)
    else:
        event_range = sample.getEventRange(args.subJob)

    #
    # Get luminosity weight
    #
    from HNL.Weights.lumiweight import LumiWeight
    lw = LumiWeight(sample, sample_manager)

    from HNL.EventSelection.eventCategorization import EventCategory
    try:
        ec = EventCategory(chain)
    except:
        ec = None

    #
    # Define event selection
    #
    event = Event(chain,
                  chain,
                  is_reco_level=True,
                  selection=args.selection,
                  strategy='MVA',
Example #3
0
    if args.isTest:
        max_events = 2000
        event_range = xrange(max_events) if max_events < len(
            sample.getEventRange(args.subJob)) else sample.getEventRange(
                args.subJob)
    else:
        event_range = sample.getEventRange(args.subJob)

    chain.HNLmass = sample.getMass()
    chain.year = int(args.year)

    #
    # Get luminosity weight
    #
    from HNL.Weights.lumiweight import LumiWeight
    lw = LumiWeight(sample, sample_manager, skimmed=not args.noskim)

    from HNL.EventSelection.eventCategorization import EventCategory
    ec = EventCategory(chain)

    #
    # Object ID param
    #
    if args.selection == 'AN2017014':
        object_selection_param = {
            'no_tau': True,
            'light_algo': 'cutbased',
            'workingpoint': 'tight'
        }
    else:
        object_selection_param = {