Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::IAvatar Class Referenceabstract

#include <G4INCLIAvatar.hh>

+ Inheritance diagram for G4INCL::IAvatar:

Public Member Functions

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

Protected Attributes

G4double theTime
 

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 }
@ UnknownAvatarType

◆ 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 }

◆ ~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)

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

Referenced by 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)

◆ getID()

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

Definition at line 94 of file G4INCLIAvatar.hh.

94{ return ID; };

Referenced by toString().

◆ getParticles()

◆ getTime()

◆ 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

◆ isADecay()

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

Definition at line 92 of file G4INCLIAvatar.hh.

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

◆ postInteraction()

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

◆ preInteraction()

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

◆ setType()

◆ 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();
77 G4int numberOfParticles = 0;
78 for(ParticleIter i=pl.begin(), e=pl.end(); i!=e; ++i) {
79 numberOfParticles++;
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
long getID() const
virtual ParticleList getParticles() const =0
G4double getTime() const
AvatarType getType() const
ParticleList::const_iterator ParticleIter

Member Data Documentation

◆ theTime


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