Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -154,8 +154,6 @@
- 60 : "energy of G4DNA Auger e- at creation (log scale)"
- 61 : "energy of G4DNA gamma at creation (log scale)"
The histograms can be viewed using ROOT or PAW.
One can control the name of the histograms file with the command:
\verbatim
/analysis/setFileName name (default testem5)
@@ -196,8 +194,6 @@
| | gottsch.mac | tramu.mac
--------------------------------------------------------
</pre>
The relevant part of the GEANT3 code is in the subdirectory geant3 together
with the xxxx.dat input files.
\section TestEm5_s9 HOW TO START ?
@@ -216,5 +212,53 @@ Idle> control/execute vis.mac
Idle> run/beamOn 5
....
\endverbatim
Macros provided in this example:
- acosta.mac: Back x-ray emission by 20 keV electrons in Silver.
(E. Acosta et al. Journal of Applied Physics 83(11) 1998 page 6038,
Fig. 4-5-6)
- anthony.mac: LPM and dielectric effect measurement: 25 GeV electrons
through thin foils.
(P.L. Anthony et al. Phys.Rev. D 56 (1997) page 1373.)
- atima.mac: to test PhysListEm19DStandard for ions
- berger.mac: Energy deposit by 1 MeV electrons in silicon counters.
(M.J.Berger et al. NIM 69 (1969) page 181.)
- bichsel.mac: 0.766 MeV protons, transmitted through 1.37 mg/cm2 Al
(H.Bichsel Phys.Rev. 112 (1958) page 182.)
- dedx1.mac: to control dE/dx calculation.
- dedx2.mac: to control dE/dx calculation. High statistic and plot
- dna.mac: to illustrate DNA physics
- fluo.mac: to illustrate atomic deexcitation options
- gammaSpectrum.mac: to plot gamma spectrum with/without atomic deexcitation.
- geom.mac: to play with geometry (can be run interactively with visualization)
- gottsch.mac: 158.6 MeV protons, transmitted through 0.2160 g/cm2 Al
(B.Gottschalk et al. NIM B74 (1993) page 467.)
- hanson.mac: Angle distribution of 15.7 MeV electrons transmitted through
thin gold foils.
(A.O.Hanson et al. Phys.Rev.84 (1951) page 634.)
- hunger.mac: Back scattering of 41 keV electrons.
(H.J. Hunger and L. Kuchler Phys. Stat. Sol.(a) 56, K45 (1979))
- ion.mac: ion C12 in 1m Iron
- kulchi.mac: 2.25 MeV e-, transmitted through 26.60 mg/cm2 Al
(L.Kulchitsky Phys.Rev. 61 (1941) page 254.)
- mumsc.mac: 100 GeV mu+, transmitted through 1 m of iron
- mutev.mac: 1 TeV mu+, transmitted through 1 m of iron
- pixe.mac: to illustrate atomic deexcitation options
- posi.mac: to test PhysListEm19DStandard for positron
- shen1.mac: Angle distribution of high energy (50-200 GeV/c) protons
transmitted through different targets.
(G. Shen et al. Phys.Rev. D20 (1979) page 1584.)
- shen2.mac: proton 175 GeV/c, transmitted through 8.004 mm Al
(G. Shen et al. Phys.Rev. D20 (1979) page 1584.)
- tavora.mac: Back scattering of 35 keV electrons in Silver.
(L.M. Tavora et al. J.Phys.D: Appl. Phys. 33 (2000) page 2497,
Fig. 7)
- tramu.mac: 1 TeV mu+, transmitted through 3 m of iron
(Rev. of Particle Physics Eur. Phys. Jour. C (2000) page 172.
Rev. of Particle Physics Letters B 592 (2004) page 251.)
- vincour.mac: Angle distribution of 6.56 MeV protons transmitted through
thin silicon targets.
(J.Vincour,P.Bem NIM 148 (1978) page 396.)
- vis.mac - to activate visualization
*/
@@ -1,6 +1,9 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
cmake_minimum_required(VERSION 3.8...3.18)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
project(TestEm5)
#----------------------------------------------------------------------------
@@ -40,8 +43,7 @@ target_link_libraries(TestEm5 ${Geant4_LIBRARIES} ${HBOOK_LIBRARIES})
# relies on these scripts being in the current working directory.
#
set(TestEm5_SCRIPTS
acosta.mac anthony.mac atima.mac berger.mac bichsel.mac dedx1.mac dedx2.mac dna.mac fluo.mac gammaSpectrum.mac gottsch.mac hanson.mac hunger.mac ion.mac kulchi.mac mumsc.mac mutev.mac pixe.mac shen1.mac shen2.mac tavora.mac TestEm5.in TestEm5.out tramu.mac vincour.mac vis.mac
)
acosta.mac anthony.mac atima.mac berger.mac bichsel.mac dedx1.mac dedx2.mac dna.mac gammaSpectrum.mac geom.mac gottsch.mac hanson.mac hunger.mac ion.mac kulchi.mac mumsc.mac mutev.mac pixe.mac shen1.mac shen2.mac tavora.mac TestEm5.in tramu.mac vincour.mac vis.mac pixe.C plotHisto.C)
foreach(_script ${TestEm5_SCRIPTS})
configure_file(
@@ -13,7 +13,40 @@ track of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
05-10-20 mma (testem5-V10-06-04)
- StackingAction - log histograms : revert to previous version
- clean up of pixe.mac and pixe.C
- remove obsolete fluo.mac
07-09-20 mma (testem5-V10-06-03)
- Finalize macro & commands review:
- Added remaining macro descriptions
- Added geom.mac for testing remaining commands
and reverted previous modifications in TestEm5.in
31-08-20 I.Hrivnacova (testem5-V10-06-02)
- Macro & commands review:
- Added macro descriptions in README; removed info about geant3 directory
which was removed in the past
- Extended TestEm5.in with commands (missing in testing):
/testem/det/setAbsXpos
/testem/det/setWorldX
/testem/det/setWorldYZ
/testem/det/setWorldMat
/testem/gun/rndm 0.1
03-07-20 mma (testem5-V10-06-01)
- update hanson/hanson.C
- add hanson/19um-wwols.ascii and 9um too
Proposed by Weronika Wolszczak (TU Delft University)
- update berger/berger.C
27-06-20 mma (testem5-V10-06-00)
- TrackingAction - correct weight for solid angle histograms
- update hanson.mac and hanson/hanson.C
- idem for berger.mac
15-01-19 V.Ivant (testem5-V10-05-00)
- StackinAction - fixed all log histograms, which where filled in a wrong
way
@@ -121,8 +121,8 @@
3 "energy of neutral secondaries at creation"
4 "energy of charged at creation (log10(Ekin))"
5 "energy of neutral at creation (log10(Ekin))"
6 "x_vertex of charged secondaries (all)"
7 "x_vertex of charged secondaries (not absorbed)"
6 "x_vertex of charged secondaries (all)"
7 "x_vertex of charged secondaries (not absorbed)"
10 "(transmit, charged) : kinetic energy at exit of world"
11 "(transmit, charged) : ener fluence: dE(MeV)/dOmega"
12 "(transmit, charged) : space angle dN/dOmega"
@@ -141,20 +141,18 @@
41 "(reflect , neutral) : ener fluence: dE(MeV)/dOmega"
42 "(reflect , neutral) : space angle dN/dOmega"
43 "(reflect , neutral) : projected angle at exit of world"
50 "energy of Auger e- at creation"
51 "energy of fluorescence gamma at creation"
52 "energy of Auger e- at creation (log scale)"
53 "energy of fluorescence gamma at creation (log scale)"
54 "energy of PIXE Auger e- at creation"
55 "energy of PIXE gamma at creation"
56 "energy of PIXE Auger e- at creation (log scale)"
57 "energy of PIXE gamma at creation (log scale)"
58 "energy of G4DNA Auger e- at creation"
59 "energy of G4DNA gamma at creation"
60 "energy of G4DNA Auger e- at creation (log scale)"
61 "energy of G4DNA gamma at creation (log scale)"
The histograms can be viewed using ROOT or PAW.
50 "energy of Auger e- at creation"
51 "energy of fluorescence gamma at creation"
52 "energy of Auger e- at creation (log scale)"
53 "energy of fluorescence gamma at creation (log scale)"
54 "energy of PIXE Auger e- at creation"
55 "energy of PIXE gamma at creation"
56 "energy of PIXE Auger e- at creation (log scale)"
57 "energy of PIXE gamma at creation (log scale)"
58 "energy of G4DNA Auger e- at creation"
59 "energy of G4DNA gamma at creation"
60 "energy of G4DNA Auger e- at creation (log scale)"
61 "energy of G4DNA gamma at creation (log scale)"
One can control the name of the histograms file with the command:
/analysis/setFileName name (default testem5)
@@ -185,9 +183,6 @@
others| bichsel.mac | vincour.mac | shen1.mac shen2.mac
| | gottsch.mac | tramu.mac
--------------------------------------------------------
The relevant part of the GEANT3 code is in the subdirectory geant3 together
with the xxxx.dat input files.
9- HOW TO START ?
@@ -200,3 +195,51 @@
Idle> control/execute vis.mac
Idle> run/beamOn 5
....
Macros provided in this example:
- acosta.mac: Back x-ray emission by 20 keV electrons in Silver.
(E. Acosta et al. Journal of Applied Physics 83(11) 1998 page 6038,
Fig. 4-5-6)
- anthony.mac: LPM and dielectric effect measurement: 25 GeV electrons
through thin foils.
(P.L. Anthony et al. Phys.Rev. D 56 (1997) page 1373.)
- atima.mac: to test PhysListEm19DStandard for ions
- berger.mac: Energy deposit by 1 MeV electrons in silicon counters.
(M.J.Berger et al. NIM 69 (1969) page 181.)
- bichsel.mac: 0.766 MeV protons, transmitted through 1.37 mg/cm2 Al
(H.Bichsel Phys.Rev. 112 (1958) page 182.)
- dedx1.mac: to control dE/dx calculation.
- dedx2.mac: to control dE/dx calculation. High statistic and plot
- dna.mac: to illustrate DNA physics
- fluo.mac: to illustrate atomic deexcitation options
- gammaSpectrum.mac: to plot gamma spectrum with/without atomic deexcitation.
- geom.mac: to play with geometry (can be run interactively with visualization)
- gottsch.mac: 158.6 MeV protons, transmitted through 0.2160 g/cm2 Al
(B.Gottschalk et al. NIM B74 (1993) page 467.)
- hanson.mac: Angle distribution of 15.7 MeV electrons transmitted through
thin gold foils.
(A.O.Hanson et al. Phys.Rev.84 (1951) page 634.)
- hunger.mac: Back scattering of 41 keV electrons.
(H.J. Hunger and L. Kuchler Phys. Stat. Sol.(a) 56, K45 (1979))
- ion.mac: ion C12 in 1m Iron
- kulchi.mac: 2.25 MeV e-, transmitted through 26.60 mg/cm2 Al
(L.Kulchitsky Phys.Rev. 61 (1941) page 254.)
- mumsc.mac: 100 GeV mu+, transmitted through 1 m of iron
- mutev.mac: 1 TeV mu+, transmitted through 1 m of iron
- pixe.mac: to illustrate atomic deexcitation options
- posi.mac: to test PhysListEm19DStandard for positron
- shen1.mac: Angle distribution of high energy (50-200 GeV/c) protons
transmitted through different targets.
(G. Shen et al. Phys.Rev. D20 (1979) page 1584.)
- shen2.mac: proton 175 GeV/c, transmitted through 8.004 mm Al
(G. Shen et al. Phys.Rev. D20 (1979) page 1584.)
- tavora.mac: Back scattering of 35 keV electrons in Silver.
(L.M. Tavora et al. J.Phys.D: Appl. Phys. 33 (2000) page 2497,
Fig. 7)
- tramu.mac: 1 TeV mu+, transmitted through 3 m of iron
(Rev. of Particle Physics Eur. Phys. Jour. C (2000) page 172.
Rev. of Particle Physics Letters B 592 (2004) page 251.)
- vincour.mac: Angle distribution of 6.56 MeV protons transmitted through
thin silicon targets.
(J.Vincour,P.Bem NIM 148 (1978) page 396.)
- vis.mac - to activate visualization
@@ -9,6 +9,7 @@
/testem/det/setAbsMat Silicon
/testem/det/setAbsThick 20 um
/testem/det/setAbsYZ 50 um
/testem/det/setAbsXpos 0 um
#
/testem/phys/addPhysics emstandard_opt3
#
File diff suppressed because it is too large Load Diff
@@ -17,8 +17,8 @@
###/testem/det/setAbsThick 3 mm
/testem/det/setAbsYZ 1 cm
#
###/testem/phys/addPhysics emstandard_opt0
/testem/phys/addPhysics local
###/testem/phys/addPhysics emstandard_opt4
#
/run/setCut 10 um
#
@@ -31,6 +31,5 @@
/analysis/setFileName berger/local
/analysis/h1/set 1 105 0 1.05 MeV #energy deposit
#
/run/printProgress 100000
#
/run/printProgress 100000
/run/beamOn 1000000
@@ -2,19 +2,19 @@
gROOT->Reset();
// Draw histograms fill by Geant4 TestEm5 simulation
TFile f1("./msc93.root");
TH1D* h1 = (TH1D*) f1.Get("1");
TFile f1("./local.root");
TH1D* h1 = (TH1D*) f1.Get("h1");
h1->SetTitle("Energy deposited in 530 um of Si by 1 MeV e-");
h1->GetXaxis()->SetTitle("Ekine (MeV)");
h1->GetYaxis()->SetTitle("nb / MeV");
h1->SetStats(kFALSE); // Eliminate statistics box
h1->SetLineColor(1); // black
h1->SetLineColor(kBlue);
h1->Draw("HIST");
TFile f2("./local.root");
TH1D* h2 = (TH1D*) f2.Get("1");
TFile f2("./opt4.root");
TH1D* h2 = (TH1D*) f2.Get("h1");
h2->SetStats(kFALSE); // Eliminate statistics box
h2->SetLineColor(4); // blue
h2->SetLineColor(kRed);
h2->Draw("SAME HIST");
/*
* e- 1 MeV in Silicon 530 um
@@ -23,36 +23,27 @@
* (from 110 keV to 1.03 MeV by bin of 10 keV --> 93 bins)
*/
ifstream in;
in.open("530um.ascii");
ifstream in;
in.open("530um.ascii");
// First indicate number of data
int nbdata = 0;
in >> nbdata;
// Create a new histogram with data.acsii values
float x_min = 0.110;
float x_max = 1.030;
TH1F* h3 = new TH1F("h1f","",nbdata,x_min,x_max);
Float_t x, y;
while (1) {
TMarker *pt;
Double_t x, y;
// First indicate number of data
int nbdata = 0;
in >> nbdata;
for ( int i = 0 ; i < nbdata ; i++ ) {
in >> x >> y ;
if (!in.good()) break;
h3->Fill(x,y);
}
in.close();
// Draw histogram fill by data.acsii values
h3->SetLineColor(2); // red
h3->Draw("SAME");
// Print the histograms legend
TLegend *legend = new TLegend(0.6,0.6,0.8,0.8);
legend->AddEntry(h1,"Urban93","l");
legend->AddEntry(h2,"Urban95","l");
legend->AddEntry(h3,"Berger data","L");
legend->Draw();
pt = new TMarker(x,y,32); // 32 for open triangle-down
pt->SetMarkerColor(kGreen);
pt->Draw();
}
in.close();
// Print the histograms legend
TLegend *legend = new TLegend(0.6,0.6,0.8,0.8);
legend->AddEntry(h1,"local","l");
legend->AddEntry(h2,"opt4 ","l");
legend->AddEntry(pt,"Berger data","P");
legend->Draw();
}
@@ -1,83 +0,0 @@
macro tramu.kumac
*
set * ; opt *
*
filecase keep
set *fon -40
set mscf 1.5
set ygti 0.5 ; set gsiz 0.35 ; set ymgu 1.5
set vsiz 0.25 ; set yval 0.3 ; set ylab 0.55
set asiz 0.25 ; set yhti 0.9 ; set xlab 1.2
title 'Energy deposited in 530 um of Si by 1 MeV e-'
*
h/file 1 530um.hbook
*
opt liny
*
set dmod 1 ; set hcol 1 ; set plci 1
h/pl //lun1/1
key 0.6 7.6 1 'G4-9.1-ref-00' ! l
*
exec data
*
set dmod 2 ; set hcol 2 ; set plci 2
h/pl 2 s
key 0.6 7.0 2 'Berger data' ! l
*
atitle 'Ekin (MeV)' 'nb / MeV'
exec Redraw-Axis
close 1
return
macro data
*
* e- 1 MeV in Silicon 530 um
* M.J. Berger et al. NIM 69 (p.181) 1969
* distribution of energy deposition
* (from 110 keV to 1.03 MeV by bin of 10 keV --> 93 bins)
*
* *** read data
fname = '530um.ascii'
vector/create nb(1)
vector/read nb [fname] ! 'O'
nbin = nb(1)
*
vector/create vect(2,[nbin])
vector/read vect [fname] ! 'C'
**vector/write vect ! (1x,f6.1,3x,e12.6)
*
* *** create and fill histogram
Emin= 0.110
Emax= 1.030
create/1dhisto 2 'e- 1 MeV in Silicon' [nbin] [Emin] [Emax]
put/contents 2 vect(2)
**h/pl 2
* *** save histo
*
**h/file 111 data.hbook ! n
**hrout 0
return
Macro Redraw-Axis
set plci 1
X1 = $GRAFINFO('WNXMIN')
X2 = $GRAFINFO('WNXMAX')
Y1 = $GRAFINFO('WNYMIN')
Y2 = $GRAFINFO('WNYMAX')
IS = $GRAFINFO('?FAIS')
IC = $GRAFINFO('?FACI')
Set FAIS 0 ; Set FACI 1
Box [X1] [X2] [Y1] [Y2]
Set FAIS [IS] ; Set FACI [IC]
Tick XL [X1] !
* Tick YB ! [Y1]
Return
@@ -1,40 +0,0 @@
# macro file for TestEm5.cc
#
/control/verbose 2
/control/cout/ignoreThreadsExcept 0
/run/numberOfThreads 4
/run/verbose 2
#
/testem/det/setAbsMat Gold
/testem/det/setAbsThick 50 um
/testem/det/setAbsYZ 50 um
#
/testem/phys/addPhysics emlivermore
#
/run/setCut 10 nm
#
/cuts/setLowEdge 250 eV
#
/process/em/fluoBearden true
#
#/process/em/deexcitation World true true true
#/process/em/fluo true
/process/em/augerCascade true
/process/em/pixe true
/process/em/deexcitationIgnoreCut true
#
/run/initialize
/process/em/printParameters
#
/testem/gun/setDefault
/gun/particle gamma
/gun/energy 1 MeV
#
/analysis/setFileName fluo
# e- and gamma at vertex
/analysis/h1/set 2 1000 0.01 10.01 keV
/analysis/h1/set 3 5000 0.1 500.1 keV
#
/run/printProgress 10000
#
/run/beamOn 100000
@@ -0,0 +1,37 @@
#
# macro file for TestEm5.cc
#
# to play with geometry
# can be run interactively
#
/control/verbose 2
/run/verbose 1
#
/testem/det/setWorldMat Aluminium
/testem/det/setWorldX 5 cm
/testem/det/setWorldYZ 3 cm
#
/testem/det/setAbsMat H2Liq
/testem/det/setAbsThick 3 cm
/testem/det/setAbsYZ 2 cm
#
/testem/det/setAbsXpos 5 mm
#
/process/em/verbose 0
#
##/control/execute vis.mac
##/vis/viewer/zoom 0.8
#
/run/initialize
#
/testem/gun/setDefault
/gun/particle geantino
/gun/position -20 0 0 mm
/gun/energy 1 eV
#
/tracking/verbose 2
/run/beamOn 1
/tracking/verbose 0
#
/testem/gun/rndm 0.8
/run/beamOn 6
@@ -17,8 +17,9 @@
/run/setCut 1.12 um
/run/setCutForAGivenParticle gamma 13 um
#
###/testem/phys/addPhysics emstandard_opt0
/testem/phys/addPhysics local
###/testem/phys/addPhysics emstandard_opt3
#
/run/initialize
#
@@ -26,9 +27,8 @@
/gun/particle e-
/gun/energy 15.7 MeV
#
/analysis/setFileName hanson/19um.local
/analysis/setFileName hanson/19um-local
/analysis/h1/set 12 120 0 30 deg #space angle
#
/run/printProgress 100000
#
/run/beamOn 1000000
@@ -0,0 +1,32 @@
25
0.28045 0.01809
0.70245 0.01775
1.16664 0.01709
1.96842 0.01409
2.51701 0.01166
3.19220 0.00929
3.52980 0.00754
4.16278 0.00578
4.71137 0.00443
5.00677 0.0036
6.27978 0.00204
6.40638 0.00172
7.20816 0.00111
8.05215 6.29098E-4
9.27593 3.11939E-4
10.37311 1.80007E-4
11.34369 1.12059E-4
12.39867 7.36091E-5
13.54508 4.67004E-5
15.19085 2.64428E-5
17.13202 1.58488E-5
18.81999 1.08473E-5
21.82317 5.80239E-6
26.33848 2.51954E-6
29.80586 1.45393E-6
theta dN/Om
Gold 19.296 um
15.7 MeV
06-20 : revised by W. Wolszczak
@@ -0,0 +1,31 @@
24
0.23826 0.04088
0.74465 0.03862
1.16664 0.03256
1.92623 0.02315
2.13722 0.01952
2.51701 0.01469
2.98121 0.01021
4.16278 0.00381
4.66918 0.00242
4.96457 0.00185
6.32198 7.0489e-4
7.20816 3.36515e-4
8.05215 1.7331e-4
9.31813 1.01924e-4
10.4575 5.9753e-5
11.38589 4.08964e-5
12.35647 2.6949e-5
13.62948 1.87975e-5
15.19085 1.08473e-5
17.13202 6.88194e-6
18.81999 4.89219e-6
21.73877 2.61691e-6
26.38068 1.20283e-6
29.80586 7.34729e-7
theta dN/Om
Gold 9.658 um
15.7 MeV
06-20 : revised by W. Wolszczak
@@ -3,24 +3,24 @@
gROOT->Reset();
// Draw histograms fill by Geant4 TestEm11 simulation
TFile f1("./19um.opt0.root");
TH1D* h1 = (TH1D*) f1.Get("12");
TFile f1("./19um-local.root");
TH1D* h1 = (TH1D*) f1.Get("h12");
h1->SetTitle("Angular distribution of 15.7 MeV e- after 19um Au foil");
//h1->SetTitle("Angular distribution of 15.7 MeV e- after 9um Au foil");
h1->GetXaxis()->SetTitle("theta (deg)");
h1->GetYaxis()->SetTitle("dN/dOmega");
h1->SetStats(kFALSE); // Eliminate statistics box
h1->SetLineColor(kBlack);
h1->SetLineColor(kOrange);
h1->Draw("HIST");
TFile f2("./19um.opt3.root");
TH1D* h2 = (TH1D*) f2.Get("12");
TFile f2("./19um-opt3.root");
TH1D* h2 = (TH1D*) f2.Get("h12");
h2->SetStats(kFALSE); // Eliminate statistics box
h2->SetLineColor(kBlue);
h2->Draw("SAME HIST");
TFile f3("./19um.local.root");
TH1D* h3 = (TH1D*) f3.Get("12");
TFile f3("./19um-opt4.root");
TH1D* h3 = (TH1D*) f3.Get("h12");
h3->SetStats(kFALSE); // Eliminate statistics box
h3->SetLineColor(kGreen);
h3->Draw("SAME HIST");
@@ -32,8 +32,8 @@
*/
ifstream in;
in.open("./19um.ascii");
//in.open("./9um.ascii");
in.open("./19um-wwols.ascii");
//in.open("./9um-wwols.ascii");
TMarker *pt;
Double_t x, y;
@@ -43,17 +43,17 @@
for ( int i = 0 ; i < nbdata ; i++ ) {
in >> x >> y ;
if (!in.good()) break;
pt = new TMarker(x,y,22); // 22 for triangle TMatker
pt->SetMarkerColor(kRed);
pt = new TMarker(x,y,23); // 23 for triangle-down TMarker
pt->SetMarkerColor(kMagenta);
pt->Draw();
}
in.close();
// Print the histograms legend
TLegend* legend = new TLegend(0.6,0.5,0.8,0.68);
legend->AddEntry(h1,"opt0 ","l");
legend->AddEntry(h1,"local ","l");
legend->AddEntry(h2,"opt3 ","l");
legend->AddEntry(h3,"local","l");
legend->AddEntry(h3,"opt4","l");
legend->AddEntry(pt,"Hanson data","P");
legend->Draw();
}
@@ -1,70 +0,0 @@
macro hanson.kumac
*
set * ; opt *
*
filecase keep
set *fon -40
set mscf 1.5
set ygti 0.5 ; set gsiz 0.35 ; set ymgu 1.5
set vsiz 0.25 ; set yval 0.3 ; set ylab 0.55
set asiz 0.25 ; set yhti 0.9 ; set xlab 1.2
*
title 'Angular distribution of 15.7 MeV e- after 9um Au foil'
*
h/file 1 19um.opt0.hbook
*
h/list
*
opt liny
*
set dmod 1 ; set hcol 1 ; set plci 1
h/pl //lun1/12
key 0.6 3.0 1 '9.4-opt0' ! l
atitle 'theta(deg)' 'dN/dOm'
* *** data
* angle distribution of 15.7 MeV electrons
* transmitted through thin gold foils.
* A.O.Hanson et al. Phys.Rev.84 (1951) page 634.
*
fname = '19um.ascii'
vector/create nb(1)
vector/read nb [fname] ! 'O'
nbin = nb(1)
vector/create vect(2,[nbin])
vector/read vect [fname] ! 'C'
***vector/write vect ! (1x,f6.4,3x,f5.3)
set mtyp 22
set pmci 2
graph [nbin] vect(1) vect(2) P
vector/create xmark(1)
vector/create mark(1)
vector/input xmark 0.57
vector/input mark 2.85
graph 1 xmark mark P
itx 0.64 2.8 'Hanson data'
exec Redraw-Axis
return
Macro Redraw-Axis
set plci 1
X1 = $GRAFINFO('WNXMIN')
X2 = $GRAFINFO('WNXMAX')
Y1 = $GRAFINFO('WNYMIN')
Y2 = $GRAFINFO('WNYMAX')
IS = $GRAFINFO('?FAIS')
IC = $GRAFINFO('?FACI')
Set FAIS 0 ; Set FACI 1
Box [X1] [X2] [Y1] [Y2]
Set FAIS [IS] ; Set FACI [IC]
Tick XL [X1] !
* Tick YB ! [Y1]
Return
@@ -1,23 +1,43 @@
// ROOT macro file for plotting example B4 histograms
//
// Can be run from ROOT session:
// root[0] .x plotHisto.C
{
gROOT->Reset();
gROOT->SetStyle("Plain");
// Draw histos filled by Geant4 simulation
//
TFile f = TFile("pixe.root");
TCanvas* c1 = new TCanvas("c1", " ");
c1->SetLogy(1);
c1->cd();
c1->Update();
TH1D* hist1 = (TH1D*)f.Get("h3");
hist1->Draw("HIST");
TH1D* hist2 = (TH1D*)f.Get("h5");
hist2->Draw("HIST");
TH1D* hist3 = (TH1D*)f.Get("h20");
hist3->Draw("HIST");
// Open file filled by Geant4 simulation
TFile f("pixe.root");
// Create a canvas and divide it into 2x2 pads
TCanvas* c1 = new TCanvas("c1", "", 20, 20, 1000, 1000);
c1->Divide(2,2);
TH1D* hist4 = (TH1D*)f.Get("h40");
hist4->Draw("HIST");
// Draw pixe in the pad 1
c1->cd(1);
gPad->SetLogy(1);
gPad->SetGridy(1);
TH1D* hist1 = (TH1D*)f.Get("h55");
hist1->SetLineColor(kBlue);
hist1->Draw("HIST");
// Draw deexcitation in the pad 2
c1->cd(2);
gPad->SetLogy(1);
gPad->SetGridy(0);
TH1D* hist2 = (TH1D*)f.Get("h51");
hist2->SetLineColor(kBlue);
hist2->Draw("HIST");
// Draw total in the pad 3
c1->cd(3);
gPad->SetLogy(1);
gPad->SetGridy(1);
TH1D* hist3 = (TH1D*)f.Get("h3");
hist3->SetLineColor(kRed);
hist3->Draw("HIST");
}
@@ -2,51 +2,50 @@
#
/control/cout/ignoreThreadsExcept 0
/control/verbose 2
/run/verbose 2
/run/verbose 1
#
/testem/det/setAbsMat G4_Au
/testem/det/setAbsMat Gold
/testem/det/setAbsThick 50 um
/testem/det/setAbsYZ 50 um
#
/testem/phys/addPhysics emlivermore
#/testem/phys/addPhysics empenelope
/testem/phys/addPhysics emstandard_opt4
###/testem/phys/addPhysics emlivermore
#
/run/setCut 0.01 mm
/run/setCut 2 um
/run/setCutForAGivenParticle gamma 0.5 um
#
/process/em/deexcitationIgnoreCut true
#/process/em/deexcitation world true false true
/process/em/fluo true
# to (de)activate pixe or atomic deexcitation
/process/em/pixe true
/process/em/auger true
/process/em/augerCascade true
/process/em/deexcitationIgnoreCut true
#
/process/em/verbose 0
/process/em/printParameters
#
/run/initialize
#
/testem/gun/setDefault
/gun/particle e-
#/gun/particle proton
/gun/particle proton
/gun/energy 20 MeV
#
# to be run interactively
###/control/execute vis.mac
###/tracking/verbose 2
###/run/beamOn 1
#
/analysis/setFileName pixe
/analysis/h1/set 3 100 0 0.1 MeV #gamma: energy at vertex
/analysis/h1/set 5 100 0.001 0.1 MeV log10 #gamma: energy at vertex (log scale)
/analysis/h1/set 51 100 0 0.1 MeV #gamma: energy at vertex
/analysis/h1/set 53 100 0.001 0.1 MeV log10 #gamma: energy at vertex (log scale)
/analysis/h1/set 55 100 0 0.1 MeV #gamma: energy at vertex
/analysis/h1/set 57 100 0.001 0.1 MeV log10 #gamma: energy at vertex (log scale)
/analysis/h1/set 20 100 0 0.1 MeV #gamma: energy at exit
/analysis/h1/set 40 100 0 0.1 MeV #gamma: energy at back
/analysis/h1/set 3 1000 0 100 keV #all gamma: energy at vertex
/analysis/h1/set 51 1000 0 100 keV #deexcitation
/analysis/h1/set 55 1000 0 100 keV #pixe
#
/analysis/h1/set 2 100 0 0.1 MeV #e-: energy at vertex
/analysis/h1/set 4 100 0.001 0.1 MeV log10 #e-: energy at vertex (log scale)
/analysis/h1/set 50 100 0 0.1 MeV #e-: energy at vertex
/analysis/h1/set 52 100 0.001 0.1 MeV log10 #e-: energy at vertex (log scale)
/analysis/h1/set 54 100 0 0.1 MeV #e-: energy at vertex
/analysis/h1/set 56 100 0.001 0.1 MeV log10 #e-: energy at vertex (log scale)
/analysis/h1/set 10 100 0 0.1 MeV #e-: energy at exit
/analysis/h1/set 30 100 0 0.1 MeV #e-: energy at back
/analysis/h1/set 2 500 0 50 keV #all e-: energy at vertex
/analysis/h1/set 50 200 0 20 keV #deexcitation
/analysis/h1/set 54 200 0 20 keV #pixe
#
/run/printProgress 10000
#
/run/beamOn 10000
/analysis/h1/set 4 500 0.01 50 keV log10 #all e-: energy at vertex
/analysis/h1/set 52 200 0.01 20 keV log10 #deexcitation
/analysis/h1/set 56 200 0.01 20 keV log10 #pixe
#
/tracking/verbose 0
/run/printProgress 10000
/run/beamOn 100000
@@ -40,8 +40,6 @@
#include "G4RunManager.hh"
#include "G4Track.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::StackingAction(EventAction* EA)
@@ -128,18 +126,17 @@ StackingAction::ClassifyNewTrack(const G4Track* aTrack)
//energy spectrum of secondaries
//
G4double energy = aTrack->GetKineticEnergy();
G4double loge = (energy > 0.) ? std::log10(energy/CLHEP::MeV) : -100.;
G4double charge = aTrack->GetDefinition()->GetPDGCharge();
if (charge != 0.) {
analysisManager->FillH1(2,energy);
analysisManager->FillH1(4,loge);
analysisManager->FillH1(4,energy);
if(idx == fPhotoAuger || idx == fComptAuger) {
analysisManager->FillH1(50,energy);
analysisManager->FillH1(52,loge);
analysisManager->FillH1(52,energy);
} else if(idx == fPixeAuger) {
analysisManager->FillH1(54,energy);
analysisManager->FillH1(56,loge);
analysisManager->FillH1(56,energy);
} else if(idx == fElectronDNAAuger ||
idx == fProtonDNAAuger ||
idx == fHydrogenDNAAuger ||
@@ -148,19 +145,19 @@ StackingAction::ClassifyNewTrack(const G4Track* aTrack)
idx == fHeliumDNAAuger ||
idx == fGenericIonDNAAuger) {
analysisManager->FillH1(58,energy);
analysisManager->FillH1(60,loge);
analysisManager->FillH1(60,energy);
}
}
if (aTrack->GetDefinition() == G4Gamma::Gamma()) {
analysisManager->FillH1(3,energy);
analysisManager->FillH1(5,loge);
analysisManager->FillH1(5,energy);
if(idx == fPhotoGamma || idx == fComptGamma) {
analysisManager->FillH1(51,energy);
analysisManager->FillH1(53,loge);
analysisManager->FillH1(53,energy);
} else if(idx == fPixeGamma) {
analysisManager->FillH1(55,energy);
analysisManager->FillH1(57,loge);
analysisManager->FillH1(57,energy);
} else if(idx == fElectronDNAGamma ||
idx == fProtonDNAGamma ||
idx == fHydrogenDNAGamma ||
@@ -169,7 +166,7 @@ StackingAction::ClassifyNewTrack(const G4Track* aTrack)
idx == fHeliumDNAGamma ||
idx == fGenericIonDNAGamma) {
analysisManager->FillH1(59,energy);
analysisManager->FillH1(61,loge);
analysisManager->FillH1(61,energy);
}
}
@@ -137,7 +137,7 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (theta > 0.0) {
G4double dteta = analysisManager->GetH1Width(id);
G4double unit = analysisManager->GetH1Unit(id);
G4double weight = (unit*unit)/(twopi*std::sin(theta)*dteta);
G4double weight = unit/(twopi*std::sin(theta)*dteta);
/*
G4cout << "theta, dteta, unit, weight: "
<< theta << " "
@@ -162,7 +162,7 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (theta > 0.0) {
G4double dteta = analysisManager->GetH1Width(id);
G4double unit = analysisManager->GetH1Unit(id);
G4double weight = (unit*unit)/(twopi*std::sin(theta)*dteta);
G4double weight = unit/(twopi*std::sin(theta)*dteta);
weight *= (aTrack->GetKineticEnergy()/MeV);
analysisManager->FillH1(id,theta,weight);
}