AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
49 stars 95 forks source link

Question: Best approach to implement weighted background event overlays #919

Closed wdconinc closed 2 years ago

wdconinc commented 2 years ago

In the EIC we are anticipating the need of overlaying multiple event generator input files, in particular combining DIS events from Pythia8 with background event distributions from other generators. This is similar to event stacking to study pile-up (which I think is what ddsim already does when multiple input files are specified, with the Geant4InteractionMerger), but differs somewhat since we would want to weight multiple input files differently. Instead of:

ddsim --inputFiles dis.hepmc bg.hepmc 

we'd want something like

ddsim --inputFiles dis.hepmc bg.hepmc --input.weighting [1, 0.1]

to pick with probability 1 an event from input file 1, and pick with probability 0.1 an event from input file 2.

Is there a way to achieve this already in ddsim or using existing plugins, and is there possibly an example or some code you could point us to?

andresailer commented 2 years ago

For ILC and CLIC studies, we always do the overlay in the digitisation stage independent of the simulation. So at least I am not aware of anything in DD4hep that does this.

wdconinc commented 2 years ago

We'd been considering doing this at the digitization stage too, but that opens up a whole different set of issue that I'd be curious about too:

andresailer commented 2 years ago

For CLIC we use the overlaytiming processor: https://github.com/iLCSoft/Overlay/blob/master/src/OverlayTiming.cc (possibly with the k4MarlinWrapper for a little longer)

andresailer commented 2 years ago

I think the question was answered, and no development in DD4hep is foreseen, so closing.