Ejemplo n.º 1
0
 def test_analysis(self):
     """Check for an almost perfect match with reference.
     Will fail if physics algorithms are modified,
     so should probably be removed from test suite,
     or better: be made optional. 
     """
     self.looper.loop()
     self.looper.write()
     rootfile = "/".join([self.outdir, "heppy.analyzers.examples.zh.ZHTreeProducer.ZHTreeProducer_1/tree.root"])
     mean, sigma = plot(rootfile)
     self.assertAlmostEqual(mean, 120.7, 1)
     self.assertAlmostEqual(sigma, 20.3, 1)
Ejemplo n.º 2
0
 def test_analysis(self):
     '''Check for an almost perfect match with reference.
     Will fail if physics algorithms are modified,
     so should probably be removed from test suite,
     or better: be made optional. 
     '''
     self.looper.loop()
     self.looper.write()
     rootfile = '/'.join([
         self.outdir,
         'heppy.analyzers.examples.zh.ZHTreeProducer.ZHTreeProducer_1/tree.root'
     ])
     mean, sigma = plot(rootfile)
     self.assertAlmostEqual(mean, 120.7, 1)
     self.assertAlmostEqual(sigma, 20.3, 1)
Ejemplo n.º 3
0
 def test_analysis_ee_ZH_mumubb(self):
     '''Check for an almost perfect match with reference.
     Will fail if physics algorithms are modified,
     so should probably be removed from test suite,
     or better: be made optional. 
     '''
     from heppy.papas.detectors.CMS import cms
     config.sequence[2].detector = cms
     # import pdb; pdb.set_trace()
     fname = '/'.join(
         [os.environ['HEPPY'], 'test/data/ee_ZH_Zmumu_Hbb.root'])
     config.components[0].files = [fname]
     looper = Looper(self.outdir, config, nEvents=50, nPrint=0)
     looper.loop()
     looper.write()
     rootfile = '/'.join([
         self.outdir,
         'heppy.analyzers.examples.zh.ZHTreeProducer.ZHTreeProducer_1/tree.root'
     ])
     mean, sigma = plot(rootfile)
     self.assertAlmostEqual(mean, 113.3, 1)
     self.assertAlmostEqual(sigma, 21.2, 1)
Ejemplo n.º 4
0
 def test_analysis_ee_ZH_mumubb(self):
     '''Check for an almost perfect match with reference.
     Will fail if physics algorithms are modified,
     so should probably be removed from test suite,
     or better: be made optional. 
     '''
     from heppy.papas.detectors.CMS import cms
     for s in config.sequence:
         if hasattr( s,'detector'):
             s.detector = cms
     # import pdb; pdb.set_trace()
     fname = '/'.join([os.environ['HEPPY'],
                               'test/data/ee_ZH_Zmumu_Hbb.root'])
     config.components[0].files = [fname]
     looper = Looper( self.outdir, config,
                                   nEvents=100,
                                   nPrint=0 )
     looper.loop()
     looper.write()
     rootfile = '/'.join([self.outdir,
                         'heppy.analyzers.examples.zh.ZHTreeProducer.ZHTreeProducer_1/tree.root'])
     mean, sigma = plot(rootfile)
     self.assertAlmostEqual(mean, 110.87, 1)
     self.assertAlmostEqual(sigma, 18.6, 1)