[Gate-users] Fwd: Information about element of scattering nucleus

Helge Pettersen helge.e.s.pettersen at gmail.com
Wed Nov 18 09:03:28 CET 2020


[SOLVED]

Dear mailing list,

For future reference I'm listing my solution.

In the Gate source file digit_hits/src/GateCrystalSD.cc I added the lines
(from line 103)

G4int targetZ, targetA;
if (processName == "hadElastic" || processName == "hIoni") {
   G4HadronicProcess *ptr = (G4HadronicProcess*) process;    // remember to
#include "G4HadronicProcess.hh"
   const G4Nucleus *nuc = ptr->GetTargetNucleus();
   targetA = nuc->GetA_asInt();
   targetZ = nuc->GetZ_asInt();
}

I added this information to the ROOT Hits output (aHit->SetTargetA( targetA
); & for Z), and the needed ROOT
logistics in digit_hits/src/GateCrystalHit.cc (add ctors m_targetA(0) & for
Z), digit_hits/include/GateCrystalHit.hh (Add variables m_targetA & for Z +
setters & getters), general/src/GateRootDefs.cc (add to
GateRootHitBuffer::Clear and ::Fill + add branches to Hit buffer & Hit
trees) and in general/include/GateRootDefs.hh (public variables targetA,
targetZ).

When recompiling, the variables targetA and targetZ were available in the
Hits tree of the ROOT file.

This is valid for Gate 8.2, I guess some modifications are needed for >=
Gate 9.0

Sincerely,

Helge Pettersen
Haukeland University Hospital
Bergen, Norway
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20201118/e9514657/attachment.html>


More information about the Gate-users mailing list