Files
2016-06-09 16:25:56 +02:00

77 lines
1.4 KiB
Plaintext

macro sum.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 '30 GeV e- on 20 X0 iron'
h/file 1 9.0p1.hbook
set dmod 1 ; set hcol 4 ; set plci 4
h/pl //lun1/6
key 14 60.0 1 'Geant4-9.0p1' ! l
exec data
set dmod 2 ; set hcol 2 ; set plci 2
h/pl 2 s
key 14 55.0 2 'EGS4' ! l
atitle t '100 Edep/E0'
exec Redraw-Axis
close 1
return
macro data
*
* e- 30 GeV on 20 X0 Iron
* Particle Data Group. Physics Review D 50-3 (1994)
* cumulative longitudinal energy deposition
* (from 0 to 20 X0 by bin of 0.5 X0 --> 40 bins)
*
* *** read data
nbin=40
vector/create vect(2,[nbin])
vector/read vect sum.ascii
**vector/write vect ! (1x,f6.1,3x,e12.6)
*
* *** create and fill histogram
Emin= 0.25
Emax= 20.25
create/1dhisto 2 '20 X0 iron. e- GeV' [nbin] [Emin] [Emax]
put/contents 2 vect(2)
**h/pl 2
* *** save histo
*
**h/file 222 pdgsum.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