Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  SetNuclearPolarization(nullptr);
96 }
void SetNuclearPolarization(G4NuclearPolarization *)
Definition: G4Fragment.hh:220

Here is the call graph for this function:

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 98 of file G4Fragment.cc.

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

Definition at line 123 of file G4Fragment.cc.

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

272 {
273  G4ThreeVector v(0.0,0.0,spin);
274  return v;
275 }
tuple v
Definition: test.py:18

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 182 of file G4Fragment.cc.

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

Definition at line 150 of file G4Fragment.cc.

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

Definition at line 177 of file G4Fragment.cc.

178 {
179  return (this == (G4Fragment *) &right);
180 }
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 266 of file G4Fragment.cc.

267 {
268  spin = v.mag();
269 }
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 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
std::ostream& operator<< ( std::ostream &  out,
const G4Fragment theFragment 
)
friend

Definition at line 243 of file G4Fragment.cc.

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

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