Commit 13f466e062a3d0983c0cba05e867112145d0ef69

Authored by Jürgen Knödlseder
1 parent f78e0b8a

Avoid printing of blank lines.

The usage of the gammalib::reduce(chatter) function led to blank lines. Now we check if we're higher then TERSE before calling the print() methods with gammalib::reduce(chatter).
inst/lat/src/GLATLtCube.cpp
... ... @@ -451,9 +451,11 @@ std::string GLATLtCube::print(const GChatter& chatter) const
451 451 result.append("=== GLATLtCube ===");
452 452  
453 453 // Append information
454   - result.append("\n"+m_exposure.print(gammalib::reduce(chatter)));
455   - result.append("\n"+m_weighted_exposure.print(gammalib::reduce(chatter)));
456   - result.append("\n"+m_gti.print(gammalib::reduce(chatter)));
  454 + if (chatter > TERSE) {
  455 + result.append("\n"+m_exposure.print(gammalib::reduce(chatter)));
  456 + result.append("\n"+m_weighted_exposure.print(gammalib::reduce(chatter)));
  457 + result.append("\n"+m_gti.print(gammalib::reduce(chatter)));
  458 + }
457 459  
458 460 } // endif: chatter was not silent
459 461  
... ...
inst/lat/src/GLATResponse.cpp
... ... @@ -722,13 +722,15 @@ std::string GLATResponse::print(const GChatter& chatter) const
722 722 else {
723 723 result.append("unknown");
724 724 }
725   - for (int i = 0; i < size(); ++i) {
726   - result.append("\n"+m_aeff[i]->print(gammalib::reduce(chatter)));
727   - result.append("\n"+m_psf[i]->print(gammalib::reduce(chatter)));
728   - result.append("\n"+m_edisp[i]->print(gammalib::reduce(chatter)));
729   - }
730   - for (int i = 0; i < m_ptsrc.size(); ++i) {
731   - result.append("\n"+m_ptsrc[i]->print(gammalib::reduce(chatter)));
  725 + if (chatter > TERSE) {
  726 + for (int i = 0; i < size(); ++i) {
  727 + result.append("\n"+m_aeff[i]->print(gammalib::reduce(chatter)));
  728 + result.append("\n"+m_psf[i]->print(gammalib::reduce(chatter)));
  729 + result.append("\n"+m_edisp[i]->print(gammalib::reduce(chatter)));
  730 + }
  731 + for (int i = 0; i < m_ptsrc.size(); ++i) {
  732 + result.append("\n"+m_ptsrc[i]->print(gammalib::reduce(chatter)));
  733 + }
732 734 }
733 735  
734 736 } // endif: chatter was not silent
... ...