Message: How to get charge of a tracked nucleus Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How to get charge of a tracked nucleus 

Forum: Particles
Date: 15 Sep, 2003
From: Ivana Hrivnacova <Ivana Hrivnacova>


I'd like to get the charge of the tracked nuclei; I tried on modified example N04 this:

In ExN04TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
I added this printing
  // Track charge
  G4ParticleDefinition* particleDefinition = aTrack->GetDefinition();
  if (particleDefinition->GetParticleType() == "nucleus") {
    G4int a = particleDefinition->GetBaryonNumber();
    G4int z = G4int(particleDefinition->GetPDGCharge()/eplus);
    G4int q = G4int(aTrack->GetDynamicParticle()->GetCharge()/eplus);
    G4cout << "==================================================" << G4endl;
    G4cout << "Nucleus:  a=" << a << "  z=" << z  << "  q=" << q << G4endl;
    G4cout << G4endl;

and I commented out setting of the stacking and stepping actions in main and changed the primary generator action to track 1 TeV proton to get some nuclei produced. The resulting output looks strange - there appear nuclei with Q > Z,A:

Start Run processing.


Nucleus:  a=205  z=81  q=6561


Nucleus:  a=207  z=82  q=32


Nucleus:  a=4  z=2  q=4

 Is something wrong in the code above?

 Thank you,

 Ivana Hrivnacova  

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

 Add Message Add Message
to: "How to get charge of a tracked nucleus"

 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 ]