@@ -94,7 +94,7 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
94
94
95
95
FanProjData model_fan_data;
96
96
FanProjData fan_data;
97
- std::cout << " Allocating ..." << std::endl ;
97
+ info ( " Allocating memory ..." , 3 ) ;
98
98
DetectorEfficiencies data_fan_sums (IndexRange2D (num_physical_rings, num_physical_detectors_per_ring));
99
99
DetectorEfficiencies efficiencies (IndexRange2D (num_physical_rings, num_physical_detectors_per_ring));
100
100
@@ -151,9 +151,8 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
151
151
model_fan_data_sum += *local_model_fan_data_sum[i];
152
152
153
153
local_model_fan_data_sum.clear ();
154
- std::cout << " Model sum: " << model_fan_data_sum << std::endl ;
154
+ info ( " Model sum of fan data: " + std::to_string (model_fan_data_sum), 3 ) ;
155
155
}
156
- std::cout << " >>><<<: " << std::endl;
157
156
{
158
157
// next could be local if KL is not computed below
159
158
FanProjData measured_fan_data;
@@ -196,16 +195,16 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
196
195
// to avoid divisions by zero.
197
196
data_fan_sum = make_all_fan_data_from_cache (measured_fan_data, measured_data, model_fan_data);
198
197
float dd = data_fan_sums.find_max ();
199
- std::cout << " Data fan sum max " << dd << std::endl ;
198
+ info ( " Data fan sum max: " + std::to_string (dd), 3 ) ;
200
199
threshold_for_KL =dd / 100000000 .F ;
201
200
202
- std::cout << " 1. Making fan sum data .. " << std::endl ;
201
+ info ( " 1. Making fan sum data .. " , 3 ) ;
203
202
make_fan_sum_data (data_fan_sums, measured_fan_data);
204
- std::cout << " fan sum data min/max " << data_fan_sums.find_min () << " " << data_fan_sums.find_max () << std::endl ;
203
+ info ( " fan sum data min/max " + std::to_string ( data_fan_sums.find_min ()) + " / " + std::to_string ( data_fan_sums.find_max ()), 3 ) ;
205
204
206
- std::cout << " 2. Making fan geo data .. " << std::endl ;
205
+ info ( " 2. Making fan geo data .. " , 3 ) ;
207
206
make_geo_data (measured_geo_data, measured_fan_data);
208
- std::cout << " measured_geo_data min/max " << measured_geo_data.find_min () << " " << measured_geo_data.find_max () << std::endl ;
207
+ info ( " measured_geo_data min/max " + std::to_string ( measured_geo_data.find_min ()) + " / " + std::to_string ( measured_geo_data.find_max ()), 3 ); ;
209
208
}
210
209
if (do_display && do_block)
211
210
display (measured_block_data, " raw block data from measurements" );
@@ -239,32 +238,31 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
239
238
std::cout << " Iteration number: " << iter_num << std::endl;
240
239
if (iter_num == 1 )
241
240
{
242
- std::cout << " Calculating sums: " << std::endl ;
241
+ info ( " Calculating sums om fan_data ... " , 3 ) ;
243
242
float value = sqrt (data_fan_sum / model_fan_data_sum);
244
- std::cout << " Ratio: " << value << std::endl ;
243
+ info ( " Ratio: " + std::to_string (value), 3 ) ;
245
244
efficiencies.fill (value);
246
- std::cout << " Finished sums." << std::endl;
247
245
norm_geo_data.fill (1 );
248
246
norm_block_data.fill (1 );
249
247
}
250
248
// efficiencies
251
249
{
252
- std::cout << " Copying model to fan_data..." << std::endl ;
250
+ info ( " Copying model to fan_data..." , 3 ) ;
253
251
fan_data = model_fan_data;
254
- std::cout << " Applying geo norm..." << std::endl ;
252
+ info ( " Applying geo norm..." , 3 ) ;
255
253
apply_geo_norm (fan_data, norm_geo_data);
256
254
if (do_block)
257
255
{
258
- std::cout << " Applying block norm..." << std::endl ;
256
+ info ( " Applying block norm..." , 3 ) ;
259
257
apply_block_norm (fan_data, norm_block_data);
260
258
}
261
259
if (do_display)
262
260
display (fan_data, " model*geo*block" );
263
261
for (int eff_iter_num = 1 ; eff_iter_num <= num_eff_iterations; ++eff_iter_num)
264
262
{
265
- std::cout << " Efficiency iteration number: " << iter_num << std::endl ;
263
+ info ( " Efficiency iteration number: " + std::to_string (iter_num), 3 ) ;
266
264
iterate_efficiencies (efficiencies, data_fan_sums, fan_data);
267
- std::cout << " Finished efficiency iteration number: " << iter_num << std::endl ;
265
+ info ( " Finished efficiency iteration" , 3 ) ;
268
266
{
269
267
char * out_filename = new char [out_filename_prefix.size () + 30 ];
270
268
sprintf (out_filename, " %s_%s_%d_%d.out" , out_filename_prefix.c_str (), " eff" , iter_num, eff_iter_num);
@@ -274,7 +272,7 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
274
272
}
275
273
if (do_KL)
276
274
{
277
- std::cout << " Calculating KL" << std::endl ;
275
+ info ( " Calculating KL" , 3 ) ;
278
276
apply_efficiencies (fan_data, efficiencies);
279
277
std::cerr << " measured*norm min " << measured_fan_data.find_min () << " ,max " << measured_fan_data.find_max ()
280
278
<< std::endl;
@@ -302,8 +300,8 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
302
300
}
303
301
} // end efficiencies
304
302
305
- std::cout << " geo norm" << std::endl ;
306
- std::cout << " Copying model to fan_data..." << std::endl ;
303
+ info ( " Starting geo norm" , 3 ) ;
304
+ info ( " Copying model to fan_data..." , 3 ) ;
307
305
fan_data = model_fan_data;
308
306
apply_efficiencies (fan_data, efficiencies);
309
307
if (do_block)
0 commit comments