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

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

#include <GEventBin.hpp>

Inheritance diagram for GEventBin:
GEvent GBase GCOMEventBin GCTAEventBin GLATEventBin GMWLDatum GSPIEventBin

Public Member Functions

 GEventBin (void)
 Void constructor. More...
 
 GEventBin (const GEventBin &bin)
 Copy constructor. More...
 
virtual ~GEventBin (void)
 Destructor. More...
 
virtual GEventBinoperator= (const GEventBin &bin)
 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
 Return error in number of counts. More...
 
virtual void counts (const double &counts)=0
 
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 GEventBin &bin)
 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 bin class.

An event bin is a collection of event atoms with similar properties. Event bins are used for binned 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 events within an event bin and the uncertainty in this number, which by default is given by the square root of the number of events (this is the default implementation provided by this class).

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

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

Definition at line 64 of file GEventBin.hpp.

Constructor & Destructor Documentation

GEventBin::GEventBin ( void  )

Void constructor.

Definition at line 52 of file GEventBin.cpp.

References init_members().

GEventBin::GEventBin ( const GEventBin bin)

Copy constructor.

Parameters
[in]binEvent bin.

Definition at line 67 of file GEventBin.cpp.

References copy_members(), and init_members().

GEventBin::~GEventBin ( void  )
virtual

Destructor.

Definition at line 83 of file GEventBin.cpp.

References free_members().

Member Function Documentation

virtual std::string GEventBin::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 GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

virtual void GEventBin::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 GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

virtual GEvent* GEventBin::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 GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

void GEventBin::copy_members ( const GEventBin bin)
protected

Copy class members.

Parameters
[in]binEvent bin.

Definition at line 172 of file GEventBin.cpp.

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

virtual double GEventBin::counts ( void  ) const
pure virtual
virtual void GEventBin::counts ( const double &  counts)
pure virtual
virtual const GInstDir& GEventBin::dir ( void  ) const
pure virtual

Implements GEvent.

Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

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

Implements GEvent.

Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

double GEventBin::error ( void  ) const
pure virtual

Return error in number of counts.

Returns \(\sqrt(counts)\) as the uncertainty in the number of counts in the bin. If counts <= 0 then zero is returned.

Implements GEvent.

Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

Definition at line 141 of file GEventBin.cpp.

References counts(), and sqrt().

Referenced by GObservation::likelihood_gaussian_binned().

void GEventBin::free_members ( void  )
protected
void GEventBin::init_members ( void  )
protected
bool GEventBin::is_atom ( void  ) const
inlinevirtual

Signal if event is an atom.

Returns
False.

Implements GEvent.

Definition at line 109 of file GEventBin.hpp.

bool GEventBin::is_bin ( void  ) const
inlinevirtual

Signal if event is a bin.

Returns
True.

Implements GEvent.

Definition at line 121 of file GEventBin.hpp.

GEventBin & GEventBin::operator= ( const GEventBin bin)
virtual

Assignment operator.

Parameters
[in]binEvent bin.
Returns
Event bin.

Definition at line 105 of file GEventBin.cpp.

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

Referenced by GMWLDatum::operator=(), GCOMEventBin::operator=(), GLATEventBin::operator=(), GCTAEventBin::operator=(), and GSPIEventBin::operator=().

virtual std::string GEventBin::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 GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

virtual double GEventBin::size ( void  ) const
pure virtual
virtual const GTime& GEventBin::time ( void  ) const
pure virtual

Implements GEvent.

Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.

Friends And Related Function Documentation

friend class GEvents
friend

Definition at line 67 of file GEventBin.hpp.


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