Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ( )

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

Definition at line 39 of file G4QMDSystem.cc.

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

Here is the call graph for this function:

Member Function Documentation

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 ] ) ); };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72

Here is the caller graph for this function:

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; };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72

Here is the caller graph for this function:

G4int G4QMDSystem::GetNOCollision ( )
inline

Definition at line 65 of file G4QMDSystem.hh.

65 { return numberOfCollision; };

Here is the caller graph for this function:

G4QMDParticipant* G4QMDSystem::GetParticipant ( G4int  i)
inline

Definition at line 62 of file G4QMDSystem.hh.

62 { return participants[i]; };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72

Here is the caller graph for this function:

G4int G4QMDSystem::GetTotalNumberOfParticipant ( )
inline

Definition at line 60 of file G4QMDSystem.hh.

60 { return participants.size(); };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72

Here is the caller graph for this function:

void G4QMDSystem::IncrementCollisionCounter ( )
inline

Definition at line 64 of file G4QMDSystem.hh.

64 { numberOfCollision++; };

Here is the caller graph for this function:

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

Here is the caller graph for this function:

void G4QMDSystem::SetParticipant ( G4QMDParticipant particle)
inline

Definition at line 51 of file G4QMDSystem.hh.

51 { participants.push_back ( particle ); };
std::vector< G4QMDParticipant * > participants
Definition: G4QMDSystem.hh:72

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 72 of file G4QMDSystem.hh.


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