LDMX-Software / SimCore

Integration of Geant4 simulation framework into a more generalized event processing framework.
2 stars 0 forks source link

Enhance SimParticle Handling #59

Closed tomeichlersmith closed 3 years ago

tomeichlersmith commented 3 years ago

This resolves #57

I got sick of the annoyingly complicated way in which sim particles ended up being saved, so I removed the middle-person. No more Trajectories! Basically, the TrackMap object now holds the ancestry tree, descendent tree, and the particle map that will be stored into the output file. The UserTrackInformation has a save flag that starts off false for all tracks. If a track has a true save flag by the time it is being killed, then it will be saved into the output event bus.

Still some more work and validation to do to make sure this didn't break anything, but I have checked that it works for a basic kaon-specific case.

Still To-Do

bryngemark commented 3 years ago

I have no comments on the actual implementation, just wanted to check, does this break backwards compatibility with existing simulations?

tomeichlersmith commented 3 years ago

No. The on-disk objects do not change[0] and I am in the process of validating that the generated simulation is not affected either[1].

[0]: I have simply removed a translation layer. Before it was G4Track -> Trajectory -> SimParticle and now it is G4Track -> SimParticle. The Trajectory class was built following G4 guidelines for G4 users who do not have their own I/O framework surrounding G4. Since we do have an I/O framework, we can cut-out the extra step.

[1]: I have checked that all the test configs in the Biasing module run normally. I need to check that the output data has not changed as compared to trunk.

bryngemark commented 3 years ago

No. The on-disk objects do not change[0] and I am in the process of validating that the generated simulation is not affected either[1].

Excellent, thanks!