Geant4-11
Public Member Functions | Protected Attributes | Private Attributes
G4QMDSystem Class Reference

#include <G4QMDSystem.hh>

Inheritance diagram for G4QMDSystem:
G4QMDNucleus G4QMDGroundStateNucleus

Public Member Functions

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

Protected Attributes

std::vector< G4QMDParticipant * > participants
 

Private Attributes

G4int numberOfCollision
 

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();
35}
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
G4int numberOfCollision
Definition: G4QMDSystem.hh:75

References numberOfCollision, and participants.

◆ ~G4QMDSystem()

G4QMDSystem::~G4QMDSystem ( )
virtual

Definition at line 39 of file G4QMDSystem.cc.

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

References Clear().

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:60

References GetTotalNumberOfParticipant(), and participants.

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 ] ) ); };

References participants.

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

References participants.

Referenced by G4QMDCollision::CalFinalStateOfTheBinaryCollision().

◆ GetNOCollision()

G4int G4QMDSystem::GetNOCollision ( )
inline

Definition at line 65 of file G4QMDSystem.hh.

65{ return numberOfCollision; };

References numberOfCollision.

Referenced by G4QMDReaction::ApplyYourself().

◆ GetParticipant()

G4QMDParticipant * G4QMDSystem::GetParticipant ( G4int  i)
inline

◆ GetTotalNumberOfParticipant()

G4int G4QMDSystem::GetTotalNumberOfParticipant ( )
inline

◆ IncrementCollisionCounter()

void G4QMDSystem::IncrementCollisionCounter ( )
inline

Definition at line 64 of file G4QMDSystem.hh.

References numberOfCollision.

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

References G4cout, G4endl, CLHEP::detail::n, and participants.

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

References participants, and SetParticipant().

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

References G4cout, G4endl, CLHEP::Hep3Vector::mag(), and participants.

◆ 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

References GetParticipant(), GetTotalNumberOfParticipant(), and participants.

Referenced by G4QMDMeanField::DoClusterJudgment().

Field Documentation

◆ numberOfCollision

G4int G4QMDSystem::numberOfCollision
private

Definition at line 75 of file G4QMDSystem.hh.

Referenced by G4QMDSystem(), GetNOCollision(), and IncrementCollisionCounter().

◆ participants

std::vector< G4QMDParticipant* > G4QMDSystem::participants
protected

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