Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4INCL::AvatarDumpAction Class Reference

#include <G4INCLAvatarDumpAction.hh>

Inheritance diagram for G4INCL::AvatarDumpAction:
G4INCL::CascadeAction

Public Member Functions

virtual void afterAvatarUserAction (IAvatar *avatar, Nucleus *nucleus, FinalState *)
 
virtual void afterCascadeUserAction (Nucleus *)
 
virtual void afterPropagationUserAction (IPropagationModel *, IAvatar *)
 
virtual void afterRunUserAction ()
 
 AvatarDumpAction ()
 
virtual void beforeAvatarUserAction (IAvatar *, Nucleus *)
 
virtual void beforeCascadeUserAction (IPropagationModel *)
 
virtual void beforePropagationUserAction (IPropagationModel *)
 
virtual void beforeRunUserAction (Config const *)
 
virtual ~AvatarDumpAction ()
 

Private Member Functions

void afterAvatarAction (IAvatar *a, Nucleus *n, FinalState *fs)
 
void afterAvatarDefaultAction (IAvatar *a, Nucleus *n, FinalState *fs)
 
void afterCascadeAction (Nucleus *)
 
void afterCascadeDefaultAction (Nucleus *)
 
void afterPropagationAction (IPropagationModel *pm, IAvatar *avatar)
 
void afterPropagationDefaultAction (IPropagationModel *pm, IAvatar *avatar)
 
void afterRunAction ()
 
void afterRunDefaultAction ()
 
void beforeAvatarAction (IAvatar *a, Nucleus *n)
 
void beforeAvatarDefaultAction (IAvatar *a, Nucleus *n)
 
void beforeCascadeAction (IPropagationModel *)
 
void beforeCascadeDefaultAction (IPropagationModel *pm)
 
void beforePropagationAction (IPropagationModel *pm)
 
void beforePropagationDefaultAction (IPropagationModel *pm)
 
void beforeRunAction (Config const *config)
 
void beforeRunDefaultAction (Config const *config)
 

Private Attributes

G4int eventCounter
 
std::ofstream * oFile
 
long stepCounter
 

Detailed Description

Definition at line 53 of file G4INCLAvatarDumpAction.hh.

Constructor & Destructor Documentation

◆ AvatarDumpAction()

G4INCL::AvatarDumpAction::AvatarDumpAction ( )

Definition at line 44 of file G4INCLAvatarDumpAction.cc.

44 :
45 oFile(0),
47 {
48 }

◆ ~AvatarDumpAction()

G4INCL::AvatarDumpAction::~AvatarDumpAction ( )
virtual

Definition at line 50 of file G4INCLAvatarDumpAction.cc.

50{}

Member Function Documentation

◆ afterAvatarAction()

void G4INCL::CascadeAction::afterAvatarAction ( IAvatar a,
Nucleus n,
FinalState fs 
)
privateinherited

Definition at line 71 of file G4INCLCascadeAction.cc.

71 {
74 }
void afterAvatarDefaultAction(IAvatar *a, Nucleus *n, FinalState *fs)
virtual void afterAvatarUserAction(IAvatar *, Nucleus *, FinalState *)

References G4INCL::CascadeAction::afterAvatarDefaultAction(), G4INCL::CascadeAction::afterAvatarUserAction(), and CLHEP::detail::n.

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

◆ afterAvatarDefaultAction()

void G4INCL::CascadeAction::afterAvatarDefaultAction ( IAvatar a,
Nucleus n,
FinalState fs 
)
privateinherited

Definition at line 108 of file G4INCLCascadeAction.cc.

108 {
109
110 if(!fs) // do nothing if there is no final state
111 return;
112
113 INCL_DEBUG("Random seeds after avatar " << a->getID() << ": "
114 << G4INCL::Random::getSeeds() << '\n');
115
116 ParticleList const &modified = fs->getModifiedParticles();
117 for(ParticleIter p=modified.begin(), e=modified.end(); p!=e; ++p )
118 if(a->isACollision())
119 (*p)->incrementNumberOfCollisions();
120 else if(a->isADecay())
121 (*p)->incrementNumberOfDecays();
122
123 ParticleList const &created = fs->getCreatedParticles();
124 for(ParticleIter p=created.begin(), e=created.end(); p!=e; ++p )
125 if(a->isACollision())
126 (*p)->incrementNumberOfCollisions();
127 else if(a->isADecay())
128 (*p)->incrementNumberOfDecays();
129
130 }
#define INCL_DEBUG(x)
SeedVector getSeeds()
Definition: G4INCLRandom.cc:89
ParticleList::const_iterator ParticleIter

References G4INCL::FinalState::getCreatedParticles(), G4INCL::IAvatar::getID(), G4INCL::FinalState::getModifiedParticles(), G4INCL::Random::getSeeds(), INCL_DEBUG, G4INCL::IAvatar::isACollision(), and G4INCL::IAvatar::isADecay().

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

◆ afterAvatarUserAction()

void G4INCL::AvatarDumpAction::afterAvatarUserAction ( IAvatar avatar,
Nucleus nucleus,
FinalState finalState 
)
virtual

Reimplemented from G4INCL::CascadeAction.

Definition at line 58 of file G4INCLAvatarDumpAction.cc.

58 {
59 ParticleList particles = nucleus->getStore()->getParticles();
60 ParticleList highlight;
61 if(finalState) {
62 ParticleList const &modified = finalState->getModifiedParticles();
63 highlight.insert(highlight.end(), modified.begin(), modified.end());
64 ParticleList const &outgoing = finalState->getOutgoingParticles();
65 highlight.insert(highlight.end(), outgoing.begin(), outgoing.end());
66 ParticleList const &destroyed = finalState->getDestroyedParticles();
67 highlight.insert(highlight.end(), destroyed.begin(), destroyed.end());
68 ParticleList const &created = finalState->getCreatedParticles();
69 highlight.insert(highlight.end(), created.begin(), created.end());
70 ParticleList const &entering = finalState->getEnteringParticles();
71 highlight.insert(highlight.end(), entering.begin(), entering.end());
72 particles.insert(particles.end(), created.begin(), created.end());
73 particles.insert(particles.end(), entering.begin(), entering.end());
74 }
75
76 (*oFile) << avatar->getTime() << '\t' << avatar->getType() << '\t' << particles.size() << '\n';
77 for(ParticleIter p=particles.begin(), e=particles.end(); p!=e; ++p) {
78 ThreeVector const &pos = (*p)->getPosition();
79 ThreeVector const &vel = (*p)->getPropagationVelocity();
80 G4int highlightIt = highlight.contains(*p);
81 (*oFile)
82 << (*p)->getID() << '\t'
83 << (*p)->getParticipantType() << '\t'
84 << (*p)->getType() << '\t'
85 << pos.getX() << '\t'
86 << pos.getY() << '\t'
87 << pos.getZ() << '\t'
88 << vel.getX() << '\t'
89 << vel.getY() << '\t'
90 << vel.getZ() << '\t'
91 << (*p)->getKineticEnergy() << '\t'
92 << (*p)->getPotentialEnergy() << '\t'
93 << highlightIt << '\n';
94 }
95 }
static const G4double pos
int G4int
Definition: G4Types.hh:85

References G4INCL::UnorderedVector< T >::contains(), G4INCL::FinalState::getCreatedParticles(), G4INCL::FinalState::getDestroyedParticles(), G4INCL::FinalState::getEnteringParticles(), G4INCL::FinalState::getModifiedParticles(), G4INCL::FinalState::getOutgoingParticles(), G4INCL::Store::getParticles(), G4INCL::Nucleus::getStore(), G4INCL::IAvatar::getTime(), G4INCL::IAvatar::getType(), G4INCL::ThreeVector::getX(), G4INCL::ThreeVector::getY(), G4INCL::ThreeVector::getZ(), and pos.

◆ afterCascadeAction()

void G4INCL::CascadeAction::afterCascadeAction ( Nucleus n)
privateinherited

◆ afterCascadeDefaultAction()

void G4INCL::CascadeAction::afterCascadeDefaultAction ( Nucleus )
privateinherited

Definition at line 141 of file G4INCLCascadeAction.cc.

141{}

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

◆ afterCascadeUserAction()

void G4INCL::AvatarDumpAction::afterCascadeUserAction ( Nucleus )
virtual

Reimplemented from G4INCL::CascadeAction.

Definition at line 97 of file G4INCLAvatarDumpAction.cc.

97 {
98 oFile->close();
99 delete oFile;
100 ++eventCounter;
101 }

References eventCounter, and oFile.

◆ afterPropagationAction()

void G4INCL::CascadeAction::afterPropagationAction ( IPropagationModel pm,
IAvatar avatar 
)
privateinherited

Definition at line 76 of file G4INCLCascadeAction.cc.

76 {
79 }
virtual void afterPropagationUserAction(IPropagationModel *, IAvatar *)
void afterPropagationDefaultAction(IPropagationModel *pm, IAvatar *avatar)

References G4INCL::CascadeAction::afterPropagationDefaultAction(), and G4INCL::CascadeAction::afterPropagationUserAction().

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

◆ afterPropagationDefaultAction()

void G4INCL::CascadeAction::afterPropagationDefaultAction ( IPropagationModel pm,
IAvatar avatar 
)
privateinherited

Definition at line 132 of file G4INCLCascadeAction.cc.

133 {
134 ++stepCounter; // Increment the step counter
135
136#ifdef INCL_DEBUG_LOG
137 // INCL_DATABLOCK(pm->getNucleus()->getStore()->printParticleConfiguration());
138#endif
139 }

References G4INCL::CascadeAction::stepCounter.

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

◆ afterPropagationUserAction()

virtual void G4INCL::CascadeAction::afterPropagationUserAction ( IPropagationModel ,
IAvatar  
)
inlinevirtualinherited

Definition at line 70 of file G4INCLCascadeAction.hh.

70{}

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

◆ afterRunAction()

void G4INCL::CascadeAction::afterRunAction ( )
privateinherited

◆ afterRunDefaultAction()

void G4INCL::CascadeAction::afterRunDefaultAction ( )
privateinherited

Definition at line 143 of file G4INCLCascadeAction.cc.

143{}

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

◆ afterRunUserAction()

virtual void G4INCL::CascadeAction::afterRunUserAction ( )
inlinevirtualinherited

Definition at line 72 of file G4INCLCascadeAction.hh.

72{}

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

◆ beforeAvatarAction()

void G4INCL::CascadeAction::beforeAvatarAction ( IAvatar a,
Nucleus n 
)
privateinherited

◆ beforeAvatarDefaultAction()

void G4INCL::CascadeAction::beforeAvatarDefaultAction ( IAvatar a,
Nucleus n 
)
privateinherited

Definition at line 101 of file G4INCLCascadeAction.cc.

101 {
102 n->getStore()->getBook().incrementAvatars(a->getType());
103 INCL_DEBUG("Random seeds before avatar " << a->getID() << ": "
104 << G4INCL::Random::getSeeds() << '\n');
105 INCL_DEBUG("Next avatar:" << '\n' << a->dump() << '\n');
106 }

References G4INCL::IAvatar::dump(), G4INCL::IAvatar::getID(), G4INCL::Random::getSeeds(), G4INCL::IAvatar::getType(), INCL_DEBUG, and CLHEP::detail::n.

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

◆ beforeAvatarUserAction()

virtual void G4INCL::CascadeAction::beforeAvatarUserAction ( IAvatar ,
Nucleus  
)
inlinevirtualinherited

Definition at line 68 of file G4INCLCascadeAction.hh.

68{}

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

◆ beforeCascadeAction()

void G4INCL::CascadeAction::beforeCascadeAction ( IPropagationModel pm)
privateinherited

Definition at line 56 of file G4INCLCascadeAction.cc.

56 {
59 }
void beforeCascadeDefaultAction(IPropagationModel *pm)
virtual void beforeCascadeUserAction(IPropagationModel *)

References G4INCL::CascadeAction::beforeCascadeDefaultAction(), and G4INCL::CascadeAction::beforeCascadeUserAction().

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

◆ beforeCascadeDefaultAction()

void G4INCL::CascadeAction::beforeCascadeDefaultAction ( IPropagationModel pm)
privateinherited

Definition at line 95 of file G4INCLCascadeAction.cc.

95{}

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

◆ beforeCascadeUserAction()

void G4INCL::AvatarDumpAction::beforeCascadeUserAction ( IPropagationModel )
virtual

Reimplemented from G4INCL::CascadeAction.

Definition at line 52 of file G4INCLAvatarDumpAction.cc.

52 {
53 std::stringstream ss;
54 ss << "avatar-dump-" << eventCounter << ".dat";
55 oFile = new std::ofstream(ss.str().c_str());
56 }

References eventCounter, and oFile.

◆ beforePropagationAction()

void G4INCL::CascadeAction::beforePropagationAction ( IPropagationModel pm)
privateinherited

◆ beforePropagationDefaultAction()

void G4INCL::CascadeAction::beforePropagationDefaultAction ( IPropagationModel pm)
privateinherited

Definition at line 97 of file G4INCLCascadeAction.cc.

97 {
98 // assert(pm->getNucleus()->getStore()->getBook().getCascading() == pm->getNucleus()->getStore()->countCascading());
99 }

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

◆ beforePropagationUserAction()

virtual void G4INCL::CascadeAction::beforePropagationUserAction ( IPropagationModel )
inlinevirtualinherited

Definition at line 67 of file G4INCLCascadeAction.hh.

67{}

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

◆ beforeRunAction()

void G4INCL::CascadeAction::beforeRunAction ( Config const *  config)
privateinherited

◆ beforeRunDefaultAction()

void G4INCL::CascadeAction::beforeRunDefaultAction ( Config const *  config)
privateinherited

Definition at line 93 of file G4INCLCascadeAction.cc.

93{}

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

◆ beforeRunUserAction()

virtual void G4INCL::CascadeAction::beforeRunUserAction ( Config const *  )
inlinevirtualinherited

Definition at line 65 of file G4INCLCascadeAction.hh.

65{}

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

Field Documentation

◆ eventCounter

G4int G4INCL::AvatarDumpAction::eventCounter
private

Definition at line 65 of file G4INCLAvatarDumpAction.hh.

Referenced by afterCascadeUserAction(), and beforeCascadeUserAction().

◆ oFile

std::ofstream* G4INCL::AvatarDumpAction::oFile
private

Definition at line 64 of file G4INCLAvatarDumpAction.hh.

Referenced by afterCascadeUserAction(), and beforeCascadeUserAction().

◆ stepCounter

long G4INCL::CascadeAction::stepCounter
privateinherited

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