Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 187 of file G4Fragment.cc.

188 {
189  if (!theFragment) {
190  out << "Fragment: null pointer ";
191  return out;
192  }
193 
194  std::ios::fmtflags old_floatfield = out.flags();
195  out.setf(std::ios::floatfield);
196 
197  out << "Fragment: A = " << std::setw(3) << theFragment->theA
198  << ", Z = " << std::setw(3) << theFragment->theZ ;
199  out.setf(std::ios::scientific,std::ios::floatfield);
200 
201  // Store user's precision setting and reset to (3) here: back-compatibility
202  std::streamsize floatPrec = out.precision();
203 
204  out << std::setprecision(3)
205  << ", U = " << theFragment->GetExcitationEnergy()/CLHEP::MeV
206  << " MeV ";
207  if(theFragment->GetCreatorModelType() >= 0) {
208  out << " creatorModelType= " << theFragment->GetCreatorModelType();
209  }
210  if(theFragment->GetCreationTime() > 0.0) {
211  out << " Time= " << theFragment->GetCreationTime()/CLHEP::ns << " ns";
212  }
213  out << G4endl
214  << " P = ("
215  << theFragment->GetMomentum().x()/CLHEP::MeV << ","
216  << theFragment->GetMomentum().y()/CLHEP::MeV << ","
217  << theFragment->GetMomentum().z()/CLHEP::MeV
218  << ") MeV E = "
219  << theFragment->GetMomentum().t()/CLHEP::MeV << " MeV"
220  << G4endl;
221 
222  out << " #spin= " << theFragment->GetSpin()
223  << " #floatLevelNo= " << theFragment->GetFloatingLevelNumber() << " ";
224 
225  if(theFragment->GetNuclearPolarization()) {
226  out << theFragment->GetNuclearPolarization();
227  }
228 
229  if (theFragment->GetNumberOfExcitons() != 0) {
230  out << " "
231  << "#Particles= " << theFragment->GetNumberOfParticles()
232  << ", #Charged= " << theFragment->GetNumberOfCharged()
233  << ", #Holes= " << theFragment->GetNumberOfHoles()
234  << ", #ChargedHoles= " << theFragment->GetNumberOfChargedHoles();
235  }
236  out << G4endl;
237  out.setf(old_floatfield,std::ios::floatfield);
238  out.precision(floatPrec);
239 
240  return out;
241 }
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 243 of file G4Fragment.cc.

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

Variable Documentation

G4ThreadLocal G4Allocator<G4Fragment>* pFragmentAllocator = nullptr

Definition at line 46 of file G4Fragment.cc.