Geant4  10.02.p02
G4InuclNuclei.hh
Go to the documentation of this file.
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 // $Id: G4InuclNuclei.hh 66241 2012-12-13 18:34:42Z gunter $
27 //
28 // 20100112 Michael Kelsey -- Replace G4CascadeMomentum with G4LorentzVector
29 // 20100301 M. Kelsey -- Add function to create unphysical nuclei for use
30 // as temporary final-state fragments.
31 // 20100319 M. Kelsey -- Remove "using" directory and unnecessary #includes.
32 // 20100409 M. Kelsey -- Drop unused string argument from ctors.
33 // 20100630 M. Kelsey -- Add excitation energy as optional public ctor arg,
34 // remove excitation energy data member (part of G4Ions). Add
35 // excitation energy to "getNucleiMass()" function, move print to .cc
36 // 20100711 M. Kelsey -- Add optional model ID to constructors
37 // 20100714 M. Kelsey -- Use G4DynamicParticle::theDynamicalMass to deal with
38 // excitation energy without instantianting "infinite" G4PartDefns.
39 // 20100719 M. Kelsey -- Move setExitationEnergy implementation to .cc file.
40 // 20100906 M. Kelsey -- Add fill() functions to rewrite contents
41 // 20100909 M. Kelsey -- Add function to discard exciton configuration
42 // 20100914 M. Kelsey -- Use integers for A and Z
43 // 20100915 M. Kelsey -- Add constructor to copy G4DynamicParticle input
44 // 20100924 M. Kelsey -- Add constructor to copy G4Fragment input, and output
45 // functions to create G4Fragment.
46 // 20110214 M. Kelsey -- Replace integer "model" with enum
47 // 20110225 M. Kelsey -- Add equality operator (NOT sorting!)
48 // 20110721 M. Kelsey -- Follow base-class ctor change to pass model directly
49 // 20110722 M. Kelsey -- BUG FIX: Deleted excitation energy in one ctor
50 // 20110829 M. Kelsey -- Add constructor to copy G4V3DNucleus input
51 // 20110919 M. Kelsey -- Add clear() to restore completely empty state
52 // 20110922 M. Kelsey -- Add stream argument to printParticle() => print()
53 
54 #ifndef G4INUCL_NUCLEI_HH
55 #define G4INUCL_NUCLEI_HH
56 
57 #include <CLHEP/Units/SystemOfUnits.h>
58 
59 #include "G4InuclParticle.hh"
60 #include "G4LorentzVector.hh"
61 #include "G4ExitonConfiguration.hh"
62 
63 class G4Fragment;
65 class G4V3DNucleus;
66 
67 
69 public:
71 
73  : G4InuclParticle(dynPart, model) {}
74 
76  : G4InuclParticle(makeDefinition(a,z), model) {
77  setExitationEnergy(exc);
78  }
79 
81  G4double exc=0., Model model=DefaultModel)
82  : G4InuclParticle(makeDefinition(a,z), mom, model) {
83  setExitationEnergy(exc);
84  }
85 
87  Model model=DefaultModel)
88  : G4InuclParticle(makeDefinition(a,z), ekin, model) {
89  setExitationEnergy(exc);
90  }
91 
92  G4InuclNuclei(const G4Fragment& aFragment, Model model=DefaultModel);
93 
94  G4InuclNuclei(G4V3DNucleus* a3DNucleus, Model model=DefaultModel);
95 
96  virtual ~G4InuclNuclei() {}
97 
98  // Copy and assignment constructors for use with std::vector<>
100  : G4InuclParticle(right),
102 
104 
105  // Equality (comparison) operator -- NOT SORTING
107  return ( G4InuclParticle::operator==(right) &&
109  }
110 
111  // Overwrite data structure (avoids creating/copying temporaries)
112  void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel) {
113  fill(0., a, z, exc, model);
114  }
115 
116  void fill(const G4LorentzVector& mom, G4int a, G4int z,
117  G4double exc=0., Model model=DefaultModel);
118 
119  void fill(G4double ekin, G4int a, G4int z, G4double exc,
120  Model model=DefaultModel);
121 
122  void copy(const G4Fragment& aFragment, Model model=DefaultModel);
123 
124  void copy(G4V3DNucleus* a3DNucleus, Model model=DefaultModel);
125 
126  void clear(); // Discard all information (including A,Z)
127 
128  // Excitation energy is stored as dynamical mass of particle
130 
133  }
134 
136 
137  G4int getA() const { return getDefinition()->GetAtomicMass(); }
138  G4int getZ() const { return getDefinition()->GetAtomicNumber(); }
139 
141  return getDefinition()->GetPDGMass()*CLHEP::MeV/CLHEP::GeV; // From G4 to Bertini
142  }
143 
145  return (getMass()-getNucleiMass())*CLHEP::GeV/CLHEP::MeV; // Always in MeV
146  }
147 
149 
151  return theExitonConfiguration;
152  }
153 
154  static G4double getNucleiMass(G4int a, G4int z, G4double exc=0.);
155 
156  virtual void print(std::ostream& os) const;
157 
158  // Convert contents to G4Fragment for use outside package
159  G4Fragment makeG4Fragment() const;
160  operator G4Fragment() const;
161 
162 protected:
163  // Convert nuclear configuration to standard GEANT4 pointer
166 
167 private:
169 };
170 
171 #endif // G4INUCL_NUCLEI_HH
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
G4InuclNuclei(const G4DynamicParticle &dynPart, Model model=DefaultModel)
G4InuclNuclei(const G4InuclNuclei &right)
static const double MeV
Definition: G4SIunits.hh:211
G4int getZ() const
G4double getExitationEnergyInGeV() const
virtual ~G4InuclNuclei()
G4double z
Definition: TRTMaterials.hh:39
G4InuclNuclei & operator=(const G4InuclNuclei &right)
const G4ParticleDefinition * getDefinition() const
G4double a
Definition: TRTMaterials.hh:39
G4InuclNuclei(const G4LorentzVector &mom, G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
int G4int
Definition: G4Types.hh:78
G4int GetAtomicNumber() const
void setExitationEnergy(G4double e)
G4int getA() const
G4double getNucleiMass() const
void copy(const G4Fragment &aFragment, Model model=DefaultModel)
G4double getExitationEnergy() const
struct config_s config
static const double GeV
Definition: G4SIunits.hh:214
virtual void print(std::ostream &os) const
G4int GetAtomicMass() const
G4InuclNuclei(G4double ekin, G4int a, G4int z, G4double exc, Model model=DefaultModel)
G4double GetPDGMass() const
void setExitonConfiguration(const G4ExitonConfiguration &config)
bool operator==(const G4InuclNuclei &right)
G4Fragment makeG4Fragment() const
void clearExitonConfiguration()
static G4ParticleDefinition * makeDefinition(G4int a, G4int z)
double G4double
Definition: G4Types.hh:76
G4ExitonConfiguration theExitonConfiguration
static G4ParticleDefinition * makeNuclearFragment(G4int a, G4int z)
G4InuclNuclei(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
G4double getMass() const
CLHEP::HepLorentzVector G4LorentzVector
const G4ExitonConfiguration & getExitonConfiguration() const