Collected charge with diode

Hi
I am working with a pin diode of 25um and with a 200V voltage bias. I am measuring the signal with an oscilloscope during irradiation with 84MeV protons and then converting it into a collected charge. I would like to simulate the same setup and be able to compare the total propagated charge with the measured one. I am trying to set up the simulation with the following configuration file. I should obtain the charge value with an analysis script looping on the PropagatedCharge output file? Do you have any suggestions on where to start looking and how to extract a total propagated charge?

Thank you in advance.
Umberto.

Dear @berto ,

I think you forgot to attach or paste the configuration file.
You have several options. A very simple one would be to have a look at the histogram file, depending on your charge propagation and/or digitisation module you will find graphs that should the information you need. If you like to get information on an event-by-event basis, indeed I recommend writing out the data via the ROOTObjectWriter and writing an analysis script as the one you mentioned. You can either look at the PropagatedCharge objects or, if you prefer, at the PixelCharge or PixelHit objects. You can get more information on what to expect from which object here.
If you need hints on how to write such a script, there’s a directory in the repository holding a couple of scripts. I have to admit, that some of them might be a bit outdated, but they show the general syntax on how to access individual objects from individual events.

I hope this helps - please let us know in case you need further help!

Cheers
Paul

…adding to @pschutze’s nice explanation - I’d avoid storing PropagatedCharge objects (the latest version of APSQ prints a warning if you do) because this will write a separate object for every electron and every hole in your sensor for every event - so a high data volume that you don’t necessarily need.

Best,
Simon