ANASEN_analysis/eloss_calculations/stopit/script.exp

107 lines
2.0 KiB
Plaintext
Executable File

#!/usr/bin/expect -f
#
set timeout -1
spawn ./a.out
match_max 100000
expect -exact "\r
1 define stopee\r
2 define absorber\r
3 edit absorber\r
4 run with current parameters\r
5 find thickness of absorber to stop the stopee\r
6 print status of data\r
7 stop\r
"
send -- "1\r"
expect -exact "1\r
Enter Z and A of stopee.\r
"
send -- "2\r"
expect -exact "2\r
"
send -- "4\r"
expect -exact "4\r
Enter energy in MeV.\r
"
send -- "5.486\r"
expect -exact "5.486\r
\r
1 define stopee\r
2 define absorber\r
3 edit absorber\r
4 run with current parameters\r
5 find thickness of absorber to stop the stopee\r
6 print status of data\r
7 stop\r
"
send -- "2\r"
expect -exact "2\r
\r
How many stopping layers are there in the absorber?\r
"
send -- "1\r"
expect -exact "1\r
\r
Is layer 1 a solid, gas, or standardized medium?\r
(0 = solid, 1 = gas, 2 = standardized medium)\r
(Standardized media are: CO2, Si, C \[graphite\], C4H10, CF4,\r
CH2, CD2, He, and H2)\r
"
send -- "2\r"
expect -exact "2\r
Which standardized medium for layer 1?\r
1: CO2\r
2: Si\r
3: C (graphite)\r
4: C4H10\r
5: CF4\r
6: CH2\r
7: CD2\r
8: He-gas\r
9: H2-gas\r
"
send -- "2\r"
expect -exact "2\r
Enter thickness(microns) for layer 1\r
"
send -- "100\r"
expect -exact "100\r
\r
1 define stopee\r
2 define absorber\r
3 edit absorber\r
4 run with current parameters\r
5 find thickness of absorber to stop the stopee\r
6 print status of data\r
7 stop\r
"
send -- "4\r"
expect -exact "4\r
\r
\r
Charged particle has Z = 2. A = 4. Initialenergy = 5.486 MeV.\r
\r
\r
Absorber contains 1 layers.\r
\r
\r
Layer # 1 - Solid Absorber\r
Density = 0.2329E+01 g/cm3 Thickness = 0.2329E+02 mg/cm2\r
Z = 14. A = 28. Atoms per molecule = 1.\r
Energy lost in layer = 5.486 MeV\r
\r
Energy remaining = 0.000 MeV\r
\r
Output also written to stopit.log\r
\r
1 define stopee\r
2 define absorber\r
3 edit absorber\r
4 run with current parameters\r
5 find thickness of absorber to stop the stopee\r
6 print status of data\r
7 stop\r
"
send -- "7\r"
expect eof