Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Fragment.cc File Reference
#include "G4Fragment.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 181 of file G4Fragment.cc.

182{
183 std::ios::fmtflags old_floatfield = out.flags();
184 out.setf(std::ios::floatfield);
185
186 out << "Fragment: A = " << std::setw(3) << theFragment.theA
187 << ", Z = " << std::setw(3) << theFragment.theZ ;
188 out.setf(std::ios::scientific,std::ios::floatfield);
189
190 // Store user's precision setting and reset to (3) here: back-compatibility
191 std::streamsize floatPrec = out.precision();
192
193 out << std::setprecision(3)
194 << ", U = " << theFragment.GetExcitationEnergy()/CLHEP::MeV
195 << " MeV ";
196 if(theFragment.GetCreatorModelType() >= 0) {
197 out << " creatorModelType= " << theFragment.GetCreatorModelType();
198 }
199 if(theFragment.GetCreationTime() > 0.0) {
200 out << " Time= " << theFragment.GetCreationTime()/CLHEP::ns << " ns";
201 }
202 out << G4endl
203 << " P = ("
204 << theFragment.GetMomentum().x()/CLHEP::MeV << ","
205 << theFragment.GetMomentum().y()/CLHEP::MeV << ","
206 << theFragment.GetMomentum().z()/CLHEP::MeV
207 << ") MeV E = "
208 << theFragment.GetMomentum().t()/CLHEP::MeV << " MeV"
209 << G4endl;
210
211 out << " #spin= " << theFragment.GetSpin()
212 << " #floatLevelNo= " << theFragment.GetFloatingLevelNumber() << " ";
213
214 if (theFragment.GetNumberOfExcitons() != 0) {
215 out << " "
216 << "#Particles= " << theFragment.GetNumberOfParticles()
217 << ", #Charged= " << theFragment.GetNumberOfCharged()
218 << ", #Holes= " << theFragment.GetNumberOfHoles()
219 << ", #ChargedHoles= " << theFragment.GetNumberOfChargedHoles();
220 }
221 out << G4endl;
222 if(theFragment.GetNuclearPolarization()) {
223 out << *(theFragment.GetNuclearPolarization());
224 }
225 //out << G4endl;
226 out.setf(old_floatfield,std::ios::floatfield);
227 out.precision(floatPrec);
228
229 return out;
230}
#define G4endl
Definition: G4ios.hh:57
G4int GetNumberOfParticles() const
Definition: G4Fragment.hh:337
G4int GetNumberOfHoles() const
Definition: G4Fragment.hh:357
G4NuclearPolarization * GetNuclearPolarization() const
Definition: G4Fragment.hh:455
G4int GetNumberOfChargedHoles() const
Definition: G4Fragment.hh:362
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:275
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:299
G4double GetCreationTime() const
Definition: G4Fragment.hh:440
G4double GetSpin() const
Definition: G4Fragment.hh:409
G4int GetFloatingLevelNumber() const
Definition: G4Fragment.hh:419
G4int GetNumberOfExcitons() const
Definition: G4Fragment.hh:332
G4int GetCreatorModelType() const
Definition: G4Fragment.hh:399
G4int GetNumberOfCharged() const
Definition: G4Fragment.hh:342

◆ pFragmentAllocator()

G4Allocator< G4Fragment > *& pFragmentAllocator ( )

Definition at line 45 of file G4Fragment.cc.

46{
48 return _instance;
49}
#define G4ThreadLocalStatic
Definition: tls.hh:76

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