Geant4-11
Functions
G4Fragment.cc File Reference
#include "G4Fragment.hh"
#include "G4HadronicException.hh"
#include "G4ios.hh"
#include <iomanip>

Go to the source code of this file.

Functions

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

Function Documentation

◆ operator<<()

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

Definition at line 212 of file G4Fragment.cc.

213{
214 std::ios::fmtflags old_floatfield = out.flags();
215 out.setf(std::ios::floatfield);
216
217 out << "Fragment: A = " << std::setw(3) << theFragment.theA
218 << ", Z = " << std::setw(3) << theFragment.theZ
219 << ", numberOfLambdas = " << std::setw(3) << theFragment.theL ;
220 out.setf(std::ios::scientific,std::ios::floatfield);
221
222 // Store user's precision setting and reset to (3) here: back-compatibility
223 std::streamsize floatPrec = out.precision();
224
225 out << std::setprecision(3)
226 << ", U = " << theFragment.GetExcitationEnergy()/CLHEP::MeV
227 << " MeV ";
228 if(theFragment.GetCreatorModelID() >= 0) {
229 out << " creatorModelID= " << theFragment.GetCreatorModelID();
230 }
231 if(theFragment.GetCreationTime() > 0.0) {
232 out << " Time= " << theFragment.GetCreationTime()/CLHEP::ns << " ns";
233 }
234 out << G4endl
235 << " P = ("
236 << theFragment.GetMomentum().x()/CLHEP::MeV << ","
237 << theFragment.GetMomentum().y()/CLHEP::MeV << ","
238 << theFragment.GetMomentum().z()/CLHEP::MeV
239 << ") MeV E = "
240 << theFragment.GetMomentum().t()/CLHEP::MeV << " MeV"
241 << G4endl;
242
243 out << " #spin= " << theFragment.GetSpin()
244 << " #floatLevelNo= " << theFragment.GetFloatingLevelNumber() << " ";
245
246 if (theFragment.GetNumberOfExcitons() != 0) {
247 out << " "
248 << "#Particles= " << theFragment.GetNumberOfParticles()
249 << ", #Charged= " << theFragment.GetNumberOfCharged()
250 << ", #Holes= " << theFragment.GetNumberOfHoles()
251 << ", #ChargedHoles= " << theFragment.GetNumberOfChargedHoles();
252 }
253 out << G4endl;
254 if(theFragment.GetNuclearPolarization()) {
255 out << *(theFragment.GetNuclearPolarization());
256 }
257 //out << G4endl;
258 out.setf(old_floatfield,std::ios::floatfield);
259 out.precision(floatPrec);
260
261 return out;
262}
#define G4endl
Definition: G4ios.hh:57
G4int GetNumberOfParticles() const
Definition: G4Fragment.hh:361
G4int GetCreatorModelID() const
Definition: G4Fragment.hh:423
G4int GetNumberOfHoles() const
Definition: G4Fragment.hh:381
G4NuclearPolarization * GetNuclearPolarization() const
Definition: G4Fragment.hh:479
G4int GetNumberOfChargedHoles() const
Definition: G4Fragment.hh:386
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:299
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:323
G4double GetCreationTime() const
Definition: G4Fragment.hh:464
G4double GetSpin() const
Definition: G4Fragment.hh:433
G4int theZ
Definition: G4Fragment.hh:196
G4int GetFloatingLevelNumber() const
Definition: G4Fragment.hh:443
G4int GetNumberOfExcitons() const
Definition: G4Fragment.hh:356
G4int theA
Definition: G4Fragment.hh:194
G4int theL
Definition: G4Fragment.hh:198
G4int GetNumberOfCharged() const
Definition: G4Fragment.hh:366
static constexpr double MeV
static constexpr double ns

◆ pFragmentAllocator()

G4Allocator< G4Fragment > *& pFragmentAllocator ( )

Definition at line 46 of file G4Fragment.cc.

47{
49 return _instance;
50}
#define G4ThreadLocalStatic
Definition: tls.hh:76

References G4ThreadLocalStatic.

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