GammaLib 2.2.0.dev
Loading...
Searching...
No Matches
GCOSRoi Class Reference

COSI region of interest class. More...

#include <GCOSRoi.hpp>

Inheritance diagram for GCOSRoi:
GRoi GBase

Public Member Functions

 GCOSRoi (void)
 Void constructor.
 
 GCOSRoi (const double &radius)
 Radius constructor.
 
 GCOSRoi (const GCOSRoi &roi)
 Copy constructor.
 
virtual ~GCOSRoi (void)
 Destructor.
 
GCOSRoioperator= (const GCOSRoi &roi)
 Assignment operator.
 
virtual void clear (void)
 Clear region of interest.
 
virtual GCOSRoiclone (void) const
 Clone region of interest.
 
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 region of interest information.
 
const double & radius (void) const
 Returns region of interest radius.
 
void radius (const double &radius)
 Set radius of region of interest.
 
- Public Member Functions inherited from GRoi
 GRoi (void)
 Void constructor.
 
 GRoi (const GRoi &roi)
 Copy constructor.
 
virtual ~GRoi (void)
 Destructor.
 
virtual GRoioperator= (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 GCOSRoi &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

double m_radius
 Region of interest radius.
 

Detailed Description

COSI region of interest class.

The COSI region of interest class defines the event direction region that is used for unbinned data analysis. By definition, COSI is always doing an allsky analysis, hence the class simply sets the radius to 180 deg once the region is defined.

Definition at line 50 of file GCOSRoi.hpp.

Constructor & Destructor Documentation

◆ GCOSRoi() [1/3]

GCOSRoi::GCOSRoi ( void )

Void constructor.

Definition at line 55 of file GCOSRoi.cpp.

References init_members().

Referenced by clone().

◆ GCOSRoi() [2/3]

GCOSRoi::GCOSRoi ( const double & radius)
explicit

Radius constructor.

Parameters
[in]radiusRegion of interest radius

Definition at line 70 of file GCOSRoi.cpp.

References init_members(), and radius().

◆ GCOSRoi() [3/3]

GCOSRoi::GCOSRoi ( const GCOSRoi & roi)

Copy constructor.

Parameters
[in]roiCOSI region of interest.

Definition at line 88 of file GCOSRoi.cpp.

References copy_members(), and init_members().

◆ ~GCOSRoi()

GCOSRoi::~GCOSRoi ( void )
virtual

Destructor.

Definition at line 104 of file GCOSRoi.cpp.

References free_members().

Member Function Documentation

◆ classname()

std::string GCOSRoi::classname ( void ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GCOSRoi").

Implements GRoi.

Definition at line 90 of file GCOSRoi.hpp.

◆ clear()

void GCOSRoi::clear ( void )
virtual

Clear region of interest.

Implements GRoi.

Definition at line 159 of file GCOSRoi.cpp.

References free_members(), GRoi::free_members(), init_members(), and GRoi::init_members().

Referenced by GCOSEventList::init_members().

◆ clone()

GCOSRoi * GCOSRoi::clone ( void ) const
virtual

Clone region of interest.

Returns
Pointer to deep copy of COSI region of interest.

Implements GRoi.

Definition at line 179 of file GCOSRoi.cpp.

References GCOSRoi().

◆ contains()

bool GCOSRoi::contains ( const GEvent & event) const
virtual

Check if region of interest contains an event.

Returns
True if region of interest contains event, false otherwise.

This method checks whether an event is contained in the region of interest. As COSI regions of interest are always 180 deg an event is always contained in the region in case that a region of interest is defined (i.e. it has a radius of 180 deg).

If the instrument direction of the event is not of type GCOSInstDir then the method returns false.

Implements GRoi.

Definition at line 198 of file GCOSRoi.cpp.

References contains(), and m_radius.

Referenced by contains().

◆ copy_members()

void GCOSRoi::copy_members ( const GCOSRoi & roi)
protected

Copy class members.

Parameters
[in]roiCOSI region of interest.

Definition at line 303 of file GCOSRoi.cpp.

References m_radius.

Referenced by GCOSRoi(), and operator=().

◆ free_members()

void GCOSRoi::free_members ( void )
protected

Delete class members.

Definition at line 316 of file GCOSRoi.cpp.

Referenced by clear(), operator=(), and ~GCOSRoi().

◆ init_members()

void GCOSRoi::init_members ( void )
protected

Initialise class members.

Definition at line 288 of file GCOSRoi.cpp.

References m_radius.

Referenced by clear(), GCOSRoi(), GCOSRoi(), GCOSRoi(), and operator=().

◆ operator=()

GCOSRoi & GCOSRoi::operator= ( const GCOSRoi & roi)

Assignment operator.

Parameters
[in]roiCOSI region of interest.
Returns
COSI region of interest.

Definition at line 126 of file GCOSRoi.cpp.

References copy_members(), free_members(), init_members(), and GRoi::operator=().

◆ print()

std::string GCOSRoi::print ( const GChatter & chatter = NORMAL) const
virtual

Print region of interest information.

Parameters
[in]chatterChattiness.
Returns
String containing region of interest information.

Implements GRoi.

Definition at line 257 of file GCOSRoi.cpp.

References m_radius, gammalib::parformat(), SILENT, and gammalib::str().

◆ radius() [1/2]

void GCOSRoi::radius ( const double & radius)

Set radius of region of interest.

Parameters
[in]radiusRegion of interest radius (degrees).
Exceptions
GException::invalid_argumentROI radius is not 0 or 180 degrees.

Set the radius of the region of interest.

Definition at line 233 of file GCOSRoi.cpp.

References G_RADIUS, m_radius, radius(), and gammalib::str().

◆ radius() [2/2]

const double & GCOSRoi::radius ( void ) const
inline

Returns region of interest radius.

Returns
Region of interest radius (degrees).

Returns the radius of the region of interest in degrees.

Definition at line 104 of file GCOSRoi.hpp.

References m_radius.

Referenced by GCOSRoi(), radius(), GCOSEventList::read(), and GCOSEventList::write().

Member Data Documentation

◆ m_radius

double GCOSRoi::m_radius
protected

Region of interest radius.

Definition at line 80 of file GCOSRoi.hpp.

Referenced by contains(), copy_members(), init_members(), print(), radius(), and radius().


The documentation for this class was generated from the following files: