~ajdobbs/maus/event-viewer

« back to all changes in this revision

Viewing changes to src/map/MapCppEMRPlaneHits/test_map_cpp_emr_plane_hits.py

  • Committer: Adam Dobbs
  • Date: 2015-07-13 16:49:38 UTC
  • mfrom: (706.6.27 maus)
  • Revision ID: phuccj@gmail.com-20150713164938-8ux8j43u8iyx0yky
Merge: EMR updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        spill_out = maus_cpp.converter.json_repr(result)
67
67
        self.assertFalse("MapCppEMRPlaneHits" in spill_out["errors"])
68
68
 
69
 
        # consistent amount of reconEvents (5 = 3primary+1noise+1decay)
 
69
        # consistent amount of reconEvents (1DBB+fADC, 2 fADC only)
70
70
        n_ev = len(spill_out['recon_events'])
71
 
        self.assertEqual(5, n_ev)
 
71
        self.assertEqual(3, n_ev)
72
72
 
73
73
        # consitent amount of plane hit in each event (1 per event)
74
74
        for i in range(0, n_ev):
76
76
                                  ['emr_plane_hits'])
77
77
            self.assertEqual(1, n_hits)
78
78
 
 
79
        # secondary hits stored at the spill level (1 triggerless hit)
 
80
        self.assertTrue(spill_out['emr_spill_data']['emr_plane_hits'])
 
81
        spill_hits = 0
 
82
        for i in range(0, len(spill_out['emr_spill_data']\
 
83
                                       ['emr_plane_hits'])):
 
84
            for j in range(0, len(spill_out['emr_spill_data']\
 
85
                                           ['emr_plane_hits'][i]\
 
86
                                           ['emr_bars'])):
 
87
                spill_hits += len(spill_out['emr_spill_data']\
 
88
                                           ['emr_plane_hits'][i]\
 
89
                                           ['emr_bars'][j]['emr_bar_hits'])
 
90
        self.assertEqual(1, spill_hits)
 
91
 
79
92
if __name__ == "__main__":
80
93
    unittest.main()
81
94