#include <G4CollisionManager.hh>
Definition at line 36 of file G4CollisionManager.hh.
G4CollisionManager::G4CollisionManager |
( |
| ) |
|
G4CollisionManager::~G4CollisionManager |
( |
| ) |
|
Definition at line 48 of file G4CollisionManager.cc.
56 theCollisionList->push_back(collision);
58 G4cerr <<
"G4Scatterer invalid TimeTo Interaction : " << time;
61 if (target)
G4cerr <<
" target "
const G4String & GetParticleName() const
const G4LorentzVector & Get4Momentum() const
const G4ParticleDefinition * GetDefinition() const
G4GLOB_DLL std::ostream G4cerr
void G4CollisionManager::ClearAndDestroy |
( |
| ) |
|
Definition at line 131 of file G4CollisionManager.cc.
133 std::vector<G4CollisionInitialState *>::iterator i;
134 for(i = theCollisionList->begin(); i != theCollisionList->end(); ++i)
136 theCollisionList->clear();
G4int G4CollisionManager::Entries |
( |
| ) |
|
|
inline |
Definition at line 140 of file G4CollisionManager.cc.
144 std::vector<G4CollisionInitialState *>::iterator i;
145 for(i = theCollisionList->begin(); i != theCollisionList->end(); ++i)
147 if(nextTime > (*i)->GetCollisionTime())
149 nextTime = (*i)->GetCollisionTime();
153 #ifdef debug_G4CollisionManager
154 if(theNext == 0 && theCollisionList->size()!=0)
157 G4cerr <<
"G4CollisionManager::GetNextCollision - Fatal"<<
G4endl;
158 G4cerr <<
" number of collisions left "<<theCollisionList->size()<<
G4endl;
159 for(i = theCollisionList->begin(); i != theCollisionList->end(); ++i)
161 G4cerr <<
" Time to collision "<<(*i)->GetCollisionTime()<<
" "<<
G4endl;
162 G4cerr <<
" projectile "<<(*i)->GetPrimary()->Get4Momentum()<<
" "
163 <<(*i)->GetPrimary()->GetDefinition()->GetParticleName()<<
G4endl;
164 if ((*i)->GetTarget())
G4cerr <<
" target "<<(*i)->GetTarget()->Get4Momentum()<<
" "
165 <<(*i)->GetTarget()->GetDefinition()->GetParticleName()<<
G4endl;
167 G4cerr <<
"G4CollisionManager::GetNextCollision - End of message"<<
G4endl;
G4GLOB_DLL std::ostream G4cerr
void G4CollisionManager::Print |
( |
| ) |
|
Definition at line 175 of file G4CollisionManager.cc.
177 std::vector<G4CollisionInitialState *>::iterator i;
179 G4cout <<
"CollisionManager: " << theCollisionList->size()
180 <<
" entries at " << theCollisionList <<
G4endl;
182 for(i = theCollisionList->begin(); i != theCollisionList->end(); ++i)
188 G4cout <<
" collision " << collision <<
" time: "
195 <<
" Collision type: "<<
typeid(action).
name()
G4KineticTrack * GetPrimary(void)
G4int GetPDGEncoding() const
static constexpr double second
G4GLOB_DLL std::ostream G4cout
G4KineticTrack * GetTarget(void)
G4double GetCollisionTime(void)
const G4ParticleDefinition * GetDefinition() const
const G4BCAction * GetGenerator()
Definition at line 70 of file G4CollisionManager.cc.
72 theCollisionList->erase(std::find(theCollisionList->begin(),
73 theCollisionList->end(),
Definition at line 80 of file G4CollisionManager.cc.
84 if(toBeCaned->empty())
88 std::vector<G4CollisionInitialState *>::iterator collIter, collIter2;
89 std::vector<G4KineticTrack *>::iterator trackIter;
92 for(collIter = theCollisionList->begin();
93 collIter != theCollisionList->end(); collIter++)
95 collision = *collIter;
97 G4bool getNextCollision =
false;
98 for(trackIter = toBeCaned->begin(); trackIter != toBeCaned->end(); ++trackIter)
100 if((collision->
GetTarget() == *trackIter) ||
103 toRemove.push_back(collision);
106 for(
size_t tcount=0; tcount<targets.size(); tcount++)
108 if(targets[tcount] == *trackIter)
110 toRemove.push_back(collision);
111 getNextCollision =
true;
115 if(getNextCollision)
break;
120 for(collIter = toRemove.begin(); collIter != toRemove.end(); ++collIter)
122 collision = *collIter;
123 collIter2 = std::find(theCollisionList->begin(),
124 theCollisionList->end(), collision);
125 theCollisionList->erase(collIter2);
std::vector< G4CollisionInitialState * > G4ListOfCollisions
G4KineticTrack * GetPrimary(void)
G4KineticTrack * GetTarget(void)
G4KineticTrackVector & GetTargetCollection(void)
The documentation for this class was generated from the following files: