GammaLib
2.1.0.dev
|
Abstract interface for the event bin class. More...
#include <GEventBin.hpp>
Public Member Functions | |
GEventBin (void) | |
Void constructor. More... | |
GEventBin (const GEventBin &bin) | |
Copy constructor. More... | |
virtual | ~GEventBin (void) |
Destructor. More... | |
virtual GEventBin & | operator= (const GEventBin &bin) |
Assignment operator. More... | |
virtual void | clear (void)=0 |
Clear object. More... | |
virtual GEvent * | clone (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 GInstDir & | dir (void) const =0 |
virtual const GEnergy & | energy (void) const =0 |
virtual const GTime & | time (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 GEvent & | operator= (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 |
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.
GEventBin::GEventBin | ( | void | ) |
GEventBin::GEventBin | ( | const GEventBin & | bin | ) |
Copy constructor.
[in] | bin | Event bin. |
Definition at line 67 of file GEventBin.cpp.
References copy_members(), and init_members().
|
virtual |
|
pure virtual |
Return 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.
|
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.
|
pure virtual |
Clones 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.
|
protected |
Copy class members.
[in] | bin | Event bin. |
Definition at line 172 of file GEventBin.cpp.
Referenced by GEventBin(), and operator=().
|
pure virtual |
Implements GEvent.
Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
Referenced by error(), GObservation::likelihood_gaussian_binned(), and GObservation::likelihood_poisson_binned().
|
pure virtual |
Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
|
pure virtual |
Implements GEvent.
Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
|
pure virtual |
Implements GEvent.
Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
|
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().
|
protected |
Delete class members.
Definition at line 182 of file GEventBin.cpp.
Referenced by GMWLDatum::clear(), GCOMEventBin::clear(), GLATEventBin::clear(), GCTAEventBin::clear(), GSPIEventBin::clear(), operator=(), and ~GEventBin().
|
protected |
Initialise class members.
Definition at line 160 of file GEventBin.cpp.
Referenced by GMWLDatum::clear(), GCOMEventBin::clear(), GLATEventBin::clear(), GCTAEventBin::clear(), GSPIEventBin::clear(), GEventBin(), and operator=().
|
inlinevirtual |
Signal if event is an atom.
Implements GEvent.
Definition at line 109 of file GEventBin.hpp.
|
inlinevirtual |
Signal if event is a bin.
Implements GEvent.
Definition at line 121 of file GEventBin.hpp.
Assignment operator.
[in] | bin | 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=().
Print content of object.
[in] | chatter | Chattiness (defaults to NORMAL). |
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.
|
pure virtual |
Implements GEvent.
Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
Referenced by GObservation::likelihood_gaussian_binned(), GObservation::likelihood_poisson_binned(), and GCOMObservation::npred().
|
pure virtual |
Implements GEvent.
Implemented in GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
|
friend |
Definition at line 67 of file GEventBin.hpp.