yes @weller! I just did it! I wrote in the stepping action
auto proc_man = step->GetTrack()->GetDynamicParticle()->GetParticleDefinition()->GetProcessManager();
G4ProcessVector* proc_vec = proc_man->GetPostStepProcessVector(typeDoIt);
G4int n_proc = proc_vec->entries();
G4int n_scint = 0;
for(G4int i = 0; i < n_proc; ++i) {
G4String proc_name = (*proc_vec)[i]->GetProcessName();
if(proc_name.compare("Scintillation") == 0) {
auto scint = (G4Scintillation*) (*proc_vec)[i];
n_scint = scint->GetNumPhotons();
}
G4cout << "In this step, " << n_scint << " scintillation photons were produced." << G4endl;
}
Then it would write something about n_scint…i.e. I didn’t write if n_scint>0,…so even if n_scint==0 it should write
In this step, 0 scintillation photons were produced.
but look the log…it didn’t write anything…
log.txt (5.0 KB)
B1SteppingAction.cc (46.8 KB)