diff options
author | Stan Seibert <stan@mtrr.org> | 2011-09-13 16:10:04 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-09-13 16:10:04 -0400 |
commit | 4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75 (patch) | |
tree | 90a910177777115b6ef7ad2780b09ca69ff87109 /fileio | |
parent | 1ed35a8420b73afa76c12c82f4aebc31132650d9 (diff) | |
parent | 6f0703602270d03f4025221f13fee21aa842a863 (diff) | |
download | chroma-4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75.tar.gz chroma-4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75.tar.bz2 chroma-4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75.zip |
merge
Diffstat (limited to 'fileio')
-rw-r--r-- | fileio/root.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fileio/root.py b/fileio/root.py index 507c249..af86deb 100644 --- a/fileio/root.py +++ b/fileio/root.py @@ -25,11 +25,11 @@ def make_photon_with_arrays(size): def root_vertex_to_python_vertex(vertex): "Returns a chroma.event.Vertex object from a root Vertex object." return event.Vertex(str(vertex.particle_name), - tvector3_to_ndarray(vertex.pos), - tvector3_to_ndarray(vertex.dir), - tvector3_to_ndarray(vertex.pol), - vertex.ke, - vertex.t0) + pos=tvector3_to_ndarray(vertex.pos), + dir=tvector3_to_ndarray(vertex.dir), + ke=vertex.ke, + t0=vertex.t0, + pol=tvector3_to_ndarray(vertex.pol)) def root_event_to_python_event(ev): '''Returns a new chroma.event.Event object created from the @@ -148,12 +148,14 @@ class RootWriter(object): "Write an event.Event object to the ROOT tree as a ROOT.Event object." self.ev.id = pyev.id - self.ev.primary_vertex.particle_name = pyev.primary_vertex.particle_name - self.ev.primary_vertex.pos.SetXYZ(*pyev.primary_vertex.pos) - self.ev.primary_vertex.dir.SetXYZ(*pyev.primary_vertex.dir) - if pyev.primary_vertex.pol is not None: - self.ev.primary_vertex.pol.SetXYZ(*pyev.primary_vertex.pol) - self.ev.primary_vertex.ke = pyev.primary_vertex.ke + if pyev.primary_vertex is not None: + self.ev.primary_vertex.particle_name = \ + pyev.primary_vertex.particle_name + self.ev.primary_vertex.pos.SetXYZ(*pyev.primary_vertex.pos) + self.ev.primary_vertex.dir.SetXYZ(*pyev.primary_vertex.dir) + if pyev.primary_vertex.pol is not None: + self.ev.primary_vertex.pol.SetXYZ(*pyev.primary_vertex.pol) + self.ev.primary_vertex.ke = pyev.primary_vertex.ke if pyev.photons_beg is not None: photons = pyev.photons_beg |