#include <v11/CGlomParameters.h> namespace v11 { class CGlomParameters : public ::CGlomParameters { public: CGlomParameters(uint64_t interval, bool isBuilding, TimestampPolicy policy); uint64_t coincidenceTicks() const; bool isBuilding() const; TimestampPolicy timestampPolicy() const; virtual std::string typeName() const; virtual std::string toString() const; virtual bool hasBodyHeader() const; virtual void* getBodyHeader() const; virtual void setBodyHeader(uint64_t timestamp, uint32_t sourceId, uint32_t barrierType = 0); }; } // v11 namespace
The v11::CGlomParameters
class provides the ability to document three
event builder settings in the event stream:
isBuilding -A boolean that, if true, indicates the event builder glom stage is actualy building events rather than emitting single fragment events.
coincidenceTicks The number of timestamp ticks in the coincidence interval that determines if fragments belong in the sam event. This is meaningless if the isBuilding flag is false.
timestampPolicy Determines how timestamps are assigned to output events from the fragments in that event.
In general, glom parameter items do not have body headers.
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.