| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * DISCLAIMER *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The following disclaimer summarizes all the specific disclaimers *
|
|---|
| 6 | // * of contributors to this software. The specific disclaimers,which *
|
|---|
| 7 | // * govern, are listed with their locations in: *
|
|---|
| 8 | // * http://cern.ch/geant4/license *
|
|---|
| 9 | // * *
|
|---|
| 10 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 11 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 12 | // * work make any representation or warranty, express or implied, *
|
|---|
| 13 | // * regarding this software system or assume any liability for its *
|
|---|
| 14 | // * use. *
|
|---|
| 15 | // * *
|
|---|
| 16 | // * This code implementation is the intellectual property of the *
|
|---|
| 17 | // * GEANT4 collaboration. *
|
|---|
| 18 | // * By copying, distributing or modifying the Program (or any work *
|
|---|
| 19 | // * based on the Program) you indicate your acceptance of this *
|
|---|
| 20 | // * statement, and all its terms. *
|
|---|
| 21 | // ********************************************************************
|
|---|
| 22 | //
|
|---|
| 23 | #include "G4VKM_NuclearDensity.hh"
|
|---|
| 24 | #include "G4KM_NuclearFermiDensity.hh"
|
|---|
| 25 | #include "G4KM_NuclearShellModelDensity.hh"
|
|---|
| 26 | #include "G4VNuclearDensity.hh"
|
|---|
| 27 | #include "G4NuclearFermiDensity.hh"
|
|---|
| 28 | #include "G4NuclearShellModelDensity.hh"
|
|---|
| 29 | #include "G4Fancy3DNucleus.hh"
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | int main(int argc, char ** argv)
|
|---|
| 34 | {
|
|---|
| 35 | // Get nucleus
|
|---|
| 36 | G4int A, Z;
|
|---|
| 37 | if(argc != 3)
|
|---|
| 38 | {
|
|---|
| 39 | cerr << "Wrong arguments. Please, enter A and Z for the nucleus: ";
|
|---|
| 40 | cin >> A >> Z;
|
|---|
| 41 | }
|
|---|
| 42 | else
|
|---|
| 43 | {
|
|---|
| 44 | A = atoi(argv[1]);
|
|---|
| 45 | Z = atoi(argv[2]);
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | G4VNuclearDensity *g4Density;
|
|---|
| 49 | G4VKM_NuclearDensity * nuclearDensity;
|
|---|
| 50 | if(A < 17)
|
|---|
| 51 | {
|
|---|
| 52 | g4Density = new G4NuclearShellModelDensity(A, Z);
|
|---|
| 53 | nuclearDensity = new G4KM_NuclearShellModelDensity(A);
|
|---|
| 54 | }
|
|---|
| 55 | else
|
|---|
| 56 | {
|
|---|
| 57 | g4Density = new G4NuclearFermiDensity(A, Z);
|
|---|
| 58 | nuclearDensity = new G4KM_NuclearFermiDensity(A);
|
|---|
| 59 | }
|
|---|
| 60 |
|
|---|
| 61 | G4Fancy3DNucleus nucleus;
|
|---|
| 62 | nucleus.Init(A, Z);
|
|---|
| 63 | G4double radius = nucleus.GetOuterRadius();
|
|---|
| 64 | G4double step = radius/1000.;
|
|---|
| 65 | G4double r = 0;
|
|---|
| 66 | while(r < 2*radius)
|
|---|
| 67 | {
|
|---|
| 68 | G4ThreeVector pos(0, 0, r);
|
|---|
| 69 | cout << nuclearDensity->GetDensity(pos)*fermi*fermi*fermi << " "
|
|---|
| 70 | << g4Density->GetDensity(pos)*fermi*fermi*fermi << " "
|
|---|
| 71 | << nuclearDensity->GetDeriv(pos)*fermi*fermi*fermi*fermi << " "
|
|---|
| 72 | << g4Density->GetDeriv(pos)*fermi*fermi*fermi*fermi << " "
|
|---|
| 73 | << r/fermi << endl;
|
|---|
| 74 | r += step;
|
|---|
| 75 | }
|
|---|
| 76 |
|
|---|
| 77 | return 0;
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|