Commit 31856847 authored by Christian Brabetz's avatar Christian Brabetz
Browse files

new HDv2 implemented as H4 - 12 micron active

small bug fixes
GUI updates
parent f0781ee1
function varargout = RCF_energyloss_GUI_2016(varargin)
% RCF_energyloss_GUI_2016
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.
......@@ -17,8 +17,8 @@ function varargout = RCF_energyloss_GUI_2016(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @RCF_energyloss_GUI_2016_OpeningFcn, ...
'gui_OutputFcn', @RCF_energyloss_GUI_2016_OutputFcn, ...
'gui_OpeningFcn', @RCF_energyloss_GUI_OpeningFcn, ...
'gui_OutputFcn', @RCF_energyloss_GUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
......@@ -32,15 +32,15 @@ else
end
% End initialization code - DO NOT EDIT
% --- Executes just before RCF_energyloss_GUI_2016 is made visible.
function RCF_energyloss_GUI_2016_OpeningFcn(hObject, eventdata, handles, varargin)
% --- Executes just before RCF_energyloss_GUI is made visible.
function RCF_energyloss_GUI_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to RCF_energyloss_GUI_2016 (see VARARGIN)
% varargin command line arguments to RCF_energyloss_GUI (see VARARGIN)
% Choose default command line output for RCF_energyloss_GUI_2016
% Choose default command line output for RCF_energyloss_GUI
handles.output = hObject;
set(handles.print_pushbutton,'Enable','Off');
......@@ -142,11 +142,11 @@ show_rcfstack(handles);
guidata(hObject, handles);
if closeit==1
close RCF_energyloss_GUI_2016
close RCF_energyloss_GUI
end
% --- Outputs from this function are returned to the command line.
function varargout = RCF_energyloss_GUI_2016_OutputFcn(hObject, eventdata, handles)
function varargout = RCF_energyloss_GUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
......@@ -413,7 +413,7 @@ elseif strcmp(user,'loaded')
show_message(handles,'file loaded succesfuly...everything seems to be ok...','blue');
elseif user~=0
close RCF_energyloss_GUI_2016
close RCF_energyloss_GUI
end
%first try => very old files
......@@ -799,6 +799,11 @@ if ~handles.parallel
v(1,i) = E;
v(2,i) = E_stop;
v(4,i) = E_stop_corr;
case 'H4'
[E_new, E_stop, E_stop_corr] = elo_HDv2(E_new, loss.([ion '_in_Active']), loss.([ion '_in_Poly']), projmass);
v(1,i) = E;
v(2,i) = E_stop;
v(4,i) = E_stop_corr;
otherwise
set(handles.out_text,'String','Unknown layer.')
break
......@@ -1048,6 +1053,9 @@ for i=1:length(handles.parameters.rcf_config)
case 'ES'
imgfile = ['icons/' 'ebt3half' '.png'];
mName = 'ES';
case 'H4'
imgfile = ['icons/' 'hdv4' '.png'];
mName = 'H4';
otherwise
set(handles.out_text,'String','Unknown layer.')
break
......@@ -1168,7 +1176,7 @@ for i=1:length(handles.parameters.rcf_config)
save(filename,'data', '-ascii', '-double');
end
j=j+1;
case {'HD','MD','M2','HS','H2','H3','E3','ES'}
case {'HD','MD','M2','HS','H2','H3','E3','ES','H4'}
corroffhdl=findobj('Tag', 'corroff');
corronhdl=findobj('Tag', 'corron');
if (get(corronhdl,'Value')==1)
......@@ -1214,6 +1222,9 @@ for i=1:length(handles.parameters.rcf_config)
j=j+1;
otherwise
set(handles.out_text,'String','Unknown layer.')
corroffhdl=findobj('Tag', 'corroff');
corronhdl=findobj('Tag', 'corron');
legend_text='Unknown layer';
break
end
end
......
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);
end
\ No newline at end of file
File added
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment