source: trunk/source/processes/electromagnetic/lowenergy/test/G4MillerGreenTest.cc @ 1199

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

nvx fichiers dans CVS

File size: 4.9 KB
Line 
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: G4MillerGreenTest.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 "G4CrossSectionExcitationMillerGreen.hh"
56
57int main()
58{
59  //  G4cout.setf( ios::scientific, ios::floatfield );
60
61  G4CrossSectionExcitationMillerGreen* cross = new G4CrossSectionExcitationMillerGreen;
62
63  // Particle definitions
64 
65  //  G4ParticleDefinition* gamma = G4Gamma::GammaDefinition();
66  G4ParticleDefinition* proton = G4Proton::ProtonDefinition();
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 
78  G4cout << "Enter energy " << G4endl;
79  G4double energy;
80  G4cin >> energy;
81
82 
83  G4DynamicParticle dynamicParticle(proton,direction,energy);
84   
85    //     dynamicParticle.DumpInfo(0);
86   
87    // Track
88   
89    G4ThreeVector position(0.,0.,0.);
90    G4double time = 0. ;
91   
92    G4Track track(&dynamicParticle,time,position);
93   
94    G4double sigma = cross->CrossSection(track);
95   
96    G4cout << energy/keV <<" " << sigma / m2 << G4endl;
97 
98
99  /*
100 
101  G4double eStep;
102 
103  G4double energy = 0.;
104  eStep = 0.1 * eV;
105
106  while (energy < 50.00001*eV)
107  {
108    energy = energy + eStep;
109         
110    G4DynamicParticle dynamicParticle(proton,direction,energy);
111   
112    //     dynamicParticle.DumpInfo(0);
113   
114    // Track
115   
116    G4ThreeVector position(0.,0.,0.);
117    G4double time = 0. ;
118   
119    G4Track track(&dynamicParticle,time,position);
120   
121    G4double sigma = cross->CrossSection(track);
122   
123    G4cout << energy/keV <<" " << sigma / m2 << G4endl;
124  }
125
126
127  energy = 50 * eV;
128  eStep = 1. * eV;
129
130  while (energy < 50.00001*keV)
131  {
132    energy = energy + eStep;
133         
134    G4DynamicParticle dynamicParticle(proton,direction,energy);
135   
136    //     dynamicParticle.DumpInfo(0);
137   
138    // Track
139   
140    G4ThreeVector position(0.,0.,0.);
141    G4double time = 0. ;
142   
143    G4Track track(&dynamicParticle,time,position);
144   
145    G4double sigma = cross->CrossSection(track);
146   
147    G4cout << energy/keV <<" " << sigma / m2 << G4endl;
148  }
149
150
151  energy = 50 * keV;
152  eStep = 1. * keV;
153
154  while (energy < 100.00001*MeV)
155  {
156    energy = energy + eStep;
157         
158    G4DynamicParticle dynamicParticle(proton,direction,energy);
159   
160    //     dynamicParticle.DumpInfo(0);
161   
162    // Track
163   
164    G4ThreeVector position(0.,0.,0.);
165    G4double time = 0. ;
166   
167    G4Track track(&dynamicParticle,time,position);
168   
169    G4double sigma = cross->CrossSection(track);
170   
171    G4cout << energy/keV <<" " << sigma / m2 << G4endl;
172  }
173
174  */
175  delete cross;
176 
177  //  G4cout << "END OF THE MAIN PROGRAM" << G4endl;
178}
179
180
181
182
183
184
185
186
Note: See TracBrowser for help on using the repository browser.