GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTABackground.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCTABackground.hpp - CTA background model base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2014-2018 by Juergen Knoedlseder *
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 GCTABackground.hpp
23  * @brief CTA background model base class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GCTABACKGROUND_HPP
28 #define GCTABACKGROUND_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 
34 /* __ Forward declarations _______________________________________________ */
35 class GRan;
36 class GEnergy;
37 class GTime;
38 class GFilename;
39 class GCTAInstDir;
41 
42 
43 /***********************************************************************//**
44  * @class GCTABackground
45  *
46  * @brief Abstract base class for the CTA background model
47  ***************************************************************************/
48 class GCTABackground : public GBase {
49 
50 public:
51  // Constructors and destructors
52  GCTABackground(void);
53  GCTABackground(const GCTABackground& bgd);
54  virtual ~GCTABackground(void);
55 
56  // Pure virtual operators
57  virtual double operator()(const double& logE,
58  const double& detx,
59  const double& dety) const = 0;
60 
61  // Operators
63 
64  // Pure virtual methods
65  virtual void clear(void) = 0;
66  virtual GCTABackground* clone(void) const = 0;
67  virtual std::string classname(void) const = 0;
68  virtual void load(const GFilename& filename) = 0;
69  virtual GFilename filename(void) const = 0;
70  virtual GCTAInstDir mc(const GEnergy& energy,
71  const GTime& time,
72  GRan& ran) const = 0;
73  virtual const GModelSpectralNodes& spectrum(void) const = 0;
74  virtual double rate_ebin(const GCTAInstDir& dir,
75  const GEnergy& emin,
76  const GEnergy& emax) const = 0;
77  virtual std::string print(const GChatter& chatter = NORMAL) const = 0;
78 
79 protected:
80  // Methods
81  void init_members(void);
82  void copy_members(const GCTABackground& bgd);
83  void free_members(void);
84 };
85 
86 #endif /* GCTABACKGROUND_HPP */
virtual ~GCTABackground(void)
Destructor.
void copy_members(const GCTABackground &bgd)
Copy class members.
GCTABackground(void)
Void constructor.
virtual void clear(void)=0
Clear object.
GCTABackground & operator=(const GCTABackground &bgd)
Assignment operator.
Definition of interface for all GammaLib classes.
Random number generator class.
Definition: GRan.hpp:44
virtual const GModelSpectralNodes & spectrum(void) const =0
Time class.
Definition: GTime.hpp:55
Spectral nodes model class.
virtual void load(const GFilename &filename)=0
Filename class.
Definition: GFilename.hpp:62
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
GChatter
Definition: GTypemaps.hpp:33
virtual GCTABackground * clone(void) const =0
Clones object.
virtual GFilename filename(void) const =0
void init_members(void)
Initialise class members.
virtual double operator()(const double &logE, const double &detx, const double &dety) const =0
Abstract base class for the CTA background model.
CTA instrument direction class.
Definition: GCTAInstDir.hpp:63
virtual GCTAInstDir mc(const GEnergy &energy, const GTime &time, GRan &ran) const =0
virtual std::string classname(void) const =0
Return class name.
virtual double rate_ebin(const GCTAInstDir &dir, const GEnergy &emin, const GEnergy &emax) const =0
Class that handles energies in a unit independent way.
Definition: GEnergy.hpp:48
void free_members(void)
Delete class members.