Deposited energy

Hello, excuse me, I have a small question I would like to ask.
I want to get the distribution of deposited energy, but I’m not sure where to get it from the object module.
I only know of a histogram distribution in [DepositionGeant4], but the histogram is of little use to me.

Hi!

The easiest way is likely the histogram you mention, but I’m not sure why it is of little use to you. If the scaling is wrong, you can change it by using the output_plots_scale keyword. The number of bins in the histogram is 5 times this value, and the maximum in the deposited energy histogram is given by (output_plots_scale / 2) * charge_creation_energy + 10 where charge_creation_energy is either a value given in the configuration, or taken from the sensor material if no configuration value is given.

Another way to get the distribution could be by using [RootObjectWriter] module and saving the MCTrack object, which contains the initial and final energies for each Monte Carlo track. Taking the difference of these values will give the total energy lost by the track through your setup however, rather than just the energy deposited in a single sensor.

Feel free to elaborate a bit more on what you need, and we can try and sort it out in some nice way!

Kind regards,
Håkan

Thank you for your reply!
I want to get the distribution of the deposited energy, but the [DepositionGeant4] module gives a histogram, not the tree of root file I want. We can’t adjust the histogram at will.
Another way to get the distribution could be by using [RootObjectWriter] module and saving the MCTrack object, which contains the initial and final energies for each Monte Carlo track. But I don’t know if this energy difference is the deposition energy I need. I can currently only export the deposited energy as a txt file by modifying the source file in the [DepositionGeant4] module and then convert it to the root file. But I have to say, I find this method a bit laborious. So I was curious if there was an easy way.

Hi @Newyean

right now the only option to get this information from the ROOT tree is to store the DepositedCharge objects and to sum them up for each event.

We have, however, identified this as a nuisance already, especially since it requires you to store many objects that you might not need otherwise. We therefore have a patch under review that will add the total energy deposited to each MCParticle so you could sum this information instead: Draft: Store Total Deposited Charge by MCParticle (!919) · Merge requests · Allpix Squared / Allpix Squared · GitLab Let us know if this would help!

Cheers,
Simon