Skip to content
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

Merged
merged 17 commits into from
May 4, 2023
Merged

Feature t0 vertex #133

merged 17 commits into from
May 4, 2023

Conversation

YifanC
Copy link
Collaborator

@YifanC YifanC commented May 3, 2023

No description provided.

#print("Class: ", event.ClassName())
#print("Event number:", event.EventId)

globalVertexID = (event.RunId * 1E6) + event.EventId
Copy link
Member

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
Copy link
Member

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"),
Copy link
Member

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"),
Copy link
Member

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"),
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@mjkramer
Copy link
Member

mjkramer commented May 4, 2023

Successfully tested on a 2x2 (beam) file. Review comments are for future consideration.

@mjkramer mjkramer closed this May 4, 2023
@mjkramer mjkramer reopened this May 4, 2023
@mjkramer mjkramer merged commit c013e94 into develop May 4, 2023
@mjkramer mjkramer mentioned this pull request May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants