Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Fragment.cc File Reference
#include "G4Fragment.hh"
#include "G4SystemOfUnits.hh"
#include "G4Exception.hh"
#include "G4ios.hh"
#include <iomanip>

Go to the source code of this file.

Functions

G4Allocator< G4Fragment > *& pFragmentAllocator ()
std::ostream & operator<< (std::ostream &out, const G4Fragment &theFragment)

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream & out,
const G4Fragment & theFragment )

Definition at line 256 of file G4Fragment.cc.

257{
258 std::ios::fmtflags old_floatfield = out.flags();
259 out.setf(std::ios::floatfield);
260
261 out << "Fragment: A = " << std::setw(3) << theFragment.theA
262 << ", Z = " << std::setw(3) << theFragment.theZ
263 << ", numberOfLambdas = " << std::setw(3) << theFragment.theL ;
264 out.setf(std::ios::scientific,std::ios::floatfield);
265
266 // Store user's precision setting and reset to (3) here: back-compatibility
267 std::streamsize floatPrec = out.precision();
268
269 out << std::setprecision(3)
270 << ", U = " << theFragment.GetExcitationEnergy()/CLHEP::MeV
271 << " MeV ";
272 if(theFragment.GetCreatorModelID() >= 0) {
273 out << " creatorModelID= " << theFragment.GetCreatorModelID();
274 }
275 if(theFragment.GetCreationTime() > 0.0) {
276 out << " Time= " << theFragment.GetCreationTime()/CLHEP::ns << " ns";
277 }
278 out << G4endl
279 << " P = ("
280 << theFragment.GetMomentum().x()/CLHEP::MeV << ","
281 << theFragment.GetMomentum().y()/CLHEP::MeV << ","
282 << theFragment.GetMomentum().z()/CLHEP::MeV
283 << ") MeV E = "
284 << theFragment.GetMomentum().t()/CLHEP::MeV << " MeV"
285 << G4endl;
286
287 out << " #spin= " << theFragment.GetSpin()
288 << " #floatLevelNo= " << theFragment.GetFloatingLevelNumber() << " ";
289
290 if (theFragment.GetNumberOfExcitons() != 0) {
291 out << " "
292 << "#Particles= " << theFragment.GetNumberOfParticles()
293 << ", #Charged= " << theFragment.GetNumberOfCharged()
294 << ", #Holes= " << theFragment.GetNumberOfHoles()
295 << ", #ChargedHoles= " << theFragment.GetNumberOfChargedHoles();
296 }
297 out << G4endl;
298 if(theFragment.GetNuclearPolarization()) {
299 out << *(theFragment.GetNuclearPolarization());
300 }
301 //out << G4endl;
302 out.setf(old_floatfield,std::ios::floatfield);
303 out.precision(floatPrec);
304
305 return out;
306}
#define G4endl
Definition G4ios.hh:67
G4int GetNumberOfParticles() const
G4int GetCreatorModelID() const
G4int GetNumberOfHoles() const
G4NuclearPolarization * GetNuclearPolarization() const
G4int GetNumberOfChargedHoles() const
G4double GetExcitationEnergy() const
const G4LorentzVector & GetMomentum() const
G4double GetCreationTime() const
G4double GetSpin() const
G4int GetFloatingLevelNumber() const
G4int GetNumberOfExcitons() const
G4int GetNumberOfCharged() const

◆ pFragmentAllocator()

G4Allocator< G4Fragment > *& pFragmentAllocator ( )

Definition at line 47 of file G4Fragment.cc.

48{
50 return _instance;
51}
#define G4ThreadLocalStatic
Definition tls.hh:76

Referenced by G4Fragment::operator delete(), and G4Fragment::operator new().