GOnOffMaker.hpp

Martin Pierrick, 06/23/2013 03:38 PM

Download (4.7 KB)

 
1
/***************************************************************************
2
 *    GOnOffMaker.hpp - Abstract virtual base class for ON-OFF data        *
3
 * ----------------------------------------------------------------------- *
4
 *  copyright (C) 2009-2013 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 GOnOffMaker.hpp
23
 * @brief Abstract base class interface for ON-OFF data preparation
24
 * @author Pierrick Martin
25
 */
26

    
27
#ifndef GONOFFMAKER_HPP
28
#define GONOFFMAKER_HPP
29

    
30
/* __ Includes ___________________________________________________________ */
31
#include <vector>
32
#include <string>
33
#include "GBase.hpp"
34

    
35
/* __ Forward declarations _______________________________________________ */
36
class GOnOffBin;
37
class GModelPar;
38
class GObservations;
39

    
40
/***********************************************************************//**
41
* @class GOnOffMaker
42
*
43
* @brief Abstract base class interface for ON-OFF data preparation
44
*
45
* This class defines the interface for the preparation of ON and OFF data 
46
* for data analysis in the way adopted by existing Cherenkov telescopes 
47
* such as HESS, VERITAS, and MAGIC. 
48
*
49
* The different methods are implemented as derived classes such as
50
* GOnOffMakerReflected or GOnOffMakerRing. Each derived class can either take
51
* GSkyRegion objects as parameters for the definition of ON and OFF 
52
* regions, or generate them for a specified pattern.
53
*
54
* The parameters for the regions definition are stored in variable m_pars
55
* and accessible through operator[...]. They are GModelPar objects but not
56
* intended to be fitted, just because the GModelPar class offers a convenient
57
* way to handle them.
58
*
59
* The main output is an array of GOnOffBin elements (spectrum, map, cube),
60
* stored in the m_data variable, accessible through the data() method.
61
*
62
**************************************************************************/
63
class GOnOffMaker : public GBase {
64
        
65
public:
66
    // Constructors and destructors
67
    GOnOffMaker(void);
68
    GOnOffMaker(const GOnOffMaker& maker);
69
        explicit GOnOffMaker(const GObservations& obs);
70
        explicit GOnOffMaker(const std::string& filename);
71
    virtual ~GOnOffMaker(void);
72
        
73
    // Operators
74
    virtual GOnOffMaker&           operator=(const GOnOffMaker& maker);
75
        virtual GModelPar&             operator[](const int& index);
76
    virtual const GModelPar&       operator[](const int& index) const;
77
    virtual GModelPar&             operator[](const std::string& name);
78
    virtual const GModelPar&       operator[](const std::string& name) const;
79
          
80
    // Pure virtual methods
81
    virtual void                   clear(void) = 0;
82
    virtual GOnOffMaker*           clone(void) const = 0;
83
    virtual std::string            type(void) const = 0;
84
    virtual std::string            print(const GChatter& chatter = NORMAL) const = 0;
85
        
86
    // Implemented methods
87
    const std::vector<GOnOffBin*>  data(void) const;
88
        const GObservations*           obs(void) const;
89
        void                           obs(const GObservations& obs);
90
        
91
protected:
92
    // Protected methods
93
    void         init_members(void);
94
    void         copy_members(const GOnOffMaker& maker);
95
    void         free_members(void);
96
        
97
    // Protected members
98
    std::string               m_type;         //!< Type of background evaluation
99
        GObservations*            m_obs;          //!< Container of observations
100
        std::vector<GOnOffBin*>   m_data;         //!< List of ON-OFF data
101
        std::vector<GModelPar*>   m_pars;         //!< Parameter pointers
102
};
103

    
104
#endif /* GONOFFMAKER_HPP */
105

    
106
                                                                                                                                                  
107
                                                                                                                                
108
                                                                                                                                                
109