Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
ThicknessScan.m
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ThicknessScan.m
1
close all
2
clear all
3
4
% From Geant4 Material Scans
on
EMCal along without support and
electronics
,
e
.g.
5
%
6
%
g4
->
ApplyCommand
(
"/control/matScan/phi 1111 0 22.5 deg"
)
7
%
g4
->
ApplyCommand
(
"/control/matScan/theta 1111 1 70 deg"
)
8
%
g4
->
ApplyCommand
(
"/control/matScan/scan"
) ; > mat3.list
9
10
11
%
file
=
'mat2.list'
;
12
13
%
file
=
'mat.list'
;
14
%
n_scan
= 111;
15
16
file
=
'E:\tmp\Transfer Buffer\mat3.list'
;
17
n_scan
= 1111;
18
19
20
21
%%
22
23
Data
= zeros(
n_scan
*
n_scan
,5);
24
25
i
= 1;
26
27
fid
= fopen(
file
);
28
tline
= fgetl(
fid
);
29
while
ischar
(
tline
)
30
%
disp
(
tline
)
31
32
[A,n] = sscanf(
tline
,
'%f'
);
33
if
n
== 5
34
%
disp
(
A
);
35
36
Data
(
i
,:) =
A
';
37
i = i + 1;
38
39
elseif (strncmpi(tline,'
ave.
',5))
40
disp(tline)
41
end
42
43
44
tline = fgetl(fid);
45
46
end
47
fclose(fid);
48
49
50
assert(i-1 == n_scan*n_scan);
51
%%
52
Data = Data(Data(:,1)<54,:);
53
n_eta = size(Data,1)/n_scan;
54
55
56
%%
57
58
Theta = Data(:,1);
59
Phi_Deg = Data(:,2);
60
Length = Data(:,3);
61
x0 = Data(:,4);
62
lambda0 = Data(:,5);
63
64
%%
65
66
Theta = reshape(Theta,[],n_eta);
67
Phi_Deg = reshape(Phi_Deg,[],n_eta);
68
Length = reshape(Length,[],n_eta);
69
x0 = reshape(x0,[],n_eta);
70
lambda0 = reshape(lambda0,[],n_eta);
71
72
%%
73
74
Eta = -log(tan((90-Theta)/180*pi/2));
75
Phi_Rad = Phi_Deg/180*pi;
76
77
%%
78
79
figure('
name
','
2
D
','
PaperPositionMode
','
auto
', ...
80
'
position
',[100,0,1900,1000]) ;
81
82
subplot(1,2,1);
83
84
surf(Eta,Phi_Rad,x0);
85
86
xlabel('
\eta
','
FontSize
',18);
87
ylabel('
\phi [rad]
','
FontSize
',18);
88
zlabel('
Radiatiaon
Length
','
FontSize
',18);
89
90
91
subplot(1,2,2);
92
93
surf(Eta,Phi_Rad,lambda0);
94
95
xlabel('
\eta
','
FontSize
',18);
96
ylabel('
\phi [rad]
','
FontSize
',18);
97
zlabel('
Nuclear Interaction
Length
','
FontSize
',18);
98
99
%%
100
101
figure('
name
','
1
D
-Projections','
PaperPositionMode
','
auto
', ...
102
'
position
',[100,0,1900,1100]) ;
103
104
subplot
(2,2,1);
105
106
plot
(
mean
(
Eta
,1),
mean
(
x0
,1),
'LineWidth'
,2);
107
108
xlabel
(
'\eta'
,
'FontSize'
,18);
109
ylabel
(
'Radiatiaon Length'
,
'FontSize'
,18);
110
set
(gca,
'FontSize'
,16,
'XMinorTick'
,
'off'
,
'YMinorTick'
,
'off'
);
111
line
(
get
(gca,
'XLim'
),[18,18],
'Color'
,[.5 .5 .5]);
112
text
(
mean
(
get
(gca,
'XLim'
)),18,
'18 X_0'
,
'VerticalAlignment'
,
'top'
,
'FontSize'
,18,
'Color'
,[.5 .5 .5]);
113
114
set
(gca,
'YLim'
,[0,30]);
115
set
(gca,
'XLim'
,[0,1.2]);
116
117
text
(
mean
(
get
(gca,
'XLim'
)),
mean
(
get
(gca,
'YLim'
))*.2,...
118
sprintf(
'sPHENIX EMCal, average %.1f X_0'
,
mean
(
mean
(
x0
))),...
119
'HorizontalAlignment'
,
'center'
,
'FontSize'
,18);
120
121
122
subplot
(2,2,2);
123
124
plot
(
mean
(
Phi_Rad
,2),
mean
(
x0
,2),
'LineWidth'
,2);
125
126
xlim
=
get
(gca,
'XLim'
);
127
128
xlabel
(
'\phi [rad]'
,
'FontSize'
,18);
129
ylabel
(
'Radiatiaon Length'
,
'FontSize'
,18);
130
set
(gca,
'FontSize'
,16,
'XMinorTick'
,
'off'
,
'YMinorTick'
,
'off'
);
131
line
((
xlim
),[18,18],
'Color'
,[.5 .5 .5]);
132
text
(
mean
(
xlim
)*1.2,18,
'18 X_0'
,
'VerticalAlignment'
,
'top'
,
'FontSize'
,18,
'Color'
,[.5 .5 .5]);
133
134
135
set
(gca,
'YLim'
,[0,30]);
136
set
(gca,
'XLim'
,
xlim
);
137
138
subplot
(2,2,3);
139
140
plot
(
mean
(
Eta
,1),
mean
(
lambda0
,1),
'LineWidth'
,2);
141
142
xlabel
(
'\eta'
,
'FontSize'
,18);
143
ylabel
(
'Nuclear Interaction Length'
,
'FontSize'
,18);
144
set
(gca,
'FontSize'
,16,
'XMinorTick'
,
'off'
,
'YMinorTick'
,
'off'
);
145
146
line
(
get
(gca,
'XLim'
),[0.75,0.75],
'Color'
,[.5 .5 .5]);
147
text
(
mean
(
get
(gca,
'XLim'
)),0.75 ,
'0.75 \Lambda_0'
,
'VerticalAlignment'
,
'top'
,
'FontSize'
,18,
'Color'
,[.5 .5 .5]);
148
149
set
(gca,
'YLim'
,[0,1.5]);
150
set
(gca,
'XLim'
,[0,1.2]);
151
152
text
(
mean
(
get
(gca,
'XLim'
)),
mean
(
get
(gca,
'YLim'
))*.2,...
153
sprintf(
'sPHENIX EMCal, average %.1f \\Lambda_0'
,
mean
(
mean
(
lambda0
))),...
154
'HorizontalAlignment'
,
'center'
,
'FontSize'
,18);
155
156
subplot
(2,2,4);
157
158
plot
(
mean
(
Phi_Rad
,2),
mean
(
lambda0
,2),
'LineWidth'
,2);
159
160
xlabel
(
'\phi [rad]'
,
'FontSize'
,18);
161
ylabel
(
'Nuclear Interaction Length'
,
'FontSize'
,18);
162
set
(gca,
'YLim'
,[0,1.5]);
163
set
(gca,
'XLim'
,
xlim
);
164
set
(gca,
'FontSize'
,16,
'XMinorTick'
,
'off'
,
'YMinorTick'
,
'off'
);
165
166
line
((
xlim
),[.75,.75],
'Color'
,[.5 .5 .5]);
167
text
(
mean
(
xlim
)*1.2,0.75 ,
'0.75 \Lambda_0'
,
'VerticalAlignment'
,
'top'
,
'FontSize'
,18,
'Color'
,[.5 .5 .5]);
168
169
170
SaveCavas
(
file
,
gcf
);
171
172
173
%%
174
175
176
figure
(
'name'
,
'1D-Projections-RadiationLength'
,
'PaperPositionMode'
,
'auto'
, ...
177
'position'
,[100,0,800,600]) ;
178
179
180
plot
(
mean
(
Eta
,1),
mean
(
x0
,1),
'LineWidth'
,3);
181
182
xlabel
(
'\eta'
,
'FontSize'
,18);
183
ylabel
(
'Radiatiaon Length'
,
'FontSize'
,18);
184
set
(gca,
'FontSize'
,16,
'XMinorTick'
,
'off'
,
'YMinorTick'
,
'off'
);
185
line
(
get
(gca,
'XLim'
),[18,18],
'Color'
,[.5 .5 .5]);
186
text
(
mean
(
get
(gca,
'XLim'
)),18,
'18 X_0'
,
'VerticalAlignment'
,
'top'
,
'FontSize'
,18,
'Color'
,[.5 .5 .5]);
187
188
set
(gca,
'YLim'
,[0,30]);
189
set
(gca,
'XLim'
,[0,1.2]);
190
191
text
(
mean
(
get
(gca,
'XLim'
))*.1,
mean
(
get
(gca,
'YLim'
))*.6,...
192
sprintf(
'sPHENIX simulation\n2-D projective SPACAL EMCal\nThickness scan from vertex of (0,0,0) & averaged in \\phi\n\nAverage thickness = %.1f X_0, %.2f \\Lambda_0\nMin thickness = %.1f X_0, %.2f \\Lambda_0'
,...
193
mean
(
mean
(
x0
)),
mean
(
mean
(
lambda0
)),
min
(
mean
(
x0
,1)),
min
(
mean
(
lambda0
,1))),...
194
'HorizontalAlignment'
,
'left'
,
'FontSize'
,18);
195
196
197
SaveCavas
(
file
,
gcf
);
analysis
blob
master
EMCal-analysis
ThicknessScan
ThicknessScan.m
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:51
using
1.8.2 with
sPHENIX GitHub integration