Commit 36a07ff6 authored by Christian Brabetz's avatar Christian Brabetz
Browse files

added GPL.

parent 1311c1c1
This diff is collapsed.
RCF EnergyLoss GUI is a collaborative project released under the
GNU General Public License v3. We would like to recognize the
following names for their contribution to the product.
* Christian Brabetz <c.brabetz@gsi.de>
* K.A. Flippo
* Marius Schollmeier
* Oliver Deppert
\ No newline at end of file
function varargout = RCF_energyloss_GUI(varargin)
% RCF_energyloss_GUI
%
% Purpose: Calculate the energy deposition of laser-accelerated protons in Radiochromic Film detector stacks.
% The code uses tables for the energy loss produced by the SRIM code package.
% See http://www.srim.org for details about SRIM.
% Copyright (C) 2013,2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% Authors: O. Deppert, C. Brabetz, S.Busold, M. Schollmeier, F. Nuernberg, K.A. Flippo
%
% Email: O.Deppert@gsi.de, C.Brabetz@gsi.de, m.schollmeier@gmx.net, f.nuernberg@gsi.de
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% Copyright: January 2013
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
% Update: 27. April 2016, CB, RCF config as plain text output ...
% Update: 02. September 2019, CB, progress Monitor off, Ver 2.2
......
......@@ -2,6 +2,33 @@
RCF_EnergyLoss_GUI Matlab routines for calculating energy loss of protons/deuterons in given materials.
## License and copyright information
### License
RCF Spectrum GUI is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
long with this program. If not, see <https://www.gnu.org/licenses/>.
### Copyright owners
RCF Spectrum GUI contributors, including those listed in the CREDITS file, hold the
copyright to this work.
### Additional license information
Some components of RCF Spectrum GUI imported from other projects may be under other
Free and Open Source, or Free Culture, licenses. Specific details of their
licensing information can be found in those components.
## Getting Started
Einfach jemand fragen der sich damit auskennt.
......
/*write stuff back to output pointer
* Copyright (C) 2021 by it's contributors.
* Some rights reserved. See COPYING, CREDITS.
*
* This file is part of RCF Energyloss GUI.
*
* RCF Energyloss GUI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* long with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "mex.h"
#include "matrix.h"
#include <math.h>
......
function [E_new, E_stop_front, E_stop_back] = elo_CR39(E_new, H_in_CR39, projmass)
% Routine to calculate the energyloss and energydeposition in 1.1 mm CR-39
thickness_front = 100; % um
thickness_middle = 900; % um
thickness_back = 100; % um
tmp = elo(E_new, thickness_front, H_in_CR39.x, H_in_CR39.c, H_in_CR39.crange, H_in_CR39.xrangeinv, H_in_CR39.crangeinv, H_in_CR39.k, H_in_CR39.Nele, H_in_CR39.Zeff, H_in_CR39.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop_front = mean(tmp(:,2));
tmp = elo(E_new, thickness_middle, H_in_CR39.x, H_in_CR39.c, H_in_CR39.crange, H_in_CR39.xrangeinv, H_in_CR39.crangeinv, H_in_CR39.k, H_in_CR39.Nele, H_in_CR39.Zeff, H_in_CR39.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_back, H_in_CR39.x, H_in_CR39.c, H_in_CR39.crange, H_in_CR39.xrangeinv, H_in_CR39.crangeinv, H_in_CR39.k, H_in_CR39.Nele, H_in_CR39.Zeff, H_in_CR39.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop_back = mean(tmp(:,2));
% Routine to calculate the energyloss and energydeposition in 1.1 mm CR-39
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
thickness_front = 100; % um
thickness_middle = 900; % um
thickness_back = 100; % um
tmp = elo(E_new, thickness_front, H_in_CR39.x, H_in_CR39.c, H_in_CR39.crange, H_in_CR39.xrangeinv, H_in_CR39.crangeinv, H_in_CR39.k, H_in_CR39.Nele, H_in_CR39.Zeff, H_in_CR39.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop_front = mean(tmp(:,2));
tmp = elo(E_new, thickness_middle, H_in_CR39.x, H_in_CR39.c, H_in_CR39.crange, H_in_CR39.xrangeinv, H_in_CR39.crangeinv, H_in_CR39.k, H_in_CR39.Nele, H_in_CR39.Zeff, H_in_CR39.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_back, H_in_CR39.x, H_in_CR39.c, H_in_CR39.crange, H_in_CR39.xrangeinv, H_in_CR39.crangeinv, H_in_CR39.k, H_in_CR39.Nele, H_in_CR39.Zeff, H_in_CR39.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop_back = mean(tmp(:,2));
end
\ No newline at end of file
function [E_new, E_stop, E_stop_corr] = elo_DHv2(E_new, H_in_Active, H_in_Poly, projmass)
% Routine to calculate the energyloss and energydeposition in HDv2 in
% reverse order.
% 14.01.2020
thickness_poly_hdv2 = 96; %microns
thickness_active_hdv2 = 8; %microns
tmp = elo(E_new, thickness_poly_hdv2, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
% Routine to calculate the energyloss and energydeposition in HDv2 in
% reverse order.
% 14.01.2020
tmp = elo(E_new, thickness_active_hdv2, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
thickness_poly_hdv2 = 96; %microns
thickness_active_hdv2 = 8; %microns
tmp = elo(E_new, thickness_poly_hdv2, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_hdv2, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
end
\ No newline at end of file
function [E_new, E_stop, E_stop_corr] = elo_EBT3(E_new, H_in_Poly, H_in_ActiveEBT3, projmass)
% Routine to calculate the energyloss and energydeposition in EBT3
thickness_poly_ebt3 = 125; % microns
thickness_active_ebt3 = 28; % microns
% Routine to calculate the energyloss and energydeposition in EBT3
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
tmp = elo(E_new, thickness_poly_ebt3, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
%assume same correction like active layer in HD => needs to be checked
%experimentaly
tmp = elo(E_new, thickness_active_ebt3, H_in_ActiveEBT3.x, H_in_ActiveEBT3.c, H_in_ActiveEBT3.crange, H_in_ActiveEBT3.xrangeinv, H_in_ActiveEBT3.crangeinv, H_in_ActiveEBT3.k, H_in_ActiveEBT3.Nele, H_in_ActiveEBT3.Zeff, H_in_ActiveEBT3.Ieff, projmass, 1, H_in_ActiveEBT3.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_ebt3, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
thickness_poly_ebt3 = 125; % microns
thickness_active_ebt3 = 28; % microns
tmp = elo(E_new, thickness_poly_ebt3, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
%assume same correction like active layer in HD => needs to be checked
%experimentaly
tmp = elo(E_new, thickness_active_ebt3, H_in_ActiveEBT3.x, H_in_ActiveEBT3.c, H_in_ActiveEBT3.crange, H_in_ActiveEBT3.xrangeinv, H_in_ActiveEBT3.crangeinv, H_in_ActiveEBT3.k, H_in_ActiveEBT3.Nele, H_in_ActiveEBT3.Zeff, H_in_ActiveEBT3.Ieff, projmass, 1, H_in_ActiveEBT3.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_ebt3, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
end
function [E_new, E_stop, E_stop_corr] = elo_EBT3half(E_new, H_in_Poly, H_in_ActiveEBT3, projmass)
% Routine to calculate the energyloss and energydeposition in EBT3
thickness_poly_ebt3 = 125; % microns
thickness_active_ebt3 = 28; % microns
% Routine to calculate the energyloss and energydeposition in EBT3
%assume same correction like active layer in HD => needs to be checked
%experimentaly
tmp = elo(E_new, thickness_active_ebt3, H_in_ActiveEBT3.x, H_in_ActiveEBT3.c, H_in_ActiveEBT3.crange, H_in_ActiveEBT3.xrangeinv, H_in_ActiveEBT3.crangeinv, H_in_ActiveEBT3.k, H_in_ActiveEBT3.Nele, H_in_ActiveEBT3.Zeff, H_in_ActiveEBT3.Ieff, projmass, 1, H_in_ActiveEBT3.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_ebt3, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
thickness_poly_ebt3 = 125; % microns
thickness_active_ebt3 = 28; % microns
%assume same correction like active layer in HD => needs to be checked
%experimentaly
tmp = elo(E_new, thickness_active_ebt3, H_in_ActiveEBT3.x, H_in_ActiveEBT3.c, H_in_ActiveEBT3.crange, H_in_ActiveEBT3.xrangeinv, H_in_ActiveEBT3.crangeinv, H_in_ActiveEBT3.k, H_in_ActiveEBT3.Nele, H_in_ActiveEBT3.Zeff, H_in_ActiveEBT3.Ieff, projmass, 1, H_in_ActiveEBT3.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_ebt3, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
end
function [E_new, E_stop, E_stop_corr] = elo_HD810(E_new, H_in_Gel, H_in_Active, H_in_Poly, projmass)
% Routine to calculate the energyloss and energydeposition in HD810
% Routine to calculate the energyloss and energydeposition in HD810
thickness_poly_hd = 96.52; %microns
thickness_gel_hd = 0.75; %microns
thickness_active_hd = 6.50; %microns
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
tmp = elo(E_new, thickness_gel_hd, H_in_Gel.x, H_in_Gel.c, H_in_Gel.crange, H_in_Gel.xrangeinv, H_in_Gel.crangeinv, H_in_Gel.k, H_in_Gel.Nele, H_in_Gel.Zeff, H_in_Gel.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_hd, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hd, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
thickness_poly_hd = 96.52; %microns
thickness_gel_hd = 0.75; %microns
thickness_active_hd = 6.50; %microns
tmp = elo(E_new, thickness_gel_hd, H_in_Gel.x, H_in_Gel.c, H_in_Gel.crange, H_in_Gel.xrangeinv, H_in_Gel.crangeinv, H_in_Gel.k, H_in_Gel.Nele, H_in_Gel.Zeff, H_in_Gel.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_hd, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hd, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
end
\ No newline at end of file
function [E_new, E_stop, E_stop_corr] = elo_HD810v2(E_new, H_in_Active, H_in_Poly, projmass)
% Routine to calculate the energyloss and energydeposition in HD810V2
thickness_poly_hdv2 = 96; %microns
thickness_active_hdv2 = 8; %microns
tmp = elo(E_new, thickness_active_hdv2, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hdv2, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
% Routine to calculate the energyloss and energydeposition in HD810V2
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
thickness_poly_hdv2 = 96; %microns
thickness_active_hdv2 = 8; %microns
tmp = elo(E_new, thickness_active_hdv2, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hdv2, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
end
\ No newline at end of file
function [E_new, E_stop, E_stop_corr] = elo_HDv2(E_new, H_in_Active, H_in_Poly, projmass)
% Routine to calculate the energyloss and energydeposition in HDv2
% 14.01.2020
thickness_poly_hdv2 = 97; %microns
thickness_active_hdv2 = 12; %microns
tmp = elo(E_new, thickness_active_hdv2, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hdv2, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
% Routine to calculate the energyloss and energydeposition in HDv2
% 14.01.2020
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
thickness_poly_hdv2 = 97; %microns
thickness_active_hdv2 = 12; %microns
tmp = elo(E_new, thickness_active_hdv2, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hdv2, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
end
\ No newline at end of file
function [E_new, E_stop, E_stop_corr] = elo_HS(E_new, H_in_Poly, H_in_Active, projmass)
% Routine to calculate the energyloss and energydeposition in HS
thickness_poly_hs = 96.53;
thickness_active_hs = 40;
% Routine to calculate the energyloss and energydeposition in HS
tmp = elo(E_new, thickness_poly_hs, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_hs, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hs, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
thickness_poly_hs = 96.53;
thickness_active_hs = 40;
tmp = elo(E_new, thickness_poly_hs, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_hs, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
E_stop_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_hs, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
end
\ No newline at end of file
function [E_new, E_stop] = elo_LANEX(E_new, H_in_LANEX, projmass)
% Routine to calculate the energyloss and energydeposition in LANEX Regular
% calculates stopping in total LANEX regular equivalent SiN
%LANEX 12 mils thick .3048 mm(measured with caliper)
%LANEX fine @ effect density of ~3.1 g/cm^3
%544nm light peak, Gd2O2S:Tb, 7.3 g/cm^3 effective thickness= 33.7 mg/cm^2 Chapter3 and 4 of University
%of Grongingen NL, http://dissertations.ub.rug.nl/FILES/faculties/science/1998/s.n.boon/
% Routine to calculate the energyloss and energydeposition in LANEX Regular
% calculates stopping in total LANEX regular equivalent SiN
%LANEX 12 mils thick .3048 mm(measured with caliper)
%LANEX fine @ effect density of ~3.1 g/cm^3
%544nm light peak, Gd2O2S:Tb, 7.3 g/cm^3 effective thickness= 33.7 mg/cm^2 Chapter3 and 4 of University
%of Grongingen NL, http://dissertations.ub.rug.nl/FILES/faculties/science/1998/s.n.boon/
thickness_LANEX = 324.8;% active Gd_2 O_2 S:Tb layer is measured to be 324.8 um thick with polystyrene backing 44.8 um (plastic side was away from stack)
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% long with this program. If not, see <https://www.gnu.org/licenses/>.
tmp = elo(E_new, thickness_LANEX, H_in_LANEX.x, H_in_LANEX.c, H_in_LANEX.crange, H_in_LANEX.xrangeinv, H_in_LANEX.crangeinv, H_in_LANEX.k, H_in_LANEX.Nele, H_in_LANEX.Zeff, H_in_LANEX.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
thickness_LANEX = 324.8;% active Gd_2 O_2 S:Tb layer is measured to be 324.8 um thick with polystyrene backing 44.8 um (plastic side was away from stack)
tmp = elo(E_new, thickness_LANEX, H_in_LANEX.x, H_in_LANEX.c, H_in_LANEX.crange, H_in_LANEX.xrangeinv, H_in_LANEX.crangeinv, H_in_LANEX.k, H_in_LANEX.Nele, H_in_LANEX.Zeff, H_in_LANEX.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop = mean(tmp(:,2));
end
\ No newline at end of file
function [E_new, E_stop, E_stop_corr] = elo_MD55(E_new, H_in_Poly, H_in_Active, H_in_Adhesive, projmass)
% Routine to calculate the energyloss and energydeposition in MD55
thickness_poly_md = 67.31;
thickness_active_md = 16;
thickness_adhesive_md = 20;
thickness_polymiddle_md = 25;
tmp = elo(E_new, thickness_poly_md, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_md, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
Estop1 = mean(tmp(:,2));
E_stop1_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_adhesive_md, H_in_Adhesive.x, H_in_Adhesive.c, H_in_Adhesive.crange, H_in_Adhesive.xrangeinv, H_in_Adhesive.crangeinv, H_in_Adhesive.k, H_in_Adhesive.Nele, H_in_Adhesive.Zeff, H_in_Adhesive.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_polymiddle_md, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_adhesive_md, H_in_Adhesive.x, H_in_Adhesive.c, H_in_Adhesive.crange, H_in_Adhesive.xrangeinv, H_in_Adhesive.crangeinv, H_in_Adhesive.k, H_in_Adhesive.Nele, H_in_Adhesive.Zeff, H_in_Adhesive.Ieff, projmass, 0);
E_new = tmp(:,1);
tmp = elo(E_new, thickness_active_md, H_in_Active.x, H_in_Active.c, H_in_Active.crange, H_in_Active.xrangeinv, H_in_Active.crangeinv, H_in_Active.k, H_in_Active.Nele, H_in_Active.Zeff, H_in_Active.Ieff, projmass, 1, H_in_Active.ccorr);
E_new = tmp(:,1);
Estop2 = mean(tmp(:,2));
E_stop2_corr = mean(tmp(:,3));
tmp = elo(E_new, thickness_poly_md, H_in_Poly.x, H_in_Poly.c, H_in_Poly.crange, H_in_Poly.xrangeinv, H_in_Poly.crangeinv, H_in_Poly.k, H_in_Poly.Nele, H_in_Poly.Zeff, H_in_Poly.Ieff, projmass, 0);
E_new = tmp(:,1);
E_stop = Estop1+Estop2;
E_stop_corr = E_stop1_corr+E_stop2_corr;
% Routine to calculate the energyloss and energydeposition in MD550
% Copyright (C) 2021 by it's contributors.
% Some rights reserved. See COPYING, CREDITS.
%
% This file is part of RCF Energyloss GUI.
%
% RCF Energyloss GUI is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or