GammaLib
2.1.0.dev
|
Interface for the CTA region of interest class. More...
#include <GCTARoi.hpp>
Public Member Functions | |
GCTARoi (void) | |
Void constructor. More... | |
GCTARoi (const GXmlElement &xml) | |
XML element constructor. More... | |
GCTARoi (const GCTAInstDir ¢re, const double &radius) | |
Region of interest constructor. More... | |
GCTARoi (const GCTARoi &roi) | |
Copy constructor. More... | |
virtual | ~GCTARoi (void) |
Destructor. More... | |
GCTARoi & | operator= (const GCTARoi &roi) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear instance. More... | |
virtual GCTARoi * | clone (void) const |
Clone instance. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual bool | contains (const GEvent &event) const |
Check if region of interest contains an event. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print ROI information. More... | |
bool | is_valid (void) const |
Checks if RoI is valid. More... | |
bool | contains (const GCTAInstDir &dir) const |
Check if region of interest contains an instrument direction. More... | |
const GCTAInstDir & | centre (void) const |
Returns region of interest centre. More... | |
const double & | radius (void) const |
Returns radius of region of interest in degrees. More... | |
void | centre (const GCTAInstDir ¢re) |
Set region of interest centre. More... | |
void | radius (const double &radius) |
Set radius of region of interest. More... | |
void | read (const GXmlElement &xml) |
Read region of interest from XML element. More... | |
void | write (GXmlElement &xml) const |
Write region of interest into XML element. More... | |
Public Member Functions inherited from GRoi | |
GRoi (void) | |
Void constructor. More... | |
GRoi (const GRoi &roi) | |
Copy constructor. More... | |
virtual | ~GRoi (void) |
Destructor. More... | |
virtual GRoi & | operator= (const GRoi &roi) |
Assignment operator. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GCTARoi &roi) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Member Functions inherited from GRoi | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GRoi &roi) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
GCTAInstDir | m_centre |
Centre of ROI in instrument coordinates. More... | |
double | m_radius |
Radius of ROI in degrees. More... | |
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 |
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(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GCTACubeEdisp::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().
|
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.
|
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 GRoi::free_members(), free_members(), GRoi::init_members(), and init_members().
Referenced by GCTAEventList::init_members(), and read().
|
virtual |
Clone instance.
Implements GRoi.
Definition at line 204 of file GCTARoi.cpp.
References GCTARoi().
|
virtual |
Check if region of interest contains an event.
Implements GRoi.
Definition at line 215 of file GCTARoi.cpp.
Referenced by contains(), GCTACubeBackground::fill(), and GCTAModelSpatial::mc().
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.
|
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(), and operator=().
|
inline |
Checks if RoI is valid.
Definition at line 152 of file GCTARoi.hpp.
References m_radius.
Referenced by GCTACubeBackground::fill(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GCTACubeEdisp::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().
|
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(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GCTACubeEdisp::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::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().
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(), 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(), and write().