source: trunk/source/processes/hadronic/models/binary_cascade/test/G4NuclearFieldTest.cc@ 1200

Last change on this file since 1200 was 1199, checked in by garnier, 16 years ago

nvx fichiers dans CVS

File size: 4.2 KB
Line 
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 "G4VNuclearField.hh"
24#include "G4AntiProtonField.hh"
25#include "G4PionZeroField.hh"
26#include "G4ProtonField.hh"
27#include "G4KaonMinusField.hh"
28#include "G4SigmaMinusField.hh"
29#include "G4KaonPlusField.hh"
30#include "G4SigmaPlusField.hh"
31#include "G4KaonZeroField.hh"
32#include "G4SigmaZeroField.hh"
33#include "G4NeutronField.hh"
34#include "G4PionMinusField.hh"
35#include "G4VNuclearField.hh"
36#include "G4PionPlusField.hh"
37#include "G4Fancy3DNucleus.hh"
38
39int main(int argc, char ** argv)
40{
41 // Get nucleus
42 G4int A, Z;
43 if(argc != 3)
44 {
45 cerr << "Wrong arguments. Please, enter A and Z for the nucleus: ";
46 cin >> A >> Z;
47 }
48 else
49 {
50 A = atoi(argv[1]);
51 Z = atoi(argv[2]);
52 }
53
54 G4V3DNucleus * nucleus = new G4Fancy3DNucleus;
55 nucleus->Init(A, Z);
56 G4VNuclearField * pro = new G4ProtonField(nucleus);
57 G4VNuclearField * neu = new G4NeutronField(nucleus);
58 G4VNuclearField * pbar = new G4AntiProtonField(nucleus);
59 G4VNuclearField * pip = new G4PionPlusField(nucleus);
60 G4VNuclearField * pi0 = new G4PionZeroField(nucleus);
61 G4VNuclearField * pim = new G4PionMinusField(nucleus);
62 G4VNuclearField * kp = new G4KaonPlusField(nucleus);
63 G4VNuclearField * k0 = new G4KaonZeroField(nucleus);
64 G4VNuclearField * km = new G4KaonMinusField(nucleus);
65 G4VNuclearField * sp = new G4SigmaPlusField(nucleus);
66 G4VNuclearField * s0 = new G4SigmaZeroField(nucleus);
67 G4VNuclearField * sm = new G4SigmaMinusField(nucleus);
68
69 G4double radius = nucleus->GetOuterRadius();
70 G4double step = radius/1000.;
71 G4double r = 0;
72
73 G4cout << "C Nucradius proton Neutron Pbar Pi+ Pi0 Pi- K+ K0 K- Sigma+ Sigma0 Sigma-" << G4endl;
74 G4cout << "C " << radius << " "
75 << pro->GetBarrier()/MeV << " "
76 << neu->GetBarrier()/MeV << " "
77 << pbar->GetBarrier()/MeV << " "
78 << pip->GetBarrier()/MeV << " "
79 << pi0->GetBarrier()/MeV << " "
80 << pim->GetBarrier()/MeV << " "
81 << kp->GetBarrier()/MeV << " "
82 << k0->GetBarrier()/MeV << " "
83 << km->GetBarrier()/MeV << " "
84 << sp->GetBarrier()/MeV << " "
85 << s0->GetBarrier()/MeV << " "
86 << sm->GetBarrier()/MeV << " "
87 << G4endl;
88
89 G4cout << "C radius proton Neutron Pbar Pi+ Pi0 Pi- K+ K0 K- Sigma+ Sigma0 Sigma-" << G4endl;
90 while(r < 1.1*radius)
91 {
92 G4ThreeVector pos(0, 0, r);
93 G4cout << r/fermi << " "
94 << pro->GetField(pos)/MeV << " "
95 << neu->GetField(pos)/MeV << " "
96 << pbar->GetField(pos)/MeV << " "
97 << pip->GetField(pos)/MeV << " "
98 << pi0->GetField(pos)/MeV << " "
99 << pim->GetField(pos)/MeV << " "
100 << kp->GetField(pos)/MeV << " "
101 << k0->GetField(pos)/MeV << " "
102 << km->GetField(pos)/MeV << " "
103 << sp->GetField(pos)/MeV << " "
104 << s0->GetField(pos)/MeV << " "
105 << sm->GetField(pos)/MeV << " "
106 << G4endl;
107 r += step;
108 }
109
110 return 0;
111}
112
Note: See TracBrowser for help on using the repository browser.