ctools 2.1.0.dev
Loading...
Searching...
No Matches
cterror.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * cterror - Parameter error calculation tool *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2015-2024 by Florent Forest *
5 * ----------------------------------------------------------------------- *
6 * *
7 * This program is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19 * *
20 ***************************************************************************/
21/**
22 * @file cterror.hpp
23 * @brief Parameter error calculation tool interface definition
24 * @author Florent Forest
25 */
26
27#ifndef CTERROR_HPP
28#define CTERROR_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include "ctlikelihood.hpp"
32
33/* __Definitions _________________________________________________________ */
34#define CTERROR_NAME "cterror"
35
36
37/***********************************************************************//**
38 * @class cterror
39 *
40 * @brief Parameter error calculation tool
41 ***************************************************************************/
42class cterror : public ctlikelihood {
43
44public:
45 // Constructors and destructors
46 cterror(void);
47 explicit cterror(const GObservations& obs);
48 cterror(int argc, char *argv[]);
49 cterror(const cterror& app);
50 virtual ~cterror(void);
51
52 // Operators
53 cterror& operator=(const cterror& app);
54
55 // Methods
56 void clear(void);
57 void process(void);
58 void save(void);
59
60protected:
61 // Protected methods
62 void init_members(void);
63 void copy_members(const cterror& app);
64 void free_members(void);
65 void get_parameters(void);
66 double error_bisection(const double& min, const double& max);
67 void update_intensities(void);
68 void create_fits(void);
69
70 // User parameters
71 std::string m_srcname; //!< Name of source
72 double m_confidence; //!< Confidence level
73 double m_tol; //!< Tolerance for limit determination
74 int m_max_iter; //!< Maximum number of iterations
75 bool m_apply_edisp; //!< Apply energy dispersion?
76 GChatter m_chatter; //!< Chattiness
77
78 // Protected members
79 double m_value; //!< Parameter value
80 double m_dlogL; //!< Likelihood difference for upper limit computation
81 GModelPar* m_model_par; //!< Pointer to model parameter
82 double m_best_logL; //!< Best fit log likelihood of given model
83
84 // Protected members for butterfly
85 GEnergies m_energies; //!< Energy values
86 std::vector<double> m_intensities; //!< Model intensity
87 std::vector<double> m_min_intensities; //!< Minimum intensities
88 std::vector<double> m_max_intensities; //!< Maximum intensities
89 GFits m_fits; //!< FITS file holding butterfly
90};
91
92#endif /* CTERROR_HPP */
Parameter error calculation tool.
Definition cterror.hpp:42
void clear(void)
Clear cterror tool.
Definition cterror.cpp:193
std::string m_srcname
Name of source.
Definition cterror.hpp:71
void init_members(void)
Initialise class members.
Definition cterror.cpp:438
std::vector< double > m_min_intensities
Minimum intensities.
Definition cterror.hpp:87
virtual ~cterror(void)
Destructor.
Definition cterror.cpp:134
void process(void)
Compute parameter errors using a likelihood profile method.
Definition cterror.cpp:223
double m_value
Parameter value.
Definition cterror.hpp:79
std::vector< double > m_intensities
Model intensity.
Definition cterror.hpp:86
GFits m_fits
FITS file holding butterfly.
Definition cterror.hpp:89
cterror(void)
Void constructor.
Definition cterror.cpp:60
GEnergies m_energies
Energy values.
Definition cterror.hpp:85
double m_best_logL
Best fit log likelihood of given model.
Definition cterror.hpp:82
bool m_apply_edisp
Apply energy dispersion?
Definition cterror.hpp:75
void save(void)
Save model.
Definition cterror.cpp:381
std::vector< double > m_max_intensities
Maximum intensities.
Definition cterror.hpp:88
cterror & operator=(const cterror &app)
Assignment operator.
Definition cterror.cpp:158
void free_members(void)
Delete class members.
Definition cterror.cpp:502
void update_intensities(void)
Update intensities.
Definition cterror.cpp:687
double error_bisection(const double &min, const double &max)
Calculate error using a bisection method.
Definition cterror.cpp:578
GModelPar * m_model_par
Pointer to model parameter.
Definition cterror.hpp:81
double m_dlogL
Likelihood difference for upper limit computation.
Definition cterror.hpp:80
double m_tol
Tolerance for limit determination.
Definition cterror.hpp:73
void get_parameters(void)
Get application parameters.
Definition cterror.cpp:514
int m_max_iter
Maximum number of iterations.
Definition cterror.hpp:74
GChatter m_chatter
Chattiness.
Definition cterror.hpp:76
double m_confidence
Confidence level.
Definition cterror.hpp:72
void copy_members(const cterror &app)
Copy class members.
Definition cterror.cpp:471
void create_fits(void)
Set result FITS file.
Definition cterror.cpp:751
Base class for likelihood tools.
const GObservations & obs(void) const
Return observation container.
Likelihood tool base class interface definition.