diff --git a/include/GEvent.hpp b/include/GEvent.hpp index d253ac2..4538ca5 100644 --- a/include/GEvent.hpp +++ b/include/GEvent.hpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GEvent.hpp - Event abstract base class * + * GEvent.hpp - Abstract event base class * * ----------------------------------------------------------------------- * * copyright (C) 2009-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GEvent.hpp - * @brief GEvent abstract base class interface definition. + * @brief Abstract event base class definition * @author Juergen Knoedlseder */ @@ -77,7 +77,7 @@ public: virtual ~GEvent(void); // Operators - virtual GEvent& operator= (const GEvent& event); + virtual GEvent& operator=(const GEvent& event); // Pure virtual methods virtual void clear(void) = 0; diff --git a/include/GEventAtom.hpp b/include/GEventAtom.hpp index 1992328..2f1a893 100644 --- a/include/GEventAtom.hpp +++ b/include/GEventAtom.hpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GEventAtom.hpp - Event atom abstract base class * + * GEventAtom.hpp - Abstract event atom base class * * ----------------------------------------------------------------------- * * copyright (C) 2009-2013 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GEventAtom.hpp - * @brief GEventAtom abstract base class interface definition. + * @brief Abstract event atom base class definition * @author Juergen Knoedlseder */ @@ -71,22 +71,22 @@ public: virtual ~GEventAtom(void); // Operators - virtual GEventAtom& operator= (const GEventAtom& atom); + virtual GEventAtom& operator=(const GEventAtom& atom); // Pure virtual methods virtual void clear(void) = 0; virtual GEvent* clone(void) const = 0; - virtual double size(void) const { return 1.0; } + virtual double size(void) const; 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 { return 1.0; } - virtual double error(void) const { return 0.0; } + virtual double counts(void) const; + virtual double error(void) const; virtual std::string print(const GChatter& chatter = NORMAL) const = 0; // Other methods - bool isatom(void) const { return true; } - bool isbin(void) const { return false; } + bool isatom(void) const; + bool isbin(void) const; protected: // Protected methods @@ -95,4 +95,69 @@ protected: void free_members(void); }; + +/***********************************************************************//** + * @brief Return size of an event atom + * + * @return 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. + ***************************************************************************/ +inline +double GEventAtom::size(void) const +{ + return (1.0); +} + + +/***********************************************************************//** + * @brief Return number of counts in event atom + * + * @return Number of counts, fixed to 1.0 for an event atom. + ***************************************************************************/ +inline +double GEventAtom::counts(void) const +{ + return (1.0); +} + + +/***********************************************************************//** + * @brief Return error in number of counts in event atom + * + * @return Error in number of counts, fixed to 0.0 for an event atom. + ***************************************************************************/ +inline +double GEventAtom::error(void) const +{ + return (0.0); +} + + +/***********************************************************************//** + * @brief Signal if event is an atom + * + * @return True. + ***************************************************************************/ +inline +bool GEventAtom::isatom(void) const +{ + return (true); +} + + +/***********************************************************************//** + * @brief Signal if event is a bin + * + * @return False. + ***************************************************************************/ +inline +bool GEventAtom::isbin(void) const +{ + return (false); +} + #endif /* GEVENTATOM_HPP */ diff --git a/include/GEventBin.hpp b/include/GEventBin.hpp index d8aba34..15b094b 100644 --- a/include/GEventBin.hpp +++ b/include/GEventBin.hpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GEventBin.hpp - Event bin abstract base class * + * GEventBin.hpp - Abstract event bin base class * * ----------------------------------------------------------------------- * * copyright (C) 2009-2013 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GEventBin.hpp - * @brief GEventBin abstract base class interface definition. + * @brief Abstract event bin base class definition * @author Juergen Knoedlseder */ @@ -73,7 +73,7 @@ public: virtual ~GEventBin(void); // Operators - virtual GEventBin& operator= (const GEventBin& bin); + virtual GEventBin& operator=(const GEventBin& bin); // Pure virtual methods virtual void clear(void) = 0; @@ -88,8 +88,8 @@ public: virtual std::string print(const GChatter& chatter = NORMAL) const = 0; // Other methods - bool isatom(void) const { return false; } - bool isbin(void) const { return true; } + bool isatom(void) const; + bool isbin(void) const; protected: // Protected methods @@ -98,4 +98,28 @@ protected: void free_members(void); }; + +/***********************************************************************//** + * @brief Signal if event is an atom + * + * @return False. + ***************************************************************************/ +inline +bool GEventBin::isatom(void) const +{ + return (false); +} + + +/***********************************************************************//** + * @brief Signal if event is a bin + * + * @return True. + ***************************************************************************/ +inline +bool GEventBin::isbin(void) const +{ + return (true); +} + #endif /* GEVENTBIN_HPP */ diff --git a/pyext/GEvent.i b/pyext/GEvent.i index 8dbe8ea..5cc27f9 100644 --- a/pyext/GEvent.i +++ b/pyext/GEvent.i @@ -1,5 +1,5 @@ /*************************************************************************** - * GEvent.i - Abstract event class * + * GEvent.i - Abstract event base class * * ----------------------------------------------------------------------- * * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * diff --git a/pyext/GEventAtom.i b/pyext/GEventAtom.i index 536d75f..775b13c 100644 --- a/pyext/GEventAtom.i +++ b/pyext/GEventAtom.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GEventAtom.i - Abstract event atom class * + * GEventAtom.i - Abstract event atom base class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GEventAtom.i - * @brief Abstract event atom class interface definition + * @brief Abstract event atom base class definition * @author Juergen Knoedlseder */ %{ diff --git a/pyext/GEventBin.i b/pyext/GEventBin.i index 69abf57..a704a69 100644 --- a/pyext/GEventBin.i +++ b/pyext/GEventBin.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GEventBin.i - Abstract event bin class * + * GEventBin.i - Abstract event bin base class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2009-2013 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GEventBin.i - * @brief Abstract event bin class python interface definition + * @brief Abstract event bin base class definition * @author Juergen Knoedlseder */ %{ diff --git a/src/obs/GEvent.cpp b/src/obs/GEvent.cpp index fc8dfe1..ddd602c 100644 --- a/src/obs/GEvent.cpp +++ b/src/obs/GEvent.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GEvent.cpp - Event abstract base class * + * GEvent.cpp - Abstract event base class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2012 by Juergen Knoedlseder * + * copyright (C) 2009-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GEvent.cpp - * @brief GEvent abstract base class implementation. + * @brief Abstract event base class implementation * @author Juergen Knoedlseder */ @@ -100,8 +100,9 @@ GEvent::~GEvent(void) * @brief Assignment operator * * @param[in] event Event. + * @return Event. ***************************************************************************/ -GEvent& GEvent::operator= (const GEvent& event) +GEvent& GEvent::operator=(const GEvent& event) { // Execute only if object is not identical if (this != &event) { diff --git a/src/obs/GEventAtom.cpp b/src/obs/GEventAtom.cpp index adeb24d..20f65b7 100644 --- a/src/obs/GEventAtom.cpp +++ b/src/obs/GEventAtom.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GEventAtom.cpp - Event atom abstract base class * + * GEventAtom.cpp - Abstract event atom base class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2011 by Jurgen Knodlseder * + * copyright (C) 2009-2013 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,8 +20,8 @@ ***************************************************************************/ /** * @file GEventAtom.cpp - * @brief GEvent atom abstract base class implementation. - * @author J. Knodlseder + * @brief Abstract event atom base class implementation + * @author Juergen Knoedlseder */ /* __ Includes ___________________________________________________________ */ @@ -99,8 +99,9 @@ GEventAtom::~GEventAtom(void) * @brief Assignment operator * * @param[in] atom Event atom. + * @return Event atom. ***************************************************************************/ -GEventAtom& GEventAtom::operator= (const GEventAtom& atom) +GEventAtom& GEventAtom::operator=(const GEventAtom& atom) { // Execute only if object is not identical if (this != &atom) { diff --git a/src/obs/GEventBin.cpp b/src/obs/GEventBin.cpp index cf95946..48bff61 100644 --- a/src/obs/GEventBin.cpp +++ b/src/obs/GEventBin.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GEventBin.cpp - Event bin abstract base class * + * GEventBin.cpp - Abstract event bin base class * * ----------------------------------------------------------------------- * - * copyright (C) 2009-2011 by Jurgen Knodlseder * + * copyright (C) 2009-2013 by Jurgen Knodlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file GEventBin.cpp * @brief Abstract event bin base class implementation - * @author J. Knodlseder + * @author Juergen Knoedlseder */ /* __ Includes ___________________________________________________________ */ @@ -100,8 +100,9 @@ GEventBin::~GEventBin(void) * @brief Assignment operator * * @param[in] bin Event bin. + * @return Event bin. ***************************************************************************/ -GEventBin& GEventBin::operator= (const GEventBin& bin) +GEventBin& GEventBin::operator=(const GEventBin& bin) { // Execute only if object is not identical if (this != &bin) {