Message: energy not change at EndOfEventAction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question energy not change at EndOfEventAction 

Forum: Event and Track Management
Date: 20 May, 2014
From: kunli <kunli>

Hello,
I try to simulate deposited energy, output it in EndOfEventAction.
But the results are always the same to the initial energy, as below.
Why?


----------------------
EventAction::EventAction(PrimaryGeneratorAction* _pgact):G4UserEventAction(),fEnergyAbs(0.999999)
{}

void EventAction::EndOfEventAction(const G4Event* evt){
	G4int eventID = evt->GetEventID();
	G4double particleE = PGAct->GetParticleEnergy();
	G4cout<<"----->End of EventAction:"<<eventID<<---deposited energy in Phosphor:" <<G4BestUnit(fEnergyAbs,"Energy")<<G4endl; 
}

void EventAction::AddAbs(G4double DeStep){
fEnergyAbs +=DeStep;
G4cout<<"------EventAction---DeStep--"<<G4BestUnit(DeStep,"Energy")<<"---fEnergyAbs---"<<G4BestUnit(fEnergyAbs,"Energy")<<G4endl;
}
-------------------
Output:
...
------EventAction---DeStep--4.011 keV---fEnergyAbs---1.04982 MeV
------EventAction---DeStep--5.011 keV---fEnergyAbs---1.05483 MeV
------EventAction---DeStep--6.011 keV---fEnergyAbs---1.06084 MeV
----->End of EventAction:1---deposited energy in Phosphor:999.999 keV

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Ok: Re: energy not change at EndOfEventAction   (kunli - 21 May, 2014)
 Add Message Add Message
to: "energy not change at EndOfEventAction"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]