Back to home page

EIC code displayed by LXR

 
 

    


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

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 #ifndef G4Fancy3DNucleus_h
0027 #define G4Fancy3DNucleus_h 1
0028 
0029 // ------------------------------------------------------------
0030 //      GEANT 4 class header file
0031 //
0032 //      ---------------- G4Fancy3DNucleus ----------------
0033 //             by Gunter Folger, May 1998.
0034 //       class for a 3D nucleus, arranging nucleons in space and momentum.
0035 // ------------------------------------------------------------
0036 // 20110805  M. Kelsey -- Remove C-style array (pointer) of G4Nucleons,
0037 //      make vector a container of objects.  Move testSums,
0038 //      places, momentum and fermiM to class data members for
0039 //      reuse.  Remove args from ReduceSum(), use data members.
0040 
0041 #include "globals.hh"
0042 #include "G4DynamicParticle.hh"
0043 #include "G4Nucleon.hh"
0044 #include "G4V3DNucleus.hh"
0045 #include "G4VNuclearDensity.hh"
0046 #include "G4FermiMomentum.hh"
0047 #include <vector>
0048 
0049 class G4Fancy3DNucleusHelper;
0050 
0051 // to test if we can drop old interface for (A,Z), comment next line..
0052 //#define NON_INTEGER_A_Z 1
0053 
0054 class G4Fancy3DNucleus : public G4V3DNucleus
0055 {
0056 
0057   public:
0058       G4Fancy3DNucleus();
0059       ~G4Fancy3DNucleus();
0060 
0061   private:
0062       G4Fancy3DNucleus(const G4Fancy3DNucleus &right);
0063       const G4Fancy3DNucleus & operator=(const G4Fancy3DNucleus &right);
0064       G4bool operator==(const G4Fancy3DNucleus &right) const;
0065       G4bool operator!=(const G4Fancy3DNucleus &right) const;
0066       
0067 
0068 //  Implementation 
0069       void ChooseNucleons();
0070       void ChoosePositions();
0071       void ChooseFermiMomenta();
0072       G4double BindingEnergy();
0073       G4bool ReduceSum();
0074 
0075   public:
0076 #if defined(NON_INTEGER_A_Z)
0077       void Init(G4double theA, G4double theZ, G4int numberOfLambdas = 0);
0078 #endif
0079       void Init(G4int theA, G4int theZ, G4int numberOfLambdas = 0);
0080       G4bool StartLoop();
0081       G4Nucleon * GetNextNucleon();
0082       const std::vector<G4Nucleon> & GetNucleons();
0083       G4int GetMassNumber();
0084       G4double GetMass();
0085       G4int GetCharge();
0086       G4int GetNumberOfLambdas();  // Non-negative number of Lambdas (for hypernuclei) or anti-Lambdas (for anti-hypernuclei) 
0087       G4double GetNuclearRadius();
0088       G4double GetNuclearRadius(const G4double maxRelativeDensity);
0089       G4double GetOuterRadius();
0090       G4double AddExcitationEnergy(G4double);
0091       G4double GetExcitationEnergy();
0092       G4double CoulombBarrier();
0093       void DoLorentzBoost(const G4LorentzVector & theBoost);
0094       void DoLorentzBoost(const G4ThreeVector & theBeta);
0095       void DoLorentzContraction(const G4LorentzVector & theBoost);
0096       void DoLorentzContraction(const G4ThreeVector & theBeta);
0097       void CenterNucleons();
0098       void DoTranslation(const G4ThreeVector & theShift);
0099       const G4VNuclearDensity * GetNuclearDensity() const;
0100       void SortNucleonsIncZ();
0101       void SortNucleonsDecZ();
0102       
0103   private:
0104   
0105   G4int myA;
0106   G4int myZ;
0107   G4int myL;  // Non-negative number of Lambdas (for hypernuclei) or anti-Lambdas (for anti-hypernuclei) 
0108   std::vector<G4Nucleon> theNucleons;
0109 
0110   G4int currentNucleon;
0111   G4VNuclearDensity * theDensity;
0112   G4FermiMomentum theFermi;  
0113   G4double nucleondistance;
0114   G4double excitationEnergy;
0115   
0116   std::vector<G4ThreeVector> places;        // For selecting locations
0117   std::vector<G4ThreeVector> momentum;      // For selecting nucleon motion
0118   std::vector<G4double> fermiM;
0119   std::vector<G4Fancy3DNucleusHelper> testSums; // For sorting nucleon configs
0120 };
0121 
0122 
0123 inline G4int G4Fancy3DNucleus::GetCharge()
0124 {
0125     return myZ;
0126 }
0127 
0128 inline G4int G4Fancy3DNucleus::GetMassNumber()
0129 {
0130     return myA;
0131 }
0132 
0133 inline G4int G4Fancy3DNucleus::GetNumberOfLambdas()
0134 {
0135         return myL;
0136 } 
0137 
0138 inline G4double G4Fancy3DNucleus::AddExcitationEnergy(G4double anE)
0139 {
0140    excitationEnergy +=anE;
0141    return excitationEnergy;
0142 }
0143 
0144 inline G4double G4Fancy3DNucleus::GetExcitationEnergy()
0145 {
0146    return excitationEnergy;
0147 }
0148 
0149 #endif