Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:31

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // 20100112  Michael Kelsey -- Replace G4CascadeMomentum with G4LorentzVector
0028 // 20100301  M. Kelsey -- Add function to create unphysical nuclei for use
0029 //       as temporary final-state fragments.
0030 // 20100319  M. Kelsey -- Remove "using" directory and unnecessary #includes.
0031 // 20100409  M. Kelsey -- Drop unused string argument from ctors.
0032 // 20100630  M. Kelsey -- Add excitation energy as optional public ctor arg,
0033 //       remove excitation energy data member (part of G4Ions).  Add
0034 //       excitation energy to "getNucleiMass()" function, move print to .cc
0035 // 20100711  M. Kelsey -- Add optional model ID to constructors
0036 // 20100714  M. Kelsey -- Use G4DynamicParticle::theDynamicalMass to deal with
0037 //       excitation energy without instantianting "infinite" G4PartDefns.
0038 // 20100719  M. Kelsey -- Move setExitationEnergy implementation to .cc file.
0039 // 20100906  M. Kelsey -- Add fill() functions to rewrite contents
0040 // 20100909  M. Kelsey -- Add function to discard exciton configuration
0041 // 20100914  M. Kelsey -- Use integers for A and Z
0042 // 20100915  M. Kelsey -- Add constructor to copy G4DynamicParticle input
0043 // 20100924  M. Kelsey -- Add constructor to copy G4Fragment input, and output
0044 //      functions to create G4Fragment.
0045 // 20110214  M. Kelsey -- Replace integer "model" with enum
0046 // 20110225  M. Kelsey -- Add equality operator (NOT sorting!)
0047 // 20110721  M. Kelsey -- Follow base-class ctor change to pass model directly
0048 // 20110722  M. Kelsey -- BUG FIX:  Deleted excitation energy in one ctor
0049 // 20110829  M. Kelsey -- Add constructor to copy G4V3DNucleus input
0050 // 20110919  M. Kelsey -- Add clear() to restore completely empty state
0051 // 20110922  M. Kelsey -- Add stream argument to printParticle() => print()
0052 
0053 #ifndef G4INUCL_NUCLEI_HH
0054 #define G4INUCL_NUCLEI_HH
0055 
0056 #include <CLHEP/Units/SystemOfUnits.h>
0057 
0058 #include "G4InuclParticle.hh"
0059 #include "G4LorentzVector.hh"
0060 #include "G4ExitonConfiguration.hh"
0061 
0062 class G4Fragment;
0063 class G4ParticleDefinition;
0064 class G4V3DNucleus;
0065 
0066 
0067 class G4InuclNuclei : public G4InuclParticle {
0068 public:
0069   G4InuclNuclei() : G4InuclParticle() {}
0070 
0071   G4InuclNuclei(const G4DynamicParticle& dynPart, Model model=DefaultModel)
0072     : G4InuclParticle(dynPart, model) {}
0073 
0074   G4InuclNuclei(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
0075     : G4InuclParticle(makeDefinition(a,z), model) {
0076     setExitationEnergy(exc);
0077   }
0078 
0079   G4InuclNuclei(const G4LorentzVector& mom, G4int a, G4int z,
0080         G4double exc=0., Model model=DefaultModel)
0081     : G4InuclParticle(makeDefinition(a,z), mom, model) {
0082     setExitationEnergy(exc);
0083   }
0084 
0085   G4InuclNuclei(G4double ekin, G4int a, G4int z, G4double exc,
0086         Model model=DefaultModel)
0087     : G4InuclParticle(makeDefinition(a,z), ekin, model) {
0088     setExitationEnergy(exc);
0089   }
0090 
0091   G4InuclNuclei(const G4Fragment& aFragment, Model model=DefaultModel);
0092 
0093   G4InuclNuclei(G4V3DNucleus* a3DNucleus, Model model=DefaultModel);
0094 
0095   virtual ~G4InuclNuclei() {}
0096 
0097   // Copy and assignment constructors for use with std::vector<>
0098   G4InuclNuclei(const G4InuclNuclei& right)
0099     : G4InuclParticle(right),
0100       theExitonConfiguration(right.theExitonConfiguration) {}
0101 
0102   G4InuclNuclei& operator=(const G4InuclNuclei& right);
0103 
0104   // Equality (comparison) operator -- NOT SORTING
0105   G4bool operator==(const G4InuclNuclei& right) {
0106     return ( G4InuclParticle::operator==(right) && 
0107          theExitonConfiguration == right.theExitonConfiguration );
0108   }
0109 
0110   // Overwrite data structure (avoids creating/copying temporaries)
0111   void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel) {
0112     fill(0., a, z, exc, model);
0113   }
0114 
0115   void fill(const G4LorentzVector& mom, G4int a, G4int z,
0116         G4double exc=0., Model model=DefaultModel);
0117 
0118   void fill(G4double ekin, G4int a, G4int z, G4double exc,
0119         Model model=DefaultModel);
0120 
0121   void copy(const G4Fragment& aFragment, Model model=DefaultModel);
0122 
0123   void copy(G4V3DNucleus* a3DNucleus, Model model=DefaultModel);
0124 
0125   void clear();         // Discard all information (including A,Z)
0126 
0127   // Excitation energy is stored as dynamical mass of particle
0128   void setExitationEnergy(G4double e);
0129 
0130   void setExitonConfiguration(const G4ExitonConfiguration& config) { 
0131     theExitonConfiguration = config;
0132   }
0133 
0134   void clearExitonConfiguration() { theExitonConfiguration.clear(); }
0135 
0136   G4int getA() const { return getDefinition()->GetAtomicMass(); }
0137   G4int getZ() const { return getDefinition()->GetAtomicNumber(); }
0138 
0139   G4double getNucleiMass() const {
0140     return getDefinition()->GetPDGMass()*CLHEP::MeV/CLHEP::GeV; // From G4 to Bertini
0141   }
0142 
0143   G4double getExitationEnergy() const {
0144     return (getMass()-getNucleiMass())*CLHEP::GeV/CLHEP::MeV; // Always in MeV
0145   }
0146 
0147   G4double getExitationEnergyInGeV() const { return getExitationEnergy()/CLHEP::GeV; }
0148 
0149   const G4ExitonConfiguration& getExitonConfiguration() const {
0150     return theExitonConfiguration;
0151   }
0152 
0153   static G4double getNucleiMass(G4int a, G4int z, G4double exc=0.);
0154 
0155   virtual void print(std::ostream& os) const;
0156 
0157   // Convert contents to G4Fragment for use outside package
0158   G4Fragment makeG4Fragment() const;
0159   operator G4Fragment() const;
0160 
0161 protected:
0162   // Convert nuclear configuration to standard GEANT4 pointer
0163   static G4ParticleDefinition* makeDefinition(G4int a, G4int z);
0164   static G4ParticleDefinition* makeNuclearFragment(G4int a, G4int z);
0165 
0166 private: 
0167   G4ExitonConfiguration theExitonConfiguration;
0168 };        
0169 
0170 #endif // G4INUCL_NUCLEI_HH