ldmx-sw icon indicating copy to clipboard operation
ldmx-sw copied to clipboard

Wketchum/genie generator hep mc3 refactor

Open wesketchum opened this issue 1 year ago • 0 comments

I am updating ldmx-sw, here are the details.

What are the issues that this addresses?

This PR enables GENIE simulation that include the following:

  • A HepMC3GenEvent object to add to the LDMX event bus, inheriting from the HepMC3::GenEvent.
  • A EventWeights object to add to the LDMX event bus, for use in event reweighting studies.
  • A GenieGenerator generator that interfaces with the GENIE neutrino generator to run lepton scattering models. Currently the generator is limited to starting interactions at the target. It uses a HepMC3GenEvent as an interface to the event bus.
  • A GenieReweightProducer that can run GENIE's Reweight functionality, to reweight events based on turns of systematic knobs. It reads in HepMC3GenEvent recrods, recreates the GENIE internal event record based on that, and then runs reweighting.
  • A GenieTruthDQM module that extracts truth GENIE interaction information from the HepMC3GenEvent metadata, and stores it in a flat tree.

Check List

(note, this requires use of the updated docker image described by this PR: https://github.com/LDMX-Software/docker/pull/105)

  • [x] I successfully compiled ldmx-sw with my developments
  • [x] I ran my developments and the following shows that they are successful.

An example ldmxsw config is here: https://github.com/wesketchum/LDMX_eN_GENIE/blob/main/ldmxsw_configs/genie_sim.py. From the output of that, one can look at the genie_truth tree from the DQM. Attached is a plot of the initial and final lepton energy for a 4 GeV run. lepton_energy_example

Additionally, to see the event reweighting working, here is a screenshot of some screen debug outputs that show weights applied per event. Screenshot 2024-10-16 at 14 26 29

wesketchum avatar Oct 16 '24 12:10 wesketchum