Time window of detection

Hello, i created a setup with two detectors and scintillation material.
Also i generated a source with one gamma at time=0 and two other gammas after a certain lifetime.
So my problem is, i want only the scintillation hits in a time window of 200ns if i get a hit with the first gamma in one detector and one of the other two gammas in the other detector. All hits of other events aren’t relevant.
Do anyone has an idea how to solve this problem?

It sounds like you’re doing a coincidence experiment. You could do this within your simulation using a SteppingAction, where you set a flag and store the hit when one of the detectors is hit (make sure you store the event number as well, and reset everything when the event changes!), and then watch for a hit in the other detector within 200 ns.

Alternatively, you could store hits from both detectors into an N-tuple (including information like event number, hit times and energies, etc.), and implement the trigger window in your offline analysis code.

@mkelsey : Following the second approach, I save GlobalTime for each entry but that is unchanged for every entry of that event; as the decay primary source has really large half-life. How can I compare the timing of two entries (of respective two detectors) in my post-analysis; as I essentially see both times the same? Is there a way to reset the time at the start of each event or any alternative means to implement for a beginner like me?

I see. Do you need the half-life time distribution of primaries for your analysis? Or would you be happy if each event started with time t=0 after the decay?

In our experiment, we wrote a wrapper class around G4RadioactiveDecay, with a flag to reset the daughter times to match the parent track time. But that only works if you’re only generating one decay per event.

Thanks, yes i’m doing a coincidence experiment.
Is there an example for a coincidence experiment in the geant4 examples?