1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4eScreenedRutherfordTest.cc,v 1.1 2007/05/02 17:22:39 pia Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
29 | // |
---|
30 | /// |
---|
31 | // ------------------------------------------------------------------- |
---|
32 | // Author: Maria Grazia Pia |
---|
33 | // |
---|
34 | // Creation date: 6 August 2001 |
---|
35 | // |
---|
36 | // Modifications: |
---|
37 | // |
---|
38 | // ------------------------------------------------------------------- |
---|
39 | |
---|
40 | #include "globals.hh" |
---|
41 | #include "G4ios.hh" |
---|
42 | #include <fstream> |
---|
43 | #include <iomanip> |
---|
44 | |
---|
45 | |
---|
46 | #include "G4ParticleDefinition.hh" |
---|
47 | #include "G4ParticleTypes.hh" |
---|
48 | //#include "G4ParticleTable.hh" |
---|
49 | #include "G4ParticleMomentum.hh" |
---|
50 | #include "G4DynamicParticle.hh" |
---|
51 | #include "G4ThreeVector.hh" |
---|
52 | #include "G4Track.hh" |
---|
53 | #include "G4SystemOfUnits.hh" |
---|
54 | |
---|
55 | #include "G4eCrossSectionScreenedRutherford.hh" |
---|
56 | |
---|
57 | int main() |
---|
58 | { |
---|
59 | // G4cout.setf( ios::scientific, ios::floatfield ); |
---|
60 | |
---|
61 | G4eCrossSectionScreenedRutherford* cross = new G4eCrossSectionScreenedRutherford; |
---|
62 | |
---|
63 | // Particle definitions |
---|
64 | |
---|
65 | // G4ParticleDefinition* gamma = G4Gamma::GammaDefinition(); |
---|
66 | G4ParticleDefinition* electron = G4Electron::ElectronDefinition(); |
---|
67 | // G4ParticleDefinition* positron = G4Positron::PositronDefinition(); |
---|
68 | |
---|
69 | // Create a DynamicParticle |
---|
70 | |
---|
71 | G4double initX = 0.; |
---|
72 | G4double initY = 0.; |
---|
73 | G4double initZ = 1.; |
---|
74 | |
---|
75 | G4ParticleMomentum direction(initX,initY,initZ); |
---|
76 | |
---|
77 | G4double e0 = 0.01 * keV; |
---|
78 | G4double eStep = 0.0001 * keV; |
---|
79 | |
---|
80 | for (G4int i=0; i<1000; i++) |
---|
81 | { |
---|
82 | G4double energy = e0 + i * eStep; |
---|
83 | |
---|
84 | G4DynamicParticle dynamicParticle(electron,direction,energy); |
---|
85 | |
---|
86 | // dynamicParticle.DumpInfo(0); |
---|
87 | |
---|
88 | // Track |
---|
89 | |
---|
90 | G4ThreeVector position(0.,0.,0.); |
---|
91 | G4double time = 0. ; |
---|
92 | |
---|
93 | G4Track track(&dynamicParticle,time,position); |
---|
94 | |
---|
95 | G4double sigma = cross->CrossSection(track); |
---|
96 | |
---|
97 | G4cout << energy/keV <<" " << sigma / cm2 << G4endl; |
---|
98 | } |
---|
99 | |
---|
100 | e0 = 0.1 * keV; |
---|
101 | eStep = 0.001 * keV; |
---|
102 | |
---|
103 | for (G4int i=0; i<901; i++) |
---|
104 | { |
---|
105 | G4double energy = e0 + i * eStep; |
---|
106 | |
---|
107 | G4DynamicParticle dynamicParticle(electron,direction,energy); |
---|
108 | |
---|
109 | // dynamicParticle.DumpInfo(0); |
---|
110 | |
---|
111 | // Track |
---|
112 | |
---|
113 | G4ThreeVector position(0.,0.,0.); |
---|
114 | G4double time = 0. ; |
---|
115 | |
---|
116 | G4Track track(&dynamicParticle,time,position); |
---|
117 | |
---|
118 | G4double sigma = cross->CrossSection(track); |
---|
119 | |
---|
120 | G4cout << energy/keV <<" " << sigma / cm2 << G4endl; |
---|
121 | } |
---|
122 | |
---|
123 | delete cross; |
---|
124 | |
---|
125 | G4cout << "END OF THE MAIN PROGRAM" << G4endl; |
---|
126 | } |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | |
---|
134 | |
---|