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

COSI event atom class. More...

#include <GCOSEventAtom.hpp>

Inheritance diagram for GCOSEventAtom:
GEventAtom GEvent GBase

Public Member Functions

 GCOSEventAtom (void)
 Void constructor.
 
 GCOSEventAtom (const GCOSEventAtom &atom)
 Copy constructor.
 
 GCOSEventAtom (const GCOSInstDir &dir, const GEnergy &energy, const GTime &time)
 Event constructor.
 
virtual ~GCOSEventAtom (void)
 Destructor.
 
GCOSEventAtomoperator= (const GCOSEventAtom &atom)
 Assignment operator.
 
void clear (void)
 Clear event atom.
 
GCOSEventAtomclone (void) const
 Clone event atom.
 
std::string classname (void) const
 Return class name.
 
const GCOSInstDirdir (void) const
 Return event instrument direction.
 
const GEnergyenergy (void) const
 Return event energy.
 
const GTimetime (void) const
 Return event time.
 
std::string print (const GChatter &chatter=NORMAL) const
 Print event information.
 
void dir (const GCOSInstDir &dir)
 Set event instrument direction.
 
void energy (const GEnergy &energy)
 Set event energy.
 
void time (const GTime &time)
 Set event time.
 
- Public Member Functions inherited from GEventAtom
 GEventAtom (void)
 Void constructor.
 
 GEventAtom (const GEventAtom &atom)
 Copy constructor.
 
virtual ~GEventAtom (void)
 Destructor.
 
virtual GEventAtomoperator= (const GEventAtom &atom)
 Assignment operator.
 
virtual double size (void) const
 Return size of an event atom.
 
virtual double counts (void) const
 Return number of counts in event atom.
 
virtual double error (void) const
 Return error in number of counts in event atom.
 
bool is_atom (void) const
 Signal if event is an atom.
 
bool is_bin (void) const
 Signal if event is a bin.
 
- Public Member Functions inherited from GEvent
 GEvent (void)
 Void constructor.
 
 GEvent (const GEvent &event)
 Copy constructor.
 
virtual ~GEvent (void)
 Destructor.
 
virtual GEventoperator= (const GEvent &event)
 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 GCOSEventAtom &atom)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
- Protected Member Functions inherited from GEventAtom
void init_members (void)
 Initialise class members.
 
void copy_members (const GEventAtom &atom)
 Copy class members.
 
void free_members (void)
 Delete class members.
 
- Protected Member Functions inherited from GEvent
void init_members (void)
 Initialise class members.
 
void copy_members (const GEvent &event)
 Copy class members.
 
void free_members (void)
 Delete class members.
 

Protected Attributes

GCOSInstDir m_dir
 Event direction.
 
GEnergy m_energy
 Event energy.
 
GTime m_time
 Event time.
 

Friends

bool operator< (const GCOSEventAtom &a, const GCOSEventAtom &b)
 Check if time of one event atom is smaller than time of another event atom.
 

Detailed Description

COSI event atom class.

Definition at line 47 of file GCOSEventAtom.hpp.

Constructor & Destructor Documentation

◆ GCOSEventAtom() [1/3]

GCOSEventAtom::GCOSEventAtom ( void )

Void constructor.

Creates an empty COSI event atom.

Definition at line 54 of file GCOSEventAtom.cpp.

References init_members().

Referenced by clone().

◆ GCOSEventAtom() [2/3]

GCOSEventAtom::GCOSEventAtom ( const GCOSEventAtom & atom)

Copy constructor.

Parameters
[in]atomCOSI event atom.

Definition at line 69 of file GCOSEventAtom.cpp.

References copy_members(), and init_members().

◆ GCOSEventAtom() [3/3]

GCOSEventAtom::GCOSEventAtom ( const GCOSInstDir & dir,
const GEnergy & energy,
const GTime & time )

Event constructor.

Parameters
[in]dirCOSI instrument direction.
[in]energyEvent energy.
[in]timeEvent trigger time.

Constructs a COSI event from the instrument direction, event energy and event trigger time.

Definition at line 92 of file GCOSEventAtom.cpp.

References dir(), energy(), init_members(), and time().

◆ ~GCOSEventAtom()

GCOSEventAtom::~GCOSEventAtom ( void )
virtual

Destructor.

Definition at line 112 of file GCOSEventAtom.cpp.

References free_members().

Member Function Documentation

◆ classname()

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

Return class name.

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

Implements GEventAtom.

Definition at line 95 of file GCOSEventAtom.hpp.

◆ clear()

void GCOSEventAtom::clear ( void )
virtual

Clear event atom.

Clears COSI event atom by resetting all class members to an initial state. Any information that was present before will be lost.

Implements GEventAtom.

Definition at line 170 of file GCOSEventAtom.cpp.

References free_members(), GEvent::free_members(), GEventAtom::free_members(), init_members(), GEvent::init_members(), and GEventAtom::init_members().

◆ clone()

GCOSEventAtom * GCOSEventAtom::clone ( void ) const
virtual

Clone event atom.

Returns
Pointer to deep copy of COSI event atom.

Implements GEventAtom.

Definition at line 192 of file GCOSEventAtom.cpp.

References GCOSEventAtom().

◆ copy_members()

void GCOSEventAtom::copy_members ( const GCOSEventAtom & atom)
protected

Copy class members.

Parameters
[in]atomCOSI event atom.

Definition at line 250 of file GCOSEventAtom.cpp.

References m_dir, m_energy, and m_time.

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

◆ dir() [1/2]

void GCOSEventAtom::dir ( const GCOSInstDir & dir)
inline

Set event instrument direction.

Parameters
[in]dirEvent instrument direction.

Sets the event instrument direction.

Definition at line 125 of file GCOSEventAtom.hpp.

References dir(), and m_dir.

◆ dir() [2/2]

const GCOSInstDir & GCOSEventAtom::dir ( void ) const
inlinevirtual

Return event instrument direction.

Returns
Event instrument direction.

Returns the instrument direction of the event. The instrument direction is the event location in the three-dimensional COSI data space, spanned by the scattering angles Chi and Psi and the Compton scatter angle Phi.

Implements GEventAtom.

Definition at line 111 of file GCOSEventAtom.hpp.

References m_dir.

Referenced by dir(), and GCOSEventAtom().

◆ energy() [1/2]

void GCOSEventAtom::energy ( const GEnergy & energy)
inline

Set event energy.

Parameters
[in]energyEvent energy.

Sets the event energy.

Definition at line 154 of file GCOSEventAtom.hpp.

References energy(), and m_energy.

◆ energy() [2/2]

const GEnergy & GCOSEventAtom::energy ( void ) const
inlinevirtual

Return event energy.

Returns
Event energy.

Returns the measured energy of the photon on the sky.

Implements GEventAtom.

Definition at line 140 of file GCOSEventAtom.hpp.

References m_energy.

Referenced by energy(), and GCOSEventAtom().

◆ free_members()

void GCOSEventAtom::free_members ( void )
protected

Delete class members.

Definition at line 265 of file GCOSEventAtom.cpp.

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

◆ init_members()

void GCOSEventAtom::init_members ( void )
protected

Initialise class members.

Definition at line 233 of file GCOSEventAtom.cpp.

References GCOSInstDir::clear(), GEnergy::clear(), GTime::clear(), m_dir, m_energy, and m_time.

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

◆ operator=()

GCOSEventAtom & GCOSEventAtom::operator= ( const GCOSEventAtom & atom)

Assignment operator.

Parameters
[in]atomCOSI event atom.
Returns
COSI event atom.

Definition at line 134 of file GCOSEventAtom.cpp.

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

◆ print()

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

Print event information.

Parameters
[in]chatterChattiness.
Returns
String containing event information.

Implements GEventAtom.

Definition at line 204 of file GCOSEventAtom.cpp.

References m_dir, m_energy, m_time, GCOSInstDir::print(), GEnergy::print(), GTime::print(), gammalib::reduce(), and SILENT.

◆ time() [1/2]

void GCOSEventAtom::time ( const GTime & time)
inline

Set event time.

Parameters
[in]timeEvent time.

Sets the event time.

Definition at line 183 of file GCOSEventAtom.hpp.

References m_time, and time().

◆ time() [2/2]

const GTime & GCOSEventAtom::time ( void ) const
inlinevirtual

Return event time.

Returns
Event time.

Returns the event triggering time.

Implements GEventAtom.

Definition at line 169 of file GCOSEventAtom.hpp.

References m_time.

Referenced by GCOSEventAtom(), and time().

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const GCOSEventAtom & a,
const GCOSEventAtom & b )
friend

Check if time of one event atom is smaller than time of another event atom.

Parameters
[in]aFirst event atom.
[in]bSecond event atom.
Returns
True if time of a is smaller than time of b.

Definition at line 199 of file GCOSEventAtom.hpp.

Member Data Documentation

◆ m_dir

GCOSInstDir GCOSEventAtom::m_dir
protected

Event direction.

Definition at line 83 of file GCOSEventAtom.hpp.

Referenced by copy_members(), dir(), dir(), init_members(), and print().

◆ m_energy

GEnergy GCOSEventAtom::m_energy
protected

Event energy.

Definition at line 84 of file GCOSEventAtom.hpp.

Referenced by copy_members(), energy(), energy(), init_members(), and print().

◆ m_time

GTime GCOSEventAtom::m_time
protected

Event time.

Definition at line 85 of file GCOSEventAtom.hpp.

Referenced by copy_members(), init_members(), print(), time(), and time().


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