forked from Gleneral/d2o_analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd2o_run_loader.cc
210 lines (208 loc) · 5.74 KB
/
d2o_run_loader.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
//July 10, 2012
//Loads in runs based on run number specified
#include <iostream>
#include "d2o_globals.h"
void run_loader(int run)
{
int short_target;
switch (run)
{
case 142:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run142[ii]; //total experimental hits for detector ii
d_n[ii] = d_run142[ii];
flux = n_t_run142;
d_flux = d_n_t_run142;
n_sim[ii] = run142_sim[ii];
n_back_sub_sim[ii] = run142_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 143:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run143[ii]; //total experimental hits for detector ii
d_n[ii] = d_run143[ii];
flux = n_t_run143;
d_flux = d_n_t_run143;
n_sim[ii] = run143_sim[ii];
n_back_sub_sim[ii] = run143_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 149:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run149[ii]; //total experimental hits for detector ii
d_n[ii] = d_run149[ii];
flux = n_t_run149;
d_flux = d_n_t_run149;
n_sim[ii] = run149_sim[ii];
n_back_sub_sim[ii] = run149_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 150:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run150[ii]; //total experimental hits for detector ii
d_n[ii] = d_run150[ii];
flux = n_t_run150;
d_flux = d_n_t_run150;
n_sim[ii] = run150_sim[ii];
n_back_sub_sim[ii] = run150_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 152:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run152[ii]; //total experimental hits for detector ii
d_n[ii] = d_run152[ii];
flux = n_t_run152;
d_flux = d_n_t_run152;
n_sim[ii] = run152_sim[ii];
n_back_sub_sim[ii] = run152_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 153:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run153[ii]; //total experimental hits for detector ii
d_n[ii] = d_run153[ii];
flux = n_t_run153;
d_flux = d_n_t_run153;
n_sim[ii] = run153_sim[ii];
n_back_sub_sim[ii] = run153_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 154:
tar_length = long_tar; //this is a long target run
short_target = 0;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run154[ii]; //total experimental hits for detector ii
d_n[ii] = d_run154[ii];
flux = n_t_run154;
d_flux = d_n_t_run154;
n_sim[ii] = run154_sim[ii];
n_back_sub_sim[ii] = 0;
}
cout << "Loading run " << run << ".\n";
break;
case 155:
tar_length = short_tar; //this is a short target run
short_target = 1;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run155[ii]; //total experimental hits for detector ii
d_n[ii] = d_run155[ii];
flux = n_t_run155;
d_flux = d_n_t_run155;
n_sim[ii] = run155_sim[ii];
n_back_sub_sim[ii] = run155_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 157:
tar_length = short_tar; //this is a short target run
short_target = 1;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run157[ii]; //total experimental hits for detector ii
d_n[ii] = d_run157[ii];
flux = n_t_run157;
d_flux = d_n_t_run157;
n_sim[ii] = run157_sim[ii];
n_back_sub_sim[ii] = run157_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 158:
tar_length = short_tar; //this is a short target run
short_target = 1;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run158[ii]; //ttal experimental hits for detector ii
d_n[ii] = d_run158[ii];
flux = n_t_run158;
d_flux = d_n_t_run158;
n_sim[ii] = run158_sim[ii];
n_back_sub_sim[ii] = run158_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
case 159:
tar_length = short_tar; //this is a short target run
short_target = 1;
for(int ii = 0;ii < 88;ii++)
{
n[ii] = run159[ii]; //ttal experimental hits for detector ii
d_n[ii] = d_run159[ii];
flux = n_t_run159;
d_flux = d_n_t_run159;
n_sim[ii] = run159_sim[ii];
n_back_sub_sim[ii] = run159_back_sub_sim[ii];
}
cout << "Loading run " << run << ".\n";
break;
default:
cerr << "ERROR: run " << run << " not found.\n";
return;
}
//load in simulated data
if (short_target == 1)
{
for(int ii = 0;ii < 88;ii++)
{
a[ii] = a_short[ii];
b[ii] = b_short[ii];
c[ii] = c_short[ii];
d[ii] = d_short[ii];
e[ii] = e_short[ii];
f[ii] = f_short[ii];
g[ii] = g_short[ii];
h[ii] = h_short[ii];
i[ii] = i_short[ii];
j[ii] = j_short[ii];
k[ii] = k_short[ii];
l[ii] = l_short[ii];
}
cout << "Run " << run << " is a short target run. \n";
}
else
{
for(int ii = 0;ii < 88;ii++)
{
a[ii] = a_long[ii];
b[ii] = b_long[ii];
c[ii] = c_long[ii];
d[ii] = d_long[ii];
e[ii] = e_long[ii];
f[ii] = f_long[ii];
g[ii] = g_long[ii];
h[ii] = h_long[ii];
i[ii] = i_long[ii];
j[ii] = j_long[ii];
k[ii] = k_long[ii];
l[ii] = l_long[ii];
}
cout << "Run " << run << " is a long target run. \n";
}
return;
}