Exemple #1
0
#!/usr/bin/env python
from __future__ import print_function
import math

from FireROOT.Analysis.Events import *
from FireROOT.Analysis.Utils import *
from FireROOT.Analysis.DatasetMapLoader import DatasetMapLoader, SigDatasetMapLoader

from rootpy.logger import log

log = log[__name__]

dml = DatasetMapLoader()
dataDS, dataMAP = dml.fetch('data')
bkgDS, bkgMAP, bkgSCALE = dml.fetch('bkg')

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


class MyEvents(Events):
    def __init__(self, files=None, type='MC'):
        super(MyEvents, self).__init__(files=files, type=type)

    def processEvent(self, event, aux):
        LJ0, LJ1 = aux['lj0'], aux['lj1']
        passCosmic = all(map(lambda lj: lj.passCosmicVeto(event), [LJ0, LJ1]))

        if not passCosmic: return
Exemple #2
0
if __name__ == '__main__':

    outdir = os.path.join(
        os.getenv('CMSSW_BASE'),
        '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(
Exemple #3
0
#!/usr/bin/env python
from __future__ import print_function
import math

from FireROOT.Analysis.Events import *
from FireROOT.Analysis.Utils import *
from FireROOT.Analysis.DatasetMapLoader import DatasetMapLoader, SigDatasetMapLoader

from rootpy.logger import log
log = log[__name__]

dml = DatasetMapLoader()
dataDS, dataMAP = dml.fetch('data')

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


class MyEvents(Events):
    def __init__(self, files=None, type='MC'):
        super(MyEvents, self).__init__(files=files, type=type)

    def processEvent(self, event, aux):
        LJ0, LJ1 = aux['lj0'], aux['lj1']
        passCosmic = all(map(lambda lj: lj.passCosmicVeto(event), [LJ0, LJ1]))

        if not passCosmic: return
        # for lj in [LJ0, LJ1]:
        #     if lj.isMuonType() and lj.minTkD0()<0.1: return