eic / npsim

DD4hep-based simulation plugins, front-end, and related utilities
0 stars 2 forks source link

feat: plugin to apply optical photon efficiency on generation #16

Closed wdconinc closed 8 months ago

wdconinc commented 9 months ago

Briefly, what does this PR introduce?

This adds a stacking action plugion to apply final quantum efficiency for optical photons as an effective generation efficiency by suppressing at stacking.

TODO:

What kind of change does this PR introduce?

Please check if this PR fulfills the following:

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No. Optical photons are not enabled by default in the DIRC since none of the materials support optical photons.

wdconinc commented 8 months ago

@veprbl This is not required for 24.03.0.

veprbl commented 8 months ago

Do optical processes trigger stacking action? Because, if they do, the efficiency will be applied multiple times. Is it possible add a debug printout to display creator process, possibly assert that it has to be scintillation/cherenkov?

wdconinc commented 8 months ago

Stacking action applies to new particles. The only optical process that should add secondaries is WLS (and WLS2). Optical boundary processes change the same particle so it undergoes reflection, transmission, or absorption.

Tests comparing the received optical photon energy spectrum at the hpDIRC sensor plane indicate that this plugin applies the efficiency only once. I can post some plots later.

wdconinc commented 8 months ago

Comparison without (top) and with efficiency (bottom) (for different random seeds). image

wdconinc commented 8 months ago

There are a substantial number of calls to classifyNewTrack(), but they are all no-ops. I added some more diagnostic output in VERBOSE, and a counter in DEBUG that indicates what fraction of photons was killed. I'll file a new PR for that.