Catima data source and new Eloss table generator

This commit is contained in:
James Szalkie 2026-05-12 16:01:10 -04:00
parent 36f9958562
commit f0f5b57afc
24 changed files with 949666 additions and 47 deletions

View File

@ -7,6 +7,7 @@
#include "TObjArray.h"
#include "TBranch.h"
#include <iostream>
#include <fstream>
void aarootscript(int argument = 0) {
std::cout << "\n\n\n";
@ -89,8 +90,6 @@ void aarootscript(int argument = 0) {
}
std::cout << "x length: " << x.size() << ", y length: " << y.size() << std::endl;
#include <fstream>
std::ofstream outfile("Tb_dEb_data.txt");
if (!outfile.is_open()) {

View File

@ -35,13 +35,15 @@ int main(int argc, char **argv){
if( argc >= 2 ) numEvent = atoi(argv[1]);
//double density = (2.1525e-7) * 1000; // example for aluminum target, adjust as needed (400 torr is 0.0000861)
//char command[256];
//snprintf(command, sizeof(command), "python3 ../ELoss/EvXconverter.py %f", density);
//snprintf(command, sizeof(command), "python3 /home/jamesszalkie/.venv/EvXconverter.py %f", density);
//printf("Command: %s\n", command);
//system(command); // run the conversion script to generate energy loss tables with correct density
// load energy loss tables (assume units: E in MeV, dE/dx in MeV/(mg/cm^2), density in mg/cm^3)
TGraph* elossLight = LoadELoss("../ELoss/E_vs_x_light"); // for light particle (alpha)
TGraph* elossHeavy = LoadELoss("../ELoss/Eloss_p"); // for heavy particle (proton)
TGraph* elossLight = LoadELoss("../ELoss/E_vs_x_alpha.dat"); // for light particle (alpha)
TGraph* elossHeavy = LoadELoss("../ELoss/E_vs_x_proton.dat"); // for heavy particle (proton)
TGraph* elossRecoil = LoadELoss("../ELoss/E_vs_x_recoil.dat"); // for recoil particle (if needed)
TGraph *invgLight = new TGraph(elossLight->GetN(), elossLight->GetY(), elossLight->GetX());
TGraph *invgHeavy = new TGraph(elossHeavy->GetN(), elossHeavy->GetY(), elossHeavy->GetX());
auto c1 = new TCanvas("c1", "Graph Example", 800, 600);
auto g = elossLight;
g->SetTitle("Energy Loss Table;cm;Kinetic Energy (MeV)");
@ -52,17 +54,18 @@ int main(int argc, char **argv){
c1->Print("eloss_light.png");
int ELossTotal = 0;
auto c2 = new TCanvas("c2", "Graph Example", 800, 600);
auto g2 = elossHeavy;
g2->SetTitle("Energy Loss Table;Kinetic Energy (MeV);dE/dx (MeV/(mg/cm^{2}))");
g2->SetTitle("Energy Loss Table;cm;Kinetic Energy (MeV)");
g2->Draw("ALP");
g2->SetLineColor(kBlue);
c1->Print("eloss_heavy.png");
c2->Print("eloss_heavy.png");
// Reaction setup: projectile + target configuration, energy, and product IDs
TransferReaction transfer;
transfer.SetA(24,12, 0); // e.g., 24Mg (Z=12) with 0 excitation
transfer.SetIncidentEnergyAngle(5.46, 0, 0); // 5.46 MeV beam, 0 polar and azimuthal angle
transfer.SetA(17,13, 0); // e.g., 24Mg (Z=12) with 0 excitation
transfer.SetIncidentEnergyAngle(72, 0, 0); // 5.46 MeV beam for alpha source, 0 polar and azimuthal angle
transfer.Seta( 4, 2); // identify reaction product a in internal indexing e.g., 4He (alpha)
transfer.Setb( 1, 1); // identify reaction product b e.g., 1H (proton)
@ -136,13 +139,15 @@ int main(int argc, char **argv){
double thetab, phib, Tb;
double thetaB, phiB, TB;
double dEb;
double dEB; // placeholder for heavy particle energy loss, currently set equal to light particle loss for simplicity
tree->Branch("thetab", &thetab, "thetab/D");
tree->Branch("phib", &phib, "phib/D");
tree->Branch("Tb", &Tb, "Tb/D");
tree->Branch("Tb", &Tb, "Tb/D"); // kinetic energy of light particle at vertex (before energy loss)
tree->Branch("thetaB", &thetaB, "thetaB/D");
tree->Branch("phiB", &phiB, "phiB/D");
tree->Branch("TB", &TB, "TB/D");
tree->Branch("TB", &TB, "TB/D"); // kinetic energy of heavy particle at vertex (before energy loss)
tree->Branch("dEb", &dEb, "dEb/D");
tree->Branch("dEB", &dEB, "dEB/D"); // placeholder for heavy particle energy loss, currently set equal to light particle loss for simplicity
// excitation state identifiers
int ExAID;
@ -306,49 +311,38 @@ int main(int argc, char **argv){
z0 = pw->GetZ0();
dEb = 0;
dEB = 0;
tree->Fill();
//Energy loss
double dl = (hitPos - vertex).Mag() / 10; // path length in cm (positions in mm)
double dl = (hitPos - vertex).Mag(); // path length in units of cm
if (numEvent <= 10){
printf("Event %d: Ekin before loss = %f MeV, distance = %f cm\n", i, Tb, dl);
}
double tb_temp = Tb;
//double dx = 0;
//double counter = 0;
//energy loss loop
/*while(dx < dl){
double step = 0.1; // cm, step size for energy loss calculation
if(dx + step > dl) step = dl - dx; // adjust last step to end at hit position
double EkinStep = Tb; // kinetic energy at current step
double dedxStep = elossLight->Eval(EkinStep); // dE/dx at current energy
double dE_step = dedxStep * step * density; // energy loss for this step
if (numEvent <= 10 && fmod(counter, 10) == 0){
printf("Event %d: step = %f, Ekin = %f MeV, dE/dx = %f MeV/(g/cm^2), dE_step = %f MeV\n", i, counter, EkinStep, dedxStep, dE_step);
}
Pb.SetE(Pb.E() - dE_step); // update energy after loss for this step
dx += step;
counter++;
Tb = Tb - dE_step; // update kinetic energy for tree storage
if (Tb < 0) {
Tb = 0; // prevent negative kinetic energy
break;
}
}
dEb = tb_temp - Tb; // total energy loss*/
TGraph *invg = new TGraph(elossLight->GetN(), elossLight->GetY(), elossLight->GetX());
double x0 = invg->Eval(Tb);
//double x0 = elossLight->GetX(Tb); // range corresponding to final kinetic energy
x0 = x0 + dl;
Tb = elossLight->Eval(x0); // kinetic energy corresponding to range at hit position
double tB_temp = TB;
dEb = tb_temp - Tb; // total energy loss
dEB = tB_temp - TB; // total energy loss for heavy particle, currently set equal to light particle loss for simplicity
double x0light = invgLight->Eval(Tb);
double x0heavy = invgHeavy->Eval(TB);
x0light = x0light + dl;
x0heavy = x0heavy + dl;
Tb = elossLight->Eval(x0light); // kinetic energy corresponding to range at hit position
TB = elossHeavy->Eval(x0heavy); // kinetic energy for heavy particle, currently set equal to light particle loss for simplicity
dEb = tb_temp - Tb; // total energy loss
dEB = tB_temp - TB; // total energy loss for heavy particle, currently set equal to light particle loss for simplicity
// fill tree2 with energy loss adjusted data
if (Tb != 0) {
tree2->Fill();
}
if (numEvent <= 10){
printf("Event %d: Tb after energy loss = %f MeV, energy loss = %f MeV\n", i, Tb, tb_temp - Tb);
}
ELossTotal += (tb_temp - Tb);
} //to give in scientific notation, use %e instead of %f in the printf format string. For example: printf("Event %d: Tb after energy loss = %e MeV, energy loss = %e MeV\n", i, Tb, tb_temp - Tb);
ELossTotal += (tb_temp - Tb) + (tB_temp - TB);
}else{
// no valid SX3 hit: mark clearly invalid
@ -367,6 +361,7 @@ int main(int argc, char **argv){
rePhi1 = TMath::QuietNaN();
z0 = TMath::QuietNaN();
dEb = TMath::QuietNaN();
dEB = TMath::QuietNaN();
//Tb = -12354567; // mark kinetic energy as invalid for no hit case
// fill tree with original data (no energy loss for these events)
//tree->Fill();
@ -402,7 +397,8 @@ int main(int argc, char **argv){
saveFile->Close();
printf("=============== done. saved as %s. tree entries: %d, tree2 entries: %d\n", saveFileName.Data(), count, count2);
printf("Average energy loss for light particle: %f MeV\n", (double)ELossTotal / count);
printf("Total energy loss across all events: %e MeV\n", (double)ELossTotal);
printf("Average energy loss across events: %e MeV\n", (double)ELossTotal / count);
if(enableVis){
printf("Displaying geometry with %zu tracks from simulation\n", visTrackVertex.size());

View File

@ -34,10 +34,10 @@ void histcomp() {
// Temporary draw to get range
tree1->Draw(name, "", "goff");
double min = fmax(tree1->GetMinimum(name), tree2->GetMinimum(name));
double max = fmin(tree1->GetMaximum(name), tree2->GetMaximum(name));
double min = fmin(tree1->GetMinimum(name), tree2->GetMinimum(name));
double max = fmax(tree1->GetMaximum(name), tree2->GetMaximum(name));
//if (min == max) continue; // skip constant branches
if (min == max) continue; // skip constant branches
// Expand range slightly
double margin = 0.1 * (max - min);

131
ELoss/EXtable.py Normal file
View File

@ -0,0 +1,131 @@
import pycatima as catima
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy.integrate import cumulative_trapezoid
import matplotlib.pyplot as plt
# GAS SETUP
P_TORR = 400
TEMP_K = 293.15
R = 8.3144
# Gas density
p_pa = P_TORR * 133.322
molar_density = p_pa / (R * TEMP_K)
m_he = 4.0026
m_c = 12.0000
m_o = 15.9949
m_mix_avg = (0.96 * m_he) + (0.04 * (m_c + 2*m_o))
rho_g_cm3 = (molar_density * m_mix_avg) / 1e6
print(f"Gas density = {rho_g_cm3:.6e} g/cm^3")
# MATERIAL
material_def = [
(m_he, 2, 0.96),
(m_c, 6, 0.04),
(m_o, 8, 0.08)
]
gas_mix = catima.Material(material_def)
gas_mix.density(rho_g_cm3)
# FUNCTION
def make_E_vs_x(
z,
mass_u,
emax_mev,
label,
npoints=500
):
projectile = catima.Projectile(mass_u, z)
# Energy grid
E = np.linspace(0.01, emax_mev, npoints)
# Stopping power array
S_mass = np.zeros_like(E)
for i, energy in enumerate(E):
projectile.T(energy / mass_u)
# MeV / (g/cm^2)
S_mass[i] = catima.dedx(projectile, gas_mix)
# Convert to MeV/cm
S_linear = S_mass * rho_g_cm3
# Sort descending energy
sort_idx = np.argsort(E)[::-1]
E = E[sort_idx]
S_linear = S_linear[sort_idx]
# Integrate dx/dE = 1/S(E)
invS = 1.0 / S_linear
x = cumulative_trapezoid(
invS,
E,
initial=0
)
x = -x
# Output table
output = pd.DataFrame({
"Distance_cm": x,
"Energy_MeV": E
})
outfile = f"E_vs_x_{label}.dat"
output.to_csv(
outfile,
sep='\t',
index=False
)
print(f"Saved: {outfile}")
return x, E
# RUN
#proton parameters: z=1, mass_u=1.0078, emax_mev=20
#alpha parameters: z=2, mass_u=4.0026, emax_mev=40
x, E = make_E_vs_x(
z=1,
mass_u=1.0078,
emax_mev=20,
label="proton"
)
x, E = make_E_vs_x(
z=2,
mass_u=4.0026,
emax_mev=40,
label="alpha"
)
# PLOT
plt.figure(figsize=(8,6))
plt.plot(x, E)
plt.xlabel("Distance in Gas (cm)")
plt.ylabel("Energy (MeV)")
plt.title("Energy Loss Curve")
plt.grid(True)
plt.show()
#gives data in units of Energy (MeV) and Distance (cm). To convert to E(x), you can use the cumulative energy

501
ELoss/E_vs_x_alpha.dat Normal file
View File

@ -0,0 +1,501 @@
Distance_cm Energy_MeV
-0.0 40.0
3.3168136638228574 39.91985971943888
6.627897879905463 39.83971943887776
9.933251562889753 39.75957915831663
13.232873624423497 39.679438877755516
16.526762973147783 39.59929859719439
19.8149185146818 39.519158316633266
23.09733915161019 39.43901803607215
26.374023783470314 39.358877755511024
29.644971306736817 39.2787374749499
32.910180614808766 39.19859719438878
36.169650597996686 39.11845691382766
39.42338014350692 39.03831663326653
42.67136813542852 38.958176352705415
45.9136134547201 38.87803607214429
49.15011497919392 38.797895791583166
52.38087158350261 38.71775551102205
55.60588213912573 38.63761523046092
58.8251455143537 38.5574749498998
62.03866057427424 38.47733466933868
65.2464261807587 38.39719438877756
68.44844119244583 38.31705410821643
71.64470446472787 38.236913827655314
74.83521484973677 38.15677354709419
78.01997119632735 38.07663326653307
81.19897235006462 37.99649298597195
84.37221715320692 37.91635270541082
87.53970444469165 37.836212424849705
90.701433060121 37.75607214428858
93.85740183174507 37.675931863727456
97.00760958844737 37.59579158316634
100.15205515573032 37.515651302605214
103.29073735569816 37.43551102204409
106.42365500704213 37.35537074148297
109.55080692502582 37.27523046092185
112.67219192146771 37.19509018036072
115.78780880472625 37.114949899799605
118.89765637968482 37.03480961923848
122.00173344773411 36.954669338677355
125.10003880675694 36.87452905811624
128.19257125111295 36.79438877755511
131.27932957162074 36.71424849699399
134.36031255554238 36.63410821643287
137.43551898656793 36.553967935871746
140.50494764479728 36.47382765531062
143.56859730672446 36.393687374749504
146.62646674522176 36.31354709418838
149.67855472952147 36.233406813627255
152.7248600251998 36.15326653306614
155.76538139416087 36.07312625250501
158.80011759461806 35.99298597194389
161.82906738107778 35.91284569138277
164.8522295043231 35.832705410821646
167.86960271139492 35.75256513026052
170.88118574557538 35.672424849699404
173.88697734637125 35.59228456913828
176.88697624949492 35.512144288577154
179.8811811868474 35.43200400801604
182.86959088650167 35.35186372745491
185.852204072683 35.27172344689379
188.82901946575214 35.19158316633267
191.80003578218796 35.111442885771545
194.76525173456793 35.03130260521042
197.72466603155064 34.9511623246493
200.67827737785848 34.87102204408818
203.62608447425757 34.790881763527054
206.56808601754025 34.710741482965936
209.50428070050725 34.63060120240481
212.43466721194756 34.55046092184369
215.3592442366204 34.47032064128257
218.2780104552374 34.390180360721445
221.19096454444184 34.31004008016032
224.0981051767907 34.2298997995992
226.99943102073627 34.14975951903808
229.89494074060525 34.06961923847695
232.78463299658046 33.989478957915836
235.66850644468212 33.90933867735471
238.54655973674684 33.829198396793586
241.41879152040886 33.74905811623247
244.28520043908105 33.668917835671344
247.14578513193376 33.58877755511022
250.00054423387556 33.5086372745491
252.84947637553412 33.42849699398798
255.69258018323467 33.34835671342685
258.5298542789805 33.268216432865735
261.3612972804335 33.18807615230461
264.1869078008924 33.107935871743486
267.0066844492728 33.02779559118237
269.82062583008775 32.94765531062124
272.6287305434252 32.86751503006012
275.4309971849283 32.787374749499
278.2274243457751 32.70723446893788
281.0180106126562 32.62709418837675
283.80275456775445 32.546953907815634
286.58165478872445 32.46681362725451
289.35470984867 32.386673346693385
292.12191831612313 32.30653306613227
294.88327875502387 32.22639278557114
297.63878972469655 32.146252505010025
300.3884497798303 32.0661122244489
303.13225747045544 31.98597194388778
305.8702113419229 31.90583166332666
308.6023099348818 31.825691382765537
311.3285517852574 31.745551102204413
314.0489354242286 31.66541082164329
316.7634593782064 31.58527054108217
319.4721221688111 31.505130260521046
322.17492231284956 31.424989979959925
324.8718583222932 31.344849699398804
327.56292870425506 31.26470941883768
330.2481319609667 31.184569138276558
332.92746658975597 31.104428857715437
335.6009310830236 31.024288577154312
338.26852392822 30.94414829659319
340.93024360782243 30.86400801603207
343.5860885993116 30.783867735470945
346.23605737514794 30.703727454909824
348.8801484027486 30.623587174348703
351.5183601444636 30.543446893787582
354.1506910575522 30.463306613226457
356.77713959415865 30.383166332665336
359.3977042012891 30.303026052104215
362.0123833207872 30.22288577154309
364.62117538930937 30.14274549098197
367.22407883830175 30.06260521042085
369.82109209397515 29.982464929859724
372.41221357728045 29.902324649298603
374.99744170388465 29.82218436873748
377.57677488414606 29.742044088176357
380.1502115230892 29.661903807615236
382.7177500203804 29.581763527054115
385.2793887703029 29.50162324649299
387.8351261617312 29.42148296593187
390.3849605781067 29.341342685370748
392.92889039741226 29.261202404809623
395.4669139921462 29.181062124248502
397.99902972929783 29.10092184368738
400.5252359703214 29.020781563126256
403.0455310711102 28.940641282565135
405.55991338197157 28.860501002004014
408.06838124760054 28.78036072144289
410.5709330070536 28.70022044088177
413.06756699372346 28.620080160320647
415.55828153531246 28.539939879759523
418.043074953806 28.4597995991984
420.5219455654469 28.37965931863728
422.9948916807087 28.299519038076156
425.46191160426855 28.219378757515035
427.92300363498157 28.139238476953913
430.3781660658535 28.05909819639279
432.8273971840138 27.978957915831668
435.27069527068915 27.898817635270547
437.70805860117616 27.818677354709425
440.13948544481434 27.7385370741483
442.5649740649586 27.65839679358718
444.9845227189526 27.57825651302606
447.3981296581007 27.498116232464934
449.80579312764064 27.417975951903813
452.20751136671623 27.33783567134269
454.60328260834945 27.257695390781567
456.99310507941243 27.177555110220446
459.37697700060016 27.097414829659325
461.75489658640225 27.0172745490982
464.12686204507446 26.93713426853708
466.4928715786113 26.856993987975958
468.85292338271745 26.776853707414833
471.20701564677915 26.696713426853712
473.5551465538364 26.61657314629259
475.89731428055404 26.536432865731467
478.2335169971932 26.456292585170345
480.5637528675828 26.376152304609224
482.88802004909087 26.2960120240481
485.20631669259507 26.21587174348698
487.5186409424546 26.135731462925857
489.82499093648084 26.055591182364733
492.12536480590785 25.97545090180361
494.4197606753639 25.89531062124249
496.7081766628418 25.815170340681366
498.9906108796695 25.735030060120245
501.26706143048074 25.654889779559124
503.53752641318584 25.574749498998
505.80200391894147 25.494609218436878
508.0604920321216 25.414468937875757
510.3129888302875 25.334328657314632
512.5594923841576 25.25418837675351
514.8000007575781 25.17404809619239
517.0345120074929 25.093907815631265
519.263024183913 25.013767535070144
521.485535329887 24.933627254509023
523.7020434814707 24.853486973947902
525.9125466676966 24.773346693386777
528.1170429105435 24.693206412825656
530.3155302249065 24.613066132264535
532.5080066185662 24.53292585170341
534.6944700921579 24.45278557114229
536.874918639141 24.37264529058117
539.049350245769 24.292505010020044
541.2177628910574 24.212364729458923
543.3801545467539 24.1322244488978
545.5365231773071 24.052084168336677
547.6868667398351 23.971943887775556
549.8311831840947 23.891803607214435
551.9694704524508 23.81166332665331
554.1017264798438 23.73152304609219
556.2279491937597 23.651382765531068
558.3481365141979 23.571242484969943
560.4622863536397 23.491102204408822
562.5703966170173 23.4109619238477
564.6724652016819 23.330821643286576
566.7684899973718 23.250681362725455
568.8584688861811 23.170541082164334
570.9423997425275 23.09040080160321
573.0202804331207 23.01026052104209
575.0921088169301 22.930120240480967
577.1578827451534 22.849979959919843
579.2176000611835 22.76983967935872
581.2712586005771 22.6896993987976
583.3188561910223 22.609559118236476
585.3603906523058 22.529418837675355
587.395859796281 22.449278557114233
589.4252614268355 22.36913827655311
591.4485933398578 22.288997995991988
593.4658533232055 22.208857715430867
595.477039156672 22.128717434869742
597.4821486119538 22.04857715430862
599.4811794526174 21.9684368737475
601.4741294340668 21.88829659318638
603.4609963035094 21.808156312625254
605.4417777999238 21.728016032064133
607.4164716540256 21.647875751503012
609.3850755882347 21.567735470941887
611.347587316641 21.487595190380766
613.3040045449715 21.407454909819645
615.2543249705558 21.32731462925852
617.1985462822927 21.2471743486974
619.1366661606158 21.167034068136278
621.0686822774599 21.086893787575153
622.9945922962256 21.006753507014032
624.9143938717464 20.92661322645291
626.8280846502527 20.846472945891787
628.7356622693376 20.766332665330665
630.6371243579222 20.686192384769544
632.5324685362203 20.60605210420842
634.4216924157031 20.5259118236473
636.3047935990636 20.445771543086178
638.1817696801814 20.365631262525053
640.0526182440865 20.28549098196393
641.917336866923 20.20535070140281
643.7759231159138 20.125210420841686
645.6283745493226 20.045070140280565
647.4746887164185 19.964929859719444
649.3148631574383 19.88478957915832
651.1488954035487 19.804649298597198
652.9767829768102 19.724509018036077
654.7985233901377 19.644368737474952
656.6141141472626 19.56422845691383
658.4235527426952 19.48408817635271
660.2268366616846 19.403947895791585
662.0239633801801 19.323807615230464
663.8149303647915 19.243667334669343
665.5997350727489 19.16352705410822
667.3783749518619 19.083386773547097
669.1508474404794 19.003246492985976
670.9171499674477 18.923106212424855
672.6772799520687 18.84296593186373
674.4312348040572 18.76282565130261
676.1790119234986 18.68268537074149
677.9206087008047 18.602545090180364
679.6560225166695 18.522404809619243
681.3852507420253 18.44226452905812
683.1082907379961 18.362124248496997
684.825139855852 18.281983967935876
686.5357954369622 18.201843687374755
688.2402548127476 18.12170340681363
689.9385153046316 18.04156312625251
691.6305742239912 17.961422845691388
693.3164288721068 17.881282565130263
694.9960765401108 17.801142284569142
696.6695145089353 17.72100200400802
698.3367400492591 17.640861723446896
699.9977504214529 17.560721442885775
701.6525428755243 17.480581162324654
703.3011146510609 17.40044088176353
704.9434629771719 17.32030060120241
706.5795850724293 17.240160320641287
708.2094781448071 17.160020040080163
709.8331393916186 17.07987975951904
711.4505659994533 16.99973947895792
713.0617551441111 16.919599198396796
714.6667039905352 16.839458917835675
716.2654096927438 16.759318637274554
717.8578693937587 16.67917835671343
719.444080225533 16.599038076152308
721.024039308876 16.518897795591187
722.5977437533771 16.438757515030062
724.1651906573258 16.35861723446894
725.7263771076302 16.27847695390782
727.2813001797341 16.198336673346695
728.8299569375288 16.118196392785574
730.3723444332649 16.038056112224453
731.9084597074597 15.957915831663328
733.4382997888018 15.877775551102205
734.9618616940534 15.797635270541084
736.4791424279477 15.717494989979961
737.9901389830849 15.637354709418839
739.4948483398224 15.557214428857717
740.9932674661634 15.477074148296595
742.4853933176395 15.396933867735472
743.9712228371906 15.31679358717435
745.45075295504 15.236653306613228
746.9239805885646 15.156513026052107
748.3909026421609 15.076372745490984
749.8515160071054 14.99623246492986
751.3058175614104 14.91609218436874
752.7538041696743 14.835951903807617
754.1954726829248 14.755811623246494
755.6308199384583 14.675671342685373
757.0598427596718 14.59553106212425
758.4825379558876 14.515390781563127
759.8989023221725 14.435250501002006
761.3089326391491 14.355110220440883
762.7126256727994 14.27496993987976
764.1099781742607 14.19482965931864
765.5009868796137 14.114689378757516
766.885648509661 14.034549098196393
768.2639597696974 13.954408817635272
769.6359173492704 13.87426853707415
771.0015179219305 13.794128256513028
772.3607581449721 13.713987975951905
773.7136346591625 13.633847695390783
775.0601440884598 13.553707414829661
776.4002830397195 13.473567134268539
777.7340481023883 13.393426853707416
779.0614358481847 13.313286573146295
780.3824428307662 13.233146292585172
781.6970655853826 13.153006012024049
783.0053006285136 13.072865731462928
784.3071444574922 12.992725450901805
785.60259355011 12.912585170340682
786.8916443642072 12.83244488977956
788.1742933372436 12.752304609218438
789.4505368858518 12.672164328657315
790.7203714053696 12.592024048096194
791.9837932693544 12.511883767535071
793.2407988290729 12.43174348697395
794.4913844129718 12.351603206412827
795.7355463261227 12.271462925851704
796.973280849644 12.191322645290583
798.2045842400963 12.11118236472946
799.429452728852 12.031042084168337
800.6478825214355 11.950901803607216
801.8598697968359 11.870761523046093
803.0654107067878 11.79062124248497
804.2645013750199 11.71048096192385
805.4571378964712 11.630340681362727
806.6433163364709 11.550200400801604
807.8230327298825 11.470060120240483
808.996283080209 11.38991983967936
810.1630633586577 11.309779559118237
811.3233695031636 11.229639278557116
812.477197417368 11.149498997995993
813.6245429695516 11.06935871743487
814.7654019915193 10.989218436873749
815.8997702774344 10.909078156312626
817.0276435825998 10.828937875751505
818.1490176221846 10.748797595190382
819.2638880698923 10.66865731462926
820.3722505565687 10.588517034068138
821.4741006687464 10.508376753507015
822.5694339471231 10.428236472945892
823.6582458849706 10.348096192384771
824.740531926471 10.267955911823648
825.8162874649771 10.187815631262525
826.8855078411927 10.107675350701404
827.9481883412708 10.027535070140281
829.0043241948232 9.947394789579159
830.0539105728401 9.867254509018037
831.0969425855137 9.787114228456915
832.1334152799617 9.706973947895792
833.1633236378465 9.62683366733467
834.1866625728848 9.546693386773548
835.2034269282424 9.466553106212427
836.2136114738096 9.386412825651304
837.2172109033501 9.30627254509018
838.2142198315192 9.22613226452906
839.2046327907448 9.145991983967937
840.1884442279628 9.065851703406814
841.165648501204 8.985711422845693
842.1362398760216 8.90557114228457
843.1002125217543 8.825430861723447
844.0575605076173 8.745290581162326
845.0082777986116 8.665150300601203
845.9523582512454 8.58501002004008
846.8897956090566 8.50486973947896
847.8205834979296 8.424729458917836
848.7447154211957 8.344589178356713
849.6621847545064 8.264448897795592
850.5729847404713 8.18430861723447
851.4771084830486 8.104168336673347
852.3745489416771 8.024028056112225
853.2652989251382 7.943887775551103
854.1493510851362 7.863747494989981
855.0266979095848 7.783607214428859
855.8973317155845 7.703466933867736
856.7612446420812 7.623326653306614
857.618428642189 7.543186372745492
858.4688754751639 7.46304609218437
859.3125766980149 7.382905811623247
860.149523656735 7.302765531062125
860.9797074771382 7.222625250501003
861.803119055286 7.14248496993988
862.6197490474872 7.062344689378758
863.4295878598543 6.982204408817636
864.2326256373995 6.902064128256514
865.028852252653 6.821923847695391
865.8182572937881 6.741783567134269
866.6008300522332 6.661643286573147
867.3765595097566 6.581503006012024
868.1454343250053 6.501362725450902
868.9074428194826 6.42122244488978
869.6625729629483 6.3410821643286575
870.4108123582267 6.2609418837675355
871.1521482254104 6.1808016032064135
871.8865673854444 6.1006613226452915
872.6140562430837 6.020521042084169
873.3346007692144 5.940380761523047
874.0481864825335 5.860240480961925
874.7547984305863 5.780100200400802
875.4544211701624 5.69995991983968
876.1470387470584 5.619819639278558
876.832634675221 5.539679358717435
877.5111919152888 5.459539078156313
878.1826928525622 5.379398797595191
878.8471192744391 5.299258517034069
879.5044523473654 5.219118236472946
880.1546725933622 5.138977955911824
880.79775986621 5.058837675350702
881.4336933273827 4.978697394789579
882.0624514218533 4.898557114228457
882.6840118539104 4.818416833667335
883.2983515631593 4.738276553106213
883.9054467009124 4.65813627254509
884.5052726072154 4.577995991983968
885.0978037887983 4.497855711422846
885.6830138982988 4.4177154308617235
886.2608757151638 4.3375751503006015
886.8313611287117 4.2574348697394795
887.3944411239196 4.177294589178357
887.9500857706033 4.097154308617235
888.4982642167707 4.017014028056113
889.0389446870676 3.93687374749499
889.5720944873926 3.8567334669338678
890.0976800169467 3.7765931863727458
890.6156667891962 3.6964529058116233
891.1260194634918 3.6163126252505013
891.6287018893812 3.536172344689379
892.1236771660092 3.456032064128257
892.6109077194183 3.3758917835671345
893.0903554010513 3.295751503006012
893.5619816113408 3.21561122244489
894.0257474529553 3.1354709418837676
894.4816139190865 3.0553306613226456
894.9295421231245 2.975190380761523
895.3694935772153 2.8950501002004008
895.8014305285548 2.8149098196392788
896.225316363901 2.7347695390781563
896.6411160947243 2.6546292585170344
897.0487969377401 2.574488977955912
897.4483290083564 2.4943486973947895
897.8396861479281 2.4142084168336675
898.2228469097687 2.334068136272545
898.5977957337949 2.253927855711423
898.9645243456974 2.1737875751503006
899.3230334239131 2.093647294589178
899.6733345868216 2.013507014028056
900.015452764022 1.933366733466934
900.3494290299925 1.8532264529058118
900.6753239969484 1.7730861723446896
900.9932218877797 1.6929458917835674
901.3032354417734 1.6128056112224451
901.6055118486687 1.532665330661323
901.9002399653972 1.4525250501002005
902.1876591521553 1.3723847695390783
902.4680701819481 1.292244488977956
902.7418488488331 1.2121042084168339
903.0094631542546 1.1319639278557116
903.2714953361993 1.0518236472945892
903.5286706029773 0.971683366733467
903.781895381209 0.8915430861723448
904.032309435413 0.8114028056112226
904.2813588341609 0.7312625250501003
904.5309013671109 0.651122244488978
904.7833647033009 0.5709819639278558
905.0419952299258 0.4908416833667335
905.3112754590231 0.4107014028056113
905.5976925055561 0.330561122244489
905.9113738277266 0.25042084168336676
906.2705145196951 0.17028056112224452
906.7180616804087 0.09014028056112225
907.5636766533732 0.01

133
ELoss/E_vs_x_heavy Normal file
View File

@ -0,0 +1,133 @@
Distance_cm Energy_MeV
-0.0 10000.0
5389774.75443511 9000.0
10855647.976939568 8000.0
16399799.429078534 7000.0
22024503.893759202 6000.0
27746439.525929503 5000.0
33568523.97924803 4000.0
39479505.49998565 3000.0
42465232.64965547 2500.0
45458635.19045554 2000.0
48421801.341954604 1500.0
51264380.18730769 1000.0
51538310.854370475 950.0
51809056.07244193 900.0
52076066.51597537 850.0
52338857.31093465 800.0
52596975.52453359 750.0
52850042.63171125 700.0
53097197.84366988 650.0
53338197.88222988 600.0
53571964.718051545 550.0
53797134.59432279 500.0
54013123.12525151 450.0
54218488.681383975 400.0
54411632.1250669 350.0
54590900.82324512 300.0
54674749.274030656 275.0
54754256.7635274 250.0
54829072.96640371 225.0
54898883.947833 200.0
54963248.91418915 175.0
55021660.73144465 150.0
55073591.66506018 125.0
55118462.172014125 100.0
55126542.009983145 95.0
55134303.789901204 90.0
55141742.9111429 85.0
55148854.714513645 80.0
55155631.22054315 75.0
55162063.40008629 70.0
55168143.093377516 65.0
55173859.24063356 60.0
55179217.07482415 55.0
55184209.24504438 50.0
55188808.61217146 45.0
55193010.79257213 40.0
55196805.62161694 35.0
55200176.011313476 30.0
55201698.2656194 27.5
55203109.909383446 25.0
55205596.537658684 20.0
55206667.294212274 17.5
55207618.48544631 15.0
55208446.88368818 12.5
55209148.32167941 10.0
55209272.99713796 9.5
55209392.30237793 9.0
55209506.23213812 8.5
55209614.84207803 8.0
55209718.062790126 7.5
55209815.742544316 7.0
55209907.85777273 6.5
55209994.36717252 6.0
55210075.180298805 5.5
55210150.22437268 5.0
55210219.4022728 4.5
55210282.630938694 4.0
55210339.8877284 3.5
55210391.020879395 3.0
55210414.18692252 2.75
55210435.72461827 2.5
55210455.64593725 2.25
55210473.89066913 2.0
55210490.431652516 1.75
55210505.225633934 1.5
55210518.22121416 1.25
55210529.400417954 1.0
55210531.41404439 0.95
55210533.35055263 0.9
55210535.20681682 0.85
55210536.98353343 0.8
55210538.682475016 0.75
55210540.30109701 0.7
55210541.836545736 0.65
55210543.287729986 0.6
55210544.65540986 0.55
55210545.937436916 0.5
55210547.13151188 0.45
55210548.23633637 0.4
55210549.24931867 0.35
55210550.16842291 0.3
55210550.592340045 0.275
55210550.99210096 0.25
55210551.36786262 0.225
55210551.719991796 0.2
55210552.04937974 0.175
55210552.35762383 0.15
55210552.64763077 0.125
55210552.9230082 0.1
55210552.97653193 0.095
55210553.029809006 0.09
55210553.08284391 0.085
55210553.13563664 0.08
55210553.18842938 0.075
55210553.24146428 0.07
55210553.294741355 0.065
55210553.348516345 0.06
55210553.40304525 0.055
55210553.45835695 0.05
55210553.51474285 0.045
55210553.57262797 0.04
55210553.63261063 0.035
55210553.695258826 0.03
55210553.727836125 0.0275
55210553.76145144 0.025
55210553.79627961 0.0225
55210553.832593 0.02
55210553.87069793 0.0175
55210553.911007315 0.015
55210553.954146795 0.0125
55210554.00104025 0.01
55210554.021164455 0.009
55210554.04239499 0.008
55210554.06492518 0.007
55210554.08902819 0.006
55210554.11508502 0.005
55210554.14362026 0.004
55210554.17551789 0.003
55210554.19311401 0.0025
55210554.21218867 0.002
55210554.23317281 0.0015
55210554.25667492 0.001

122
ELoss/E_vs_x_light Normal file
View File

@ -0,0 +1,122 @@
Distance_cm Energy_MeV
-0.0 1000.0
38090.24265357861 950.0
74970.65178025051 900.0
110609.72374756227 850.0
144982.69086113444 800.0
177995.20260308465 750.0
209570.9996173871 700.0
239680.33175059053 650.0
268237.80575094 600.0
295209.9123122635 550.0
320489.19563622813 500.0
343987.25387062563 450.0
365618.4078917277 400.0
385287.841529391 350.0
402920.17875570967 300.0
410949.998222299 275.0
418425.3819566142 250.0
425326.008920567 225.0
431645.1046300599 200.0
437360.67691461876 175.0
442448.12394963385 150.0
446885.4980521254 125.0
450646.96400049457 100.0
451316.28419787926 95.0
451957.2298491922 90.0
452569.1796854077 85.0
453152.5707252523 80.0
453706.0893323338 75.0
454229.64302234026 70.0
454724.311798022 65.0
455187.63266045594 60.0
455619.87866210006 55.0
456021.06220334885 50.0
456389.32941057585 45.0
456725.72511147766 40.0
457029.88762390387 35.0
457299.87371961994 30.0
457421.77280618943 27.5
457534.9246840642 25.0
457734.41127965244 20.0
457820.5609423128 17.5
457897.27749702823 15.0
457964.30094574887 12.5
458021.45338128274 10.0
458031.67251620576 9.5
458041.47014381184 9.0
458050.8486102679 8.5
458059.8085490814 8.0
458068.3413273997 7.5
458076.4409698491 7.0
458084.1032909443 6.5
458091.3241694552 6.0
458098.0959899924 5.5
458104.41310307384 5.0
458110.2757390081 4.5
458115.6643265186 4.0
458120.5567648235 3.5
458124.953645527 3.0
458126.96500826493 2.75
458128.85245274403 2.5
458130.6145406349 2.25
458132.256880079 2.0
458133.7834459798 1.75
458135.1950897439 1.5
458136.4965912958 1.25
458137.69808799133 1.0
458137.92808426364 0.95
458138.15537980536 0.9
458138.38003730914 0.85
458138.60253869527 0.8
458138.8233480066 0.75
458139.04290270153 0.7
458139.2616304426 0.65
458139.4803581836 0.6
458139.700331072 0.55
458139.9228422575 0.5
458140.1492653625 0.45
458140.3811350161 0.4
458140.6212044783 0.35
458140.8733442866 0.3
458141.0053697707 0.275
458141.1423808325 0.25
458141.2855021647 0.225
458141.43604882533 0.2
458141.5957608915 0.175
458141.76731704 0.15
458141.9544791492 0.125
458142.1633982047 0.1
458142.2082474724 0.095
458142.2543479838 0.09
458142.3019607871 0.085
458142.3511884961 0.08
458142.40214453876 0.075
458142.4549547324 0.07
458142.5097591571 0.065
458142.56686030654 0.06
458142.6266386429 0.055
458142.6894257576 0.05
458142.7556563149 0.045
458142.82594587334 0.04
458142.9010657205 0.035
458142.9819561412 0.03
458143.0248967919 0.0275
458143.06979883165 0.025
458143.1169267642 0.0225
458143.16659811663 0.02
458143.21919888444 0.0175
458143.27514753735 0.015
458143.3349655939 0.0125
458143.399372441 0.01
458143.4265797572 0.009
458143.454674733 0.008
458143.4836821286 0.007
458143.51366321446 0.006
458143.54460034927 0.005
458143.5763374784 0.004
458143.6086461392 0.003
458143.6249128085 0.0025
458143.6411117 0.002
458143.6570674755 0.0015
458143.67255874246 0.001

501
ELoss/E_vs_x_proton.dat Normal file
View File

@ -0,0 +1,501 @@
Distance_cm Energy_MeV
-0.0 20.0
12.004960341817172 19.95993987975952
23.98964201736537 19.919879759519038
35.95403279928156 19.87981963927856
47.8981204715152 19.839759519038076
59.82189282933158 19.799699398797596
71.72533767933199 19.759639278557113
83.60844283945664 19.719579158316634
95.47119613900456 19.67951903807615
107.31358541863614 19.63945891783567
119.1355985303925 19.59939879759519
130.93722333769784 19.55933867735471
142.7184477153773 19.51927855711423
154.47925954966414 19.479218436873747
166.21964673820682 19.439158316633268
177.93959719008618 19.399098196392785
189.63909882581686 19.359038076152306
201.31813957736523 19.318977955911823
212.97670738815043 19.278917835671344
224.61479021306178 19.23885771543086
236.23237601845952 19.19879759519038
247.82945278219168 19.1587374749499
259.4060084935945 19.11867735470942
270.96203115350795 19.07861723446894
282.4975087742806 19.038557114228457
294.01242937977463 18.998496993987978
305.5067810053806 18.958436873747495
316.9805516980169 18.918376753507015
328.43372951614475 18.878316633266532
339.8663025297676 18.838256513026053
351.2782588204458 18.79819639278557
362.669586481295 18.75813627254509
374.0402736170009 18.718076152304608
385.39030834381686 18.67801603206413
396.7196787895775 18.63795591182365
408.0283731549779 18.597895791583166
419.31637982576467 18.557835671342687
430.58368713504734 18.517775551102204
441.8302832511163 18.477715430861725
453.05615635388847 18.437655310621242
464.2612946349039 18.397595190380763
475.44568629733817 18.35753507014028
486.6093195559983 18.3174749498998
497.75218263733467 18.277414829659318
508.87426377943666 18.237354709418838
519.9755512320438 18.197294589178355
531.0560332565411 18.157234468937876
542.1156981259685 18.117174348697397
553.1545341250206 18.077114228456914
564.1725295500464 18.037054108216434
575.1696727090575 17.99699398797595
586.1459519217227 17.956933867735472
597.1013555193769 17.91687374749499
608.0358718450148 17.87681362725451
618.9494892532997 17.836753507014027
629.8421961105564 17.796693386773548
640.7139807947792 17.756633266533065
651.5648316956248 17.716573146292586
662.3947372144183 17.676513026052106
673.2036857641508 17.636452905811623
683.9916657694749 17.596392785571144
694.7586656667115 17.55633266533066
705.50467390384 17.51627254509018
716.2296789405049 17.4762124248497
726.9336692480065 17.43615230460922
737.6166333093062 17.396092184368737
748.2785596190165 17.356032064128257
758.919436683406 17.315971943887774
769.5392530203891 17.275911823647295
780.1379971595287 17.235851703406816
790.7156576420305 17.195791583166333
801.2722230462253 17.155731462925853
811.8076821486147 17.11567134268537
822.3220237086892 17.07561122244489
832.8152363078991 17.03555110220441
843.2873085393342 16.99549098196393
853.7382290077255 16.955430861723446
864.1679863294327 16.915370741482967
874.5765691324449 16.875310621242484
884.9639660563674 16.835250501002005
895.3301657524224 16.79519038076152
905.6751568834343 16.755130260521042
915.9989281238289 16.715070140280563
926.3014681596235 16.67501002004008
936.5827656884155 16.6349498997996
946.8428094193811 16.594889779559118
957.0815880732588 16.55482965931864
967.2990903823483 16.514769539078156
977.4953050904932 16.474709418837676
987.6702209530791 16.434649298597193
997.8238267370164 16.394589178356714
1007.9561112207365 16.35452905811623
1018.0670631941748 16.314468937875752
1028.156671458765 16.274408817635273
1038.2249248274256 16.23434869739479
1048.2718121245452 16.19428857715431
1058.2973221859763 16.154228456913827
1068.3014438590164 16.114168336673348
1078.2841660024014 16.074108216432865
1088.2454774862856 16.034048096192386
1098.1853671922354 15.993987975951903
1108.103824013208 15.953927855711422
1118.0008368535425 15.91386773547094
1127.8763946289428 15.87380761523046
1137.7304862664625 15.833747494989979
1147.5631008529945 15.793687374749497
1157.3742275229429 15.753627254509016
1167.1638552701836 15.713567134268535
1176.9319730603706 15.673507014028054
1186.6785698704548 15.633446893787573
1196.4036346886658 15.593386773547094
1206.1071565144957 15.553326653306613
1215.7891243586785 15.513266533066131
1225.449527243173 15.47320641282565
1235.0883542011434 15.43314629258517
1244.70559427694 15.393086172344688
1254.3012365260793 15.353026052104207
1263.8752700152234 15.312965931863726
1273.4276838221597 15.272905811623245
1282.9584670357797 15.232845691382764
1292.4676087560574 15.192785571142283
1301.955098094027 15.152725450901803
1311.4209241717626 15.112665330661322
1320.8650761223519 15.072605210420841
1330.2875430898753 15.03254509018036
1339.6883142293823 14.992484969939879
1349.0673787068665 14.952424849699398
1358.424725699242 14.912364729458917
1367.7603443943174 14.872304609218435
1377.0742239907715 14.832244488977954
1386.3663536981269 14.792184368737473
1395.6367227367234 14.752124248496992
1404.8853203376923 14.712064128256511
1414.1121357429279 14.672004008016032
1423.317158205062 14.63194388777555
1432.5003769965256 14.59188376753507
1441.6617815512257 14.551823647294588
1450.8013613011033 14.511763527054107
1459.9191055344168 14.471703406813626
1469.01500355005 14.431643286573145
1478.0890446574824 14.391583166332664
1487.1412181767578 14.351523046092183
1496.1715134384535 14.311462925851702
1505.1799197836492 14.27140280561122
1514.1664265638938 14.23134268537074
1523.1310231411737 14.19128256513026
1532.0736988878805 14.151222444889779
1540.9944431867757 14.111162324649298
1549.8932454309581 14.071102204408817
1558.7700950238293 14.031042084168336
1567.6249813790587 13.990981963927855
1576.457893920548 13.950921843687373
1585.2688220823961 13.910861723446892
1594.0577553088622 13.870801603206411
1602.8246830543294 13.83074148296593
1611.5695947832678 13.790681362725449
1620.292479970196 13.75062124248497
1628.9933280996452 13.710561122244489
1637.6721286661177 13.670501002004007
1646.3288711740504 13.630440881763526
1654.9635451377737 13.590380761523045
1663.576140081473 13.550320641282564
1672.1666455391476 13.510260521042083
1680.7350510545693 13.470200400801602
1689.2813462744693 13.43014028056112
1697.8055208897172 13.39008016032064
1706.30756450391 13.350020040080159
1714.787466692128 13.309959919839677
1723.2452170390538 13.269899799599198
1731.6808051389326 13.229839679358717
1740.0942205955243 13.189779559118236
1748.485453022062 13.149719438877755
1756.8544920412062 13.109659318637274
1765.201327285 13.069599198396793
1773.5259483948237 13.029539078156311
1781.8283450213487 12.98947895791583
1790.1085068244913 12.94941883767535
1798.366423473366 12.909358717434868
1806.6020846462386 12.869298597194387
1814.815480030478 12.829238476953906
1823.006599322509 12.789178356713427
1831.1754322277643 12.749118236472945
1839.3219684606352 12.709058116232464
1847.4461977444223 12.668997995991983
1855.5481098112878 12.628937875751502
1863.627694402204 12.588877755511021
1871.684941266905 12.54881763527054
1879.719840163835 12.508757515030059
1887.7323808600984 12.468697394789578
1895.722553131409 12.428637274549097
1903.6903468185924 12.388577154308615
1911.6357518099082 12.348517034068136
1919.5587579416467 12.308456913827655
1927.4593550157244 12.268396793587174
1935.3375328424584 12.228336673346693
1943.193281240514 12.188276553106212
1951.0265900368515 12.14821643286573
1958.8374490666745 12.10815631262525
1966.6258481733762 12.068096192384768
1974.391777208487 12.028036072144287
1982.1352260316207 11.987975951903806
1989.8561845104227 11.947915831663325
1997.554642520515 11.907855711422844
2005.2305899454436 11.867795591182364
2012.8840166766263 11.827735470941883
2020.5149126132972 11.787675350701402
2028.123267662455 11.747615230460921
2035.7090717388087 11.70755511022044
2043.2723147647253 11.667494989979959
2050.812986670176 11.627434869739478
2058.3310773926833 11.587374749498997
2065.826576877268 11.547314629258516
2073.299475076398 11.507254509018034
2080.749761949933 11.467194388777553
2088.1774274945883 11.427134268537074
2095.5824617448034 11.387074148296593
2102.9648547087063 11.347014028056112
2110.324596367168 11.30695390781563
2117.661676708255 11.26689378757515
2124.9760857271804 11.226833667334668
2132.267813426253 11.186773547094187
2139.536849814829 11.146713426853706
2146.783184909265 11.106653306613225
2154.0068087328677 11.066593186372744
2161.2077113158493 11.026533066132263
2168.385882695281 10.986472945891782
2175.541312915047 10.946412825651302
2182.6739920258024 10.906352705410821
2189.783910084928 10.86629258517034
2196.8710571564884 10.82623246492986
2203.935423311192 10.786172344689378
2210.9769986263514 10.746112224448897
2217.9957731858435 10.706052104208416
2224.9917370800736 10.665991983967935
2231.96488040594 10.625931863727454
2238.9151932668 10.585871743486972
2245.842665778164 10.545811623246491
2252.7472880775113 10.50575150300601
2259.629050298767 10.465691382765531
2266.4879425624626 10.42563126252505
2273.323954995514 10.385571142284569
2280.1370777312027 10.345511022044088
2286.9273009091526 10.305450901803606
2293.6946146753153 10.265390781563125
2300.4390091819537 10.225330661322644
2307.1604745876293 10.185270541082163
2313.859001057194 10.145210420841682
2320.534578761782 10.105150300601201
2327.1872451995137 10.06509018036072
2333.817138037164 10.02503006012024
2340.424348582387 9.98496993987976
2347.00886891868 9.944909819639278
2353.5706910889135 9.904849699398797
2360.1098070949556 9.864789579158316
2366.626208897291 9.824729458917835
2373.119888414632 9.784669338677354
2379.59083752353 9.744609218436873
2386.0390480579763 9.704549098196392
2392.464511809 9.66448897795591
2398.8672205242597 9.62442885771543
2405.2471659076296 9.584368737474948
2411.6043396187792 9.544308617234469
2417.93873327275 9.504248496993988
2424.250338439522 9.464188376753507
2430.539146643575 9.424128256513026
2436.805149363448 9.384068136272544
2443.048338031286 9.344008016032063
2449.268704032386 9.303947895791582
2455.46623870473 9.263887775551101
2461.64093333852 9.22382765531062
2467.792779175697 9.183767535070139
2473.9217674094593 9.143707414829658
2480.0278891837715 9.103647294589177
2486.1111355928656 9.063587174348697
2492.171497680737 9.023527054108216
2498.20896644063 8.983466933867735
2504.223532814517 8.943406813627254
2510.2151876925723 8.903346693386773
2516.1839219126327 8.863286573146292
2522.129726259655 8.82322645290581
2528.0525914651616 8.78316633266533
2533.9525082066802 8.743106212424848
2539.829467107172 8.703046092184367
2545.6834587344556 8.662985971943886
2551.5144736006155 8.622925851703407
2557.3225021614085 8.582865731462926
2563.107534815654 8.542805611222445
2568.8695619046202 8.502745490981964
2574.6085737113963 8.462685370741482
2580.3245604602585 8.422625250501001
2586.0175123160216 8.38256513026052
2591.687419383384 8.342505010020039
2597.3342717062606 8.302444889779558
2602.9580592671027 8.262384769539077
2608.558771986211 8.222324649298596
2614.1363997210337 8.182264529058115
2619.6909322654533 8.142204408817635
2625.2223593490653 8.102144288577154
2630.7306706364384 8.062084168336673
2636.2158557263683 8.022024048096192
2641.677904151115 7.981963927855711
2647.1168053756282 7.94190380761523
2652.5325487967607 7.901843687374749
2657.925123742466 7.8617835671342675
2663.2945194709832 7.821723446893786
2668.640725170008 7.781663326653306
2673.9637299558485 7.741603206412825
2679.2635228725658 7.701543086172344
2684.5400928911 7.661482965931863
2689.7934289083805 7.621422845691382
2695.023519746421 7.5813627254509015
2700.2303541513957 7.54130260521042
2705.4139207927014 7.501242484969939
2710.5742082620013 7.461182364729458
2715.711205072251 7.421122244488977
2720.824899656706 7.381062124248496
2725.9152803679126 7.341002004008016
2730.982335476679 7.300941883767535
2736.026053171025 7.2608817635270535
2741.046421555114 7.220821643286572
2746.0434286481654 7.180761523046091
2751.017062383342 7.14070140280561
2755.9673106066207 7.10064128256513
2760.8941610756383 7.060581162324649
2765.7976014585147 7.020521042084168
2770.6776193326546 6.980460921843687
2775.5342021835236 6.9404008016032055
2780.3673374034 6.900340681362724
2785.1770122901034 6.860280561122244
2789.9632140456947 6.820220440881763
2794.7259297751502 6.780160320641282
2799.4651464850117 6.740100200400801
2804.1808510820033 6.70004008016032
2808.8730303716234 6.659979959919839
2813.5416710567056 6.619919839679358
2818.186759735949 6.579859719438877
2822.8082829024183 6.539799599198396
2827.4062269420097 6.499739478957915
2831.9805781318855 6.459679358717434
2836.531322638874 6.419619238476953
2841.0584465178335 6.379559118236473
2845.5619357099827 6.3394989979959915
2850.0417760411897 6.29943887775551
2854.4979532202265 6.259378757515029
2858.930452836981 6.219318637274548
2863.339260360632 6.179258517034068
2867.7243611377776 6.139198396793587
2872.085740390524 6.099138276553106
2876.4233832145273 6.059078156312625
2880.737274576992 6.0190180360721435
2885.0273993146184 5.978957915831662
2889.293742131504 5.938897795591182
2893.5362875969927 5.898837675350701
2897.7550201434724 5.85877755511022
2901.9499240641176 5.818717434869739
2906.1209835105788 5.778657314629258
2910.26818249061 5.738597194388777
2914.3915048656413 5.698537074148296
2918.490934348287 5.658476953907815
2922.566454499789 5.618416833667334
2926.618048727399 5.578356713426853
2930.6457002816874 5.538296593186372
2934.6493922537834 5.498236472945891
2938.6291075725435 5.458176352705411
2942.5848290016415 5.4181162324649295
2946.5165391365817 5.378056112224448
2950.4242204016314 5.337995991983967
2954.3078550466657 5.297935871743486
2958.167425143929 5.257875751503005
2962.0029125847027 5.217815631262525
2965.8142990758797 5.177755511022044
2969.6015661364413 5.137695390781563
2973.364695093831 5.0976352705410815
2977.103667080224 5.0575751503006
2980.8184630286873 5.01751503006012
2984.5090636692235 4.977454909819639
2988.1754495246973 4.937394789579158
2991.817600906638 4.897334669338677
2995.435497910913 4.857274549098196
2999.0291204132686 4.817214428857715
3002.598448064728 4.777154308617234
3006.1434602868467 4.737094188376753
3009.6641362668147 4.697034068136272
3013.1604549523995 4.656973947895791
3016.6323950467254 4.61691382765531
3020.079935002878 4.576853707414829
3023.50305301833 4.5367935871743486
3026.901727029177 4.496733466933867
3030.2759347041765 4.456673346693386
3033.6256534385807 4.416613226452905
3036.950860347752 4.376553106212424
3040.2515322605536 4.336492985971943
3043.527645712502 4.296432865731463
3046.7791769386704 4.256372745490982
3050.0061018663323 4.2163126252505005
3053.208396107331 4.176252505010019
3056.3860349501592 4.136192384769538
3059.538993351741 4.096132264529057
3062.6672459288893 4.056072144288577
3065.770766949438 4.016012024048096
3068.8495303230115 3.9759519038076148
3071.9035095914332 3.9358917835671337
3074.9326779187368 3.895831663326653
3077.9370080807676 3.855771543086172
3080.9164724543493 3.8157114228456908
3083.8710430059905 3.77565130260521
3086.800691280106 3.735591182364729
3089.705388386725 3.695531062124248
3092.5851049886537 3.655470941883767
3095.4398112880654 3.615410821643286
3098.269477012478 3.575350701402805
3101.074071400087 3.5352905811623243
3103.853563184408 3.495230460921843
3106.6079205781925 3.455170340681362
3109.3371112565665 3.4151102204408814
3112.0411023393444 3.3750501002004003
3114.719860372463 3.334989979959919
3117.3733513084767 3.2949298597194385
3120.001540486058 3.2548697394789574
3122.604392608425 3.2148096192384763
3125.181871720631 3.1747494989979956
3127.733941185635 3.1346893787575145
3130.2605636590615 3.094629258517034
3132.761701062565 3.0545691382765527
3135.2373145556885 3.0145090180360716
3137.6873645061128 2.974448897795591
3140.1118104581683 2.93438877755511
3142.5106110994843 2.8943286573146287
3144.883724225627 2.854268537074148
3147.2311067025703 2.814208416833667
3149.552714426832 2.774148296593186
3151.848502283076 2.734088176352705
3154.1184240989833 2.694028056112224
3156.3624325971628 2.653967935871743
3158.5804793438456 2.6139078156312623
3160.772514694097 2.573847695390781
3162.938487733234 2.5337875751503
3165.078346214121 2.4937274549098194
3167.192036489969 2.4536673346693383
3169.2795034422275 2.413607214428857
3171.3406904031267 2.3735470941883765
3173.3755390723504 2.3334869739478954
3175.3839894272974 2.2934268537074143
3177.3659796262973 2.2533667334669336
3179.321445904103 2.2133066132264525
3181.2503224588754 2.1732464929859714
3183.1525413298145 2.1331863727454907
3185.0280322644658 2.0931262525050096
3186.8767225746346 2.0530661322645285
3188.698536979705 2.013006012024048
3190.493397436011 1.972945891783567
3192.2612229507567 1.932885771543086
3194.0019293787764 1.8928256513026052
3195.715429200238 1.852765531062124
3197.4016312771373 1.8127054108216432
3199.0604405861745 1.7726452905811623
3200.691757925294 1.7325851703406812
3202.2954795908404 1.6925250501002003
3203.8714970218916 1.6524649298597194
3205.4196964079156 1.6124048096192383
3206.939958255419 1.5723446893787574
3208.4321569087438 1.5322845691382765
3209.8961600196076 1.4922244488977956
3211.331827959366 1.4521643286573145
3212.739013167362 1.4121042084168336
3214.1175594280726 1.3720440881763527
3215.4673010691545 1.3319839679358716
3216.7880620719543 1.2919238476953907
3218.0796550856808 1.2518637274549098
3219.341880336359 1.2118036072144287
3220.5745244220984 1.1717434869739478
3221.777358987393 1.131683366733467
3222.950139271537 1.0916232464929858
3224.0926025304434 1.051563126252505
3225.204466338055 1.011503006012024
3226.285426784458 0.971442885771543
3227.335156604663 0.931382765531062
3228.353303297527 0.8913226452905811
3229.339487332344 0.8512625250501001
3230.2933005968616 0.8112024048096191
3231.214305322723 0.7711422845691382
3232.1020338436997 0.7310821643286572
3232.9559897137706 0.6910220440881764
3233.7756509569062 0.6509619238476954
3234.5604765658722 0.6109018036072144
3235.30991784901 0.5708416833667335
3236.0234368864194 0.5307815631262525
3236.7005352545007 0.4907214428857715
3237.340797377451 0.4506613226452906
3237.9439544585052 0.4106012024048096
3238.509977099474 0.37054108216432863
3239.039207832505 0.3304809619238477
3239.532549955435 0.29042084168336674
3239.9917393995006 0.25036072144288574
3240.419750968563 0.2103006012024048
3240.821457352705 0.17024048096192385
3241.204868151086 0.13018036072144287
3241.5840701519737 0.09012024048096191
3241.989400353421 0.05006012024048096
3242.5361575547254 0.01

1000
ELoss/Eloss_HeProton Normal file

File diff suppressed because it is too large Load Diff

108
ELoss/EvXconverter.py Normal file
View File

@ -0,0 +1,108 @@
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sys
from scipy.interpolate import interp1d
from scipy.integrate import cumulative_trapezoid
if len(sys.argv) > 1:
density = float(sys.argv[1])
print(f"Using user-provided density: {density} g/cm^3")
else:
density = (2.1525e-7) * 400 # default density (g/cm^3)
print(f"No density provided, using default: {density} g/cm^3")
filename = "/home/jamesszalkie/anasen/ELoss/Eloss_HeProton"
delimiter = '\t'
# Number of header lines to skip
skiprows = 0
data = pd.read_csv(
filename,
delimiter=delimiter,
skiprows=skiprows,
comment='#',
header=None
)
# Extract columns
data = data.dropna()
data[0] = pd.to_numeric(data[0], errors='coerce')
data[1] = pd.to_numeric(data[1], errors='coerce')
data = data.dropna()
E = np.array(data[0], dtype=float)
S_mass = np.array(data[1], dtype=float)
# Convert:
# (MeV cm^2/g) * (g/cm^3) = MeV/cm
S_linear = S_mass * density
sort_idx = np.argsort(E)[::-1]
E = E[sort_idx]
S_linear = S_linear[sort_idx]
invS = 1.0 / S_linear
x = cumulative_trapezoid(
invS,
E,
initial=0
)
x = -x
E_of_x = interp1d(
x,
E,
bounds_error=False,
fill_value=0.0
)
x_of_E = interp1d(
E,
x,
bounds_error=False,
fill_value="extrapolate"
)
output = pd.DataFrame({
"Distance_cm": x,
"Energy_MeV": E
})
output.to_csv("/home/jamesszalkie/anasen/ELoss/E_vs_x_heavy", index=False, sep='\t')
print("Saved E(x) dataset to:")
print("/home/jamesszalkie/anasen/ELoss/E_vs_x_heavy")
initial_energy = 10.0 # MeV
distance = 5.0 # cm
remaining_energy = E_of_x(distance)
print("\nExample:")
print(f"Initial Energy: {initial_energy:.3f} MeV")
print(f"Distance traveled: {distance:.3f} cm")
print(f"Remaining energy: {remaining_energy:.3f} MeV")
plt.figure(figsize=(8,6))
plt.plot(x, E)
plt.xlabel("Distance in Helium (cm)")
plt.ylabel("Proton Energy (MeV)")
plt.title("Proton Energy Loss in Helium")
plt.grid(True)
plt.show()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

113
eloss_calculations/Eloss.py Normal file
View File

@ -0,0 +1,113 @@
import pycatima as catima
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy.integrate import cumulative_trapezoid
import matplotlib.pyplot as plt
# --- 1. Constants ---
P_TORR = 400
TEMP_K = 293.15
R = 8.3144
MEV2U = 1.0 / 931.494
# Gas Density Calculations
p_pa = P_TORR * 133.322
molar_density = p_pa / (R * TEMP_K)
m_he, m_c, m_o= 4.0026, 12.0000, 15.9949
m_mix_avg = (0.96 * m_he) + (0.04 * (m_c + 2*m_o))
rho_g_cm3 = (molar_density * m_mix_avg) / 1e6
print(f"Gas density at {P_TORR} Torr: {rho_g_cm3:.6e} g/cm^3")
# --- 2. Material & Step Setup ---
material_def = [(m_he, 2, 0.96), (m_c, 6, 0.04), (m_o, 8, 0.08)] # 96% He, 4% C, 8% O by number (adjust as needed)
gas_mix = catima.Material(material_def)
gas_mix.density(rho_g_cm3)
# Thickness step settings
step_mg_cm2 = 0.001 # 1 ug/cm2 steps as per your example
step_g_cm2 = step_mg_cm2 / 1000.0
max_steps = 1000000000 # Adjust based on how far you want to track
def generate_lookup(z, mass_u, e_start_mev, label): # Function to generate lookup table for a given projectile
filename = f"{label}_lookup_{e_start_mev}MeV.dat"
projectile = catima.Projectile(mass_u, z)
current_e_total = e_start_mev
current_thickness_g_cm2 = 0.0
output = []
header = f"Energy(MeV) \tmg/cm2 \tcm\nStarting Energy: {e_start_mev} MeV"
for i in range(max_steps):
# 1. Record current state
dist_cm = current_thickness_g_cm2 / rho_g_cm3
output.append([current_e_total, current_thickness_g_cm2 * 1000.0, dist_cm])
# 2. Calculate energy loss for the NEXT step
e_u = current_e_total / mass_u
if e_u < 0.0001: # Stop at ATIMA limit
break
projectile.T(e_u)
# dedx returns MeV / (g/cm2)
loss_mev = catima.dedx(projectile, gas_mix) * step_g_cm2
# 3. Update values
current_e_total -= loss_mev
current_thickness_g_cm2 += step_g_cm2
np.savetxt(filename, output, fmt='%.6f', delimiter='\t', header=header)
print(f"Lookup table created: {filename}")
# --- 3. Run ---
# Format: generate_lookup(Z, mass_u, E_start_MeV, label)
generate_lookup(1, 1.0078, 20, "proton") # Example for proton, arguments: Z=1, mass_u=1.0078, E_start=20 MeV
generate_lookup(2, 4.0026, 20, "alpha") # Example for alpha, arguments: Z=2, mass_u=4.0026, E_start=20 MeV
generate_lookup(13,26.9815, 80, "aluminum") # Example for aluminum, arguments: Z=13, mass_u=26.9815, E_start=80 MeV
generate_lookup(9,17.0021, 70, "fluorine") # Example for fluorine, arguments: Z=9, mass_u=17.0021, E_start=70 MeV
generate_lookup(8,15.9949, 70, "oxygen") # Example for oxygen, arguments: Z=8, mass_u=15.9949, E_start=70 MeV
#data is output in format: Energy(MeV) \tmg/cm2 \tcm. To convert to E(x), you can use the cumulative energy
#loss to get distance as a function of energy, then invert that relationship to get energy as a function of distance.
#This is done in the EvXconverter.py script.
def EofXconverter(filename, density):
# Load data
data = pd.read_csv(filename, comment='#', delim_whitespace=True, header=None)
data = data.dropna()
data[0] = pd.to_numeric(data[0], errors='coerce')
data[1] = pd.to_numeric(data[1], errors='coerce')
data = data.dropna()
E = np.array(data[0], dtype=float)
S_mass = np.array(data[1], dtype=float)
S_linear = S_mass * density
sort_idx = np.argsort(E)[::-1]
E = E[sort_idx]
S_linear = S_linear[sort_idx]
invS = 1.0 / S_linear
x = cumulative_trapezoid(invS, E, initial=0)
x = -x
output = pd.DataFrame({
"Distance_cm": x,
"Energy_MeV": E
})
return output
#Put EofX converter into a txt file for use in the Armory and to generate the E(x) dataset for plotting.
def save_EofX_to_file(filename, density, output_filename):
output = EofXconverter(filename, density)
output.to_csv(output_filename, index=False, sep='\t')
print(f"Saved E(x) dataset to: {output_filename}")
EofXconverter("/home/jamesszalkie/anasen/eloss_calculations/proton_lookup_20MeV.dat", rho_g_cm3)
save_EofX_to_file("/home/jamesszalkie/anasen/eloss_calculations/proton_lookup_20MeV.dat", rho_g_cm3, "/home/jamesszalkie/anasen/eloss_calculations/E_vs_x_proton")
EofXconverter("/home/jamesszalkie/anasen/eloss_calculations/alpha_lookup_20MeV.dat", rho_g_cm3)
save_EofX_to_file("/home/jamesszalkie/anasen/eloss_calculations/alpha_lookup_20MeV.dat", rho_g_cm3, "/home/jamesszalkie/anasen/eloss_calculations/E_vs_x_alpha")
EofXconverter("/home/jamesszalkie/anasen/eloss_calculations/aluminum_lookup_80MeV.dat", rho_g_cm3)
save_EofX_to_file("/home/jamesszalkie/anasen/eloss_calculations/aluminum_lookup_80MeV.dat", rho_g_cm3, "/home/jamesszalkie/anasen/eloss_calculations/E_vs_x_aluminum")
EofXconverter("/home/jamesszalkie/anasen/eloss_calculations/fluorine_lookup_70MeV.dat", rho_g_cm3)
save_EofX_to_file("/home/jamesszalkie/anasen/eloss_calculations/fluorine_lookup_70MeV.dat", rho_g_cm3, "/home/jamesszalkie/anasen/eloss_calculations/E_vs_x_fluorine")
EofXconverter("/home/jamesszalkie/anasen/eloss_calculations/oxygen_lookup_70MeV.dat", rho_g_cm3)
save_EofX_to_file("/home/jamesszalkie/anasen/eloss_calculations/oxygen_lookup_70MeV.dat", rho_g_cm3, "/home/jamesszalkie/anasen/eloss_calculations/E_vs_x_oxygen")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
#include "/home/sud/Desktop/Software2/propagator/elastcaller.h"
void make_eloss_table_protons() {
double einput = 20.0, estepnow;
double target_thickness_unit = 4e-2; //mg/cm2.
double density = 0.0711;//mg/cm3
long i=0;
while(einput > 0.001) {
std::cout << "After " << i << " steps, 1H is at " << einput << " MeV after penetrating " << i*target_thickness_unit << " mg/cm2 " << i*target_thickness_unit/density << " cm of HeCO2" << std::endl;
estepnow = slowmedown("1H",einput,"3(12C)6(16O)97(4He)",target_thickness_unit);
einput = estepnow;
i+=1;
}
}
void make_eloss_table() {
double einput = 20.0, estepnow;
double target_thickness_unit = 1e-3; //mg/cm2.
double density = 0.0711;//mg/cm3
long i=0;
while(einput > 0.001) {
std::cout << "After " << i << " steps, 4He is at " << einput << " MeV after penetrating " << i*target_thickness_unit << " mg/cm2 " << i*target_thickness_unit/density << " cm of HeCO2" << std::endl;
estepnow = slowmedown("4He",einput,"3(12C)6(16O)97(4He)",target_thickness_unit);
einput = estepnow;
i+=1;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff