Total energy deposited in the detector

Hi Dear geant4 user !
I’m trying to simulate the efficiency of HPGe detector.
can someone let me to know how to print the total energy deposited on the detector crystal ?

Hello!

I think that one of the possible solution in this case may be using scoring in macro mode. If your crystal has a simple geometry it is not so tricky to define corresponding mesh with just 1 bin and then take it to score energy deposit for all particles.
I have no huge experience in Geant4, therefore there can be a simplest solution that other users may suggest to you.
Reply please if you need more details about scoring.

thank for your answer.
can you give me more about the scoring you say ?

Simple way to define scoring is write some command in macro file, which you probably using for start your simulation.

  1. Firstly you need to add some code to “main.cpp” of your simulation, please see here on the page 4:
    https://indico.cern.ch/event/782305/contributions/3256028/attachments/1793321/2922301/2c_Scoring.pdf
  2. Secondly, in your macro file define scoring mesh - special non-physical volume in that you want to calculate energy deposition. At this moment there are just two possible shapes of mesh: box and cylinder. In the page 6 you can see example of defining box mesh. In your case (I mean that you want to calculate full deposit in whole crystal) number of bins at all axis are equal to 1.
  3. Then you write /score/quantity/energyDeposit “quantity name” and /score/close.
  4. And finally after /run/beamOn command in macro write this to save result in the file /score/dumpQuantityToFile “mesh name” “quantity name” “path to file and it’s name”

All this steps and some additional features are covered in the document that I linked.

1 Like

Okay, thank I will try to see