#include <CRingPhysicsEventCountItem.h>
class CRingPhysicsEventCountItem {
}
CRingPhysicsEventCountItem();
CRingPhysicsEventCountItem(uint64_t count, uint32_t timeOffset);
CRingPhysicsEventCountItem(uint64_t count, uint32_t timeoffset, time_t stamp);
CRingPhysicsEventCountItem(uint64_t timestamp, uint32_t source, uint32_t barrier, uint64_t count, uint32_t timeoffset, time_t stamp, int divisor = 1);
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 float computeElapsedTime();
const uint32_t getTimeDivisor();
const time_t getTimestamp();
void setTimestamp(time_t stamp);
const uint64_t getEventCount();
void setEventCount(uint64_t count);
const uint32_t getOriginalSourceId();
// Added in V12.0virtual const std::string typeName();
virtual const std::string toString();
}
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.
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(uint64_t timestamp, uint32_t source, uint32_t barrier, uint64_t count, uint32_t timeoffset, time_t stamp, int divisor = 1);
Constructs a physics event count item with a full body header.
The contents of the body header are determined by the values
of timestamp
, source
and barrier
. The divisor
optional parameter provides support for run time intervals that
are less than one second. The actual time in seconds into the
run is
(float)timeoffset/divisor.
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 float computeElapsedSourceId();
Since NSCLDAQ-11.0, the elapsed time can is expressed in arbitrary ticks that are at least one tick per second. This allows for sub-second precision. This method returns the elapsed time in units of second.
const uint32_t getTimeDivisor();
Returns the conversion divisor that converts the elapsed time ticks into seconds.
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
.
const uint32_t getOriginalSourceId();
This method is available since NSCLDAQ V12.0. When the NSCLDAQ event builder is used, each data source is assigned a unique source id. Since multi-level event building is supported, the event builders themselves are assigned source ids and, emit data with body headers that reflect the event builder's source id.
This means that the source id of the body header can no longer
be used to identify the actual source of the event count item.
Therefore, beginning in NSCLDAQ-12.0, the source id used to
construct these items is also stored in the item body, which
the event builder does not touch.
getOriginalSourceId
returns
this source id and should be used rather than the
source id in the item's body header to identify the source
of this data.
virtual const std::string typeName();
Returns a text version of the ring item type field. This consists of the text Trigger count:.
virtual const std::string toString();
Returns a human readable string representation of the item.