ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Fragment.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Fragment.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //---------------------------------------------------------------------
28 //
29 // Geant4 header G4Fragment
30 //
31 // by V. Lara (May 1998)
32 //
33 // Modifications:
34 // 03.05.2010 V.Ivanchenko General cleanup of inline functions: objects
35 // are accessed by reference; remove double return
36 // tolerance of excitation energy at modent it is computed;
37 // safe computation of excitation for exotic fragments
38 // 18.05.2010 V.Ivanchenko added member theGroundStateMass and inline
39 // method which allowing to compute this value once and use
40 // many times
41 // 26.09.2010 V.Ivanchenko added number of protons, neutrons, proton holes
42 // and neutron holes as members of the class and Get/Set methods;
43 // removed not needed 'const'; removed old debug staff and unused
44 // private methods; add comments and reorder methods for
45 // better reading
46 
47 #ifndef G4Fragment_h
48 #define G4Fragment_h 1
49 
50 #include "globals.hh"
51 #include "G4Allocator.hh"
52 #include "G4LorentzVector.hh"
53 #include "G4ThreeVector.hh"
54 #include "G4NuclearPolarization.hh"
55 #include "G4NucleiProperties.hh"
56 #include "G4Proton.hh"
57 #include "G4Neutron.hh"
58 #include <vector>
59 
61 
62 class G4Fragment;
63 typedef std::vector<G4Fragment*> G4FragmentVector;
64 
65 class G4Fragment
66 {
67 public:
68 
69  // ============= CONSTRUCTORS ==================
70 
71  // Default constructor - obsolete
72  G4Fragment();
73 
74  // Destructor
75  ~G4Fragment();
76 
77  // Copy constructor
78  G4Fragment(const G4Fragment &right);
79 
80  // A,Z and 4-momentum - main constructor for fragment
81  G4Fragment(G4int A, G4int Z, const G4LorentzVector& aMomentum);
82 
83  // 4-momentum and pointer to G4particleDefinition (for gammas, e-)
84  G4Fragment(const G4LorentzVector& aMomentum,
85  const G4ParticleDefinition* aParticleDefinition);
86 
87  // ============= OPERATORS ==================
88 
89  G4Fragment & operator=(const G4Fragment &right);
90  G4bool operator==(const G4Fragment &right) const;
91  G4bool operator!=(const G4Fragment &right) const;
92 
93  friend std::ostream& operator<<(std::ostream&, const G4Fragment&);
94 
95  // new/delete operators are overloded to use G4Allocator
96  inline void *operator new(size_t);
97  inline void operator delete(void *aFragment);
98 
99  // ============= GENERAL METHODS ==================
100 
101  inline G4int GetZ_asInt() const;
102  inline G4int GetA_asInt() const;
103  inline void SetZandA_asInt(G4int Znew, G4int Anew);
104 
105  inline G4double GetExcitationEnergy() const;
106  inline void SetExcEnergyAndMomentum(G4double eexc, const G4LorentzVector&);
107 
108  inline G4double GetGroundStateMass() const;
109 
110  inline G4double GetBindingEnergy() const;
111 
112  inline const G4LorentzVector& GetMomentum() const;
113  inline void SetMomentum(const G4LorentzVector& value);
114 
115  // computation of mass for any Z and A
116  inline G4double ComputeGroundStateMass(G4int Z, G4int A) const;
117 
118  // extra methods
119  inline G4double GetSpin() const;
120  inline void SetSpin(G4double value);
121 
122  inline G4int GetCreatorModelType() const;
123  inline void SetCreatorModelType(G4int value);
124 
125  // obsolete methods
126 
127  inline G4double GetZ() const;
128  inline G4double GetA() const;
129  inline void SetZ(G4double value);
130  inline void SetA(G4double value);
131 
132  // ============= METHODS FOR PRE-COMPOUND MODEL ===============
133 
134  inline G4int GetNumberOfExcitons() const;
135 
136  inline G4int GetNumberOfParticles() const;
137  inline G4int GetNumberOfCharged() const;
138  inline void SetNumberOfExcitedParticle(G4int valueTot, G4int valueP);
139 
140  inline G4int GetNumberOfHoles() const;
141  inline G4int GetNumberOfChargedHoles() const;
142  inline void SetNumberOfHoles(G4int valueTot, G4int valueP=0);
143 
144  // these methods will be removed in future
145  inline void SetNumberOfParticles(G4int value);
146  inline void SetNumberOfCharged(G4int value);
147 
148  // ============= METHODS FOR PHOTON EVAPORATION ===============
149 
150  inline G4int GetNumberOfElectrons() const;
151  inline void SetNumberOfElectrons(G4int value);
152 
153  inline G4int GetFloatingLevelNumber() const;
154  inline void SetFloatingLevelNumber(G4int value);
155 
156  inline const G4ParticleDefinition * GetParticleDefinition() const;
157  inline void SetParticleDefinition(const G4ParticleDefinition * p);
158 
159  inline G4double GetCreationTime() const;
160  inline void SetCreationTime(G4double time);
161 
162  // G4Fragment class is not responsible for creation and delition of
163  // G4NuclearPolarization object
167 
168  void SetAngularMomentum(const G4ThreeVector&);
170 
171  // ============= PRIVATE METHODS ==============================
172 
173 private:
174 
176 
177  void NumberOfExitationWarning(const G4String&);
178 
179  inline void CalculateExcitationEnergy();
180 
181  inline void CalculateGroundStateMass();
182 
183  // ============= DATA MEMBERS ==================
184 
186 
188 
190 
192 
194 
195  // Nuclear polarisation by default is nullptr
197 
198  // creator model type
200 
201  // Exciton model data members
206 
207  // Gamma evaporation data members
210 
212 
215 
217 };
218 
219 // ============= INLINE METHOD IMPLEMENTATIONS ===================
220 
221 #if defined G4HADRONIC_ALLOC_EXPORT
223 #else
225 #endif
226 
227 inline void * G4Fragment::operator new(size_t)
228 {
230  return (void*) pFragmentAllocator()->MallocSingle();
231 }
232 
233 inline void G4Fragment::operator delete(void * aFragment)
234 {
235  pFragmentAllocator()->FreeSingle((G4Fragment *) aFragment);
236 }
237 
239 {
243  theExcitationEnergy = 0.0;
244  }
245 }
246 
247 inline G4double
249 {
251 }
252 
254 {
256 }
257 
259 {
260  return theA;
261 }
262 
264 {
265  return theZ;
266 }
267 
268 inline void G4Fragment::SetZandA_asInt(G4int Znew, G4int Anew)
269 {
270  theZ = Znew;
271  theA = Anew;
273 }
274 
276 {
277  return theExcitationEnergy;
278 }
279 
281 {
282  return theGroundStateMass;
283 }
284 
286  const G4LorentzVector& v)
287 {
288  theExcitationEnergy = eexc;
289  theMomentum.set(0.0, 0.0, 0.0, theGroundStateMass + eexc);
291 }
292 
294 {
297 }
298 
300 {
301  return theMomentum;
302 }
303 
305 {
306  theMomentum = value;
308 }
309 
311 {
312  return G4double(theZ);
313 }
314 
316 {
317  return G4double(theA);
318 }
319 
320 inline void G4Fragment::SetZ(const G4double value)
321 {
322  theZ = G4lrint(value);
324 }
325 
326 inline void G4Fragment::SetA(const G4double value)
327 {
328  theA = G4lrint(value);
330 }
331 
333 {
335 }
336 
338 {
339  return numberOfParticles;
340 }
341 
343 {
344  return numberOfCharged;
345 }
346 
347 inline
349 {
350  numberOfParticles = valueTot;
351  numberOfCharged = valueP;
352  if(valueTot < valueP) {
353  NumberOfExitationWarning("SetNumberOfExcitedParticle");
354  }
355 }
356 
358 {
359  return numberOfHoles;
360 }
361 
363 {
364  return numberOfChargedHoles;
365 }
366 
367 inline void G4Fragment::SetNumberOfHoles(G4int valueTot, G4int valueP)
368 {
369  numberOfHoles = valueTot;
370  numberOfChargedHoles = valueP;
371  if(valueTot < valueP) {
372  NumberOfExitationWarning("SetNumberOfHoles");
373  }
374 }
375 
377 {
379 }
380 
382 {
384  if(value > numberOfParticles) {
385  NumberOfExitationWarning("SetNumberOfCharged");
386  }
387 }
388 
390 {
391  return numberOfShellElectrons;
392 }
393 
395 {
397 }
398 
400 {
401  return creatorModel;
402 }
403 
405 {
407 }
408 
410 {
411  return spin;
412 }
413 
415 {
416  spin = value;
417 }
418 
420 {
421  return xLevel;
422 }
423 
425 {
426  xLevel = value;
427 }
428 
429 inline
431 {
432  return theParticleDefinition;
433 }
434 
436 {
438 }
439 
441 {
442  return theCreationTime;
443 }
444 
446 {
448 }
449 
451 {
452  return thePolarization;
453 }
454 
456 {
457  return thePolarization;
458 }
459 
461 {
462  thePolarization = p;
463 }
464 
465 #endif
466 
467