Geant4 9.6.0
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 ()
 
 ~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:72

◆ ~G4QMDSystem()

G4QMDSystem::~G4QMDSystem ( )

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:66
G4int GetTotalNumberOfParticipant()
Definition: G4QMDSystem.hh:60

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

◆ DeleteParticipant()

void G4QMDSystem::DeleteParticipant ( G4int  i)
inline

Definition at line 57 of file G4QMDSystem.hh.

57{ delete participants[ i ] ; participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ); };

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions().

◆ EraseParticipant()

G4QMDParticipant * G4QMDSystem::EraseParticipant ( G4int  i)
inline

Definition at line 56 of file G4QMDSystem.hh.

56{ G4QMDParticipant* particle = participants[ i ]; participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ) ; return particle; };

Referenced by G4QMDCollision::CalFinalStateOfTheBinaryCollision().

◆ GetNOCollision()

G4int G4QMDSystem::GetNOCollision ( )
inline

Definition at line 65 of file G4QMDSystem.hh.

65{ return numberOfCollision; };

Referenced by G4QMDReaction::ApplyYourself().

◆ GetParticipant()

◆ GetTotalNumberOfParticipant()

◆ IncrementCollisionCounter()

void G4QMDSystem::IncrementCollisionCounter ( )
inline

Definition at line 64 of file G4QMDSystem.hh.

64{ numberOfCollision++; };

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions().

◆ InsertParticipant()

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

Definition at line 104 of file G4QMDSystem.cc.

105{
106
107 if ( (size_t) n > participants.size()+1 )
108 G4cout << "G4QMDSystem::InsertParticipant size error" << G4endl;
109
110 std::vector< G4QMDParticipant* >::iterator it;
111 it = participants.begin();
112
113 for ( G4int i = 0; i < n ; i++ )
114 it++;
115
116 participants.insert( it, particle );
117}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT 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:51

◆ ShowParticipants()

void G4QMDSystem::ShowParticipants ( )

Definition at line 79 of file G4QMDSystem.cc.

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

◆ 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:62

Referenced by G4QMDMeanField::DoClusterJudgment().

Member Data Documentation

◆ participants


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