LXe example, SteppingAction

Lxe example give output for only one step. How should I make it run that covers all possible steps?
I want to store Cerenkov photons per event comprising all steps.

I don’t know what you mean. LXeStackingAction works on all new tracks, no matter what step. All it does is count the Cerenkov photons, but you could modify it to store whatever you want.
https://geant4.kek.jp/lxr/source/examples/extended/optical/LXe/src/LXeStackingAction.cc#L63

Ahh, Ok. I read the following in README-
""cerenkov.mac: Shoot a 200 MeV mu+ and only allow it to take one step. The
Cerenkov cone and PMTs hit are visible. (Reduce the number
of particles for visualization.) "
Second issue, If I shoot with Gammas instead of mu+, do I have to change something in StackingAction.cc? Because when I did that number of Cerenkov photon per event differs from what should be.

In cerenkov.mac:
#This causes the primary particle to be killed after its first step in the
#scintillator volume. Thus preventing the cerenkov cone to fill in.
/LXe/oneStepPrimaries true

How may Cerenkov photons do you expect with gammas? How many do you observe?

when I shoot with gamma the generated cernkov photon per event look like this
1000gammas.pdf (14.2 KB)
.
And, when I do another way saving the electron generated by gamma and then shoot electron back I got cerenkov photon per event
1000Electron.pdf (15.7 KB).
I expect last one when I shoot with gammas

But the number of Cerenkov photons depends on the energy and path length of the charged particle. Presumably, if you shoot 1 gamma vs 1 electron, these values (energy, path length) are different.

You could try

/process/optical/cerenkov/verbose 2

and look for this output:

G4cout << "\n Exiting from G4Cerenkov::DoIt -- NumberOfSecondaries = "
       << aParticleChange.GetNumberOfSecondaries() << G4endl;
1 Like