Commit 0c6d1c8b authored by Christian Brabetz's avatar Christian Brabetz
Browse files

added H2 in reverse as 2H.

parent ec5a6222
......@@ -513,7 +513,7 @@ for i=1:length(handles.parameters.rcf_config)
legend_text{col_index} = char([num2str(j,'%05.2d'),' - ',char(handles.parameters.rcf_config(i)),', ','E \approx ',num2str(handles.parameters.stoppingE(i),'%04.1f'),' MeV']);
j=j+1;
col_index=col_index+1;
case {'HD','MD','M2','HS','H2','H3','E3','LA','ES'}
case {'HD','MD','M2','HS','H2','H3','E3','LA','ES','2H'}
corroffhdl=findobj('Tag', 'corroff');
corronhdl=findobj('Tag', 'corron');
if (get(corronhdl,'Value')==1)
......@@ -551,7 +551,7 @@ for i=1:length(handles.parameters.rcf_config)
area(Edeposition(:,1,i),Edeposition(:,3,i),'FaceColor',[colors(col_index,:)],'EdgeColor',[colors(col_index,:)],'Linewidth',1)
j=j+1;
col_index=col_index+1;
case {'HD','MD','M2','HS','LA', 'H2', 'H3', 'E3', 'ES'}
case {'HD','MD','M2','HS','LA', 'H2', 'H3', 'E3', 'ES', '2H'}
area(Edeposition(:,1,i),Edeposition(:,2,i),'FaceColor',[colors(col_index,:)],'EdgeColor',[colors(col_index,:)],'Linewidth',1) %,'-','MarkerSize',5)
j=j+1;
col_index=col_index+1;
......@@ -789,6 +789,11 @@ if ~handles.parallel
v(1,i) = E;
v(2,i) = E_stop;
v(4,i) = E_stop_corr;
case '2H'
[E_new, E_stop, E_stop_corr] = elo_DHv2(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;
case 'E3'
[E_new, E_stop, E_stop_corr] = elo_EBT3(E_new, loss.([ion '_in_Poly']), loss.([ion '_in_ActiveEBT3']), projmass);
v(1,i) = E;
......@@ -876,6 +881,11 @@ elseif handles.parallel
v(1,i) = E;
v(2,i) = E_stop;
v(4,i) = E_stop_corr;
case '2H'
[E_new, E_stop, E_stop_corr] = elo_DHv2(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;
case 'E3'
[E_new, E_stop, E_stop_corr] = elo_EBT3(E_new, loss.([ion '_in_Poly']), loss.([ion '_in_ActiveEBT3']), projmass);
v(1,i) = E;
......@@ -1047,6 +1057,9 @@ for i=1:length(handles.parameters.rcf_config)
case 'H3'
imgfile = ['icons/' 'hd810v3' '.png'];
mName = 'H3';
case '2H'
imgfile = ['icons/' 'dhv2' '.png'];
mName = '2H';
case 'E3'
imgfile = ['icons/' 'ebt3' '.png'];
mName = 'E3';
......@@ -1162,7 +1175,7 @@ for i=1:length(handles.parameters.rcf_config)
data(:,:)=Edeposition(:,:,i);
save(filename,'data', '-ascii', '-double');
j=j+1; f=f+1;
case {'HD','MD','M2','HS','H2','H3','E3','ES','H4'}
case {'HD','MD','M2','HS','H2','H3','E3','ES','H4','2H'}
corroffhdl=findobj('Tag', 'corroff');
corronhdl=findobj('Tag', 'corron');
h1=plot(handles.parameters.stoppingE(i,1),handles.parameters.stoppingE(i,2),'ro','MarkerSize',10, 'LineWidth', 2.0);
......
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);
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
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