Project

General

Profile

N02to » History » Version 1

Krzysztof Genser, 05/13/2015 10:52 AM

1 1 Krzysztof Genser
h1. N02to
2 1 Krzysztof Genser
3 1 Krzysztof Genser
running the N02to example:
4 1 Krzysztof Genser
5 1 Krzysztof Genser
./exampleN02 run1.mac
6 1 Krzysztof Genser
7 1 Krzysztof Genser
numerical values set in the example (excerpts from the files):
8 1 Krzysztof Genser
9 1 Krzysztof Genser
<pre>
10 1 Krzysztof Genser
N02to/run1.mac:
11 1 Krzysztof Genser
...
12 1 Krzysztof Genser
# e+ in 256 MeV the direction (1.,0.,0.)  (default kinematic)
13 1 Krzysztof Genser
# 1 event with detailled printing
14 1 Krzysztof Genser
#
15 1 Krzysztof Genser
/tracking/verbose 1
16 1 Krzysztof Genser
/N02/det/trackMaxSteps 200000
17 1 Krzysztof Genser
/N02/det/trackMaxLen   10 km
18 1 Krzysztof Genser
/run/beamOn 1
19 1 Krzysztof Genser
# 
20 1 Krzysztof Genser
# electron 25 MeV in the direction (1.,0.,0.)
21 1 Krzysztof Genser
# 1 event
22 1 Krzysztof Genser
#
23 1 Krzysztof Genser
/N02/det/trackMaxSteps 20000
24 1 Krzysztof Genser
/N02/det/trackMaxLen   1 km
25 1 Krzysztof Genser
/gun/particle e-
26 1 Krzysztof Genser
/gun/energy 25 MeV
27 1 Krzysztof Genser
/tracking/verbose 1
28 1 Krzysztof Genser
/run/beamOn 1
29 1 Krzysztof Genser
30 1 Krzysztof Genser
in the code:
31 1 Krzysztof Genser
32 1 Krzysztof Genser
N02to/src/ExN02PrimaryGeneratorAction.cc:
33 1 Krzysztof Genser
...
34 1 Krzysztof Genser
// default particle
35 1 Krzysztof Genser
36 1 Krzysztof Genser
  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
37 1 Krzysztof Genser
  G4ParticleDefinition* particle = particleTable->FindParticle("e+");
38 1 Krzysztof Genser
  
39 1 Krzysztof Genser
  particleGun->SetParticleDefinition(particle);
40 1 Krzysztof Genser
  particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
41 1 Krzysztof Genser
  particleGun->SetParticleEnergy(256.0*MeV);
42 1 Krzysztof Genser
43 1 Krzysztof Genser
  G4double position = 0.0*cm;
44 1 Krzysztof Genser
  particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,position));
45 1 Krzysztof Genser
46 1 Krzysztof Genser
47 1 Krzysztof Genser
N02to/src/ExN02DetectorConstruction.cc:
48 1 Krzysztof Genser
49 1 Krzysztof Genser
  fpMagField = new ExN02MagneticField(G4ThreeVector(0.,0.,1.0*tesla));
50 1 Krzysztof Genser
51 1 Krzysztof Genser
52 1 Krzysztof Genser
N02to/src/ExN02DetectorMessenger.cc
53 1 Krzysztof Genser
show examples of setting some of the values
54 1 Krzysztof Genser
55 1 Krzysztof Genser
</pre>