示例#1
0
文件: ssw2.py 项目: DylanHsu/MonoX
    
    ROOT.gROOT.LoadMacro(thisdir + '/Skimmer.cc+')

    snames = []

    if args.plotConfig:
        # if a plot config is specified, use the samples for that
        snames = plotconfig.getConfig(args.plotConfig).samples()

    else:
        snames = args.snames

    # handle special group names
    if 'all' in snames:
        snames.remove('all')
        snames = selectors.keys()
    elif 'dmfs' in snames:
        snames.remove('dmfs')
        snames += [key for key in selectors.keys() if key.startswith('dm') and key[3:5] == 'fs']
    elif 'dm' in snames:
        snames.remove('dm')
        snames += [key for key in selectors.keys() if key.startswith('dm')]
    elif 'add' in snames:
        snames.remove('add')
        snames += [key for key in selectors.keys() if key.startswith('add')]
    if 'fs' in snames:
        snames.remove('fs')
        snames += [key for key in selectors.keys() if 'fs' in key]

    # filter out empty samples
    tmp = [name for name in snames if allsamples[name].sumw > 0.]
示例#2
0
文件: ssw2.py 项目: yiiyama/MonoX
                # print "This combination is not part of the DMWG recommendations, moving onto next one."
                continue;

            selectors[sname] = mc_cand

if __name__ == '__main__':
    ROOT.gSystem.Load('libMitFlatDataFormats.so')
    ROOT.gSystem.AddIncludePath('-I' + os.environ['CMSSW_BASE'] + '/src/MitFlat/DataFormats/interface')
    
    ROOT.gROOT.LoadMacro(thisdir + '/Skimmer.cc+')

    sNames = sys.argv[1:]

    if len(sNames) != 0:
        if sNames[0] == 'all':
            sNames = selectors.keys()
        elif sNames[0] == 'list':
            print ' '.join(sorted(selectors.keys()))
            sys.exit(0)
        elif sNames[0] == 'dm':
            sNames = [key for key in selectors.keys() if 'dm' in key]
            print ' '.join(sorted(sNames))
            """
            for sName in sorted(sNames):
                print sName
            """
            sys.exit(0)
    
    skimmer = ROOT.Skimmer()
    
    sampleNames = []
示例#3
0
文件: ssw2.py 项目: blallen/MitMonoX
    sys.argv = []

    import ROOT

    ROOT.gSystem.Load(config.libsimpletree)
    ROOT.gSystem.AddIncludePath('-I' + config.dataformats + '/interface')
    ROOT.gSystem.AddIncludePath('-I' + config.dataformats + '/tools')
    ROOT.gSystem.AddIncludePath('-I' + os.path.dirname(basedir) + '/common')

    compiled = ROOT.gROOT.LoadMacro(thisdir + '/Skimmer.cc+')
    # doesn't seem to be returning different values if compilation fails :(
    if (compiled < 0 ):
        print "Couldn't compile Skimmer.cc. Quitting."
        sys.exit()

    snames = processSampleNames(args.snames, selectors.keys(), args.plotConfig)

    if args.list:
        print ' '.join(sorted(snames))
        # for sname in sorted(snames):
            # print sname
        sys.exit(0)
    
    skimmer = ROOT.Skimmer()

    if not os.path.exists(config.skimDir):
        os.makedirs(config.skimDir)

    if args.files:
        nStart = args.files[0]
        nEnd = args.files[1]