Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes
G4QMDSystem Class Reference

#include <G4QMDSystem.hh>

Inheritance diagram for G4QMDSystem:
G4QMDNucleus G4QMDGroundStateNucleus

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 ( )

Definition at line 31 of file G4QMDSystem.cc.

References participants.

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

Definition at line 39 of file G4QMDSystem.cc.

References Clear().

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

Member Function Documentation

void G4QMDSystem::Clear ( )

Definition at line 68 of file G4QMDSystem.cc.

References GetTotalNumberOfParticipant(), and participants.

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

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:78
G4int GetTotalNumberOfParticipant()
Definition: G4QMDSystem.hh:60
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
void G4QMDSystem::DeleteParticipant ( G4int  i)
inline

Definition at line 57 of file G4QMDSystem.hh.

References participants.

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions().

57 { delete participants[ i ] ; participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ); };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
G4QMDParticipant* G4QMDSystem::EraseParticipant ( G4int  i)
inline

Definition at line 56 of file G4QMDSystem.hh.

References participants.

Referenced by G4QMDCollision::CalFinalStateOfTheBinaryCollision().

56 { G4QMDParticipant* particle = participants[ i ]; participants.erase( std::find ( participants.begin() , participants.end() , participants[ i ] ) ) ; return particle; };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
G4int G4QMDSystem::GetNOCollision ( )
inline

Definition at line 65 of file G4QMDSystem.hh.

Referenced by G4QMDReaction::ApplyYourself().

65 { return numberOfCollision; };
G4QMDParticipant* G4QMDSystem::GetParticipant ( G4int  i)
inline
G4int G4QMDSystem::GetTotalNumberOfParticipant ( )
inline
void G4QMDSystem::IncrementCollisionCounter ( )
inline

Definition at line 64 of file G4QMDSystem.hh.

Referenced by G4QMDCollision::CalKinematicsOfBinaryCollisions().

64 { numberOfCollision++; };
void G4QMDSystem::InsertParticipant ( G4QMDParticipant particle,
G4int  j 
)

Definition at line 107 of file G4QMDSystem.cc.

References G4cout, G4endl, n, and participants.

Referenced by G4QMDCollision::CalFinalStateOfTheBinaryCollision().

108 {
109 
110  if ( (size_t) n > participants.size()+1 )
111  G4cout << "G4QMDSystem::InsertParticipant size error" << G4endl;
112 
113  std::vector< G4QMDParticipant* >::iterator it;
114  it = participants.begin();
115 
116  for ( G4int i = 0; i < n ; i++ )
117  it++;
118 
119  participants.insert( it, particle );
120 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const G4int n
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
#define G4endl
Definition: G4ios.hh:61
void G4QMDSystem::SetParticipant ( G4QMDParticipant particle)
inline
void G4QMDSystem::SetSystem ( G4QMDSystem nucleus,
G4ThreeVector  dp,
G4ThreeVector  dr 
)

Definition at line 46 of file G4QMDSystem.cc.

References participants, and SetParticipant().

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
const char * p
Definition: xmltok.h:285
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
void G4QMDSystem::ShowParticipants ( )

Definition at line 79 of file G4QMDSystem.cc.

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

80 {
81  G4ThreeVector p_sum( 0.0 );
82  std::vector< G4QMDParticipant* >::iterator it;
83  G4cout << "Momentum and Position of each participant " << G4endl;
84  G4int orginal = G4cout.precision();
85  G4int i = 0;
86  for ( it = participants.begin() ; it != participants.end() ; it++ )
87  {
88  G4cout << i
89  << " "
90  << (*it)->GetDefinition()->GetParticleName()
91  << " "
92  << std::setprecision( 8 )
93  << (*it)->GetMomentum()
94  << " "
95  << (*it)->GetPosition()
96  << G4endl;
97  p_sum += (*it)->GetMomentum();
98  i++;
99  }
100  G4cout << "Sum upped Momentum and its mag " << p_sum << " " << p_sum.mag() << G4endl;
101  //restore orginal precision
102  G4cout << std::setprecision( orginal );
103 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
#define G4endl
Definition: G4ios.hh:61
void G4QMDSystem::SubtractSystem ( G4QMDSystem nucleus)

Definition at line 59 of file G4QMDSystem.cc.

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

Referenced by G4QMDMeanField::DoClusterJudgment().

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 }
int G4int
Definition: G4Types.hh:78
G4int GetTotalNumberOfParticipant()
Definition: G4QMDSystem.hh:60
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72
G4QMDParticipant * GetParticipant(G4int i)
Definition: G4QMDSystem.hh:62

Field Documentation

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

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