Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
G4Fragment.cc File Reference
#include "G4Fragment.hh"
#include "G4HadronicException.hh"
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4ios.hh"
#include <iomanip>

Go to the source code of this file.

Functions

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

Variables

G4ThreadLocal G4Allocator
< G4Fragment > * 
pFragmentAllocator = 0
 

Function Documentation

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

Definition at line 175 of file G4Fragment.cc.

References G4endl, G4Fragment::GetExcitationEnergy(), G4Fragment::GetNumberOfExcitons(), G4Fragment::IsStable(), CLHEP::HepLorentzVector::t(), CLHEP::HepLorentzVector::x(), CLHEP::HepLorentzVector::y(), and CLHEP::HepLorentzVector::z().

176 {
177  if (!theFragment) {
178  out << "Fragment: null pointer ";
179  return out;
180  }
181 
182  std::ios::fmtflags old_floatfield = out.flags();
183  out.setf(std::ios::floatfield);
184 
185  out << "Fragment: A = " << std::setw(3) << theFragment->theA
186  << ", Z = " << std::setw(3) << theFragment->theZ ;
187  out.setf(std::ios::scientific,std::ios::floatfield);
188 
189  // Store user's precision setting and reset to (3) here: back-compatibility
190  std::streamsize floatPrec = out.precision();
191 
192  out << std::setprecision(3)
193  << ", U = " << theFragment->GetExcitationEnergy()/CLHEP::MeV
194  << " MeV IsStable= " << theFragment->IsStable() << G4endl
195  << " P = ("
196  << theFragment->theMomentum.x()/CLHEP::MeV << ","
197  << theFragment->theMomentum.y()/CLHEP::MeV << ","
198  << theFragment->theMomentum.z()/CLHEP::MeV
199  << ") MeV E = "
200  << theFragment->theMomentum.t()/CLHEP::MeV << " MeV"
201  << G4endl;
202 
203  // What about Angular momentum???
204 
205  if (theFragment->GetNumberOfExcitons() != 0) {
206  out << " "
207  << "#Particles= " << theFragment->numberOfParticles
208  << ", #Charged= " << theFragment->numberOfCharged
209  << ", #Holes= " << theFragment->numberOfHoles
210  << ", #ChargedHoles= " << theFragment->numberOfChargedHoles
211  << G4endl;
212  }
213  out.setf(old_floatfield,std::ios::floatfield);
214  out.precision(floatPrec);
215 
216  return out;
217 }
G4bool IsStable() const
Definition: G4Fragment.hh:408
G4int GetNumberOfExcitons() const
Definition: G4Fragment.hh:320
#define G4endl
Definition: G4ios.hh:61
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:255
std::ostream& operator<< ( std::ostream &  out,
const G4Fragment theFragment 
)

Definition at line 219 of file G4Fragment.cc.

220 {
221  out << &theFragment;
222  return out;
223 }

Variable Documentation

G4ThreadLocal G4Allocator<G4Fragment>* pFragmentAllocator = 0

Definition at line 50 of file G4Fragment.cc.

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