Geant4 11.1.1
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 "G4HadronicException.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 254 of file G4Fragment.cc.

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

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