Message: Re: where is the particle table? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: where is the particle table? 

Forum: Particles
Re: Sad where is the particle table? (yicong liu)
Re: Feedback Re: where is the particle table? (Gumplinger Peter)
Re: Ok Re: where is the particle table? (yicong liu)
Date: 31 May, 2016
From: Michael H. Kelsey <Michael H. Kelsey>

On Tue, 31 May 2016 02:35:28 GMT, yicong liu wrote:
> Sorry, my English is not good enough, I should ask that I want to know
> all string parameters of particle table. Such as "e-" represents
> electron , "e+" represents positron and so on. Thanks for your help

In addition to Peter's answer, here's some additional guidance. You should only need the particle name strings if you are using macro (UI) commands. Within code, it is better to get and use the particle pointers directly (string comparisons take a lot of CPU time). For an electron, you would use

  #include "G4Electron.hh"

  G4ParticleDefinition* eminus = G4Electron::Definition();
  G4ParticleDefinition* eplus = G4Positron::Definition();

and so on. These objects are singletons, so the pointers are guaranteed to be unique, and constant, across your whole job.

  -- Michael Kelsey

 Add Message Add Message
to: "Re: where is the particle table?"

 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 ]