Commit 4cf9b3ba40bb49f25db80c74335b84113dd951c0

Authored by Jürgen Knödlseder
1 parent bd02e31c

Integrate code.

Showing 1 changed file with 42 additions and 29 deletions
src/ctulimit/ctulimit.cpp
1 1 /***************************************************************************
2 2 * ctulimit - Upper limit calculation tool *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2015 by Michael Mayer *
  4 + * copyright (C) 2015-2016 by Michael Mayer *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -52,6 +52,8 @@
52 52  
53 53 /***********************************************************************//**
54 54 * @brief Void constructor
  55 + *
  56 + * Constructs an empty ctulimit tool.
55 57 ***************************************************************************/
56 58 ctulimit::ctulimit(void) : ctool(CTULIMIT_NAME, CTULIMIT_VERSION)
57 59 {
... ... @@ -68,8 +70,8 @@ ctulimit::ctulimit(void) : ctool(CTULIMIT_NAME, CTULIMIT_VERSION)
68 70 *
69 71 * param[in] obs Observation container.
70 72 *
71   - * This method creates an instance of the class by copying an existing
72   - * observations container.
  73 + * Constructs an instance of the ctulimit tool that will operate on the
  74 + * provided observation container.
73 75 ***************************************************************************/
74 76 ctulimit::ctulimit(const GObservations& obs) :
75 77 ctool(CTULIMIT_NAME, CTULIMIT_VERSION)
... ... @@ -91,6 +93,9 @@ ctulimit::ctulimit(const GObservations& obs) :
91 93 *
92 94 * @param[in] argc Number of arguments in command line.
93 95 * @param[in] argv Array of command line arguments.
  96 + *
  97 + * Constructs an instance of the ctulimit tool that will parse user
  98 + * parameters that are provided as command line arguments.
94 99 ***************************************************************************/
95 100 ctulimit::ctulimit(int argc, char *argv[]) :
96 101 ctool(CTULIMIT_NAME, CTULIMIT_VERSION, argc, argv)
... ... @@ -107,6 +112,9 @@ ctulimit::ctulimit(int argc, char *argv[]) :
107 112 * @brief Copy constructor
108 113 *
109 114 * @param[in] app Application.
  115 + *
  116 + * Constructs an instance of the ctulimit tool by copying information from
  117 + * another ctulimit tool.
110 118 ***************************************************************************/
111 119 ctulimit::ctulimit(const ctulimit& app) : ctool(app)
112 120 {
... ... @@ -123,6 +131,8 @@ ctulimit::ctulimit(const ctulimit& app) : ctool(app)
123 131  
124 132 /***********************************************************************//**
125 133 * @brief Destructor
  134 + *
  135 + * Destructs the ctulimit tool.
126 136 ***************************************************************************/
127 137 ctulimit::~ctulimit(void)
128 138 {
... ... @@ -145,6 +155,8 @@ ctulimit::~ctulimit(void)
145 155 *
146 156 * @param[in] app Application.
147 157 * @return Application.
  158 + *
  159 + * Assigns a ctulimit tool.
148 160 ***************************************************************************/
149 161 ctulimit& ctulimit::operator=(const ctulimit& app)
150 162 {
... ... @@ -177,7 +189,9 @@ ctulimit& ctulimit::operator=(const ctulimit& app)
177 189 ==========================================================================*/
178 190  
179 191 /***********************************************************************//**
180   - * @brief Clear instance
  192 + * @brief Clear ctulimit tool
  193 + *
  194 + * Resets the ctulimit tool to a clean initial state.
181 195 ***************************************************************************/
182 196 void ctulimit::clear(void)
183 197 {
... ... @@ -197,9 +211,9 @@ void ctulimit::clear(void)
197 211  
198 212  
199 213 /***********************************************************************//**
200   - * @brief Computes the upper limit
  214 + * @brief Compute upper limit
201 215 *
202   - * This method calculates the upper limit depending on the given algorithm
  216 + * Computes the upper limit depending on the given algorithm
203 217 ***************************************************************************/
204 218 void ctulimit::run(void)
205 219 {
... ... @@ -369,9 +383,9 @@ void ctulimit::run(void)
369 383  
370 384  
371 385 /***********************************************************************//**
372   - * @brief Save maps
  386 + * @brief Save upper limits
373 387 *
374   - * This method saves the upper limit to an ascii file.
  388 + * Saves the upper limit to an ASCII file in comma-separated value format.
375 389 *
376 390 * @todo No yet implemented as we have no clear use case yet for saving
377 391 * the result.
... ... @@ -417,14 +431,14 @@ void ctulimit::init_members(void)
417 431 {
418 432 // Initialise user parameters
419 433 m_srcname.clear();
420   - m_confidence = 0.95;
421   - m_sigma_min = 0.0;
422   - m_sigma_max = 0.0;
423   - m_eref = 0.0;
424   - m_emin = 0.0;
425   - m_emax = 0.0;
426   - m_tol = 1.0e-6;
427   - m_max_iter = 50;
  434 + m_confidence = 0.95;
  435 + m_sigma_min = 0.0;
  436 + m_sigma_max = 0.0;
  437 + m_eref = 0.0;
  438 + m_emin = 0.0;
  439 + m_emax = 0.0;
  440 + m_tol = 1.0e-6;
  441 + m_max_iter = 50;
428 442 m_apply_edisp = false;
429 443  
430 444 // Initialise protected members
... ... @@ -455,15 +469,15 @@ void ctulimit::init_members(void)
455 469 void ctulimit::copy_members(const ctulimit& app)
456 470 {
457 471 // Copy user parameters
458   - m_srcname = app.m_srcname;
459   - m_confidence = app.m_confidence;
460   - m_sigma_min = app.m_sigma_min;
461   - m_sigma_max = app.m_sigma_max;
462   - m_eref = app.m_eref;
463   - m_emin = app.m_emin;
464   - m_emax = app.m_emax;
465   - m_tol = app.m_tol;
466   - m_max_iter = app.m_max_iter;
  472 + m_srcname = app.m_srcname;
  473 + m_confidence = app.m_confidence;
  474 + m_sigma_min = app.m_sigma_min;
  475 + m_sigma_max = app.m_sigma_max;
  476 + m_eref = app.m_eref;
  477 + m_emin = app.m_emin;
  478 + m_emax = app.m_emax;
  479 + m_tol = app.m_tol;
  480 + m_max_iter = app.m_max_iter;
467 481 m_apply_edisp = app.m_apply_edisp;
468 482  
469 483 // Copy protected members
... ... @@ -624,12 +638,12 @@ void ctulimit::get_model_parameter(void)
624 638  
625 639  
626 640 /***********************************************************************//**
627   - * @brief Performs upper limit computation by using a bisection method
  641 + * @brief Calculate upper limit using a bisection method
628 642 *
629 643 * @param[in] min Minimum parameter value
630 644 * @param[in] max Maximum parameter value
631 645 *
632   - * This method calculates the upper limit using a bisection method.
  646 + * Calculates the upper limit using a bisection method.
633 647 ***************************************************************************/
634 648 void ctulimit::ulimit_bisection(const double& min, const double& max)
635 649 {
... ... @@ -697,8 +711,7 @@ void ctulimit::ulimit_bisection(const double& min, const double& max)
697 711 * @param[in] value Parameter factor value
698 712 * @return Log-likelihood value
699 713 *
700   - * This method evaluates the log-likelihood as a function of the parameter
701   - * of interest.
  714 + * Evaluates the log-likelihood as a function of the parameter of interest.
702 715 ***************************************************************************/
703 716 double ctulimit::evaluate(const double& value)
704 717 {
... ...