70 finalBaryon(0), initialCharge(0), finalCharge(0), initialStrange(0),
77 absoluteLimit(absolute), initialBaryon(0), finalBaryon(0),
78 initialCharge(0), finalCharge(0), initialStrange(0),
88 G4cout <<
" >>> G4CascadeCheckBalance(" <<
theName <<
")::collide"
109 ((pbullet ? pbullet->
baryon() : nbullet ? nbullet->
getA() : 0) +
110 (ptarget ? ptarget->
baryon() : ntarget ? ntarget->
getA() : 0) );
125 G4cout <<
" initial px " << initial.
px() <<
" py " << initial.
py()
126 <<
" pz " << initial.
pz() <<
" E " << initial.
e()
127 <<
" baryon " << initialBaryon <<
" charge " << initialCharge
128 <<
" strange " << initialStrange <<
G4endl
129 <<
" final px " <<
final.px() <<
" py " <<
final.py()
130 <<
" pz " <<
final.pz() <<
" E " <<
final.e()
131 <<
" baryon " << finalBaryon <<
" charge " << finalCharge
132 <<
" strange " << finalStrange <<
G4endl;
140 const std::vector<G4InuclElementaryParticle>& particles) {
142 G4cout <<
" >>> G4CascadeCheckBalance(" <<
theName <<
")::collide(<vector>)"
147 collide(bullet, target, tempOutput);
155 const std::vector<G4InuclNuclei>& fragments) {
157 G4cout <<
" >>> G4CascadeCheckBalance(" <<
theName <<
")::collide(<vector>)"
162 collide(bullet, target, tempOutput);
170 const std::vector<G4CascadParticle>& particles) {
173 <<
")::collide(<cparticles>)" <<
G4endl;
177 collide(bullet, target, tempOutput);
186 const std::vector<G4CascadParticle>& cparticles) {
189 <<
")::collide(<EP>,<CP>)" <<
G4endl;
192 tempOutput.
add(output);
194 collide(bullet, target, tempOutput);
206 << (relokay ?
" conserved" :
" VIOLATED")
207 <<
" absolute " <<
deltaE()
208 << (absokay ?
" conserved" :
" VIOLATED") <<
G4endl;
211 <<
" conserved absolute " <<
deltaE() <<
" conserved" <<
G4endl;
214 return (relokay && absokay);
223 <<
relativeKE() << (relokay ?
" conserved" :
" VIOLATED")
225 << (absokay ?
" conserved" :
" VIOLATED") <<
G4endl;
229 <<
" conserved" <<
G4endl;
232 return (relokay && absokay);
241 << (relokay ?
" conserved" :
" VIOLATED")
242 <<
" absolute " <<
deltaP()
243 << (absokay ?
" conserved" :
" VIOLATED") <<
G4endl;
246 <<
" conserved absolute " <<
deltaP() <<
" conserved" <<
G4endl;
249 return (relokay && absokay);
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4bool baryonOkay() const
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4bool momentumOkay() const
G4double relativeP() const
G4bool chargeOkay() const
G4bool strangeOkay() const
static const G4double tolerance
G4double relativeKE() const
G4double relativeE() const
G4CascadeCheckBalance(const char *owner="G4CascadeCheckBalance")
G4bool energyOkay() const
G4int getTotalStrangeness() const
G4LorentzVector getTotalOutputMomentum() const
G4int getTotalBaryonNumber() const
G4int getTotalCharge() const
void add(const G4CollisionOutput &right)
void addOutgoingNuclei(const std::vector< G4InuclNuclei > &nuclea)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
G4int getStrangeness() const
G4LorentzVector getMomentum() const
G4double getCharge() const