I need to detect the kinetic energy of particles passing through a detector. Geant4 provides primitive scorers(PS) as G4PSEnergyDeposit3D, which record the energy deposit but not the kinetic energy of the particle, and I could not find any PS for kinetic energy. So I tried to modify the code of G4PSEnergyDeposit3D(.hh & .cc), by creating header and source files EnergyDepositModified.hh/cc and EnergyDeposit3DModified.hh/cc .
Then as I call call the class EnergyDeposit3DModified to create scorer pointers in the detector construction I get this error : ‘Undefined Reference to EnergyDeposit3DModified::EnergyDeposit3DModified(string, int, int, int)’.
Does any one know why do I get this error?
In addition, whenever I define new header and source files to add a feature to the existing example (e.g. B1) I get the same error ‘Undefined Reference’ to that class.
I would appreciate any suggestion for how to record the kinetic energy.
Thanks to all