Esempio n. 1
0
        'src/FireROOT/Analysis/python/outputs/rootfiles/{}/'.format(
            args.mbase))
    if not os.path.isdir(outdir): os.makedirs(outdir)

    if args.outname:
        outname = os.path.join(outdir, '{}.root'.format(args.outname))
    else:
        outname = os.path.join(outdir, '{}.root'.format(args.module))
    if args.create == 'update' and not os.path.isfile(outname):
        sys.exit('UPDATE was used not file not recreated yet.')

    if args.mbase != 'proxy' and (runbkg or rundata): dml = DatasetMapLoader()

    if runsig:
        if args.private: sdml = SigDatasetMapLoader()
        else: sdml = CentralSignalMapLoader()

        sampleSig = 'mXX-800_mA-5_lxy-300|mXX-500_mA-1p2_lxy-300|mXX-1000_mA-0p25_lxy-300|mXX-1000_mA-0p25_lxy-0p3|mXX-150_mA-0p25_lxy-300|mXX-100_mA-5_lxy-0p3'.split(
            '|')
        #        sampleSig = 'mXX-150_mA-0p25_lxy-300|mXX-500_mA-1p2_lxy-300|mXX-800_mA-5_lxy-300'.split('|')
        #        sampleSig.extend( 'mXX-100_mA-5_lxy-0p3|mXX-1000_mA-0p25_lxy-0p3'.split('|') )
        if args.sigparam:
            print("Checking matching samples now", args.sigparam)
            sampleSig = []
            for s in args.sigparam:
                if '*' in s or '?' in s:
                    sampleSig.extend(
                        fnmatch.filter(sdml.get_datasets('4mu').keys(), s))
                else:
                    sampleSig.append(s)
            sampleSig = list(set(sampleSig))
Esempio n. 2
0
    print('Fail to import; run `scram b`.')



if __name__ == '__main__':

    outdir = os.path.join(os.getenv('CMSSW_BASE'), 'src/FireROOT/Analysis/python/outputs/rootfiles/centralSig')
    if not os.path.isdir(outdir): os.makedirs(outdir)
    if args.outname:
        outname = os.path.join(outdir, '{}.root'.format(args.outname))
    else:
        outname = os.path.join(outdir, '{}.root'.format(args.module))
    if args.create == 'update' and not os.path.isfile(outname):
        sys.exit('UPDATE was used not file not recreated yet.')

    sdml = CentralSignalMapLoader()
    sigDS_2mu2e, sigSCALE_2mu2e = sdml.fetch('2mu2e')
    sigDS_4mu, sigSCALE_4mu = sdml.fetch('4mu')

    sampleSig = list(set(sigDS_2mu2e.keys()) | set(sigDS_4mu.keys()))
    if args.sigparam:
        _selected = []
        for s in args.sigparam:
            if '*' in s or '?' in s:
                _selected.extend( fnmatch.filter(sampleSig, s) )
            else: _selected.append(s)
        sampleSig = list(set(_selected))
        print(sampleSig)

    def dofill(pack):
        ds, files, scale, maxevents, channel = pack