Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
G4INCL::Store Class Reference

#include <G4INCLStore.hh>

Public Member Functions

 Store (Config const *const config)
 
 ~Store ()
 
void add (Particle *p)
 
void addParticleEntryAvatar (IAvatar *a)
 Add one ParticleEntry avatar. More...
 
void addParticleEntryAvatars (IAvatarList const &al)
 Add one ParticleEntry avatar. More...
 
void add (IAvatar *a)
 
IAvatarList constgetAvatars () const
 
void addIncomingParticle (Particle *const p)
 
void removeFromIncoming (Particle *const p)
 
void clearIncoming ()
 Clear the incoming list. More...
 
void deleteIncoming ()
 Clear the incoming list and delete the particles. More...
 
void particleHasBeenUpdated (long)
 
IAvatarfindSmallestTime ()
 
void timeStep (G4double step)
 
void particleHasBeenEjected (long)
 
void addToOutgoing (Particle *p)
 add the particle to the outgoing particle list. More...
 
void addToOutgoing (ParticleList const &pl)
 Add a list of particles to the outgoing particle list. More...
 
void particleHasBeenDestroyed (long)
 
void particleHasEntered (Particle *const particle)
 Move a particle from incoming to inside. More...
 
ParticleList constgetIncomingParticles () const
 
ParticleList constgetOutgoingParticles () const
 
ParticleList extractDynamicalSpectators ()
 Returns a list of dynamical spectators. More...
 
ParticleList constgetParticles () const
 
BookgetBook ()
 
G4int countCascading ()
 
Config constgetConfig ()
 
ParticleList getParticipants ()
 
ParticleList getSpectators ()
 
void clear ()
 
void clearOutgoing ()
 
void clearAvatars ()
 
void initialiseParticleAvatarConnections ()
 Initialise the particleAvatarConnections map. More...
 
void loadParticles (std::string filename)
 
G4int getLoadedA ()
 
G4int getLoadedZ ()
 
G4double getLoadedStoppingTime ()
 
std::string printParticleConfiguration ()
 
void writeParticles (std::string filename)
 
std::string printAvatars ()
 
G4bool containsCollisions () const
 

Static Public Member Functions

static G4bool avatarComparisonPredicate (IAvatar *lhs, IAvatar *rhs)
 Comparison predicate for avatars. More...
 

Detailed Description

The purpose of the Store object is to act as a "particle manager" that keeps track ofall the particles in our simulation. It also tracks the avatars and their connections to particles.

Definition at line 62 of file G4INCLStore.hh.

Constructor & Destructor Documentation

G4INCL::Store::Store ( Config const *const  config)

Store constructor

Definition at line 44 of file G4INCLStore.cc.

G4INCL::Store::~Store ( )

Store destructor

Definition at line 53 of file G4INCLStore.cc.

Here is the call graph for this function:

Member Function Documentation

void G4INCL::Store::add ( Particle p)

Add one particle to the store.

Particle objects don't know anything about avatars so this method will only do two things:

  1. add the particle to the particle map ParticleID -> Particle*
  2. add an empty entry for this particle into map AvatarID -> [ParticleID]

Definition at line 60 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::add ( IAvatar a)

Add one avatar to the store

Avatars know about the particles they are associated with. Adding an avatar consists of the following steps:

  1. Add the new avatar to the avatar list
  2. Add any related new particles to the store by calling add(Particle*) (this should not happen, by the time we are adding avatars all particles should have already been added)
  3. Connect the particles involved to the avatar in the map: particleAvatarConnections :: ParticleID -> [AvatarID]
  4. Add the new avatar to the map: avatarParticleConnections :: AvatarID -> [ParticleID]

Definition at line 89 of file G4INCLStore.cc.

Here is the call graph for this function:

void G4INCL::Store::addIncomingParticle ( Particle *const  p)

Add a particle to the incoming list.

Parameters
pparticle to add

Definition at line 110 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::addParticleEntryAvatar ( IAvatar a)

Add one ParticleEntry avatar.

Definition at line 71 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::addParticleEntryAvatars ( IAvatarList const al)

Add one ParticleEntry avatar.

Definition at line 84 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::addToOutgoing ( Particle p)
inline

add the particle to the outgoing particle list.

Parameters
ppointer to the particle to be added

Definition at line 169 of file G4INCLStore.hh.

Here is the caller graph for this function:

void G4INCL::Store::addToOutgoing ( ParticleList const pl)
inline

Add a list of particles to the outgoing particle list.

Parameters
pllist of particles to be added

Definition at line 175 of file G4INCLStore.hh.

Here is the call graph for this function:

static G4bool G4INCL::Store::avatarComparisonPredicate ( IAvatar lhs,
IAvatar rhs 
)
inlinestatic

Comparison predicate for avatars.

avatarComparisonPredicate is used by the std::sort or std::min_element functions to compare the avatar objects according to their time.

Parameters
lhspointer to the first avatar
rhspointer to the second avatar
Returns
true iff lhs' time is smaller than rhs'.

Definition at line 348 of file G4INCLStore.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::clear ( void  )

Clear all avatars and particles from the store.

Warning! This actually deletes the objects as well!

Definition at line 340 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::clearAvatars ( )

Clear avatars only.

Definition at line 316 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::clearIncoming ( )
inline

Clear the incoming list.

Definition at line 128 of file G4INCLStore.hh.

Here is the caller graph for this function:

void G4INCL::Store::clearOutgoing ( )

Clear all outgoing particles from the store.

Warning! This actually deletes the objects as well!

Definition at line 363 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4INCL::Store::containsCollisions ( ) const

Definition at line 492 of file G4INCLStore.cc.

G4int G4INCL::Store::countCascading ( )
inline

Definition at line 243 of file G4INCLStore.hh.

void G4INCL::Store::deleteIncoming ( )
inline

Clear the incoming list and delete the particles.

Definition at line 133 of file G4INCLStore.hh.

Here is the call graph for this function:

ParticleList G4INCL::Store::extractDynamicalSpectators ( )
inline

Returns a list of dynamical spectators.

Looks in the outgoing list for particles without collisions and decays, removes them from outgoing and returns them in a list.

Returns
the (possibly empty) list of dynamical spectators

Definition at line 211 of file G4INCLStore.hh.

IAvatar * G4INCL::Store::findSmallestTime ( )

Find the avatar that has the smallest time.

Definition at line 210 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

IAvatarList const& G4INCL::Store::getAvatars ( ) const
inline

Return the list of avatars

Definition at line 109 of file G4INCLStore.hh.

Book* G4INCL::Store::getBook ( )
inline

Return the pointer to the Book object which keeps track of various counters.

Definition at line 241 of file G4INCLStore.hh.

Here is the caller graph for this function:

Config const* G4INCL::Store::getConfig ( )
inline

Get the config object

Definition at line 255 of file G4INCLStore.hh.

Here is the caller graph for this function:

ParticleList const& G4INCL::Store::getIncomingParticles ( ) const
inline

Return the list of incoming particles (i.e. particles that have yet to enter the cascade).

Definition at line 196 of file G4INCLStore.hh.

G4int G4INCL::Store::getLoadedA ( )
inline

Get the value of the nucleus mass number that we read from file with loadParticles.

Definition at line 307 of file G4INCLStore.hh.

G4double G4INCL::Store::getLoadedStoppingTime ( )
inline

Get the value of the stopping time that we read from file with loadParticles.

Definition at line 319 of file G4INCLStore.hh.

G4int G4INCL::Store::getLoadedZ ( )
inline

Get the value of the nucleus charge number that we read from file with loadParticles.

Definition at line 313 of file G4INCLStore.hh.

ParticleList const& G4INCL::Store::getOutgoingParticles ( ) const
inline

Return the list of outgoing particles (i.e. particles that have left the cascade).

Definition at line 202 of file G4INCLStore.hh.

Here is the caller graph for this function:

ParticleList G4INCL::Store::getParticipants ( )

Get list of participants (active nucleons).

Warning: This (slow) method may be deprecated in the near future...

Definition at line 292 of file G4INCLStore.cc.

Here is the caller graph for this function:

ParticleList const& G4INCL::Store::getParticles ( ) const
inline

Return the list of "active" particles (i.e. particles that can participate in collisions).

Definition at line 235 of file G4INCLStore.hh.

Here is the caller graph for this function:

ParticleList G4INCL::Store::getSpectators ( )

Get list of spectators (active nucleons).

Warning: This (slow) method may be deprecated in the near future...

Definition at line 304 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::initialiseParticleAvatarConnections ( )

Initialise the particleAvatarConnections map.

Generate an empty avatar-ID vector for each particle in the inside list and fill in the relevant particle-avatar map entry.

Definition at line 333 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::loadParticles ( std::string  filename)

Load particle configuration from ASCII file (see avatarPredictionTest).

Definition at line 379 of file G4INCLStore.cc.

Here is the call graph for this function:

void G4INCL::Store::particleHasBeenDestroyed ( long  ID)

Remove the particle from the system. This also removes all avatars related to this particle.

Definition at line 278 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::particleHasBeenEjected ( long  ID)

Mark the particle as ejected. This removes it from the list of inside particles and removes all avatars related to this particle.

Definition at line 269 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCL::Store::particleHasBeenUpdated ( long  particleID)

Notify the Store that a particle has been updated. This triggers the removal of obsolete avatars and their disconnection from the particle.

Definition at line 162 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::particleHasEntered ( Particle *const  particle)

Move a particle from incoming to inside.

Parameters
particlepointer to a particle

Definition at line 287 of file G4INCLStore.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string G4INCL::Store::printAvatars ( )

Print the list of avatars

Definition at line 483 of file G4INCLStore.cc.

std::string G4INCL::Store::printParticleConfiguration ( )

Print the nucleon configuration of the nucleus.

Definition at line 426 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::removeFromIncoming ( Particle *const  p)
inline

Add a particle to the incoming list.

Parameters
pparticle to add

Definition at line 125 of file G4INCLStore.hh.

Here is the caller graph for this function:

void G4INCL::Store::timeStep ( G4double  step)

Make one time step: propagate particles and subtract the length of the step from the avatar times.

Definition at line 261 of file G4INCLStore.cc.

Here is the caller graph for this function:

void G4INCL::Store::writeParticles ( std::string  filename)

Print the nucleon configuration of the nucleus.

Definition at line 477 of file G4INCLStore.cc.

Here is the call graph for this function:


The documentation for this class was generated from the following files: