|Message: Set track energy to take into account quenching factor||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I work on simulation of neutron on neon target. I would like to include the quenching factor in my simulation. After a hadElastic interaction of a neutron with a neon nucleus, I need to modify the energy of the neon nucleus with a given formula.
I first tried in stacking action with:
G4double EnergyQuenched = 0.1784*std::pow( track->GetKineticEnergy() + 1.103 , 0.245 );
And I get this error:
error: no matching function for call to ‘G4Track::SetKineticEnergy(G4double&) const
I tried in tracking action with the same two lines and got the same error.
I finally tried in stepping action with:
G4double EnergyQuenched = 0.1784*std::pow( step->GetPreStepPoint()->GetKineticEnergy() + 1.103 , 0.245 );
It first seems to work, using the two following lines before and after the modification print two different energies with the correct values.
cout << " Pre Point Before " << step->GetPreStepPoint()->GetKineticEnergy() << endl;
cout << " Pre Point After " << step->GetPreStepPoint()->GetKineticEnergy() << endl;
But, when I finally sum the energy deposited by the different steps induced by the neon nuclei, I recovered the initial energy before the modification and not the quenched one.
So my question is, how can modify the energy of a particle when it is created? Where and when should I use SetKineticEnergy().
|Inline Depth:||Outline Depth:||Add message:|