Ejemplo n.º 1
0
 def test_gen_load(self):
     aliases = gen.fs_content()
     zjets_cutflow = gen.filter(aliases, {
         "name": "cutflow",
         "sample": "zjets"
     })
     wrp = gen.load(zjets_cutflow).next()
     self.assertTrue(isinstance(wrp.histo, TH1F))
     self.assertAlmostEqual(wrp.histo.Integral(), 2889.0)
def gen_mixer_input(input_dict):
        for d in input_dict:
            yield   op.norm_to_integral(
                    op.merge(
                    list(
                    gen.load(
                    gen.filter(
                    gen.fs_content(),
                    d
                    )))))
Ejemplo n.º 3
0
    def run(self):
        wrps = gen.fs_content()
        wrps = gen.filter(
            wrps,
            {"analyzer": re.compile("CutFlow*")}
        )
        wrps = gen.filter_active_samples(wrps)
        wrps = sorted(wrps, key = sample_key_func)
        wrps = gen.load(wrps)
        grps = gen.group(wrps, sample_key_func)

        wrps = (self.combine_cutflow_histo(g) for g in grps)
        wrps = gen.pool_store_items(wrps)
        wrps = list(wrps)
        self.result = wrps
        count = len(wrps)
        self.message("INFO: "+self.name+" stored "+str(count)+" histos in pool.")
Ejemplo n.º 4
0
 def test_gen_load(self):
     aliases = gen.fs_content()
     zjets_cutflow = gen.filter(aliases, {"name": "cutflow", "sample": "zjets"})
     wrp = gen.load(zjets_cutflow).next()
     self.assertTrue(isinstance(wrp.histo, TH1F))
     self.assertAlmostEqual(wrp.histo.Integral(), 2889.0)