lucabaldini / hexsample

Solid-state hybrid detectors with hexagonal sampling.
https://lucabaldini.github.io/hexsample/
GNU General Public License v3.0
2 stars 0 forks source link

Properly implement the trigger condition in the readout #49

Open lucabaldini opened 3 months ago

lucabaldini commented 3 months ago

At this point we do have a concept of trigger threshold, but most likely we are not doing the right thing when an event should not actually cause a trigger.

In readout.py all the read() functions should handle the condition where a given event is not causing a trigger.

lucabaldini commented 3 months ago

This might be not trivial, as the event loop, in the current implementation, looks like

for mc_event in tqdm(photon_list):
        x, y = mc_event.propagate(sensor.trans_diffusion_sigma)
        digi_event = readout.read(mc_event.timestamp, x, y, *readout_args)
        output_file.add_row(digi_event, mc_event)

i.e., we pre-compile a list of mc events, and then we process them, under the assumption that they all trigger.

We have two choices

I vote for the second, provided that we do not incur into a too high of a performance hit.