CRingPhysicsEventCountItem

Name

CRingPhysicsEventCountItem -- Provides statistics regarding the number of events produced.

Synopsis


#include <CRingPhysicsEventCountItem.h>
         
 class CRingPhysicsEventCountItem {

  CRingPhysicsEventCountItem();
  CRingPhysicsEventCountItem(uint64_t count, uint32_t timeOffset);
  CRingPhysicsEventCountItem(uint64_t count, uint32_t timeoffset, time_t stamp);
  CRingPhysicsEventCountItem(const CRingItem& rhs)
          throws std::bad_cast;
  CRingPhysicsEventCountItem(const CRingPhysicsEventCountItem& rhs);

  virtual ~CRingPhysicsEventCountItem();

  CRingPhysicsEventCountItem& operator=(const CRingPhysicsEventCountItem& rhs);
  const int operator==(const CRingPhysicsEventCountItem& rhs);
  const int operator!=(const CRingPhysicsEventCountItem& rhs);
  const uint32_t getTimeOffset();
  void setTimeOffset(uint32_t offset);
  const time_t getTimestamp();
  void setTimestamp(time_t stamp);
  const uint64_t getEventCount();
  void setEventCount(uint64_t count);
}

Description

This class encapsulates the PhysicsEventCountItem ring item. That item is used to indicate how many events have been acquired so far this run. Timestamps and run time offset allow this to be used to compute trigger rates. Clients that need to know the fraction of PHYSICS_EVENT items they are receiving can also use this.

Public member functions

CRingPhysicsEventCountItem();

Default constructor. The event count and time offset will be zeroed. The timestamp will be the time the constructor was called.

CRingPhysicsEventCountItem(uint64_t count, uint32_t timeOffset);

Constructs an event count item which is initialized with the specified count of triggers and is said to have occured timeOffset seconds into the run.

CRingPhysicsEventCountItem(uint64_t count, uint32_t timeoffset, time_t stamp);

Same as the previous constructor with the added initialization of the item's timestamp to stamp.

CRingPhysicsEventCountItem(const CRingItem& rhs) throws std::bad_cast;

Constructs an event count item from an existing ring item; rhs. If rhs is not of type PHYSICS_EVENT_COUNT, a std::bad_cast exception is thrown.

CRingPhysicsEventCountItem(const CRingPhysicsEventCountItem& rhs);

Provides support for copy construction.

CRingPhysicsEventCountItem& operator=(const CRingPhysicsEventCountItem& rhs);

Provides support for assignment of another event count item, rhs to the object.

const int operator==(const CRingPhysicsEventCountItem& rhs);

Provides support for comparing two event count items to each other for functional equality.

const int operator!=(const CRingPhysicsEventCountItem& rhs);

Compares two items for functional equality and returns the logical inverse of the result.

const uint32_t getTimeOffset();

Returns the current value of the time offset field of the item.

void setTimeOffset(uint32_t offset);

Sets the value of the time offset field of the item to offset.

const time_t getTimestamp();

Returns the current timestamp of the item.

void setTimestamp(time_t stamp);

Sets the object's absolute timestamp to stamp.

const uint64_t getEventCount();

Returns the count of the number of eveents that have been accepted in the run so far (according to this item).

void setEventCount(uint64_t count);

Sets the event count field of the item to count.

Exceptions

std::bad_cast is thrown on an attempt to construct an event count item out of an item that is not of type PHYSICS_EVENT_COUNT.