Message: Re: GetTotalEnergyDeposit in PreStep or PostStep? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: GetTotalEnergyDeposit in PreStep or PostStep? 

Forum: Event and Track Management
Re: None GetTotalEnergyDeposit in PreStep or PostStep? (Bo)
Date: 11 May, 2012
From: michel maire <michel maire>

On Fri, 11 May 2012 15:58:13 GMT, Bo wrote:
> Hello,
> 
> I'm confused about the TotalEnergyDeposit.I see in TestEm5 and
> G4PSDoseDeposition, the Energy is deposited in the preStep.

  There is a missunderstanding of userSteppingAction() function.
  1- this function is invoked at end of step, eg. the current position of the particle is the postStep.
  2- however, all the informations are in 2 objects at this stage : preStepPoint and postStepPoint.
  3- in Em5, we take from preStepPoint the current volume to check it.
  but the GetTotalEnergyDeposit() comes from postSteppoint

  4- As you have noticed, in Em11 we play with positions extracted from pre and postStep point. But the EnergyDeposited comes from postStepPoint, as in Em5

    Michel 

> 
> However, in TestEm11, the energy is deposited in a random point between pre and post steps, see following:
>  G4ThreeVector prePoint  = aStep->GetPreStepPoint() ->GetPosition();
>  G4ThreeVector postPoint = aStep->GetPostStepPoint()->GetPosition();
>  G4ThreeVector point = prePoint + G4UniformRand()*(postPoint - prePoint);
>  G4double x = point.x() + 0.5*detector->GetAbsorSizeX();  
>  histoManager->FillHisto(1, x, edep);  
> 
> I wonder which one is better and more reasonable.
> 
> Thanks in advance.
> 
> Bo
> 

 Add Message Add Message
to: "Re: GetTotalEnergyDeposit in PreStep or PostStep?"

 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 ]