How to count the number of optical photon in macro file?

Hello experts,
As the title tell,i build a ZnS scintillator,and i only want to know how many photon producted when partical hit it.
Here is my macro file.

/run/initialize

/control/verbose 2
/run/verbose 2
/event/verbose 0
/tracking/verbose 1
/gps/direction 0. 0. 1.0
/gps/pos/type Point
/gps/pos/centre 0 0 0
/gps/pos/halfx
/gps/pos/halfy
/gps/pos/halfz
/gps/verbose 2
/gps/particle e-
/gps/ene/type Lin
/gps/ene/min 0 MeV
/gps/ene/max 10 MeV
/gps/ene/gradient 0.1
/gps/ene/intercept 0
/run/beamOn 1000

You don’t do it with a macro. (Maybe you can, but I wouldn’t and I don’t think people do).

You need to build a sensitive detector or record produced photons in your user defined stepping action

You can do it with macro commands, where you define a scorer. See the Command Based Scoring documentation.

1 Like