Geant4-11
Public Member Functions | Protected Attributes | Private Attributes | Static Private Attributes
G4INCL::IAvatar Class Referenceabstract

#include <G4INCLIAvatar.hh>

Inheritance diagram for G4INCL::IAvatar:
G4INCL::InteractionAvatar G4INCL::ParticleEntryAvatar G4INCL::SurfaceAvatar G4INCL::BinaryCollisionAvatar G4INCL::DecayAvatar

Public Member Functions

virtual std::string dump () const =0
 
void fillFinalState (FinalState *fs)
 
virtual G4INCL::IChannelgetChannel ()=0
 
FinalStategetFinalState ()
 
long getID () const
 
virtual ParticleList getParticles () const =0
 
G4double getTime () const
 
AvatarType getType () const
 
 IAvatar ()
 
 IAvatar (G4double time)
 
G4bool isACollision () const
 
G4bool isADecay () const
 
virtual void postInteraction (FinalState *)=0
 
virtual void preInteraction ()=0
 
void setType (AvatarType t)
 
std::string toString ()
 
virtual ~IAvatar ()
 

Protected Attributes

G4double theTime
 

Private Attributes

long ID
 
AvatarType type
 

Static Private Attributes

static G4ThreadLocal long nextID = 1
 

Detailed Description

Definition at line 72 of file G4INCLIAvatar.hh.

Constructor & Destructor Documentation

◆ IAvatar() [1/2]

G4INCL::IAvatar::IAvatar ( )

Definition at line 53 of file G4INCLIAvatar.cc.

53 :
55 theTime(0.)
56 {
57 ID = nextID;
58 nextID++;
59 }
AvatarType type
static G4ThreadLocal long nextID
@ UnknownAvatarType

References ID, and nextID.

◆ IAvatar() [2/2]

G4INCL::IAvatar::IAvatar ( G4double  time)

Definition at line 61 of file G4INCLIAvatar.cc.

61 :
63 theTime(time)
64 {
65 ID = nextID;
66 nextID++;
67 }

References ID, and nextID.

◆ ~IAvatar()

G4INCL::IAvatar::~IAvatar ( )
virtual

Definition at line 69 of file G4INCLIAvatar.cc.

69 {
70 INCL_DEBUG("destroying avatar " << this << std::endl);
71 }
#define INCL_DEBUG(x)

References INCL_DEBUG.

Member Function Documentation

◆ dump()

virtual std::string G4INCL::IAvatar::dump ( ) const
pure virtual

◆ fillFinalState()

void G4INCL::IAvatar::fillFinalState ( FinalState fs)

Definition at line 96 of file G4INCLIAvatar.cc.

96 {
97 INCL_DEBUG("Random seeds before preInteraction: " << Random::getSeeds() << '\n');
99 INCL_DEBUG("Random seeds before getChannel: " << Random::getSeeds() << '\n');
100 IChannel *c = getChannel();
101 if( !c )
102 return;
103 INCL_DEBUG("Random seeds before getFinalState: " << Random::getSeeds() << '\n');
104 c->fillFinalState(fs);
105 INCL_DEBUG("Random seeds before postInteraction: " << Random::getSeeds() << '\n');
106 postInteraction(fs);
107 delete c;
108 }
virtual void postInteraction(FinalState *)=0
virtual void preInteraction()=0
virtual G4INCL::IChannel * getChannel()=0
SeedVector getSeeds()
Definition: G4INCLRandom.cc:89

References G4INCL::IChannel::fillFinalState(), getChannel(), G4INCL::Random::getSeeds(), INCL_DEBUG, postInteraction(), and preInteraction().

Referenced by G4INCL::INCL::cascade(), and getFinalState().

◆ getChannel()

virtual G4INCL::IChannel * G4INCL::IAvatar::getChannel ( )
pure virtual

◆ getFinalState()

FinalState * G4INCL::IAvatar::getFinalState ( )

Definition at line 90 of file G4INCLIAvatar.cc.

90 {
91 FinalState *fs = new FinalState;
93 return fs;
94 }
void fillFinalState(FinalState *fs)

References fillFinalState().

Referenced by G4INCL::INCL::makeCompoundNucleus().

◆ getID()

long G4INCL::IAvatar::getID ( ) const
inline

◆ getParticles()

virtual ParticleList G4INCL::IAvatar::getParticles ( ) const
pure virtual

◆ getTime()

G4double G4INCL::IAvatar::getTime ( ) const
inline

◆ getType()

AvatarType G4INCL::IAvatar::getType ( ) const
inline

◆ isACollision()

G4bool G4INCL::IAvatar::isACollision ( ) const
inline

Definition at line 91 of file G4INCLIAvatar.hh.

91{ return (type==CollisionAvatarType); };
@ CollisionAvatarType

References G4INCL::CollisionAvatarType.

Referenced by G4INCL::CascadeAction::afterAvatarDefaultAction().

◆ isADecay()

G4bool G4INCL::IAvatar::isADecay ( ) const
inline

Definition at line 92 of file G4INCLIAvatar.hh.

92{ return (type==DecayAvatarType); };
@ DecayAvatarType

References G4INCL::DecayAvatarType.

Referenced by G4INCL::CascadeAction::afterAvatarDefaultAction().

◆ postInteraction()

virtual void G4INCL::IAvatar::postInteraction ( FinalState )
pure virtual

◆ preInteraction()

virtual void G4INCL::IAvatar::preInteraction ( )
pure virtual

◆ setType()

void G4INCL::IAvatar::setType ( AvatarType  t)
inline

◆ toString()

std::string G4INCL::IAvatar::toString ( )

Definition at line 73 of file G4INCLIAvatar.cc.

73 {
74 std::stringstream entry;
75 std::stringstream particleString;
76 ParticleList const &pl = getParticles();
78 for(ParticleIter i=pl.begin(), e=pl.end(); i!=e; ++i) {
80 particleString << (*i)->getID() << " ";
81 }
82 if(numberOfParticles == 1) particleString << "-1";
83 entry << getID() << " "
84 << getType() << " "
85 << getTime() << " "
86 << particleString.str();
87 return entry.str();
88 }
int G4int
Definition: G4Types.hh:85
static int numberOfParticles
long getID() const
virtual ParticleList getParticles() const =0
G4double getTime() const
AvatarType getType() const
ParticleList::const_iterator ParticleIter

References getID(), getParticles(), getTime(), getType(), and numberOfParticles.

Field Documentation

◆ ID

long G4INCL::IAvatar::ID
private

Definition at line 98 of file G4INCLIAvatar.hh.

Referenced by IAvatar().

◆ nextID

G4ThreadLocal long G4INCL::IAvatar::nextID = 1
staticprivate

Definition at line 100 of file G4INCLIAvatar.hh.

Referenced by IAvatar().

◆ theTime

G4double G4INCL::IAvatar::theTime
protected

◆ type

AvatarType G4INCL::IAvatar::type
private

Definition at line 99 of file G4INCLIAvatar.hh.


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