GammaLib
2.1.0.dev
|
CTA instrument direction class. More...
#include <GCTAInstDir.hpp>
Public Member Functions | |
GCTAInstDir (void) | |
Void constructor. More... | |
GCTAInstDir (const GSkyDir &dir) | |
Sky direction constructor. More... | |
GCTAInstDir (const double &detx, const double &dety) | |
Instrument coordinates constructor. More... | |
GCTAInstDir (const GSkyDir &dir, const double &detx, const double &dety) | |
Instrument direction constructor. More... | |
GCTAInstDir (const GCTAInstDir &dir) | |
Copy constructor. More... | |
virtual | ~GCTAInstDir (void) |
Destructor. More... | |
GCTAInstDir & | operator= (const GCTAInstDir &dir) |
Assignment operator. More... | |
virtual void | clear (void) |
Clear CTA instrument direction. More... | |
virtual GCTAInstDir * | clone (void) const |
CTA instrument direction. More... | |
virtual std::string | classname (void) const |
Return class name. More... | |
virtual u_int64_t | hash (void) const |
Return instrument direction hash value. More... | |
virtual std::string | print (const GChatter &chatter=NORMAL) const |
Print instrument direction information. More... | |
void | dir (const GSkyDir &dir) |
Set sky direction. More... | |
const GSkyDir & | dir (void) const |
Return reference to sky direction (const version) More... | |
void | detx (const double &x) |
Set DETX coordinate (in radians) More... | |
void | dety (const double &y) |
Set DETY coordinate (in radians) More... | |
const double & | detx (void) const |
Return reference to DETX coordinate (in radians) More... | |
const double & | dety (void) const |
Return reference to DETY coordinate (in radians) More... | |
double | theta (void) const |
Return offset angle (in radians) More... | |
double | phi (void) const |
Return azimuth angle (in radians) More... | |
const bool & | has_dir (void) const |
Signal if instrument direction has valid sky direction. More... | |
const bool & | has_detx (void) const |
Signal if instrument direction has valid DETX coordinate. More... | |
const bool & | has_dety (void) const |
Signal if instrument direction has valid DETY coordinate. More... | |
Public Member Functions inherited from GInstDir | |
GInstDir (void) | |
Void constructor. More... | |
GInstDir (const GInstDir &dir) | |
Copy constructor. More... | |
virtual | ~GInstDir (void) |
Destructor. More... | |
virtual GInstDir & | operator= (const GInstDir &dir) |
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 GCTAInstDir &dir) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Member Functions inherited from GInstDir | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GInstDir &dir) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
GSkyDir | m_dir |
Observed incident direction of event. More... | |
double | m_detx |
Instrument coordinate X (radians) More... | |
double | m_dety |
Instrument coordinate Y (radians) More... | |
bool | m_has_dir |
Has valid incident direction. More... | |
bool | m_has_detx |
Has valid instrument coordinate X. More... | |
bool | m_has_dety |
Has valid instrument coordinate Y. More... | |
CTA instrument direction class.
The CTA instrument direction defines the measured (or reconstructed) direction of an event. The instrument direction comprises a sky direction and detector coordinates. Not all the information is necessary provided, and the has_dir(), has_detx() and has_dety() methods inform which information is contained in a class instance. Note also that the dir(), detx() and dety() methods will throw an exception in case that no information exists. This assures that only valid information can be accessed.
Definition at line 63 of file GCTAInstDir.hpp.
GCTAInstDir::GCTAInstDir | ( | void | ) |
Void constructor.
Definition at line 56 of file GCTAInstDir.cpp.
References init_members().
Referenced by clone().
|
explicit |
Sky direction constructor.
[in] | dir | Sky direction. |
Construct CTA instrument direction from sky direction.
Definition at line 73 of file GCTAInstDir.cpp.
References dir(), and init_members().
GCTAInstDir::GCTAInstDir | ( | const double & | detx, |
const double & | dety | ||
) |
Instrument coordinates constructor.
[in] | detx | Instrument coordinate X (radians). |
[in] | dety | Instrument coordinate Y (radians). |
Construct CTA instrument direction from instrument coordinates.
Definition at line 94 of file GCTAInstDir.cpp.
References detx(), dety(), and init_members().
GCTAInstDir::GCTAInstDir | ( | const GSkyDir & | dir, |
const double & | detx, | ||
const double & | dety | ||
) |
Instrument direction constructor.
[in] | dir | Sky direction. |
[in] | detx | Instrument coordinate X (radians). |
[in] | dety | Instrument coordinate Y (radians). |
Construct CTA instrument direction from sky direction and instrument coordinates.
Definition at line 118 of file GCTAInstDir.cpp.
References detx(), dety(), dir(), and init_members().
GCTAInstDir::GCTAInstDir | ( | const GCTAInstDir & | dir | ) |
Copy constructor.
[in] | dir | CTA instrument direction. |
Definition at line 140 of file GCTAInstDir.cpp.
References copy_members(), and init_members().
|
virtual |
|
inlinevirtual |
Return class name.
Implements GInstDir.
Definition at line 119 of file GCTAInstDir.hpp.
|
virtual |
Clear CTA instrument direction.
Implements GInstDir.
Definition at line 211 of file GCTAInstDir.cpp.
References GInstDir::free_members(), free_members(), GInstDir::init_members(), and init_members().
Referenced by GCTARoi::init_members(), GCTAEventAtom::init_members(), and GCTAEventBin::init_members().
|
virtual |
CTA instrument direction.
Implements GInstDir.
Definition at line 231 of file GCTAInstDir.cpp.
References GCTAInstDir().
|
protected |
Copy class members.
[in] | dir | CTA instrument direction. |
Definition at line 318 of file GCTAInstDir.cpp.
References m_detx, m_dety, m_dir, m_has_detx, m_has_dety, and m_has_dir.
Referenced by GCTAInstDir(), and operator=().
|
inline |
Set DETX coordinate (in radians)
[in] | x | DETX coordinate (in radians). |
Set DETX coordinate.
Definition at line 170 of file GCTAInstDir.hpp.
References m_detx, and m_has_detx.
Referenced by GCTAModelIrfBackground::eval(), GCTAModelSpatialGradient::eval(), GCTAPointing::instdir(), GCTABackgroundPerfTable::mc(), GCTABackground2D::mc(), GCTABackground3D::mc(), GCTAModelSpatial::mc(), GCTAModelSpatialGradient::mc_max_value(), GCTABackground3D::rate_ebin(), GCTABackground2D::rate_ebin(), GCTAEventList::read_events(), and GCTAPointing::skydir().
|
inline |
Return reference to DETX coordinate (in radians)
GException::runtime_error | Instrument coordinate has no valid DETX coordinate |
Returns reference DETX coordinate (in radians).
Definition at line 205 of file GCTAInstDir.hpp.
References G_DETX, m_detx, and m_has_detx.
Referenced by GCTAInstDir().
|
inline |
Set DETY coordinate (in radians)
[in] | y | DETY coordinate (in radians). |
Set DETY coordinate.
Definition at line 186 of file GCTAInstDir.hpp.
References m_dety, and m_has_dety.
Referenced by GCTAModelIrfBackground::eval(), GCTAModelSpatialGradient::eval(), GCTAPointing::instdir(), GCTABackgroundPerfTable::mc(), GCTABackground2D::mc(), GCTABackground3D::mc(), GCTAModelSpatial::mc(), GCTAModelSpatialGradient::mc_max_value(), GCTABackground3D::rate_ebin(), GCTABackground2D::rate_ebin(), GCTAEventList::read_events(), and GCTAPointing::skydir().
|
inline |
Return reference to DETY coordinate (in radians)
GException::runtime_error | Instrument coordinate has no valid DETY coordinate |
Returns reference DETY coordinate (in radians).
Definition at line 226 of file GCTAInstDir.hpp.
References G_DETY, m_dety, and m_has_dety.
Referenced by GCTAInstDir().
|
inline |
Set sky direction.
[in] | dir | Sky direction. |
Set the sky direction.
Definition at line 133 of file GCTAInstDir.hpp.
References dir(), m_dir, and m_has_dir.
Referenced by GCTARoi::contains(), GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelRadialAcceptance::eval(), GCTAModelSkyCube::eval(), GCTACubeBackground::fill(), GCTACubeExposure::fill_cube(), GCTACubePsf::fill_cube(), GCTACubeEdisp::fill_cube(), GCTAResponseIrf::irf(), GCTAResponseCube::irf(), GCTAResponseCube::irf_diffuse(), GCTAResponseIrf::irf_diffuse(), GCTAResponseCube::irf_elliptical(), GCTAResponseIrf::irf_elliptical(), GCTAResponseCube::irf_ptsrc(), GCTAResponseCube::irf_radial(), GCTAResponseIrf::irf_radial(), GCTAModelRadial::mc(), GCTAModelIrfBackground::mc(), GCTAModelAeffBackground::mc(), GCTAModelRadialAcceptance::mc(), GCTAModelSpatial::mc(), GCTAResponseIrf::npsf(), GCTAResponseIrf::nroi_diffuse(), GCTAResponseIrf::nroi_elliptical(), GCTAResponseIrf::nroi_radial(), GCTACubeBackground::operator()(), GCTAEventList::read_events(), GCTAOnOffObservation::set(), GCTARoi::write(), and GCTAEventList::write_ds_keys().
|
inline |
Return reference to sky direction (const version)
GException::runtime_error | Instrument coordinate has no valid sky direction |
Returns reference to the sky direction.
Definition at line 152 of file GCTAInstDir.hpp.
References G_DIR, m_dir, and m_has_dir.
Referenced by dir(), and GCTAInstDir().
|
protected |
Delete class members.
Definition at line 336 of file GCTAInstDir.cpp.
Referenced by clear(), operator=(), and ~GCTAInstDir().
|
inline |
Signal if instrument direction has valid DETX coordinate.
Definition at line 307 of file GCTAInstDir.hpp.
References m_has_detx.
|
inline |
Signal if instrument direction has valid DETY coordinate.
Definition at line 319 of file GCTAInstDir.hpp.
References m_has_dety.
|
inline |
Signal if instrument direction has valid sky direction.
Definition at line 295 of file GCTAInstDir.hpp.
References m_has_dir.
Referenced by GCTAEventList::write_ds_keys().
|
virtual |
Return instrument direction hash value.
Returns a hash value that can be used in the response cache.
Implements GInstDir.
Definition at line 244 of file GCTAInstDir.cpp.
References GSkyDir::dec(), m_dir, and GSkyDir::ra().
|
protected |
Initialise class members.
Definition at line 298 of file GCTAInstDir.cpp.
References GSkyDir::clear(), m_detx, m_dety, m_dir, m_has_detx, m_has_dety, and m_has_dir.
Referenced by clear(), GCTAInstDir(), and operator=().
GCTAInstDir & GCTAInstDir::operator= | ( | const GCTAInstDir & | dir | ) |
Assignment operator.
[in] | dir | CTA instrument direction. |
Definition at line 178 of file GCTAInstDir.cpp.
References copy_members(), free_members(), init_members(), and GInstDir::operator=().
|
inline |
Return azimuth angle (in radians)
GException::runtime_error | Instrument coordinate has no valid DETX or DETY coordinate |
Returns the azimuth angle from the camera centre (in radians). The azimuth angle \(\phi\) is computed using
\[\phi = \arctan \left( \frac{{\rm DETY}}{{\rm DETX}} \right)\]
where \({\rm DETX}\) and \({\rm DETY}\) are the detector coordinates. The atan2(DETY,DETX)
function is used for the computation.
Definition at line 279 of file GCTAInstDir.hpp.
References gammalib::atan2(), G_PHI, m_detx, m_dety, m_has_detx, and m_has_dety.
Referenced by GCTAModelAeffBackground::eval(), and GCTAModelAeffBackground::npred_roi_kern_phi::eval().
Print instrument direction information.
[in] | chatter | Chattiness. |
Implements GInstDir.
Definition at line 267 of file GCTAInstDir.cpp.
References GSkyDir::dec_deg(), m_detx, m_dety, m_dir, GSkyDir::ra_deg(), SILENT, and gammalib::str().
Referenced by GCTAModelSpatialMultiplicative::eval(), GCTARoi::print(), and GCTAEventAtom::print().
|
inline |
Return offset angle (in radians)
GException::runtime_error | Instrument coordinate has no valid DETX or DETY coordinate |
Returns the offset angle from the camera centre (in radians). The offset angle \(\theta\) is computed using
\[\theta = \sqrt{{\rm DETX}^2 + {\rm DETY}^2}\]
where \({\rm DETX}\) and \({\rm DETY}\) are the detector coordinates.
Definition at line 252 of file GCTAInstDir.hpp.
References G_THETA, m_detx, m_dety, m_has_detx, m_has_dety, and sqrt().
Referenced by GCTAModelRadial::eval(), GCTAModelSpatialGaussSpectrum::eval(), GCTAModelAeffBackground::eval(), GCTAModelSpatialLookup::eval(), GCTAModelAeffBackground::npred_roi_kern_phi::eval(), GCTAModelSpatialLookup::fill_buffer(), and GCTABackgroundPerfTable::rate_ebin().
|
protected |
Instrument coordinate X (radians)
Definition at line 105 of file GCTAInstDir.hpp.
Referenced by copy_members(), detx(), init_members(), phi(), print(), and theta().
|
protected |
Instrument coordinate Y (radians)
Definition at line 106 of file GCTAInstDir.hpp.
Referenced by copy_members(), dety(), init_members(), phi(), print(), and theta().
|
protected |
Observed incident direction of event.
Definition at line 104 of file GCTAInstDir.hpp.
Referenced by copy_members(), dir(), hash(), init_members(), print(), and GCTAEventList::read_events().
|
protected |
Has valid instrument coordinate X.
Definition at line 108 of file GCTAInstDir.hpp.
Referenced by copy_members(), detx(), has_detx(), init_members(), phi(), and theta().
|
protected |
Has valid instrument coordinate Y.
Definition at line 109 of file GCTAInstDir.hpp.
Referenced by copy_members(), dety(), has_dety(), init_members(), phi(), and theta().
|
protected |
Has valid incident direction.
Definition at line 107 of file GCTAInstDir.hpp.
Referenced by copy_members(), dir(), has_dir(), and init_members().