|
Geant4
10.00.p04
|
Static Public Member Functions | |
| static G4bool | avatarComparisonPredicate (IAvatar *lhs, IAvatar *rhs) |
| Comparison predicate for avatars. More... | |
Private Member Functions | |
| Store (const Store &rhs) | |
| Dummy copy constructor to shut up Coverity warnings. More... | |
| Store & | operator= (Store const &rhs) |
| Dummy assignment operator to shut up Coverity warnings. More... | |
| void | connectAvatarToParticle (IAvatar *const a, Particle *const p) |
| Connect an avatar to a particle. More... | |
| void | disconnectAvatarFromParticle (IAvatar *const a, Particle *const p) |
| Disconnect an avatar from a particle. More... | |
| void | removeAvatar (IAvatar *const a) |
| Remove an avatar from the list of avatars. More... | |
| void | removeAndDeleteAvatar (IAvatar *const a) |
| Remove an avatar from the list of avatars. More... | |
Private Attributes | |
| std::map< Particle *, IAvatarList * > | particleAvatarConnections |
| IAvatarList | avatarList |
| ParticleList | incoming |
| ParticleList | inside |
| ParticleList | outgoing |
| ParticleList | geomSpectators |
| G4double | currentTime |
| Book | theBook |
| G4int | loadedA |
| G4int | loadedZ |
| G4double | loadedStoppingTime |
| Config const * | theConfig |
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.
Add one particle to the store.
Particle objects don't know anything about avatars so this method will only do two things:
| void addParticleEntryAvatars | ( | IAvatarList const & | al | ) |
Add one ParticleEntry avatar.
Add one avatar to the store
Avatars know about the particles they are associated with. Adding an avatar consists of the following steps:
| IAvatarList const& getAvatars | ( | ) | const |
Return the list of avatars
References Store::avatarList.
Add a particle to the incoming list.
| p | particle to add |
Add a particle to the incoming list.
| p | particle to add |
References Store::incoming, and UnorderedVector< T >::remove().
| void clearIncoming | ( | ) |
| void deleteIncoming | ( | ) |
Clear the incoming list and delete the particles.
References Store::clearIncoming(), and Store::incoming.
Notify the Store that a particle has been updated. This triggers the removal of obsolete avatars and their disconnection from the particle.
| IAvatar* findSmallestTime | ( | ) |
Find the avatar that has the smallest time.
Make one time step: propagate particles and subtract the length of the step from the avatar times.
Mark the particle as ejected. This removes it from the list of inside particles and removes all avatars related to this particle.
add the particle to the outgoing particle list.
| p | pointer to the particle to be added |
References Store::outgoing.
Referenced by Store::addToOutgoing().
| void addToOutgoing | ( | ParticleList const & | pl | ) |
Add a list of particles to the outgoing particle list.
| pl | list of particles to be added |
References Store::addToOutgoing().
Remove the particle from the system. This also removes all avatars related to this particle.
Move a particle from incoming to inside.
| particle | pointer to a particle |
Referenced by Nucleus::insertParticle().
| ParticleList const& getIncomingParticles | ( | ) | const |
Return the list of incoming particles (i.e. particles that have yet to enter the cascade).
References Store::incoming.
| ParticleList const& getOutgoingParticles | ( | ) | const |
Return the list of outgoing particles (i.e. particles that have left the cascade).
References Store::outgoing.
Referenced by Nucleus::computeSeparationEnergyBalance().
| ParticleList extractDynamicalSpectators | ( | ) |
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.
References Store::outgoing, and UnorderedVector< T >::remove().
| ParticleList const& getParticles | ( | ) | const |
Return the list of "active" particles (i.e. particles that can participate in collisions).
References Store::inside.
Referenced by Nucleus::containsDeltas().
| Book& getBook | ( | ) |
Return the pointer to the Book object which keeps track of various counters.
References Store::theBook.
Referenced by Nucleus::insertParticle(), and InteractionAvatar::shouldUseLocalEnergy().
| G4int countCascading | ( | ) |
References Store::inside.
Get the config object
References Store::theConfig.
Referenced by InteractionAvatar::shouldUseLocalEnergy().
| void clear | ( | ) |
Clear all avatars and particles from the store.
Warning! This actually deletes the objects as well!
| void clearInside | ( | ) |
Clear all inside particles from the store.
Warning! This actually deletes the objects as well!
| void clearOutgoing | ( | ) |
Clear all outgoing particles from the store.
Warning! This actually deletes the objects as well!
| void clearAvatars | ( | ) |
Clear avatars only.
| void 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.
| void loadParticles | ( | std::string | filename | ) |
Load particle configuration from ASCII file (see avatarPredictionTest).
| G4int getLoadedA | ( | ) |
Get the value of the nucleus mass number that we read from file with loadParticles.
References Store::loadedA.
| G4int getLoadedZ | ( | ) |
Get the value of the nucleus charge number that we read from file with loadParticles.
References Store::loadedZ.
| G4double getLoadedStoppingTime | ( | ) |
Get the value of the stopping time that we read from file with loadParticles.
References Store::loadedStoppingTime.
| std::string printParticleConfiguration | ( | ) |
Print the nucleon configuration of the nucleus.
| void writeParticles | ( | std::string | filename | ) |
Print the nucleon configuration of the nucleus.
| std::string printAvatars | ( | ) |
Print the list of avatars
| G4bool containsCollisions | ( | ) | const |
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.
| lhs | pointer to the first avatar |
| rhs | pointer to the second avatar |
References IAvatar::getTime().
Dummy assignment operator to shut up Coverity warnings.
Connect an avatar to a particle.
Adds the avatar to the list of avatars where the particle appears. This is typically called when the avatar is created.
| p | the particle |
| a | the avatar |
Disconnect an avatar from a particle.
Removes the avatar from the list of avatars where the particle appears. This is typically called when the avatar has been invalidated or realised.
| p | the particle |
| a | the avatar |
Remove an avatar from the list of avatars.
Removes an avatar from the list of all avatars. The avatar is not deleted. Use removeAndDeleteAvatar for that.
| a | the avatar to remove |
Remove an avatar from the list of avatars.
Removes an avatar from the list of all avatars and deletes it.
| a | the avatar to remove and delete |
|
private |
Map particle -> [avatar]
|
private |
List of all avatars
Referenced by Store::getAvatars().
|
private |
List of incoming particles
Referenced by Store::clearIncoming(), Store::deleteIncoming(), Store::getIncomingParticles(), and Store::removeFromIncoming().
|
private |
List of particles that are inside the nucleus
Referenced by Store::countCascading(), and Store::getParticles().
|
private |
List of outgoing particles
Referenced by Store::addToOutgoing(), Store::extractDynamicalSpectators(), and Store::getOutgoingParticles().
|
private |
List of geometrical spectators
|
private |
The current time in the simulation
|
private |
The Book object keeps track of global counters
Referenced by Store::getBook().
|
private |
The target nucleus mass number that was loaded from a particle file
Referenced by Store::getLoadedA().
|
private |
The target nucleus charge number that was loaded from a particle file
Referenced by Store::getLoadedZ().
|
private |
The stopping time that was loaded from a particle file
Referenced by Store::getLoadedStoppingTime().
Pointer to the Config object
Referenced by Store::getConfig().