Message: Re: Energy deposited by secondary particles Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Energy deposited by secondary particles 

Forum: Hadronic Processes
Re: None Energy deposited by secondary particles
Date: 10 Apr, 2014
From: Miguel Cortes-Giraldo <Miguel Cortes-Giraldo>

Hi Sarah,

If you need the energy deposited by each *individual* secondary particle you could use the track ID to later identify which track deposited the energy. Thus, you would have the information about the energy deposition by each track independently. A small example of code is:

G4double edep;
G4int trackID;
if ( aStep->GetTrack()->GetParentID() != 0 )  // This is true only for sec.
{
  edep = aStep->GetTotalEnergydeposit();
  trackID = aStep->GetTrack()->GetTrackID();
}

If you want to accumulate the energy deposition by each kind of secondary particle, then you need the info about energy deposition and particle definition:

G4double edep;
G4ParticleDefinition* parDef = 0;
if ( aStep->GetTrack()->GetParentID() != 0 )  // This is true only for sec.
{
  edep = aStep->GetTotalEnergydeposit();
  pardef = aStep->GetTrack()->GetParticleDefinition();
}

In both cases, you can use such information to later produce hits, fill histograms, etc. This depends on the kind of output you need...

Hope this helps,

Miguel

On Wed, 09 Apr 2014 09:35:50 GMT, Sarah wrote:

> Hello everyone,
> 
> I am currently running a simple simulation with protons hitting a box of
> water. The piece of information I want to get is the energy deposited
> for each secondary particle. I was wondering if anyone could recommend
> the best way to implement this?
> 
> Thank you for any help you can offer!
> 
> Sarah
> 

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

1 None: Re: Energy deposited by secondary particles   (Miguel Cortes-Giraldo - 10 Apr, 2014)
1 None: Re: Energy deposited by secondary particles   (Sarah - 12 Apr, 2014)
2 None: Re: Energy deposited by secondary particles   (Ivan Brilkov - 22 Apr, 2014)
1 None: Re: Energy deposited by secondary particles   (Miguel Cortes-Giraldo - 29 Apr, 2014)
... 1 Message(s)
 Add Message Add Message
to: "Re: Energy deposited by secondary particles"

 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 ]