GOnOffMakerReflected.hpp

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

Download (5.02 KB)

 
1
/***************************************************************************
2
 *       GOnOffMakerReflected.hpp - Class for ON-OFF data preparation      *
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 GOnOffMakerReflected.hpp
23
 * @brief Class interface for ON-OFF data preparation from reflected regions
24
 * @author Pierrick Martin
25
 */
26

    
27
#ifndef GONOFFMAKERREFLECTED_HPP
28
#define GONOFFMAKERREFLECTED_HPP
29

    
30
/* __ Includes ___________________________________________________________ */
31
#include <vector>
32
#include <string>
33

    
34
/* __ Forward declarations _______________________________________________ */
35
class GObservations;
36
class GEbounds;
37
class GSkyRegion;
38

    
39
/***********************************************************************//**
40
* @class GOnOffMakerReflected
41
*
42
* @brief Class interface for ON-OFF data preparation from reflected regions
43
*
44
* This class defines the interface for the preparation of ON and OFF data 
45
* using the so-called reflected region approach (see Berge et al. 2007).
46
* The class is derived from the abstract class GOnOffMaker.
47
*
48
* For a complete setup, the object needs:
49
* - An observations container
50
* - Definition of energy grid through GEbounds object
51
* - Definition of the ON region through a GSkyRegion object
52
* - The number of OFF regions
53
* The OFF regions will be evenly distributed about the centre of the 
54
* field-of-view in each observation run, at the same off-axis angular 
55
* distance as the ON region. More sophisticated schemes can/will be 
56
* implemented later.
57
*
58
* The method compute_data() loops over all runs in the observation 
59
* container and all energy bins and fills the GOnOffBin array based on 
60
* the internal methods sum_counts() and sum_acceptance() (the latter being 
61
* useless in the reflected region approach).
62
*
63
**************************************************************************/
64
class GOnOffMakerReflected : public GOnOffMaker {
65
        
66
public:
67
    // Constructors and destructors
68
    GOnOffMakerReflected(void);
69
    GOnOffMakerReflected(const GOnOffMakerReflected& maker);
70
        explicit GOnOffMakerReflected(const GObservations& obs, const GEbounds& ebds, const GSkyRegion& on, const int numoff);
71
        explicit GOnOffMakerReflected(const std::string& filename, const GEbounds& ebds, const GSkyRegion& on, const int numoff);
72
    virtual ~GOnOffMakerReflected(void);
73
        
74
    // Operators
75
    virtual GOnOffMakerReflected&  operator=(const GOnOffMakerReflected& maker);
76
          
77
    // Implemented pure virtual base class methods
78
    virtual void                   clear(void);
79
    virtual GOnOffMakerReflected*  clone(void) const;
80
    virtual std::string            type(void) const;
81
    virtual std::string            print(const GChatter& chatter = NORMAL) const;
82
        
83
    // Methods specific to the derived class
84
        void                           ebounds(const GEbounds& ebds);
85
        const GEbounds*                ebounds(void) const;        
86
        void                           onregion(const GSkyRegion& on);
87
        const GSkyRegion*              onregion(void) const;
88
        void                           numoff(const int numoff);
89
        const int                      numoff(void) const;        
90
        void                           compute_data(void);
91
        
92
protected:
93
    // Protected methods
94
    void         init_members(void);
95
    void         copy_members(const GOnOffMakerReflected& maker);
96
    void         free_members(void);
97
        void         sum_counts(GObservation& obs, GSkyRegion& reg);
98
        void         sum_acceptance(GObservation& obs, GSkyRegion& reg);
99
        
100
    // Protected members
101
        GEbounds*           m_ebds;         //!< Energy binning definition
102
        GSkyRegion*         m_regon;        //!< ON sky region
103
        int                 m_numoff;       //!< Number of OFF regions
104
};
105

    
106
#endif /* GONOFFMAKERREFLECTED_HPP */
107

    
108
                                                                                                                                                  
109
                                                                                                                                
110
                                                                                                                                                
111