#include <CGlomParameters.h> class CGlomParameters : public CRingItem { public: typedef enum _TimestampPolicy { first = 0, last = 1, average = 2 } TimestampPolicy; public: CGlomParameters(uint64_t interval, bool isBuilding, TimestampPolicy policy); virtual uint64_t coincidenceTicks() const; virtual bool isBuilding() const; virtual TimestampPolicy timestampPolicy() const; virtual std::string typeName() const; virtual std::string toString() const; virtual void* getBodyHeader() const; virtual void setBodyHeader(uint64_t timestamp, uint32_t sourceId, uint32_t barrierType = 0); };
NSCLDAQ versions that support event building use this ring item type to allow the event builder to document its event builder settings. The most important of these is the actual event building coincidence interval.
The following public methods are provided.
CGlomParameters(uint64_t interval, bool isBuilding, TimestampPolicy policy);
Fully parameterized construction. interval
is the coincidence interval used to build events from
the sorted fragments. If isBuilding
is false, the output stream is just a stream of single
fragment events, regardless of the coincidence interval.
This is intended for use in testing only.
>policy
is the policy used to derive
timestamps of the output event stream from the
fragments that compose them.
See DATA TYPES and CONSTANTS
for valid values and their meanings.
const virtual uint64_t coincidenceTicks();
Returns the coincidence interval stored in the object. The units of this value are timestamp ticks.
const virtual bool isBuilding();
Returns the state of the object's building flag. If true, the data are event built. If not the event builder was run in a test mode where each event output consists of a single fragment.
const virtual TimestampPolicy timestampPolicy();
Returns the timestamp policy used to derive the timestamp of output events.
const virtual std::string typeName();
Returns a string that identifies the ring item type: Glom Parameters.
const virtual std::string toString();
Returns a stringified representation of the object. Intended for use in e.g. dumper.
const virtual void* getBodyHeader();
Returns a pointer to the object's body header. Since glom parameter items dont, at present, have body headers, expect a nullptr to be returned.
virtual void setBodyHeader(uint64_t timestamp, uint32_t sourceId , uint32_t barrierType = 0);
Sets/adds a body header to the item. Since glom parameter items don't have a body header, this is a no-op.
The CGlomParameters
class provides
a single data type: TimestampPolicy. THe
event builder in NSCLDAQ supports hierarchical event building.
This means that the output of an event builder can be input
for a subsequent event builder in the data acquisition
data flow.
This allows detector systems which require an event builder of their own to be run together with other detector systems by simply providing a second level event builder to glue together events from each detector subsystem into coincident events.
This ability for hierarchical event building requires that output events are also given a timestamp. The TimestampPolicy data type provides a type that specifies how this output timestamp is determined. It can have the following values:
The output timestamp is taken from the earliest (first) fragment's timestamp.
The output timestamp is taken from the latest (last) fragment's timestamp.
The output timestamp is the average of all timestamps of the fragments that make up the event.