Dear G4 experts:
Recently, I want to use the sensitivity detector (SD) to record the information of primary C-12 ions, and the G4SDParticleFilter class was employed in my code. However, I don’t know how to define the second parameter in the constructor of the class. I noticed that the second parameter is the particle’s name:
G4SDParticleFilter* neutronFilter =
new G4SDParticleFilter(fltName=“neutronFilter”, particleName=“neutron”);
and for these particles, such as neutron, proton, electron, we can directly use its name, and the program will automatically recognize it.
I also noticed that G4SDParticleFilter class provides another construct, which supports the user define the particle:
const std::vector<G4ParticleDefinition>& particleDef*);
However, I found this method is very difficult for me since the G4ParticleDefinition is very complicated and requires a lot of parameters input by the user, and I don’t know the values of many parameters. Could you give me some suggestions or provide me a simple method.
Here is the constructor of G4ParticleDefinition class:
G4ParticleDefinition(const G4String& aName,
const G4String& pType,
G4bool shortlived = false,
const G4String& subType ="",
G4int anti_encoding =0,
G4double magneticMoment = 0.0);