Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/util/include/G4Fragment.hh

    r819 r1315  
    2424// ********************************************************************
    2525//
    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//
    2933// 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
    3043
    3144#ifndef G4Fragment_h
     
    3851#include "globals.hh"
    3952#include "G4LorentzVector.hh"
    40 #include "G4ParticleMomentum.hh"
     53//#include "G4ParticleMomentum.hh"
    4154#include "G4ThreeVector.hh"
    4255#include "G4NucleiProperties.hh"
     
    6174  // ============= CONSTRUCTORS ==================
    6275
    63   // Default constructor
     76  // Default constructor - obsolete
    6477  G4Fragment();
    6578
     
    7083  G4Fragment(const G4Fragment &right);
    7184
    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);
    7687
    7788  // 4-momentum and pointer to G4particleDefinition (for gammas)
    78   G4Fragment(const G4LorentzVector aMomentum, G4ParticleDefinition * aParticleDefinition);
     89  G4Fragment(const G4LorentzVector& aMomentum, G4ParticleDefinition * aParticleDefinition);
    7990
    8091  // ============= OPERATORS ==================
     
    89100  // ============= METHODS ==================
    90101
    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;
    98113  void SetExcitationEnergy(const G4double value);
    99114 
    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;
    113127  void SetNumberOfCharged(const G4int value);
    114128
    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;
    130144
    131145#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);
    135148#endif
    136149
    137150private:
    138151
    139   G4double CalculateExcitationEnergy(const G4LorentzVector value) const;
     152  void ExcitationEnegryWarning();
     153
     154  inline void CalculateGroundStateMass();
     155
     156  inline void CalculateExcitationEnergy();
    140157
    141158  G4ThreeVector IsotropicRandom3Vector(const G4double Magnitude = 1.0) const;
    142159 
    143 
    144160  // ============= DATA MEMBERS ==================
    145161
    146   G4double theA;
    147  
    148   G4double theZ;
     162  static G4int errCount;
     163
     164  G4int theA;
     165 
     166  G4int theZ;
    149167 
    150168  G4double theExcitationEnergy;
    151169
     170  G4double theGroundStateMass;
     171
    152172  G4LorentzVector theMomentum;
    153173 
     
    159179 
    160180  G4int numberOfCharged;
    161 
    162181
    163182  // Gamma evaporation requeriments
     
    173192
    174193// Class G4Fragment
     194inline void G4Fragment::CalculateGroundStateMass()
     195{
     196  theGroundStateMass = G4NucleiProperties::GetNuclearMass(theA, theZ);
     197}
    175198
    176199inline G4double G4Fragment::GetA() const
    177200{
     201  return G4double(theA);
     202}
     203
     204inline void G4Fragment::SetA(const G4double value)
     205{
     206  theA = G4lrint(value);
     207  CalculateGroundStateMass();
     208}
     209
     210inline G4double G4Fragment::GetZ()  const
     211{
     212  return G4double(theZ);
     213}
     214
     215inline void G4Fragment::SetZ(const G4double value)
     216{
     217  theZ = G4lrint(value);
     218  CalculateGroundStateMass();
     219}
     220
     221inline G4int G4Fragment::GetA_asInt() const
     222{
    178223  return theA;
    179224}
    180225
    181 inline void G4Fragment::SetA(const G4double value)
    182 {
    183   theA = value;
    184 }
    185 
    186 inline G4double G4Fragment::GetZ()  const
     226inline G4int G4Fragment::GetZ_asInt()  const
    187227{
    188228  return theZ;
    189229}
    190230
    191 inline void G4Fragment::SetZ(const G4double value)
    192 {
    193   theZ = value;
     231inline void G4Fragment::SetZandA_asInt(G4int Znew, G4int Anew)
     232{
     233  theZ = Znew;
     234  theA = Anew;
     235  CalculateGroundStateMass();
    194236}
    195237
     
    200242  // HPW Apr 1999 @@@@@@@
    201243 
    202   if(std::abs(theExcitationEnergy)<10*eV) return 0;
     244  //VI  if(std::abs(theExcitationEnergy)<10*eV) return 0;
    203245  return theExcitationEnergy;
    204246}
    205247
    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
     248inline const G4LorentzVector& G4Fragment::GetMomentum()  const
    213249{
    214250  return theMomentum;
    215251}
    216252
    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
     253inline const G4ThreeVector& G4Fragment::GetAngularMomentum()  const
    224254{
    225255  return theAngularMomentum;
    226256}
    227257
    228 inline void G4Fragment::SetAngularMomentum(const G4ThreeVector value)
     258inline void G4Fragment::SetAngularMomentum(const G4ThreeVector& value)
    229259{
    230260  theAngularMomentum = value;
     
    258288inline void G4Fragment::SetNumberOfCharged(const G4int value)
    259289{
    260   if (value <= numberOfParticles) numberOfCharged = value;
     290  if (value <= numberOfParticles) { numberOfCharged = value; }
    261291  else
    262292  {
    263   G4String text = "G4Fragment::SetNumberOfCharged: Number of charged particles can't be greater than number of particles";
    264           throw G4HadronicException(__FILE__, __LINE__, text);
     293    G4String text = "G4Fragment::SetNumberOfCharged: Number of charged particles can't be greater than number of particles";
     294    throw G4HadronicException(__FILE__, __LINE__, text);
    265295  }
    266296}
     
    271301}
    272302
    273 
    274303inline G4ParticleDefinition * G4Fragment::GetParticleDefinition(void) const
    275304{
     
    282311}
    283312
    284 
    285 inline G4double G4Fragment::GetCreationTime(void) const
     313inline G4double G4Fragment::GetCreationTime() const
    286314{
    287315  return theCreationTime;
     
    293321}
    294322
    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));
     323inline G4double G4Fragment::GetGroundStateMass() const
     324{
     325  return theGroundStateMass;
     326}
     327
     328inline G4double
     329G4Fragment::ComputeGroundStateMass(const G4int Z, const G4int A) const
     330{
     331  return G4NucleiProperties::GetNuclearMass(A, Z);
     332}
     333
     334inline void G4Fragment::CalculateExcitationEnergy()
     335{
     336  theExcitationEnergy = theMomentum.mag() - theGroundStateMass;
     337  if(theExcitationEnergy < 0.0) { ExcitationEnegryWarning(); }
    300338}
    301339       
    302 inline G4double G4Fragment::GetBindingEnergy(void) const
    303 {
    304         return -GetGroundStateMass()+(theA-theZ)*G4Neutron::Neutron()->GetPDGMass()
    305                                                                                  + theZ*G4Proton::Proton()->GetPDGMass();
    306 }
    307 
     340inline G4double G4Fragment::GetBindingEnergy() const
     341{
     342  return (theA-theZ)*CLHEP::neutron_mass_c2 + theZ*CLHEP::proton_mass_c2
     343    - theGroundStateMass;
     344}
     345
     346inline void G4Fragment::SetMomentum(const G4LorentzVector& value)
     347{
     348  theMomentum = value;
     349  CalculateExcitationEnergy();
     350}
    308351
    309352#endif
Note: See TracChangeset for help on using the changeset viewer.