Commit debcf44ae288fda4d76ff2e5b2506821d5bdefde

Authored by Jürgen Knödlseder
1 parent ea908ec2

Show times in CTA time reference and correct indentation.

All times are now shown in the CTA time reference.

For time slice information, the indentation was corrected.
Showing 1 changed file with 22 additions and 13 deletions
src/ctobssim/ctobssim.cpp
@@ -650,8 +650,11 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models, @@ -650,8 +650,11 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels& models,
650 indent++; 650 indent++;
651 wrklog->indent(indent); 651 wrklog->indent(indent);
652 } 652 }
653 - *wrklog << parformat("Time interval");  
654 - *wrklog << tmin << " - " << tmax << std::endl; 653 + *wrklog << parformat("Time interval", indent);
  654 + *wrklog << tmin.convert(m_cta_ref);
  655 + *wrklog << " - ";
  656 + *wrklog << tmax.convert(m_cta_ref);
  657 + *wrklog << " s" << std::endl;
655 } 658 }
656 659
657 // Loop over all energy boundaries 660 // Loop over all energy boundaries
@@ -667,7 +670,7 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models, @@ -667,7 +670,7 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models,
667 indent++; 670 indent++;
668 wrklog->indent(indent); 671 wrklog->indent(indent);
669 } 672 }
670 - *wrklog << parformat("Energy range"); 673 + *wrklog << parformat("Energy range", indent);
671 *wrklog << emin << " - " << emax << std::endl; 674 *wrklog << emin << " - " << emax << std::endl;
672 } 675 }
673 676
@@ -675,7 +678,8 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models, @@ -675,7 +678,8 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models,
675 for (int i = 0; i < models.size(); ++i) { 678 for (int i = 0; i < models.size(); ++i) {
676 679
677 // Get sky model (NULL if not a sky model) 680 // Get sky model (NULL if not a sky model)
678 - const GModelSky* model = dynamic_cast<const GModelSky*>(models[i]); 681 + const GModelSky* model =
  682 + dynamic_cast<const GModelSky*>(models[i]);
679 683
680 // If we have a sky model then simulate photons 684 // If we have a sky model then simulate photons
681 if (model != NULL) { 685 if (model != NULL) {
@@ -704,9 +708,11 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models, @@ -704,9 +708,11 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models,
704 indent++; 708 indent++;
705 wrklog->indent(indent); 709 wrklog->indent(indent);
706 } 710 }
707 - *wrklog << parformat("Time slice");  
708 - *wrklog << tstart << " - " << tstop << std::endl;  
709 - 711 + *wrklog << parformat("Time slice", indent);
  712 + *wrklog << tstart.convert(m_cta_ref);
  713 + *wrklog << " - ";
  714 + *wrklog << tstop.convert(m_cta_ref);
  715 + *wrklog << " s" << std::endl;
710 } 716 }
711 717
712 // Get photons 718 // Get photons
@@ -749,13 +755,13 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models, @@ -749,13 +755,13 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models,
749 755
750 // Dump simulation results 756 // Dump simulation results
751 if (logNormal()) { 757 if (logNormal()) {
752 - *wrklog << parformat("MC source photons"); 758 + *wrklog << parformat("MC source photons", indent);
753 *wrklog << str(nphotons); 759 *wrklog << str(nphotons);
754 if (model->name().length() > 0) { 760 if (model->name().length() > 0) {
755 *wrklog << " [" << model->name() << "]"; 761 *wrklog << " [" << model->name() << "]";
756 } 762 }
757 *wrklog << std::endl; 763 *wrklog << std::endl;
758 - *wrklog << parformat("MC source events"); 764 + *wrklog << parformat("MC source events", indent);
759 *wrklog << str(events->size()); 765 *wrklog << str(events->size());
760 if (model->name().length() > 0) { 766 if (model->name().length() > 0) {
761 *wrklog << " [" << model->name() << "]"; 767 *wrklog << " [" << model->name() << "]";
@@ -770,7 +776,7 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models, @@ -770,7 +776,7 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models,
770 776
771 // Dump simulation results 777 // Dump simulation results
772 if (logNormal()) { 778 if (logNormal()) {
773 - *wrklog << parformat("MC source events"); 779 + *wrklog << parformat("MC source events", indent);
774 *wrklog << str(events->size()); 780 *wrklog << str(events->size());
775 *wrklog << " (all source models)"; 781 *wrklog << " (all source models)";
776 *wrklog << std::endl; 782 *wrklog << std::endl;
@@ -821,8 +827,10 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models, @@ -821,8 +827,10 @@ void ctobssim::simulate_source(GCTAObservation* obs, const GModels&amp; models,
821 * 827 *
822 * This method does nothing if the observation pointer is NULL. 828 * This method does nothing if the observation pointer is NULL.
823 ***************************************************************************/ 829 ***************************************************************************/
824 -void ctobssim::simulate_background(GCTAObservation* obs, const GModels& models,  
825 - GRan& ran, GLog* wrklog) 830 +void ctobssim::simulate_background(GCTAObservation* obs,
  831 + const GModels& models,
  832 + GRan& ran,
  833 + GLog* wrklog)
826 { 834 {
827 // Continue only if observation pointer is valid 835 // Continue only if observation pointer is valid
828 if (obs != NULL) { 836 if (obs != NULL) {
@@ -839,7 +847,8 @@ void ctobssim::simulate_background(GCTAObservation* obs, const GModels&amp; models, @@ -839,7 +847,8 @@ void ctobssim::simulate_background(GCTAObservation* obs, const GModels&amp; models,
839 } 847 }
840 848
841 // Get pointer on event list (circumvent const correctness) 849 // Get pointer on event list (circumvent const correctness)
842 - GCTAEventList* events = static_cast<GCTAEventList*>(const_cast<GEvents*>(obs->events())); 850 + GCTAEventList* events =
  851 + static_cast<GCTAEventList*>(const_cast<GEvents*>(obs->events()));
843 852
844 // Loop over all models 853 // Loop over all models
845 for (int i = 0; i < models.size(); ++i) { 854 for (int i = 0; i < models.size(); ++i) {