Medipix3 Threshold Scan simulations

Hi,

I am trying to simulate a medipix3 detector, and I would really like to be able to simulate a threshold scan to determine energy resolution. I can quite easily extract the counts for one given threshold value, but I am not sure as to the best way to go about simulating multiple thresholds. Do I need to run the simulation many times, changing the threshold each time? Or is there a way to setup the simulation so it will loop through a given range of threshold values.

The other problem I have encountered is that when I set the threshold significantly high enough that there are no counts registered, the output root file contains no ‘pixel_hit’ tree. I imagine this could become an issue when performing analysis. Is there some way to set up my config files so this information is still saved even if no hits are registered in the detector?

I’m also curious as to potential ways I can simulate the different gain modes, as well as charge summing for the medipix3 detector. From what I can see in the medipix3 config file provided with the AllPix build neither the gain modes nor charge summing mode are implemented. If anyone has tried to implement these into their simulations I would love to learn more.

I have attached my simulation files.

Thanks,
Rory

dac_scan.conf (893 Bytes)
detector_geometry.conf (75 Bytes)
medipix3.conf (678 Bytes)