Hi everyone,
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);
for(i=1;i<numberOfBins;i++) {
G4SDParticleWithEnergyFilter* pEFilter=
new G4SDParticleWithEnergyFilter(“pEFilter”);
pEFilter->add(“proton”);
Emin=i1MeV;
Emax=(i+1)1MeV;
pEFilter->SetKineticEnergy(Emin,Emax);
scorer0->SetFilter(pEFilter);
}
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?
Thanks