ctools 2.1.0.dev
Loading...
Searching...
No Matches
ctbkgcube.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * ctbkgcube - Background cube generation tool *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2014-2022 by Chia-Chun Lu *
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 ctbkgcube.hpp
23 * @brief Background cube generation tool definition
24 * @author Chia-Chun Lu
25 */
26
27#ifndef CTBKGCUBE_HPP
28#define CTBKGCUBE_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include "GammaLib.hpp"
32#include "GCTALib.hpp"
33#include "ctobservation.hpp"
34
35/* __Definitions _________________________________________________________ */
36#define CTBKGCUBE_NAME "ctbkgcube"
37
38
39/***********************************************************************//**
40 * @class ctbkgcube
41 *
42 * @brief Background cube generation tool
43 ***************************************************************************/
44class ctbkgcube : public ctobservation {
45
46public:
47 // Constructors and destructors
48 ctbkgcube(void);
49 explicit ctbkgcube(const GObservations& obs);
50 ctbkgcube(int argc, char *argv[]);
51 ctbkgcube(const ctbkgcube& app);
52 virtual ~ctbkgcube(void);
53
54 // Operators
55 ctbkgcube& operator=(const ctbkgcube& app);
56
57 // Methods
58 void clear(void);
59 void process(void);
60 void save(void);
61 void publish(const std::string& name = "");
62 void cntcube(const GCTAEventCube& cntcube);
63 const GCTACubeBackground& bkgcube(void) const;
64 const GModels& models(void) const;
65
66protected:
67 // Protected methods
68 void init_members(void);
69 void copy_members(const ctbkgcube& app);
70 void free_members(void);
71 void get_parameters(void);
72
73 // User parameters
74 GFilename m_outcube; //!< Filename of output cube
75 GFilename m_outmodel; //!< Filename of output XML model
76 bool m_publish; //!< Publish background cube?
77 GChatter m_chatter; //!< Chattiness
78
79 // Protected members
80 GCTACubeBackground m_background; //!< Background cube
81 GCTAEventCube m_cube; //!< Event cube
82 GModels m_bkgmdl; //!< CTA background models
83 GModels m_outmdl; //!< Output models
84};
85
86
87/***********************************************************************//**
88 * @brief Set event cube
89 *
90 * @param[in] cntcube Event cube.
91 ***************************************************************************/
92inline
93void ctbkgcube::cntcube(const GCTAEventCube& cntcube)
94{
95 // Set counts cube
97
98 // Return
99 return;
100}
101
102
103/***********************************************************************//**
104 * @brief Return background response cube containing background rate
105 *
106 * @return Background response cube.
107 ***************************************************************************/
108inline
109const GCTACubeBackground& ctbkgcube::bkgcube(void) const
110{
111 // Return background cube
112 return (m_background);
113}
114
115
116/***********************************************************************//**
117 * @brief Return background model container
118 *
119 * @return Background model container.
120 ***************************************************************************/
121inline
122const GModels& ctbkgcube::models(void) const
123{
124 // Return background model container
125 return (m_outmdl);
126}
127
128#endif /* CTBKGCUBE_HPP */
Background cube generation tool.
Definition ctbkgcube.hpp:44
ctbkgcube & operator=(const ctbkgcube &app)
Assignment operator.
GCTACubeBackground m_background
Background cube.
Definition ctbkgcube.hpp:80
ctbkgcube(void)
Void constructor.
Definition ctbkgcube.cpp:54
void copy_members(const ctbkgcube &app)
Copy class members.
GChatter m_chatter
Chattiness.
Definition ctbkgcube.hpp:77
virtual ~ctbkgcube(void)
Destructor.
void process(void)
Generate the background cube(s).
GFilename m_outcube
Filename of output cube.
Definition ctbkgcube.hpp:74
void save(void)
Save background cube.
GModels m_bkgmdl
CTA background models.
Definition ctbkgcube.hpp:82
void get_parameters(void)
Get application parameters.
bool m_publish
Publish background cube?
Definition ctbkgcube.hpp:76
void cntcube(const GCTAEventCube &cntcube)
Set event cube.
Definition ctbkgcube.hpp:93
void free_members(void)
Delete class members.
const GModels & models(void) const
Return background model container.
GFilename m_outmodel
Filename of output XML model.
Definition ctbkgcube.hpp:75
void init_members(void)
Initialise class members.
GModels m_outmdl
Output models.
Definition ctbkgcube.hpp:83
void clear(void)
Clear ctbkgcube tool.
void publish(const std::string &name="")
Publish background cube.
GCTAEventCube m_cube
Event cube.
Definition ctbkgcube.hpp:81
const GCTACubeBackground & bkgcube(void) const
Return background response cube containing background rate.
Base class for observation tools.
const GObservations & obs(void) const
Return observation container.
Observation tool base class interface definition.