GammaLib
2.0.0
|
Abstract interface for the event classes. More...
#include <GEvent.hpp>
Public Member Functions | |
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... | |
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 |
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... | |
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.
GEvent::GEvent | ( | void | ) |
GEvent::GEvent | ( | const GEvent & | event | ) |
Copy constructor.
[in] | event | Event. |
Definition at line 67 of file GEvent.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 GBase.
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GCTAEventAtom, GMWLDatum, GLATEventAtom, and GCOMEventAtom.
|
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.
|
pure virtual |
Clones 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.
|
protected |
Copy class members.
[in] | event | GEvent members which should be copied. |
Definition at line 153 of file GEvent.cpp.
Referenced by GEvent(), and operator=().
|
pure virtual |
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
|
pure virtual |
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GMWLDatum, GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.
Referenced by GLATResponse::irf().
|
pure virtual |
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GMWLDatum, GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.
Referenced by GResponse::convolve(), GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelCubeBackground::eval(), GCTAModelRadialAcceptance::eval(), GCTAModelBackground::eval(), and GCTAModelSkyCube::eval().
|
pure virtual |
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
|
protected |
Delete class members.
Definition at line 163 of file GEvent.cpp.
Referenced by GCOMEventAtom::clear(), GLATEventAtom::clear(), GCTAEventAtom::clear(), GMWLDatum::clear(), GCOMEventBin::clear(), GLATEventBin::clear(), GCTAEventBin::clear(), GSPIEventBin::clear(), operator=(), and ~GEvent().
|
protected |
Initialise class members.
Definition at line 141 of file GEvent.cpp.
Referenced by GCOMEventAtom::clear(), GLATEventAtom::clear(), GCTAEventAtom::clear(), GMWLDatum::clear(), GCOMEventBin::clear(), GLATEventBin::clear(), GCTAEventBin::clear(), GSPIEventBin::clear(), GEvent(), and operator=().
|
pure virtual |
Implemented in GEventBin, and GEventAtom.
Referenced by GCTAModelIrfBackground::eval(), GLATResponse::irf_diffuse(), GLATResponse::irf_ptsrc(), and GLATResponse::irf_spatial().
|
pure virtual |
Implemented in GEventBin, and GEventAtom.
Referenced by GCTAResponseCube::irf_diffuse(), GCTAResponseCube::irf_elliptical(), GCTAResponseCube::irf_ptsrc(), and GCTAResponseCube::irf_radial().
Assignment operator.
[in] | event | Event. |
Definition at line 105 of file GEvent.cpp.
References copy_members(), free_members(), and init_members().
Referenced by GEventAtom::operator=(), and GEventBin::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 GBase.
Implemented in GEventBin, GSPIEventBin, GEventAtom, GCTAEventBin, GCOMEventBin, GLATEventBin, GMWLDatum, GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.
|
pure virtual |
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, and GMWLDatum.
Referenced by GCTAModelSkyCube::eval().
|
pure virtual |
Implemented in GEventBin, GEventAtom, GSPIEventBin, GCTAEventBin, GCOMEventBin, GLATEventBin, GMWLDatum, GCTAEventAtom, GLATEventAtom, and GCOMEventAtom.
Referenced by GCTAModelIrfBackground::eval(), GCTAModelAeffBackground::eval(), GCTAModelCubeBackground::eval(), GCTAModelRadialAcceptance::eval(), GCTAModelBackground::eval(), and GCTAModelSkyCube::eval().