Пример #1
0
from FireHydrant.Tools.uproothelpers import fromNestNestIndexArray

np.seterr(divide='ignore', invalid='ignore', over='ignore')

parser = argparse.ArgumentParser(description="leptonjet ABCD")
parser.add_argument(
    "--sync",
    action='store_true',
    help="issue rsync command to sync plots folder to lxplus web server")
args = parser.parse_args()

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 LjABCDProcessor(processor.ProcessorABC):
    def __init__(self, data_type='bkg'):
        self.data_type = data_type

        dataset_axis = hist.Cat('dataset', 'dataset')
        iso_axis = hist.Bin('iso', 'min pfIso', 50, 0, 0.5)
        bin_axis = hist.Bin('val', 'binary value', 3, 0, 3)
        self._accumulator = processor.dict_accumulator({
            'chan-4mu':
            hist.Hist('Counts', dataset_axis, iso_axis, bin_axis),
            'chan-2mu2e':
parser = argparse.ArgumentParser(
    description="leptonjet isolation profile of pt, eta")
parser.add_argument(
    "--sync",
    action='store_true',
    help="issue rsync command to sync plots folder to lxplus web server")
parser.add_argument("--preserve",
                    action='store_true',
                    help="preserve plots in ROOT file")
args = parser.parse_args()

import ROOT
ROOT.gROOT.SetBatch()

sdml = SigDatasetMapLoader()
sigDS, sigSCALE = sdml.fetch()

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


@contextmanager
def _setIgnoreLevel(level):
    originalLevel = ROOT.gErrorIgnoreLevel
    ROOT.gErrorIgnoreLevel = level
    yield
    ROOT.gErrorIgnoreLevel = originalLevel