Пример #1
0
def checkElectronAlgorithm(chain, algo):
    if algo is None:
        try:
            chain.obj_sel
        except:
            #Initiate default object selection
            chain.obj_sel = objectSelectionCollection()
        return chain.obj_sel['light_algo']
    else:
        return algo
Пример #2
0
def checkElectronWP(chain, wp):
    if wp is None:
        try:
            chain.obj_sel
        except:
            #Initiate default object selection
            chain.obj_sel = objectSelectionCollection()
        return chain.obj_sel['ele_wp']
    else:
        return wp
Пример #3
0
    #
    # Start event loop
    #

    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)   
        
    #prepare object  and event selection
    from HNL.ObjectSelection.objectSelection import objectSelectionCollection
    if args.region is None:
        if args.skimSelection == 'Old':
            chain.obj_sel = objectSelectionCollection('HNL', 'cutbased', 'loose', 'loose', 'loose', True, analysis='HNL')
        elif args.skimSelection in ['Luka', 'LukaFR']:
            chain.obj_sel = objectSelectionCollection('HNL', 'Luka', 'loose', 'loose', 'loose', False, analysis='HNL')
        elif args.skimSelection == 'TTT':
            chain.obj_sel = objectSelectionCollection('HNL', 'TTT', 'loose', 'loose', 'loose', False, analysis='HNL')
        else:
            chain.obj_sel = objectSelectionCollection('HNL', 'HNL', 'loose', 'loose', 'loose', False, analysis='HNL')

    from HNL.Tools.helpers import progress
    from HNL.EventSelection.eventSelectionTools import selectLeptonsGeneral, selectGenLeptonsGeneral
    from HNL.EventSelection.event import Event
    if args.region is not None:
        event = Event(chain, chain, is_reco_level=not args.genSkim, selection=args.skimSelection, strategy=args.strategy, region=args.region)
        chain.selection = args.skimSelection
        chain.region = args.region
        chain.strategy = 'MVA' if args.region != 'AN2017014' else 'cutbased'