|
GammaLib 2.2.0.dev
|
Interface for the CTA region of interest class. More...
#include <GCTARoi.hpp>
Public Member Functions | |
| GCTARoi (void) | |
| Void constructor. | |
| GCTARoi (const GXmlElement &xml) | |
| XML element constructor. | |
| GCTARoi (const GCTAInstDir ¢re, const double &radius) | |
| Region of interest constructor. | |
| GCTARoi (const GCTARoi &roi) | |
| Copy constructor. | |
| virtual | ~GCTARoi (void) |
| Destructor. | |
| GCTARoi & | operator= (const GCTARoi &roi) |
| Assignment operator. | |
| virtual void | clear (void) |
| Clear instance. | |
| virtual GCTARoi * | clone (void) const |
| Clone instance. | |
| virtual std::string | classname (void) const |
| Return class name. | |
| virtual bool | contains (const GEvent &event) const |
| Check if region of interest contains an event. | |
| virtual std::string | print (const GChatter &chatter=NORMAL) const |
| Print ROI information. | |
| bool | is_valid (void) const |
| Checks if RoI is valid. | |
| bool | contains (const GCTAInstDir &dir) const |
| Check if region of interest contains an instrument direction. | |
| const GCTAInstDir & | centre (void) const |
| Returns region of interest centre. | |
| const double & | radius (void) const |
| Returns radius of region of interest in degrees. | |
| void | centre (const GCTAInstDir ¢re) |
| Set region of interest centre. | |
| void | radius (const double &radius) |
| Set radius of region of interest. | |
| void | read (const GXmlElement &xml) |
| Read region of interest from XML element. | |
| void | write (GXmlElement &xml) const |
| Write region of interest into XML element. | |
Public Member Functions inherited from GRoi | |
| GRoi (void) | |
| Void constructor. | |
| GRoi (const GRoi &roi) | |
| Copy constructor. | |
| virtual | ~GRoi (void) |
| Destructor. | |
| virtual GRoi & | operator= (const GRoi &roi) |
| Assignment operator. | |
Public Member Functions inherited from GBase | |
| virtual | ~GBase (void) |
| Destructor. | |
Protected Member Functions | |
| void | init_members (void) |
| Initialise class members. | |
| void | copy_members (const GCTARoi &roi) |
| Copy class members. | |
| void | free_members (void) |
| Delete class members. | |
Protected Member Functions inherited from GRoi | |
| void | init_members (void) |
| Initialise class members. | |
| void | copy_members (const GRoi &roi) |
| Copy class members. | |
| void | free_members (void) |
| Delete class members. | |
Protected Attributes | |
| GCTAInstDir | m_centre |
| Centre of ROI in instrument coordinates. | |
| double | m_radius |
| Radius of ROI in degrees. | |
Interface for the CTA region of interest class.
The CTA region of interest class defines the region of photon arrival directions that is used for unbinned data analysis. A circular ROI has been implemented.
Definition at line 49 of file GCTARoi.hpp.
| GCTARoi::GCTARoi | ( | void | ) |
Void constructor.
Definition at line 58 of file GCTARoi.cpp.
References init_members().
Referenced by clone().
|
explicit |
XML element constructor.
| [in] | xml | XML element. |
Constructs region of interest from an XML element.
Definition at line 75 of file GCTARoi.cpp.
References init_members(), and read().
| GCTARoi::GCTARoi | ( | const GCTAInstDir & | centre, |
| const double & | radius ) |
Region of interest constructor.
| [in] | centre | Region of interest centre. |
| [in] | radius | Radius of region of interest (degrees). |
Definition at line 94 of file GCTARoi.cpp.
References centre(), init_members(), and radius().
| GCTARoi::GCTARoi | ( | const GCTARoi & | roi | ) |
Copy constructor.
| [in] | roi | Region of interest. |
Definition at line 113 of file GCTARoi.cpp.
References copy_members(), and init_members().
|
virtual |
|
inline |
Set region of interest centre.
| [in] | centre | Region of interest centre sky direction. |
Set the sky direction of the region of interest centre.
Definition at line 139 of file GCTARoi.hpp.
|
inline |
Returns region of interest centre.
Returns the sky direction of the region of interest centre.
Definition at line 111 of file GCTARoi.hpp.
References m_centre.
Referenced by centre(), GCTACubeBackground::fill(), GCTACubeEdisp::fill_cube(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GCTARoi(), GCTAModelAeffBackground::mc(), GCTAModelSpatial::mc(), GCTAModelSpatialGradient::mc_max_value(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), read(), gammalib::read_ds_roi(), and GCTAEventList::write_ds_keys().
|
inlinevirtual |
Return class name.
Implements GRoi.
Definition at line 97 of file GCTARoi.hpp.
|
virtual |
Clear instance.
Implements GRoi.
Definition at line 184 of file GCTARoi.cpp.
References free_members(), GRoi::free_members(), init_members(), and GRoi::init_members().
Referenced by GCTAEventList::init_members(), and read().
|
virtual |
Clone instance.
Implements GRoi.
Definition at line 204 of file GCTARoi.cpp.
References GCTARoi().
| bool GCTARoi::contains | ( | const GCTAInstDir & | dir | ) | const |
Check if region of interest contains an instrument direction.
Definition at line 240 of file GCTARoi.cpp.
References contains(), GCTAInstDir::dir(), m_centre, and m_radius.
|
virtual |
Check if region of interest contains an event.
Implements GRoi.
Definition at line 215 of file GCTARoi.cpp.
References contains().
Referenced by contains(), contains(), GCTACubeBackground::fill(), and GCTAModelSpatial::mc().
|
protected |
Copy class members.
| [in] | roi | Region of interest from which members should be copied. |
Definition at line 413 of file GCTARoi.cpp.
References m_centre, and m_radius.
Referenced by GCTARoi(), and operator=().
|
protected |
Delete class members.
Definition at line 427 of file GCTARoi.cpp.
Referenced by clear(), operator=(), and ~GCTARoi().
|
protected |
Initialise class members.
Definition at line 397 of file GCTARoi.cpp.
References GCTAInstDir::clear(), m_centre, and m_radius.
Referenced by clear(), GCTARoi(), GCTARoi(), GCTARoi(), GCTARoi(), and operator=().
|
inline |
Checks if RoI is valid.
Definition at line 152 of file GCTARoi.hpp.
References m_radius.
Referenced by GCTACubeBackground::fill(), GCTACubeEdisp::fill_cube(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), and GCTAEventList::write_ds_keys().
Assignment operator.
| [in] | roi | Region of interest. |
Definition at line 151 of file GCTARoi.cpp.
References copy_members(), free_members(), init_members(), and GRoi::operator=().
Print ROI information.
| [in] | chatter | Chattiness. |
Implements GRoi.
Definition at line 338 of file GCTARoi.cpp.
References m_centre, m_radius, gammalib::parformat(), GCTAInstDir::print(), SILENT, and gammalib::str().
| void GCTARoi::radius | ( | const double & | radius | ) |
Set radius of region of interest.
| [in] | radius | Region of interest radius (degrees). |
| GException::invalid_argument | Non-positive ROI radius encountered |
Set the radius of the region of interest.
Definition at line 371 of file GCTARoi.cpp.
References G_RADIUS, m_radius, radius(), and gammalib::str().
|
inline |
Returns radius of region of interest in degrees.
Returns the radius of the region of interest in degrees.
Definition at line 125 of file GCTARoi.hpp.
References m_radius.
Referenced by GCTACubeBackground::fill(), GCTACubeEdisp::fill_cube(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GCTARoi(), GCTAModelAeffBackground::mc(), GCTAModelSpatial::mc(), GCTAModelSpatialGradient::mc_max_value(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), radius(), read(), gammalib::read_ds_roi(), and GCTAEventList::write_ds_keys().
| void GCTARoi::read | ( | const GXmlElement & | xml | ) |
Read region of interest from XML element.
| [in] | xml | XML element. |
| GException::invalid_value | Invalid XML format encountered. |
Read region of interest from an XML element. The format of the region of interest is
<parameter name="RegionOfInterest" ra="..." dec="..." rad="..."/>
The units are deg.
Definition at line 265 of file GCTARoi.cpp.
References GXmlElement::attribute(), centre(), clear(), G_READ, GXmlElement::has_attribute(), radius(), gammalib::todouble(), and gammalib::xml_get_par().
Referenced by GCTARoi(), and GCTAObservation::read().
| void GCTARoi::write | ( | GXmlElement & | xml | ) | const |
Write region of interest into XML element.
| [in] | xml | XML element. |
Writes region of interest into an XML element. The format of the region of interest is
<parameter name="RegionOfInterest" ra="..." dec="..." rad="..."/>
The units are deg.
This method does nothing if the region of interest is not valid (signaled by a radius of 0 deg).
Definition at line 312 of file GCTARoi.cpp.
References GXmlElement::attribute(), GCTAInstDir::dir(), G_WRITE, m_centre, m_radius, gammalib::str(), and gammalib::xml_need_par().
|
protected |
Centre of ROI in instrument coordinates.
Definition at line 86 of file GCTARoi.hpp.
Referenced by centre(), centre(), contains(), copy_members(), init_members(), print(), and write().
|
protected |
Radius of ROI in degrees.
Definition at line 87 of file GCTARoi.hpp.
Referenced by contains(), copy_members(), init_members(), is_valid(), print(), radius(), radius(), and write().