-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature t0 vertex #133
Feature t0 vertex #133
Conversation
This allows us to use the globally unique event IDs. Didn't notice this before because we were either using the spill sim (where this change was already made) or using zero-based event IDs in the non-spill (bomb) case. Should probably be backported to `main`.
Feature t0 vertex
#print("Class: ", event.ClassName()) | ||
#print("Event number:", event.EventId) | ||
|
||
globalVertexID = (event.RunId * 1E6) + event.EventId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to globalEventID?
vertex["y_vert"] = primaryVertex.GetPosition().Y() | ||
vertex["z_vert"] = primaryVertex.GetPosition().Z() | ||
vertices_list.append(vertex) | ||
vertices[iVtx]["eventID"] = event.EventId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use globalEventID instead?
|
||
# Output array datatypes | ||
segments_dtype = np.dtype([("vertexID", "u4"), ("segment_id", "u4"), ("z_end", "f4"), | ||
("trackID", "u4"), ("tran_diff", "f4"), | ||
segments_dtype = np.dtype([("eventID","u4"),("vertexID", "u8"), ("segment_id", "u4"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change eventID to a u8 so that we can store globalEventId?
@@ -26,27 +27,19 @@ | |||
("y", "f4"), ("x", "f4"), ("z", "f4"), | |||
("n_photons","f4")], align=True) | |||
|
|||
trajectories_dtype = np.dtype([("vertexID", "u4"), ("trackID", "u4"), | |||
("parentID", "i4"), | |||
trajectories_dtype = np.dtype([("eventID","u4"), ("vertexID", "u8"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u8 eventID?
("Elep", "f4"), ("lep_mom", "f4"), ("lep_ang", "f4"), ("lep_pdg", "i4"), | ||
("q0", "f4"), ("q3", "f4"), ("Q2", "f4"), | ||
("x", "f4"), ("y", "f4")], align=True) | ||
vertices_dtype = np.dtype([("eventID","u4"), ("vertexID","u8"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u8 eventID?
vertex["z_vert"] = primaryVertex.GetPosition().Z() | ||
vertices_list.append(vertex) | ||
vertices[iVtx]["eventID"] = event.EventId | ||
vertices[iVtx]["vertexID"] = iVtx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is non-unique, which is fine if we're using eventID as the EVENT_SEPARATOR. But if for some reason (memory constraints??) we ever want to use vertexID as the EVENT_SEPARATOR, we'll need it to be unique. Change to something hacky like globalEventId*100 + iVtx
?
trajectories[iTraj]["vertexID"] = event.EventId | ||
trajectories[iTraj]["trackID"] = trajectory.GetTrackId() | ||
trajectories[iTraj]["parentID"] = trajectory.GetParentId() | ||
trajectories[iTraj]["eventID"] = event.EventId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
globalEventId?
trajectories[iTraj]["trackID"] = trajectory.GetTrackId() | ||
trajectories[iTraj]["parentID"] = trajectory.GetParentId() | ||
trajectories[iTraj]["eventID"] = event.EventId | ||
trajectories[iTraj]["vertexID"] = globalVertexID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually change to an actual unique vertex ID? Seems to require some changes in edep-sim so that it stores the vertex associated with each trajectory. For now I guess trajectories['eventID'] and trajectories['vertexID'] will have to refer to the same thing (for the non-spill case)
segment = np.empty(len(hitSegments), dtype=segments_dtype) | ||
for iHit, hitSegment in enumerate(hitSegments): | ||
segment[iHit]["vertexID"] = event.EventId | ||
segment[iHit]["eventID"] = event.EventId | ||
segment[iHit]["vertexID"] = globalVertexID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments above re trajectories
Successfully tested on a 2x2 (beam) file. Review comments are for future consideration. |
No description provided.