Commit 830c9353d9dca7f418e827c9d7b61e130fef56b6

Authored by Simon Bonnefoy
Committed by Jürgen Knödlseder
1 parent 2ff10caa

small cleaning in the ctfindvar.cpp file (#2713)

Showing 1 changed file with 15 additions and 25 deletions
src/ctfindvar/ctfindvar.cpp
... ... @@ -302,7 +302,8 @@ void ctfindvar::run(void)
302 302 srcInxPix.push_back(src_map_index);
303 303 }
304 304  
305   - //preparing the histogram with significance evolution for the source center and the highest sig-pix
  305 + //preparing the histogram with significance evolution
  306 + //for the source center and the highest sig-pix
306 307 m_pixsigsrc = GNdarray(srcInxPix.size(), nbins);
307 308 m_pixsigmax = GNdarray(nbins);
308 309  
... ... @@ -324,7 +325,9 @@ void ctfindvar::run(void)
324 325 #ifdef G_DEBUG
325 326 if(pix_number%20==0)
326 327 {
327   - std::cout << "Pixel number " << pix_number << " has a total number of counts of: " << total_counts << std::endl;
  328 + std::cout << "Pixel number " << pix_number ;
  329 + std::cout << " has a total number of counts of: ";
  330 + std::cout << total_counts << std::endl;
328 331 }
329 332 #endif
330 333  
... ... @@ -341,9 +344,8 @@ void ctfindvar::run(void)
341 344 m_pixsigsrc(src,i) = pixSig(i);
342 345 }
343 346 #ifdef G_DEBUG
344   - std::cout << "checking pixel number of the source of interest" << pix_number << std::endl;
345   - std::cout << "checking pixel number " << pix_number << " with total number of counts of: " << total_counts << std::endl;
346   - std::cout << "number of counts in pixel of the source of interest" << total_counts << std::endl;
  347 + std::cout << "checking pixel of the source of interest: " << pix_number ;
  348 + std::cout << " with total number of counts of: " << total_counts << std::endl;
347 349 #endif
348 350 }
349 351 #ifdef G_DEBUG
... ... @@ -358,7 +360,9 @@ void ctfindvar::run(void)
358 360 }
359 361  
360 362 #ifdef G_DEBUG
361   - std::cout << "checking pixel number of the source of interest: " << pix_number << " - with total number of counts of: " << total_counts << std::endl;
  363 + std::cout << "checking pixel number of the source of interest: " ;
  364 + std::cout << pix_number << " - with total number of counts of: " ;
  365 + std::cout << total_counts << std::endl;
362 366 #endif
363 367  
364 368 // Getting the evolution for the pix with highest significance
... ... @@ -396,9 +400,9 @@ void ctfindvar::get_variability_sig(const int&amp; pix_number,
396 400 const int& nbins,
397 401 GNdarray& sig_histogram)
398 402 {
399   - std::vector<bool> accepted_bin_bckg_vector;
400   - std::vector<double> excess_bin_vector;
401   - int background_bin_array[nbins];
  403 + std::vector<bool> accepted_bin_bckg_vector(nbins, 1);
  404 + std::vector<double> excess_bin_vector(nbins, 0.0);
  405 + std::vector<int> background_bin_vector(nbins,0);
402 406 bool background_validated=false;
403 407 double non, noff;
404 408 double alpha, sig;
... ... @@ -407,13 +411,6 @@ void ctfindvar::get_variability_sig(const int&amp; pix_number,
407 411 std::vector<double> alpha_vector(nbins, 0.0);
408 412 fill_alpha_vector(pix_number, alpha_vector);
409 413  
410   - for (int i=0;i<nbins;i++)
411   - {
412   - background_bin_array[i]=0;
413   - accepted_bin_bckg_vector.push_back(1);
414   - excess_bin_vector.push_back(0);
415   - }
416   -
417 414 while (background_validated==false)
418 415 {
419 416 background_validated=true;
... ... @@ -441,9 +438,9 @@ void ctfindvar::get_variability_sig(const int&amp; pix_number,
441 438 }
442 439 }
443 440  
444   - background_bin_array[i] = background_count; //The background is averaged on the number of bins -1
  441 + background_bin_vector[i] = background_count; //The background is averaged on the number of bins -1
445 442 non = m_counts(pix_number, i);
446   - noff = background_bin_array[i];
  443 + noff = background_bin_vector[i];
447 444 alpha = 1.0/alpha;
448 445 // alpha = (alpha_vector[i]/alpha);
449 446  
... ... @@ -484,13 +481,6 @@ void ctfindvar::get_variability_sig(const int&amp; pix_number,
484 481 }
485 482  
486 483 }
487   - if (pix_number==19900)
488   - {
489   - for (int k=0;k<sig_histogram.size();k++)
490   - {
491   - std::cout << "value of the sig of the " << k << "th slice =" << sig_histogram(k) << std::endl;
492   - }
493   - }
494 484 }
495 485  
496 486  
... ...