Message: Re: Multiple Physics Lists Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Multiple Physics Lists 

Forum: Physics List
Re: Question Multiple Physics Lists
Date: 23 Jun, 2015
From: Michael H. Kelsey <Michael H. Kelsey>

On Mon, 22 Jun 2015 20:48:00 GMT, ZachB wrote: > I am trying to register multiple physics list for my application

You can't do that. The "physics list" is a factory class, which encapsulates a table of the complete set of processes desired for the set of all "relevant" particles (as defined by the physics list code itself) for your application.

> and it looks like when I do, the latest one overwrites the previous one. Is
> this an accurate statement

Yes, that is correct. The RunManager (see G4RunManager.hh, for example) contains a single data member pointer corresponding to a physics list. If you register a physics list a second time, the value of that data member is simply replaced.

> and if so, what can I do to have these multiple physics lists running at the same time? Thank you.

If you wish to have different processes for different purposes in the same application, then you can extend your own locally written physics list by adding those processes. Geant4 provides the so-called "physics builders" or "physics constructors", which do the registration of a set of related processes to a specific set of particles. Some examples include G4DecayPhysics, G4OpticalPhysics, G4EmPhysics.

If you want to be able to choose (one time, only at the "PreInit" state) between different possible physics lists, then you may want to look at the G4PhysicsListFactory class. That class permits you to pass in a string, corresponding to the names of our reference physics lists ("FTFP_BERT", "Shielding", and so on) and have a pointer to the physics list returned. You can set the string from an environment variable or via a macro command.

If you want to be able to add or modify the processes included in a physics list via macro commands (again, only at the "PreInit" state), you may want to look at some of our examples.

  -- Michael Kelsey

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

1 None: Re: Multiple Physics Lists   (ZachB - 24 Jun, 2015)
 Add Message Add Message
to: "Re: Multiple Physics Lists"

 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 ]