G4InuclNuclei.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 // 20100112  Michael Kelsey -- Replace G4CascadeMomentum with G4LorentzVector
00029 // 20100301  M. Kelsey -- Add function to create unphysical nuclei for use
00030 //           as temporary final-state fragments.
00031 // 20100319  M. Kelsey -- Remove "using" directory and unnecessary #includes.
00032 // 20100409  M. Kelsey -- Drop unused string argument from ctors.
00033 // 20100630  M. Kelsey -- Add excitation energy as optional public ctor arg,
00034 //           remove excitation energy data member (part of G4Ions).  Add
00035 //           excitation energy to "getNucleiMass()" function, move print to .cc
00036 // 20100711  M. Kelsey -- Add optional model ID to constructors
00037 // 20100714  M. Kelsey -- Use G4DynamicParticle::theDynamicalMass to deal with
00038 //           excitation energy without instantianting "infinite" G4PartDefns.
00039 // 20100719  M. Kelsey -- Move setExitationEnergy implementation to .cc file.
00040 // 20100906  M. Kelsey -- Add fill() functions to rewrite contents
00041 // 20100909  M. Kelsey -- Add function to discard exciton configuration
00042 // 20100914  M. Kelsey -- Use integers for A and Z
00043 // 20100915  M. Kelsey -- Add constructor to copy G4DynamicParticle input
00044 // 20100924  M. Kelsey -- Add constructor to copy G4Fragment input, and output
00045 //              functions to create G4Fragment.
00046 // 20110214  M. Kelsey -- Replace integer "model" with enum
00047 // 20110225  M. Kelsey -- Add equality operator (NOT sorting!)
00048 // 20110721  M. Kelsey -- Follow base-class ctor change to pass model directly
00049 // 20110722  M. Kelsey -- BUG FIX:  Deleted excitation energy in one ctor
00050 // 20110829  M. Kelsey -- Add constructor to copy G4V3DNucleus input
00051 // 20110919  M. Kelsey -- Add clear() to restore completely empty state
00052 // 20110922  M. Kelsey -- Add stream argument to printParticle() => print()
00053 
00054 #ifndef G4INUCL_NUCLEI_HH
00055 #define G4INUCL_NUCLEI_HH
00056 
00057 #include <CLHEP/Units/SystemOfUnits.h>
00058 
00059 #include "G4InuclParticle.hh"
00060 #include "G4LorentzVector.hh"
00061 #include "G4ExitonConfiguration.hh"
00062 
00063 class G4Fragment;
00064 class G4ParticleDefinition;
00065 class G4V3DNucleus;
00066 
00067 
00068 class G4InuclNuclei : public G4InuclParticle {
00069 public:
00070   G4InuclNuclei() : G4InuclParticle() {}
00071 
00072   G4InuclNuclei(const G4DynamicParticle& dynPart, Model model=DefaultModel)
00073     : G4InuclParticle(dynPart, model) {}
00074 
00075   G4InuclNuclei(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
00076     : G4InuclParticle(makeDefinition(a,z), model) {
00077     setExitationEnergy(exc);
00078   }
00079 
00080   G4InuclNuclei(const G4LorentzVector& mom, G4int a, G4int z,
00081                 G4double exc=0., Model model=DefaultModel)
00082     : G4InuclParticle(makeDefinition(a,z), mom, model) {
00083     setExitationEnergy(exc);
00084   }
00085 
00086   G4InuclNuclei(G4double ekin, G4int a, G4int z, G4double exc,
00087                 Model model=DefaultModel)
00088     : G4InuclParticle(makeDefinition(a,z), ekin, model) {
00089     setExitationEnergy(exc);
00090   }
00091 
00092   G4InuclNuclei(const G4Fragment& aFragment, Model model=DefaultModel);
00093 
00094   G4InuclNuclei(G4V3DNucleus* a3DNucleus, Model model=DefaultModel);
00095 
00096   virtual ~G4InuclNuclei() {}
00097 
00098   // Copy and assignment constructors for use with std::vector<>
00099   G4InuclNuclei(const G4InuclNuclei& right)
00100     : G4InuclParticle(right),
00101       theExitonConfiguration(right.theExitonConfiguration) {}
00102 
00103   G4InuclNuclei& operator=(const G4InuclNuclei& right);
00104 
00105   // Equality (comparison) operator -- NOT SORTING
00106   bool operator==(const G4InuclNuclei& right) {
00107     return ( G4InuclParticle::operator==(right) && 
00108              theExitonConfiguration == right.theExitonConfiguration );
00109   }
00110 
00111   // Overwrite data structure (avoids creating/copying temporaries)
00112   void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel) {
00113     fill(0., a, z, exc, model);
00114   }
00115 
00116   void fill(const G4LorentzVector& mom, G4int a, G4int z,
00117             G4double exc=0., Model model=DefaultModel);
00118 
00119   void fill(G4double ekin, G4int a, G4int z, G4double exc,
00120             Model model=DefaultModel);
00121 
00122   void copy(const G4Fragment& aFragment, Model model=DefaultModel);
00123 
00124   void copy(G4V3DNucleus* a3DNucleus, Model model=DefaultModel);
00125 
00126   void clear();                 // Discard all information (including A,Z)
00127 
00128   // Excitation energy is stored as dynamical mass of particle
00129   void setExitationEnergy(G4double e);
00130 
00131   void setExitonConfiguration(const G4ExitonConfiguration& config) { 
00132     theExitonConfiguration = config;
00133   }
00134 
00135   void clearExitonConfiguration() { theExitonConfiguration.clear(); }
00136 
00137   G4int getA() const { return getDefinition()->GetAtomicMass(); }
00138   G4int getZ() const { return getDefinition()->GetAtomicNumber(); }
00139 
00140   G4double getNucleiMass() const {
00141     return getDefinition()->GetPDGMass()*CLHEP::MeV/CLHEP::GeV; // From G4 to Bertini
00142   }
00143 
00144   G4double getExitationEnergy() const {
00145     return (getMass()-getNucleiMass())*CLHEP::GeV/CLHEP::MeV; // Always in MeV
00146   }
00147 
00148   G4double getExitationEnergyInGeV() const { return getExitationEnergy()/CLHEP::GeV; }
00149 
00150   const G4ExitonConfiguration& getExitonConfiguration() const {
00151     return theExitonConfiguration;
00152   }
00153 
00154   static G4double getNucleiMass(G4int a, G4int z, G4double exc=0.);
00155 
00156   virtual void print(std::ostream& os) const;
00157 
00158   // Convert contents to G4Fragment for use outside package
00159   G4Fragment makeG4Fragment() const;
00160   operator G4Fragment() const;
00161 
00162 protected:
00163   // Convert nuclear configuration to standard GEANT4 pointer
00164   static G4ParticleDefinition* makeDefinition(G4int a, G4int z);
00165   static G4ParticleDefinition* makeNuclearFragment(G4int a, G4int z);
00166 
00167 private: 
00168   G4ExitonConfiguration theExitonConfiguration;
00169 };        
00170 
00171 #endif // G4INUCL_NUCLEI_HH 

Generated on Mon May 27 17:48:38 2013 for Geant4 by  doxygen 1.4.7