I am trying to record the energy spectrum of any radiation using G4SDParticleWithEnergyFilter. I write the following code in the detectorConstruction::constructSDandFields() metod:
G4PSPassageCellFlux3D * scorer0 =
new G4PSPassageCellFlux3D(psName=“flux”, fNx,fNy,fNz);
However, I have no idea how to extract the data recorded by this set of energy filters in the Run and RunAction classes.
I would appreciate any suggestion on how to get the counts as a function of energy, and if the method I have chosen for recording energy spectrum is correct?