Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QMDSystem Class Reference

#include <G4QMDSystem.hh>

+ Inheritance diagram for G4QMDSystem:

Public Member Functions

 G4QMDSystem ()
 
virtual ~G4QMDSystem ()
 
void SetParticipant (G4QMDParticipant *particle)
 
void SetSystem (G4QMDSystem *, G4ThreeVector, G4ThreeVector)
 
void SubtractSystem (G4QMDSystem *)
 
G4QMDParticipantEraseParticipant (G4int i)
 
void DeleteParticipant (G4int i)
 
void InsertParticipant (G4QMDParticipant *particle, G4int j)
 
G4int GetTotalNumberOfParticipant ()
 
G4QMDParticipantGetParticipant (G4int i)
 
void IncrementCollisionCounter ()
 
G4int GetNOCollision ()
 
void ShowParticipants ()
 
void Clear ()
 

Protected Attributes

std::vector< G4QMDParticipant * > participants
 

Detailed Description

Definition at line 45 of file G4QMDSystem.hh.

Constructor & Destructor Documentation

◆ G4QMDSystem()

G4QMDSystem::G4QMDSystem ( )

Definition at line 31 of file G4QMDSystem.cc.

32{
33 participants.clear();
34 numberOfCollision = 0;
35}
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:103

◆ ~G4QMDSystem()

G4QMDSystem::~G4QMDSystem ( )
virtual

Definition at line 39 of file G4QMDSystem.cc.

40{
41 this->Clear();
42}
void Clear()
Definition: G4QMDSystem.cc:68

Member Function Documentation

◆ Clear()

void G4QMDSystem::Clear ( )

Definition at line 68 of file G4QMDSystem.cc.

69{
70 for ( G4int i = 0 ; i < this->GetTotalNumberOfParticipant() ; i++ )
71 {
72 delete participants[i];
73 }
74 participants.clear();
75}
int G4int
Definition: G4Types.hh:85
G4int GetTotalNumberOfParticipant()
Definition: G4QMDSystem.hh:78

Referenced by G4QMDReaction::ApplyYourself(), and ~G4QMDSystem().

◆ DeleteParticipant()

void G4QMDSystem::DeleteParticipant ( G4int  i)
inline

Definition at line 69 of file G4QMDSystem.hh.

70 {
71 delete participants[ i ];
72 participants.erase(std::find ( participants.cbegin(),
73 participants.cend(), participants[ i ]));
74 }

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions().

◆ EraseParticipant()

G4QMDParticipant * G4QMDSystem::EraseParticipant ( G4int  i)
inline

Definition at line 61 of file G4QMDSystem.hh.

62 {
63 G4QMDParticipant* particle = participants[ i ];
64 participants.erase(std::find( participants.cbegin(),
65 participants.cend(), participants[ i ]));
66 return particle;
67 }

Referenced by G4QMDCollision::CalFinalStateOfTheBinaryCollision().

◆ GetNOCollision()

G4int G4QMDSystem::GetNOCollision ( )
inline

Definition at line 93 of file G4QMDSystem.hh.

94 {
95 return numberOfCollision;
96 }

Referenced by G4QMDReaction::ApplyYourself().

◆ GetParticipant()

◆ GetTotalNumberOfParticipant()

◆ IncrementCollisionCounter()

void G4QMDSystem::IncrementCollisionCounter ( )
inline

Definition at line 88 of file G4QMDSystem.hh.

89 {
90 ++numberOfCollision;
91 }

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions().

◆ InsertParticipant()

void G4QMDSystem::InsertParticipant ( G4QMDParticipant particle,
G4int  j 
)

Definition at line 110 of file G4QMDSystem.cc.

111{
112
113 if ( (size_t) n > participants.size()+1 )
114 G4cout << "G4QMDSystem::InsertParticipant size error" << G4endl;
115
116 std::vector< G4QMDParticipant* >::iterator it;
117 it = participants.begin();
118
119 for ( G4int i = 0; i < n ; i++ )
120 it++;
121
122 participants.insert( it, particle );
123}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

Referenced by G4QMDCollision::CalFinalStateOfTheBinaryCollision().

◆ SetParticipant()

void G4QMDSystem::SetParticipant ( G4QMDParticipant particle)
inline

◆ SetSystem()

void G4QMDSystem::SetSystem ( G4QMDSystem nucleus,
G4ThreeVector  dp,
G4ThreeVector  dr 
)

Definition at line 46 of file G4QMDSystem.cc.

47{
48 std::vector< G4QMDParticipant* >::iterator it;
49 for ( it = nucleus->participants.begin() ; it != nucleus->participants.end() ; it++ )
50 {
51 G4ThreeVector r = (*it)->GetPosition() + dr;
52 (*it)->SetPosition ( r );
53 G4ThreeVector p = (*it)->GetMomentum() + dp;
54 (*it)->SetMomentum ( p );
55 this->SetParticipant( *it );
56 }
57}
void SetParticipant(G4QMDParticipant *particle)
Definition: G4QMDSystem.hh:52

◆ ShowParticipants()

void G4QMDSystem::ShowParticipants ( )

Definition at line 79 of file G4QMDSystem.cc.

80{
81 //store orginal precision
82 std::ios::fmtflags oldform = G4cout.flags();
83
84 G4ThreeVector p_sum( 0.0 );
85 std::vector< G4QMDParticipant* >::iterator it;
86 G4cout << "Momentum and Position of each participant " << G4endl;
87 G4int i = 0;
88 for ( it = participants.begin() ; it != participants.end() ; it++ )
89 {
90 G4cout << i
91 << " "
92 << (*it)->GetDefinition()->GetParticleName()
93 << " "
94 << std::setprecision( 8 )
95 << (*it)->GetMomentum()
96 << " "
97 << (*it)->GetPosition()
98 << G4endl;
99 p_sum += (*it)->GetMomentum();
100 i++;
101 }
102 G4cout << "Sum upped Momentum and its mag " << p_sum << " " << p_sum.mag() << G4endl;
103
104 //restore orginal precision
105 G4cout.flags( oldform );
106}

◆ SubtractSystem()

void G4QMDSystem::SubtractSystem ( G4QMDSystem nucleus)

Definition at line 59 of file G4QMDSystem.cc.

60{
61
62 for ( G4int i = 0 ; i < nucleus->GetTotalNumberOfParticipant() ; i++ )
63 {
64 participants.erase ( std::find ( participants.begin() , participants.end() , nucleus->GetParticipant( i ) ) );
65 }
66}
G4QMDParticipant * GetParticipant(G4int i)
Definition: G4QMDSystem.hh:83

Referenced by G4QMDMeanField::DoClusterJudgment().

Member Data Documentation

◆ participants


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