Hi
I want to see the deposited energy by secondary particle from the example: advanced/radioprotection**
I am using following line in SteppingActionClass.cc**
=========
G4double secondaryParticleEdep = (*fSecondary)[lp1] -> GetTotalEnergyDeposit(); // depositted energy
==========
My code looks like:
G4SteppingManager* steppingManager = fpSteppingManager;
G4Track* theTrack = aStep -> GetTrack();
// check if it is alive
if(theTrack-> GetTrackStatus() == fAlive) { return; }
// Retrieve the secondary particles
fSecondary = steppingManager -> GetfSecondary();
#ifdef ANALYSIS_USE
for(size_t lp1=0;lp1<(*fSecondary).size(); lp1++)
{
// Retrieve the info about the generation of secondary particles
G4String volumeName = (*fSecondary)[lp1] -> GetVolume() -> GetName(); // volume where secondary was generated
G4String secondaryParticleName = (*fSecondary)[lp1]->GetDefinition() -> GetParticleName(); // name of the secondary
G4double secondaryParticleKineticEnergy = (*fSecondary)[lp1] -> GetKineticEnergy(); // kinetic energy
// G4String process = (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName(); // process creating it
G4double charge = (*fSecondary)[lp1] -> GetDynamicParticle() -> GetDefinition() -> GetPDGCharge();
G4int AA = (*fSecondary)[lp1] -> GetDynamicParticle() -> GetDefinition() -> GetBaryonNumber();
G4double secondaryParticleEdep = (*fSecondary)[lp1] -> GetTotalEnergyDeposit(); // depositted energy
analysis -> FillSecondaries(AA, charge, secondaryParticleKineticEnergy/MeV, secondaryParticleEdep/MeV);
=======================================
When I compile program by make - j 8, it gives me following error
===============
/home/kavita/Geant4_code/radioprotection/src/SteppingAction.cc: In member function ‘virtual void SteppingAction::UserSteppingAction(const G4Step*)’:
/home/kavita/Geant4_code/radioprotection/src/SteppingAction.cc:72:64: error: ‘class G4Track’ has no member named ‘GetTotalEnergyDeposit’; did you mean ‘GetTotalEnergy’?
G4double secondaryParticleEdep = (*fSecondary)[lp1] -> GetTotalEnergyDeposit(); // kinetic energy
^~~~~~~~~~~~~~~~~~~~~
GetTotalEnergy
CMakeFiles/radioprotection.dir/build.make:302: recipe for target ‘CMakeFiles/radioprotection.dir/src/SteppingAction.cc.o’ failed
make[2]: *** [CMakeFiles/radioprotection.dir/src/SteppingAction.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/radioprotection.dir/all’ failed
make[1]: *** [CMakeFiles/radioprotection.dir/all] Error 2
Makefile:129: recipe for target ‘all’ failed
make: *** [all] Error 2
===============
My query is how to get energy deposited from secondary particles?