Changeset 1315 for trunk/source/processes/hadronic/models/util/include
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/util/include/G4Fragment.hh
r819 r1315 24 24 // ******************************************************************** 25 25 // 26 // 27 // 28 // Hadronic Process: Nuclear De-excitations 26 // $Id: G4Fragment.hh,v 1.11 2010/05/19 10:23:00 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 // 29 //--------------------------------------------------------------------- 30 // 31 // Geant4 header G4Fragment 32 // 29 33 // by V. Lara (May 1998) 34 // 35 // Modifications: 36 // 03.05.2010 V.Ivanchenko General cleanup of inline functions: objects 37 // are accessed by reference; remove double return 38 // tolerance of excitation energy at modent it is computed; 39 // safe computation of excitation for exotic fragments 40 // 18.05.2010 V.Ivanchenko added member theGroundStateMass and inline 41 // method which allowing to compute this value once and use 42 // many times 30 43 31 44 #ifndef G4Fragment_h … … 38 51 #include "globals.hh" 39 52 #include "G4LorentzVector.hh" 40 #include "G4ParticleMomentum.hh"53 //#include "G4ParticleMomentum.hh" 41 54 #include "G4ThreeVector.hh" 42 55 #include "G4NucleiProperties.hh" … … 61 74 // ============= CONSTRUCTORS ================== 62 75 63 // Default constructor 76 // Default constructor - obsolete 64 77 G4Fragment(); 65 78 … … 70 83 G4Fragment(const G4Fragment &right); 71 84 72 // Several constructors 73 74 // A,Z and 4-momentum 75 G4Fragment(const G4int A, const G4int Z, const G4LorentzVector aMomentum); 85 // A,Z and 4-momentum - main constructor for fragment 86 G4Fragment(const G4int A, const G4int Z, const G4LorentzVector& aMomentum); 76 87 77 88 // 4-momentum and pointer to G4particleDefinition (for gammas) 78 G4Fragment(const G4LorentzVector aMomentum, G4ParticleDefinition * aParticleDefinition);89 G4Fragment(const G4LorentzVector& aMomentum, G4ParticleDefinition * aParticleDefinition); 79 90 80 91 // ============= OPERATORS ================== … … 89 100 // ============= METHODS ================== 90 101 91 inline G4double GetA(void) const; 92 void SetA(const G4double value); 93 94 G4double GetZ(void) const; 95 void SetZ(const G4double value); 96 97 G4double GetExcitationEnergy(void) const; 102 inline G4double GetA() const; 103 inline void SetA(const G4double value); 104 105 inline G4double GetZ() const; 106 inline void SetZ(const G4double value); 107 108 inline G4int GetZ_asInt() const; 109 inline G4int GetA_asInt() const; 110 inline void SetZandA_asInt(G4int Znew, G4int Anew); 111 112 inline G4double GetExcitationEnergy() const; 98 113 void SetExcitationEnergy(const G4double value); 99 114 100 const G4LorentzVector GetMomentum(void) const; 101 void SetMomentum(const G4LorentzVector value); 102 103 const G4ThreeVector GetAngularMomentum(void) const; 104 void SetAngularMomentum(const G4ThreeVector value); 105 106 G4int GetNumberOfExcitons(void) const; 107 // void SetNumberOfExcitons(const G4int value); 108 109 G4int GetNumberOfHoles(void) const; 110 void SetNumberOfHoles(const G4int value); 111 112 G4int GetNumberOfCharged(void) const; 115 inline const G4LorentzVector& GetMomentum() const; 116 inline void SetMomentum(const G4LorentzVector& value); 117 118 inline const G4ThreeVector& GetAngularMomentum() const; 119 inline void SetAngularMomentum(const G4ThreeVector& value); 120 121 inline G4int GetNumberOfExcitons() const; 122 123 inline G4int GetNumberOfHoles() const; 124 inline void SetNumberOfHoles(const G4int value); 125 126 inline G4int GetNumberOfCharged() const; 113 127 void SetNumberOfCharged(const G4int value); 114 128 115 G4int GetNumberOfParticles(void) const;116 void SetNumberOfParticles(const G4int value);117 118 inline G4ParticleDefinition * GetParticleDefinition( void) const;119 void SetParticleDefinition(G4ParticleDefinition * aParticleDefinition);120 121 G4double GetCreationTime(void) const;122 void SetCreationTime(const G4double time);123 124 125 // Some utility methods 126 127 inline G4double GetGroundStateMass(void) const; 128 129 inline G4double GetBindingEnergy(void) const;129 inline G4int GetNumberOfParticles() const; 130 inline void SetNumberOfParticles(const G4int value); 131 132 inline G4ParticleDefinition * GetParticleDefinition() const; 133 inline void SetParticleDefinition(G4ParticleDefinition * aParticleDefinition); 134 135 inline G4double GetCreationTime() const; 136 inline void SetCreationTime(const G4double time); 137 138 inline G4double GetGroundStateMass() const; 139 140 inline G4double GetBindingEnergy() const; 141 142 // computation of mass for any Z and A 143 inline G4double ComputeGroundStateMass(const G4int Z, const G4int A) const; 130 144 131 145 #ifdef PRECOMPOUND_TEST 132 G4String GetCreatorModel() const { return theCreatorModel; } 133 void SetCreatorModel(const G4String & aModel) 134 { theCreatorModel = aModel; } 146 G4String GetCreatorModel() const; 147 void SetCreatorModel(const G4String & aModel); 135 148 #endif 136 149 137 150 private: 138 151 139 G4double CalculateExcitationEnergy(const G4LorentzVector value) const; 152 void ExcitationEnegryWarning(); 153 154 inline void CalculateGroundStateMass(); 155 156 inline void CalculateExcitationEnergy(); 140 157 141 158 G4ThreeVector IsotropicRandom3Vector(const G4double Magnitude = 1.0) const; 142 159 143 144 160 // ============= DATA MEMBERS ================== 145 161 146 G4double theA; 147 148 G4double theZ; 162 static G4int errCount; 163 164 G4int theA; 165 166 G4int theZ; 149 167 150 168 G4double theExcitationEnergy; 151 169 170 G4double theGroundStateMass; 171 152 172 G4LorentzVector theMomentum; 153 173 … … 159 179 160 180 G4int numberOfCharged; 161 162 181 163 182 // Gamma evaporation requeriments … … 173 192 174 193 // Class G4Fragment 194 inline void G4Fragment::CalculateGroundStateMass() 195 { 196 theGroundStateMass = G4NucleiProperties::GetNuclearMass(theA, theZ); 197 } 175 198 176 199 inline G4double G4Fragment::GetA() const 177 200 { 201 return G4double(theA); 202 } 203 204 inline void G4Fragment::SetA(const G4double value) 205 { 206 theA = G4lrint(value); 207 CalculateGroundStateMass(); 208 } 209 210 inline G4double G4Fragment::GetZ() const 211 { 212 return G4double(theZ); 213 } 214 215 inline void G4Fragment::SetZ(const G4double value) 216 { 217 theZ = G4lrint(value); 218 CalculateGroundStateMass(); 219 } 220 221 inline G4int G4Fragment::GetA_asInt() const 222 { 178 223 return theA; 179 224 } 180 225 181 inline void G4Fragment::SetA(const G4double value) 182 { 183 theA = value; 184 } 185 186 inline G4double G4Fragment::GetZ() const 226 inline G4int G4Fragment::GetZ_asInt() const 187 227 { 188 228 return theZ; 189 229 } 190 230 191 inline void G4Fragment::SetZ(const G4double value) 192 { 193 theZ = value; 231 inline void G4Fragment::SetZandA_asInt(G4int Znew, G4int Anew) 232 { 233 theZ = Znew; 234 theA = Anew; 235 CalculateGroundStateMass(); 194 236 } 195 237 … … 200 242 // HPW Apr 1999 @@@@@@@ 201 243 202 if(std::abs(theExcitationEnergy)<10*eV) return 0;244 //VI if(std::abs(theExcitationEnergy)<10*eV) return 0; 203 245 return theExcitationEnergy; 204 246 } 205 247 206 inline void G4Fragment::SetExcitationEnergy(const G4double ) 207 { 208 // theExcitationEnergy = value; 209 G4cout << "Warning: G4Fragment::SetExcitationEnergy() is a dummy method. Please, avoid to use it." << G4endl; 210 } 211 212 inline const G4LorentzVector G4Fragment::GetMomentum() const 248 inline const G4LorentzVector& G4Fragment::GetMomentum() const 213 249 { 214 250 return theMomentum; 215 251 } 216 252 217 inline void G4Fragment::SetMomentum(const G4LorentzVector value) 218 { 219 theMomentum = value; 220 theExcitationEnergy = CalculateExcitationEnergy(value); 221 } 222 223 inline const G4ThreeVector G4Fragment::GetAngularMomentum() const 253 inline const G4ThreeVector& G4Fragment::GetAngularMomentum() const 224 254 { 225 255 return theAngularMomentum; 226 256 } 227 257 228 inline void G4Fragment::SetAngularMomentum(const G4ThreeVector value)258 inline void G4Fragment::SetAngularMomentum(const G4ThreeVector& value) 229 259 { 230 260 theAngularMomentum = value; … … 258 288 inline void G4Fragment::SetNumberOfCharged(const G4int value) 259 289 { 260 if (value <= numberOfParticles) numberOfCharged = value;290 if (value <= numberOfParticles) { numberOfCharged = value; } 261 291 else 262 292 { 263 G4String text = "G4Fragment::SetNumberOfCharged: Number of charged particles can't be greater than number of particles";264 293 G4String text = "G4Fragment::SetNumberOfCharged: Number of charged particles can't be greater than number of particles"; 294 throw G4HadronicException(__FILE__, __LINE__, text); 265 295 } 266 296 } … … 271 301 } 272 302 273 274 303 inline G4ParticleDefinition * G4Fragment::GetParticleDefinition(void) const 275 304 { … … 282 311 } 283 312 284 285 inline G4double G4Fragment::GetCreationTime(void) const 313 inline G4double G4Fragment::GetCreationTime() const 286 314 { 287 315 return theCreationTime; … … 293 321 } 294 322 295 inline G4double G4Fragment::GetGroundStateMass(void) const 296 { 297 if (theA == 0) return 0.0; // photon 298 else return G4ParticleTable::GetParticleTable()-> 299 GetIonTable()->GetIonMass(G4lrint(theZ),G4lrint(theA)); 323 inline G4double G4Fragment::GetGroundStateMass() const 324 { 325 return theGroundStateMass; 326 } 327 328 inline G4double 329 G4Fragment::ComputeGroundStateMass(const G4int Z, const G4int A) const 330 { 331 return G4NucleiProperties::GetNuclearMass(A, Z); 332 } 333 334 inline void G4Fragment::CalculateExcitationEnergy() 335 { 336 theExcitationEnergy = theMomentum.mag() - theGroundStateMass; 337 if(theExcitationEnergy < 0.0) { ExcitationEnegryWarning(); } 300 338 } 301 339 302 inline G4double G4Fragment::GetBindingEnergy(void) const 303 { 304 return -GetGroundStateMass()+(theA-theZ)*G4Neutron::Neutron()->GetPDGMass() 305 + theZ*G4Proton::Proton()->GetPDGMass(); 306 } 307 340 inline G4double G4Fragment::GetBindingEnergy() const 341 { 342 return (theA-theZ)*CLHEP::neutron_mass_c2 + theZ*CLHEP::proton_mass_c2 343 - theGroundStateMass; 344 } 345 346 inline void G4Fragment::SetMomentum(const G4LorentzVector& value) 347 { 348 theMomentum = value; 349 CalculateExcitationEnergy(); 350 } 308 351 309 352 #endif
Note: See TracChangeset
for help on using the changeset viewer.