Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4Fragment Class Reference

#include <G4Fragment.hh>

Public Member Functions

 G4Fragment ()
 
 ~G4Fragment ()
 
 G4Fragment (const G4Fragment &right)
 
 G4Fragment (G4int A, G4int Z, const G4LorentzVector &aMomentum)
 
 G4Fragment (const G4LorentzVector &aMomentum, const G4ParticleDefinition *aParticleDefinition)
 
G4Fragmentoperator= (const G4Fragment &right)
 
G4bool operator== (const G4Fragment &right) const
 
G4bool operator!= (const G4Fragment &right) const
 
voidoperator new (size_t)
 
void operator delete (void *aFragment)
 
G4int GetZ_asInt () const
 
G4int GetA_asInt () const
 
void SetZandA_asInt (G4int Znew, G4int Anew)
 
G4double GetExcitationEnergy () const
 
void SetExcEnergyAndMomentum (G4double eexc, const G4LorentzVector &)
 
G4double GetGroundStateMass () const
 
G4double GetBindingEnergy () const
 
const G4LorentzVectorGetMomentum () const
 
void SetMomentum (const G4LorentzVector &value)
 
G4double ComputeGroundStateMass (G4int Z, G4int A) const
 
G4double GetSpin () const
 
void SetSpin (G4double value)
 
G4int GetCreatorModelType () const
 
void SetCreatorModelType (G4int value)
 
G4double GetZ () const
 
G4double GetA () const
 
void SetZ (G4double value)
 
void SetA (G4double value)
 
G4int GetNumberOfExcitons () const
 
G4int GetNumberOfParticles () const
 
G4int GetNumberOfCharged () const
 
void SetNumberOfExcitedParticle (G4int valueTot, G4int valueP)
 
G4int GetNumberOfHoles () const
 
G4int GetNumberOfChargedHoles () const
 
void SetNumberOfHoles (G4int valueTot, G4int valueP=0)
 
void SetNumberOfParticles (G4int value)
 
void SetNumberOfCharged (G4int value)
 
G4int GetNumberOfElectrons () const
 
void SetNumberOfElectrons (G4int value)
 
G4int GetFloatingLevelNumber () const
 
void SetFloatingLevelNumber (G4int value)
 
const G4ParticleDefinitionGetParticleDefinition () const
 
void SetParticleDefinition (const G4ParticleDefinition *p)
 
G4double GetCreationTime () const
 
void SetCreationTime (G4double time)
 
G4NuclearPolarizationGetNuclearPolarization () const
 
void SetNuclearPolarization (G4NuclearPolarization *)
 
void SetAngularMomentum (const G4ThreeVector &)
 
G4ThreeVector GetAngularMomentum () const
 

Friends

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

Detailed Description

Definition at line 66 of file G4Fragment.hh.

Constructor & Destructor Documentation

G4Fragment::G4Fragment ( )

Definition at line 50 of file G4Fragment.cc.

50  :
51  theA(0),
52  theZ(0),
53  theExcitationEnergy(0.0),
54  theGroundStateMass(0.0),
55  theMomentum(G4LorentzVector(0,0,0,0)),
56  thePolarization(nullptr),
57  creatorModel(-1),
58  numberOfParticles(0),
59  numberOfCharged(0),
60  numberOfHoles(0),
61  numberOfChargedHoles(0),
62  numberOfShellElectrons(0),
63  xLevel(0),
64  theParticleDefinition(nullptr),
65  spin(0.0),
66  theCreationTime(0.0)
67 {}
CLHEP::HepLorentzVector G4LorentzVector
G4Fragment::~G4Fragment ( )

Definition at line 93 of file G4Fragment.cc.

94 {
95  delete thePolarization;
96  thePolarization = nullptr;
97 }
G4Fragment::G4Fragment ( const G4Fragment right)

Definition at line 70 of file G4Fragment.cc.

70  :
71  theA(right.theA),
72  theZ(right.theZ),
73  theExcitationEnergy(right.theExcitationEnergy),
74  theGroundStateMass(right.theGroundStateMass),
75  theMomentum(right.theMomentum),
76  thePolarization(nullptr),
77  creatorModel(right.creatorModel),
78  numberOfParticles(right.numberOfParticles),
79  numberOfCharged(right.numberOfCharged),
80  numberOfHoles(right.numberOfHoles),
81  numberOfChargedHoles(right.numberOfChargedHoles),
82  numberOfShellElectrons(right.numberOfShellElectrons),
83  xLevel(right.xLevel),
84  theParticleDefinition(right.theParticleDefinition),
85  spin(right.spin),
86  theCreationTime(right.theCreationTime)
87 {
88  if(right.thePolarization != nullptr) {
89  thePolarization = new G4NuclearPolarization(*(right.thePolarization));
90  }
91 }
G4Fragment::G4Fragment ( G4int  A,
G4int  Z,
const G4LorentzVector aMomentum 
)

Definition at line 99 of file G4Fragment.cc.

99  :
100  theA(A),
101  theZ(Z),
102  theExcitationEnergy(0.0),
103  theGroundStateMass(0.0),
104  theMomentum(aMomentum),
105  thePolarization(nullptr),
106  creatorModel(-1),
107  numberOfParticles(0),
108  numberOfCharged(0),
109  numberOfHoles(0),
110  numberOfChargedHoles(0),
111  numberOfShellElectrons(0),
112  xLevel(0),
113  theParticleDefinition(nullptr),
114  spin(0.0),
115  theCreationTime(0.0)
116 {
117  if(theA > 0) {
118  CalculateGroundStateMass();
119  CalculateExcitationEnergy();
120  }
121 }
double A(double temperature)
G4Fragment::G4Fragment ( const G4LorentzVector aMomentum,
const G4ParticleDefinition aParticleDefinition 
)

Definition at line 124 of file G4Fragment.cc.

125  :
126  theA(0),
127  theZ(0),
128  theExcitationEnergy(0.0),
129  theMomentum(aMomentum),
130  thePolarization(nullptr),
131  creatorModel(-1),
132  numberOfParticles(0),
133  numberOfCharged(0),
134  numberOfHoles(0),
135  numberOfChargedHoles(0),
136  numberOfShellElectrons(0),
137  xLevel(0),
138  theParticleDefinition(aParticleDefinition),
139  spin(0.0),
140  theCreationTime(0.0)
141 {
142  if(aParticleDefinition->GetPDGEncoding() != 22 &&
143  aParticleDefinition->GetPDGEncoding() != 11) {
144  G4String text = "G4Fragment::G4Fragment constructor for gamma used for "
145  + aParticleDefinition->GetParticleName();
146  throw G4HadronicException(__FILE__, __LINE__, text);
147  }
148  theGroundStateMass = aParticleDefinition->GetPDGMass();
149 }
const G4String & GetParticleName() const
G4double GetPDGMass() const

Here is the call graph for this function:

Member Function Documentation

G4double G4Fragment::ComputeGroundStateMass ( G4int  Z,
G4int  A 
) const
inline

Definition at line 256 of file G4Fragment.hh.

257 {
259 }
static G4double GetNuclearMass(const G4double A, const G4double Z)
double A(double temperature)

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4Fragment::GetA ( void  ) const
inline

Definition at line 323 of file G4Fragment.hh.

324 {
325  return G4double(theA);
326 }
double G4double
Definition: G4Types.hh:76
G4int G4Fragment::GetA_asInt ( void  ) const
inline

Definition at line 266 of file G4Fragment.hh.

267 {
268  return theA;
269 }

Here is the caller graph for this function:

G4ThreeVector G4Fragment::GetAngularMomentum ( ) const

Definition at line 272 of file G4Fragment.cc.

273 {
274  G4ThreeVector v(0.0,0.0,spin);
275  return v;
276 }

Here is the caller graph for this function:

G4double G4Fragment::GetBindingEnergy ( ) const
inline

Definition at line 301 of file G4Fragment.hh.

302 {
303  return (theA-theZ)*CLHEP::neutron_mass_c2 + theZ*CLHEP::proton_mass_c2
304  - theGroundStateMass;
305 }
static constexpr double proton_mass_c2
static constexpr double neutron_mass_c2
G4double G4Fragment::GetCreationTime ( ) const
inline

Definition at line 448 of file G4Fragment.hh.

449 {
450  return theCreationTime;
451 }

Here is the caller graph for this function:

G4int G4Fragment::GetCreatorModelType ( ) const
inline

Definition at line 407 of file G4Fragment.hh.

408 {
409  return creatorModel;
410 }

Here is the caller graph for this function:

G4double G4Fragment::GetExcitationEnergy ( void  ) const
inline

Definition at line 283 of file G4Fragment.hh.

284 {
285  return theExcitationEnergy;
286 }

Here is the caller graph for this function:

G4int G4Fragment::GetFloatingLevelNumber ( ) const
inline

Definition at line 427 of file G4Fragment.hh.

428 {
429  return xLevel;
430 }

Here is the caller graph for this function:

G4double G4Fragment::GetGroundStateMass ( ) const
inline

Definition at line 288 of file G4Fragment.hh.

289 {
290  return theGroundStateMass;
291 }

Here is the caller graph for this function:

const G4LorentzVector & G4Fragment::GetMomentum ( void  ) const
inline

Definition at line 307 of file G4Fragment.hh.

308 {
309  return theMomentum;
310 }

Here is the caller graph for this function:

G4NuclearPolarization * G4Fragment::GetNuclearPolarization ( ) const
inline

Definition at line 458 of file G4Fragment.hh.

459 {
460  return thePolarization;
461 }

Here is the caller graph for this function:

G4int G4Fragment::GetNumberOfCharged ( ) const
inline

Definition at line 350 of file G4Fragment.hh.

351 {
352  return numberOfCharged;
353 }

Here is the caller graph for this function:

G4int G4Fragment::GetNumberOfChargedHoles ( ) const
inline

Definition at line 370 of file G4Fragment.hh.

371 {
372  return numberOfChargedHoles;
373 }

Here is the caller graph for this function:

G4int G4Fragment::GetNumberOfElectrons ( ) const
inline

Definition at line 397 of file G4Fragment.hh.

398 {
399  return numberOfShellElectrons;
400 }

Here is the caller graph for this function:

G4int G4Fragment::GetNumberOfExcitons ( ) const
inline

Definition at line 340 of file G4Fragment.hh.

341 {
342  return numberOfParticles + numberOfHoles;
343 }

Here is the caller graph for this function:

G4int G4Fragment::GetNumberOfHoles ( ) const
inline

Definition at line 365 of file G4Fragment.hh.

366 {
367  return numberOfHoles;
368 }

Here is the caller graph for this function:

G4int G4Fragment::GetNumberOfParticles ( ) const
inline

Definition at line 345 of file G4Fragment.hh.

346 {
347  return numberOfParticles;
348 }

Here is the caller graph for this function:

const G4ParticleDefinition * G4Fragment::GetParticleDefinition ( void  ) const
inline

Definition at line 438 of file G4Fragment.hh.

439 {
440  return theParticleDefinition;
441 }

Here is the caller graph for this function:

G4double G4Fragment::GetSpin ( void  ) const
inline

Definition at line 417 of file G4Fragment.hh.

418 {
419  return spin;
420 }

Here is the caller graph for this function:

G4double G4Fragment::GetZ ( void  ) const
inline

Definition at line 318 of file G4Fragment.hh.

319 {
320  return G4double(theZ);
321 }
double G4double
Definition: G4Types.hh:76
G4int G4Fragment::GetZ_asInt ( void  ) const
inline

Definition at line 271 of file G4Fragment.hh.

272 {
273  return theZ;
274 }

Here is the caller graph for this function:

void G4Fragment::operator delete ( void aFragment)
inline

Definition at line 240 of file G4Fragment.hh.

241 {
242  ((G4Fragment *)aFragment)->SetNuclearPolarization(nullptr);
243  pFragmentAllocator->FreeSingle((G4Fragment *) aFragment);
244 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4Fragment > * pFragmentAllocator
Definition: G4Fragment.cc:46
void * G4Fragment::operator new ( size_t  )
inline

Definition at line 234 of file G4Fragment.hh.

235 {
237  return (void*) pFragmentAllocator->MallocSingle();
238 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4Fragment > * pFragmentAllocator
Definition: G4Fragment.cc:46
G4bool G4Fragment::operator!= ( const G4Fragment right) const

Definition at line 183 of file G4Fragment.cc.

184 {
185  return (this != (G4Fragment *) &right);
186 }
G4Fragment & G4Fragment::operator= ( const G4Fragment right)

Definition at line 151 of file G4Fragment.cc.

152 {
153  if (this != &right) {
154  theA = right.theA;
155  theZ = right.theZ;
156  theExcitationEnergy = right.theExcitationEnergy;
157  theGroundStateMass = right.theGroundStateMass;
158  theMomentum = right.theMomentum;
159  delete thePolarization;
160  thePolarization = nullptr;
161  if(right.thePolarization != nullptr) {
162  thePolarization = new G4NuclearPolarization(*(right.thePolarization));
163  }
164  creatorModel = right.creatorModel;
165  numberOfParticles = right.numberOfParticles;
166  numberOfCharged = right.numberOfCharged;
167  numberOfHoles = right.numberOfHoles;
168  numberOfChargedHoles = right.numberOfChargedHoles;
169  numberOfShellElectrons = right.numberOfShellElectrons;
170  xLevel = right.xLevel;
171  theParticleDefinition = right.theParticleDefinition;
172  spin = right.spin;
173  theCreationTime = right.theCreationTime;
174  }
175  return *this;
176 }
G4bool G4Fragment::operator== ( const G4Fragment right) const

Definition at line 178 of file G4Fragment.cc.

179 {
180  return (this == (G4Fragment *) &right);
181 }
void G4Fragment::SetA ( G4double  value)
inline

Definition at line 334 of file G4Fragment.hh.

335 {
336  theA = G4lrint(value);
337  CalculateGroundStateMass();
338 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
int G4lrint(double ad)
Definition: templates.hh:163

Here is the call graph for this function:

void G4Fragment::SetAngularMomentum ( const G4ThreeVector v)

Definition at line 267 of file G4Fragment.cc.

268 {
269  spin = v.mag();
270 }
double mag() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4Fragment::SetCreationTime ( G4double  time)
inline

Definition at line 453 of file G4Fragment.hh.

454 {
455  theCreationTime = time;
456 }

Here is the caller graph for this function:

void G4Fragment::SetCreatorModelType ( G4int  value)
inline

Definition at line 412 of file G4Fragment.hh.

413 {
414  creatorModel = value;
415 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
void G4Fragment::SetExcEnergyAndMomentum ( G4double  eexc,
const G4LorentzVector v 
)
inline

Definition at line 293 of file G4Fragment.hh.

295 {
296  theExcitationEnergy = eexc;
297  theMomentum.set(0.0, 0.0, 0.0, theGroundStateMass + eexc);
298  theMomentum.boost(v.boostVector());
299 }
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
void set(double x, double y, double z, double t)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4Fragment::SetFloatingLevelNumber ( G4int  value)
inline

Definition at line 432 of file G4Fragment.hh.

433 {
434  xLevel = value;
435 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
void G4Fragment::SetMomentum ( const G4LorentzVector value)
inline

Definition at line 312 of file G4Fragment.hh.

313 {
314  theMomentum = value;
315  CalculateExcitationEnergy();
316 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Fragment::SetNuclearPolarization ( G4NuclearPolarization p)
inline

Definition at line 220 of file G4Fragment.hh.

221 {
222  if(p != thePolarization) {
223  delete thePolarization;
224  thePolarization = p;
225  }
226 }
const char * p
Definition: xmltok.h:285

Here is the caller graph for this function:

void G4Fragment::SetNumberOfCharged ( G4int  value)
inline

Definition at line 389 of file G4Fragment.hh.

390 {
391  numberOfCharged = value;
392  if(value > numberOfParticles) {
393  NumberOfExitationWarning("SetNumberOfCharged");
394  }
395 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Fragment::SetNumberOfElectrons ( G4int  value)
inline

Definition at line 402 of file G4Fragment.hh.

403 {
404  numberOfShellElectrons = value;
405 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Fragment::SetNumberOfExcitedParticle ( G4int  valueTot,
G4int  valueP 
)
inline

Definition at line 356 of file G4Fragment.hh.

357 {
358  numberOfParticles = valueTot;
359  numberOfCharged = valueP;
360  if(valueTot < valueP) {
361  NumberOfExitationWarning("SetNumberOfExcitedParticle");
362  }
363 }

Here is the caller graph for this function:

void G4Fragment::SetNumberOfHoles ( G4int  valueTot,
G4int  valueP = 0 
)
inline

Definition at line 375 of file G4Fragment.hh.

376 {
377  numberOfHoles = valueTot;
378  numberOfChargedHoles = valueP;
379  if(valueTot < valueP) {
380  NumberOfExitationWarning("SetNumberOfHoles");
381  }
382 }

Here is the caller graph for this function:

void G4Fragment::SetNumberOfParticles ( G4int  value)
inline

Definition at line 384 of file G4Fragment.hh.

385 {
386  numberOfParticles = value;
387 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Fragment::SetParticleDefinition ( const G4ParticleDefinition p)
inline

Definition at line 443 of file G4Fragment.hh.

444 {
445  theParticleDefinition = p;
446 }
const char * p
Definition: xmltok.h:285
void G4Fragment::SetSpin ( G4double  value)
inline

Definition at line 422 of file G4Fragment.hh.

423 {
424  spin = value;
425 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4Fragment::SetZ ( G4double  value)
inline

Definition at line 328 of file G4Fragment.hh.

329 {
330  theZ = G4lrint(value);
331  CalculateGroundStateMass();
332 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
int G4lrint(double ad)
Definition: templates.hh:163

Here is the call graph for this function:

void G4Fragment::SetZandA_asInt ( G4int  Znew,
G4int  Anew 
)
inline

Definition at line 276 of file G4Fragment.hh.

277 {
278  theZ = Znew;
279  theA = Anew;
280  CalculateGroundStateMass();
281 }

Here is the caller graph for this function:

Friends And Related Function Documentation

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

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
std::ostream& operator<< ( std::ostream &  out,
const G4Fragment theFragment 
)
friend

Definition at line 244 of file G4Fragment.cc.

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

The documentation for this class was generated from the following files: