GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEventAtom Class Referenceabstract

Abstract interface for the event atom class. More...

#include <GEventAtom.hpp>

Inheritance diagram for GEventAtom:
GEvent GBase GCOMEventAtom GCTAEventAtom GLATEventAtom

Public Member Functions

 GEventAtom (void)
 Void constructor. More...
 
 GEventAtom (const GEventAtom &atom)
 Copy constructor. More...
 
virtual ~GEventAtom (void)
 Destructor. More...
 
virtual GEventAtomoperator= (const GEventAtom &atom)
 Assignment operator. More...
 
virtual void clear (void)=0
 Clear object. More...
 
virtual GEventclone (void) const =0
 Clones object. More...
 
virtual std::string classname (void) const =0
 Return class name. More...
 
virtual double size (void) const
 Return size of an event atom. More...
 
virtual const GInstDirdir (void) const =0
 
virtual const GEnergyenergy (void) const =0
 
virtual const GTimetime (void) const =0
 
virtual double counts (void) const
 Return number of counts in event atom. More...
 
virtual double error (void) const
 Return error in number of counts in event atom. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. More...
 
bool is_atom (void) const
 Signal if event is an atom. More...
 
bool is_bin (void) const
 Signal if event is a bin. More...
 
- Public Member Functions inherited from GEvent
 GEvent (void)
 Void constructor. More...
 
 GEvent (const GEvent &event)
 Copy constructor. More...
 
virtual ~GEvent (void)
 Destructor. More...
 
virtual GEventoperator= (const GEvent &event)
 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 GEventAtom &atom)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from GEvent
void init_members (void)
 Initialise class members. More...
 
void copy_members (const GEvent &event)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Friends

class GEvents
 

Detailed Description

Abstract interface for the event atom class.

An event atom is a single event occurring in an instrument. Event atoms are used for unbinned analysis.

Each event has 3 attributes: energy, instrument direction and time. These attributes can be accessed and changed through the energy(), dir(), and time() methods.

The counts() and error() methods return the number of counts and the error in this number for each event. For event atoms the number of counts is 1 and the error is 0.

The size() method returns the size of an event bin ,which is the quantity that has to be multiplied by the probability for an event to occur to predict the number of events in a bin. For event atoms this quantity is by definition 1.

The GEventAtom class does not hold any data members. Data members are stored in the derived classes.

Definition at line 62 of file GEventAtom.hpp.

Constructor & Destructor Documentation

GEventAtom::GEventAtom ( void  )

Void constructor.

Definition at line 51 of file GEventAtom.cpp.

References init_members().

GEventAtom::GEventAtom ( const GEventAtom atom)

Copy constructor.

Parameters
[in]atomEvent atom.

Definition at line 66 of file GEventAtom.cpp.

References copy_members(), and init_members().

GEventAtom::~GEventAtom ( void  )
virtual

Destructor.

Definition at line 82 of file GEventAtom.cpp.

References free_members().

Member Function Documentation

virtual std::string GEventAtom::classname ( void  ) const
pure virtual

Return class name.

Returns
String containing the class name.

Returns the class name for non-abstract classes in a human readable way.

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

virtual void GEventAtom::clear ( void  )
pure virtual

Clear object.

Sets the object to a clean initial state. After calling the method the object will be in the same state as it were if an empty instance of the object would have been created.

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

virtual GEvent* GEventAtom::clone ( void  ) const
pure virtual

Clones object.

Returns
Pointer to deep copy of object.

Creates a deep copy of the object and returns a pointer to the object.

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

void GEventAtom::copy_members ( const GEventAtom atom)
protected

Copy class members.

Parameters
[in]atomEvent atom.

Definition at line 155 of file GEventAtom.cpp.

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

double GEventAtom::counts ( void  ) const
inlinevirtual

Return number of counts in event atom.

Returns
Number of counts, fixed to 1.0 for an event atom.

Implements GEvent.

Definition at line 123 of file GEventAtom.hpp.

virtual const GInstDir& GEventAtom::dir ( void  ) const
pure virtual

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

virtual const GEnergy& GEventAtom::energy ( void  ) const
pure virtual

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

double GEventAtom::error ( void  ) const
inlinevirtual

Return error in number of counts in event atom.

Returns
Error in number of counts, fixed to 0.0 for an event atom.

Implements GEvent.

Definition at line 135 of file GEventAtom.hpp.

void GEventAtom::free_members ( void  )
protected

Delete class members.

Definition at line 165 of file GEventAtom.cpp.

Referenced by GCOMEventAtom::clear(), GLATEventAtom::clear(), GCTAEventAtom::clear(), operator=(), and ~GEventAtom().

void GEventAtom::init_members ( void  )
protected

Initialise class members.

Definition at line 143 of file GEventAtom.cpp.

Referenced by GCOMEventAtom::clear(), GLATEventAtom::clear(), GCTAEventAtom::clear(), GEventAtom(), and operator=().

bool GEventAtom::is_atom ( void  ) const
inlinevirtual

Signal if event is an atom.

Returns
True.

Implements GEvent.

Definition at line 147 of file GEventAtom.hpp.

bool GEventAtom::is_bin ( void  ) const
inlinevirtual

Signal if event is a bin.

Returns
False.

Implements GEvent.

Definition at line 159 of file GEventAtom.hpp.

GEventAtom & GEventAtom::operator= ( const GEventAtom atom)
virtual

Assignment operator.

Parameters
[in]atomEvent atom.
Returns
Event atom.

Definition at line 104 of file GEventAtom.cpp.

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

Referenced by GCOMEventAtom::operator=(), GLATEventAtom::operator=(), and GCTAEventAtom::operator=().

virtual std::string GEventAtom::print ( const GChatter chatter = NORMAL) const
pure virtual

Print content of object.

Parameters
[in]chatterChattiness (defaults to NORMAL).
Returns
String containing the content of the object.

Formats the content in a standard way and puts this content in a C++ string that is returned.

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

double GEventAtom::size ( void  ) const
inlinevirtual

Return size of an event atom.

Returns
Event size, fixed to 1.0 for an event atom.

Returns the size of an event atom. The size is only useful for event bins, for which it is defined as the quantity that needs to be multiplied by the event probability to give the predicted number of events in a bin. For event atoms, the size is fixed to 1.0.

Implements GEvent.

Definition at line 111 of file GEventAtom.hpp.

virtual const GTime& GEventAtom::time ( void  ) const
pure virtual

Implements GEvent.

Implemented in GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

Friends And Related Function Documentation

friend class GEvents
friend

Definition at line 65 of file GEventAtom.hpp.


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