GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEvent Class Referenceabstract

Abstract interface for the event classes. More...

#include <GEvent.hpp>

Inheritance diagram for GEvent:
GBase GEventAtom GEventBin GCOMEventAtom GCTAEventAtom GLATEventAtom GCOMEventBin GCTAEventBin GLATEventBin GMWLDatum GSPIEventBin

Public Member Functions

 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...
 
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 =0
 
virtual const GInstDirdir (void) const =0
 
virtual const GEnergyenergy (void) const =0
 
virtual const GTimetime (void) const =0
 
virtual double counts (void) const =0
 
virtual double error (void) const =0
 
virtual bool is_atom (void) const =0
 
virtual bool is_bin (void) const =0
 
virtual std::string print (const GChatter &chatter=NORMAL) const =0
 Print content of object. 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 GEvent &event)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 

Detailed Description

Abstract interface for the event classes.

This class provides an abstract interface to an event. An event can be either a physical event occurring in the instrument (called an event atom) or a collection of events with similar properties (called an event bin). While event atoms are used for unbinned analysis, event bins are used for binned analysis. The methods is_atom() and is_bin() inform whether an event is an atom or a bin.

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 event bins, the number of counts is the number of events within a bin, and error is the uncertainty in this number (typically the square root of the number, yet also other schemes may be implemented).

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. For event bins, the size is the solid angle of the event bin times the energy width times the ontime interval covered by the events.

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

Definition at line 71 of file GEvent.hpp.

Constructor & Destructor Documentation

GEvent::GEvent ( void  )

Void constructor.

Definition at line 52 of file GEvent.cpp.

References init_members().

GEvent::GEvent ( const GEvent event)

Copy constructor.

Parameters
[in]eventEvent.

Definition at line 67 of file GEvent.cpp.

References copy_members(), and init_members().

GEvent::~GEvent ( void  )
virtual

Destructor.

Definition at line 83 of file GEvent.cpp.

References free_members().

Member Function Documentation

virtual std::string GEvent::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 GBase.

Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GCTAEventAtom, GMWLDatum, GLATEventAtom, and GCOMEventAtom.

virtual void GEvent::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 GBase.

Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GCTAEventAtom, GMWLDatum, GLATEventAtom, and GCOMEventAtom.

virtual GEvent* GEvent::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 GBase.

Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GCTAEventAtom, GMWLDatum, GLATEventAtom, and GCOMEventAtom.

void GEvent::copy_members ( const GEvent event)
protected

Copy class members.

Parameters
[in]eventGEvent members which should be copied.

Definition at line 153 of file GEvent.cpp.

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

virtual double GEvent::counts ( void  ) const
pure virtual
virtual const GInstDir& GEvent::dir ( void  ) const
pure virtual
virtual double GEvent::error ( void  ) const
pure virtual
void GEvent::free_members ( void  )
protected
void GEvent::init_members ( void  )
protected
virtual bool GEvent::is_atom ( void  ) const
pure virtual
virtual bool GEvent::is_bin ( void  ) const
pure virtual
GEvent & GEvent::operator= ( const GEvent event)
virtual

Assignment operator.

Parameters
[in]eventEvent.
Returns
Event.

Definition at line 105 of file GEvent.cpp.

References copy_members(), free_members(), and init_members().

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

virtual std::string GEvent::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 GBase.

Implemented in GEventBin, GSPIEventBin, GEventAtom, GCTAEventBin, GCOMEventBin, GLATEventBin, GMWLDatum, GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.

virtual double GEvent::size ( void  ) const
pure virtual

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