Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Fragment.cc File Reference
#include "G4Fragment.hh"
#include "G4HadronicException.hh"
#include "G4ios.hh"
#include <iomanip>
Include dependency graph for G4Fragment.cc:

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 = nullptr
 

Function Documentation

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

Definition at line 188 of file G4Fragment.cc.

189 {
190  if (!theFragment) {
191  out << "Fragment: null pointer ";
192  return out;
193  }
194 
195  std::ios::fmtflags old_floatfield = out.flags();
196  out.setf(std::ios::floatfield);
197 
198  out << "Fragment: A = " << std::setw(3) << theFragment->theA
199  << ", Z = " << std::setw(3) << theFragment->theZ ;
200  out.setf(std::ios::scientific,std::ios::floatfield);
201 
202  // Store user's precision setting and reset to (3) here: back-compatibility
203  std::streamsize floatPrec = out.precision();
204 
205  out << std::setprecision(3)
206  << ", U = " << theFragment->GetExcitationEnergy()/CLHEP::MeV
207  << " MeV ";
208  if(theFragment->GetCreatorModelType() >= 0) {
209  out << " creatorModelType= " << theFragment->GetCreatorModelType();
210  }
211  if(theFragment->GetCreationTime() > 0.0) {
212  out << " Time= " << theFragment->GetCreationTime()/CLHEP::ns << " ns";
213  }
214  out << G4endl
215  << " P = ("
216  << theFragment->GetMomentum().x()/CLHEP::MeV << ","
217  << theFragment->GetMomentum().y()/CLHEP::MeV << ","
218  << theFragment->GetMomentum().z()/CLHEP::MeV
219  << ") MeV E = "
220  << theFragment->GetMomentum().t()/CLHEP::MeV << " MeV"
221  << G4endl;
222 
223  out << " #spin= " << theFragment->GetSpin()
224  << " #floatLevelNo= " << theFragment->GetFloatingLevelNumber();
225 
226  if(theFragment->GetNuclearPolarization()) {
227  out << theFragment->GetNuclearPolarization();
228  }
229 
230  if (theFragment->GetNumberOfExcitons() != 0) {
231  out << " "
232  << "#Particles= " << theFragment->GetNumberOfParticles()
233  << ", #Charged= " << theFragment->GetNumberOfCharged()
234  << ", #Holes= " << theFragment->GetNumberOfHoles()
235  << ", #ChargedHoles= " << theFragment->GetNumberOfChargedHoles();
236  }
237  out << G4endl;
238  out.setf(old_floatfield,std::ios::floatfield);
239  out.precision(floatPrec);
240 
241  return out;
242 }
G4int GetFloatingLevelNumber() const
Definition: G4Fragment.hh:427
static constexpr double ns
G4int GetNumberOfParticles() const
Definition: G4Fragment.hh:345
G4int GetNumberOfHoles() const
Definition: G4Fragment.hh:365
G4double GetCreationTime() const
Definition: G4Fragment.hh:448
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:307
static constexpr double MeV
G4double GetSpin() const
Definition: G4Fragment.hh:417
G4int GetNumberOfExcitons() const
Definition: G4Fragment.hh:340
#define G4endl
Definition: G4ios.hh:61
G4int GetNumberOfChargedHoles() const
Definition: G4Fragment.hh:370
G4int GetCreatorModelType() const
Definition: G4Fragment.hh:407
G4int GetNumberOfCharged() const
Definition: G4Fragment.hh:350
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:283
G4NuclearPolarization * GetNuclearPolarization() const
Definition: G4Fragment.hh:458

Here is the call graph for this function:

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

Definition at line 244 of file G4Fragment.cc.

245 {
246  out << &theFragment;
247  return out;
248 }

Variable Documentation

G4ThreadLocal G4Allocator<G4Fragment>* pFragmentAllocator = nullptr

Definition at line 46 of file G4Fragment.cc.