16 #ifndef HADAQ_CombinerModule
17 #define HADAQ_CombinerModule
19 #ifndef DABC_ModuleAsync
27 #ifndef HADAQ_HadaqTypeDefs
31 #ifndef HADAQ_Iterator
35 #define HADAQ_NEVTIDS 64UL
36 #define HADAQ_NEVTIDS_IN_FILE 0UL
37 #define HADAQ_RINGSIZE 100
163 for (
int n=0;n<RingSize;n++) {
164 if (first && (
fTrigNumRing[cnt]==0) && (n!=RingSize-1)) {
302 bool ShiftToNextEvent(
unsigned ninp,
bool fast =
false,
bool dropped =
false);
315 void SetInfo(
const std::string &info,
bool forceinfo =
false);
328 char*
Unit(
unsigned long v);
Represents command with its arguments.
Base class for user-derived code, implementing event-processing.
int fBNETbunch
number of events delivered to same event builder
void ProcessUserEvent(unsigned item) override
Method called by framework when custom user event is produced.
std::vector< InputCfg > fCfg
all input-dependent configurations
bool ShiftToNextEvent(unsigned ninp, bool fast=false, bool dropped=false)
Shifts to next event in the input queue.
bool fExtraDebug
when true, extra debug output is created
uint32_t fRunNumber
run id from timeofday for eventbuilding
long fBufCalls
number of buffer processing calls
std::string fDataDroppedRateName
long fOutCalls
number of output processing calls
uint32_t fTriggerRangeMask
dabc::TimeStamp fLastDropTm
timer used to avoid too often drop of data
uint32_t fEpicsRunNumber
most recent run id from epics, for multi eventbuilder mode
void AfterModuleStop() override
void SetInfo(const std::string &info, bool forceinfo=false)
bool ShiftToNextHadTu(unsigned ninp)
bool CheckDestination(uint32_t trignr)
int32_t fEBId
eventbuilder id <- node id
dabc::TimeStamp fLastBuildTm
last time when complete event was build
bool fSpecialFired
if user event was already fired
double fLastEventRate
last event rate
bool fBNETsend
indicate that combiner used as BNET sender
bool ShiftToNextBuffer(unsigned ninp)
Method should be used to skip current buffer from the queue.
double fEventBuildTimeout
timeout in seconds since last complete event when previous buffers are dropped
std::string fLostEventRateName
bool fHadesTriggerType
When true, read trigger type as in original hades event builders.
bool DropAllInputBuffers()
dabc::TimeStamp fLastDebugTm
timer used to generate rare debugs output
uint64_t fAllBuildEvents
number of build events
void StoreRunInfoStop(bool onexit=false, unsigned newrunid=0)
unsigned fEventIdCount[HADAQ_NEVTIDS]
void DoInputSnapshot(unsigned ninp)
dabc::Profiler fBldProfiler
profiler of build event performance
int fBNETNumSend
number of BNET senders
void ProcessOutputEvent(unsigned) override
Method called by framework when output event is produced.
std::string GenerateFileName(unsigned runid)
long fBldCalls
number of build event calls
uint64_t fAllFullDrops
number of complete drops
char * Unit(unsigned long v)
uint32_t fMaxHadaqTrigger
Defines trigger sequence number range for overflow.
long fInpCalls
number of input processing calls
uint64_t fRunBuildEvents
number of build events
unsigned fSpecialItemId
item used to create user events
bool fBNETrecv
indicate that second-level event building is performed
std::string fBnetInfo
info for showing of bnet sender
pid_t fPID
process id of combiner module
dabc::Command fBnetFileCmd
current running bnet file command
void ProcessInputEvent(unsigned) override
Method called by framework when input event is produced.
bool fEvnumDiffStatistics
if true, account difference of subsequent build event numbers as lost events if false,...
uint32_t fLastTrigNr
last number of build event
int DestinationPort(uint32_t trignr)
int ExecuteCommand(dabc::Command cmd) override
Main method where commands are executed.
void ProcessTimerEvent(unsigned timer) override
Method called by framework when timer event is produced.
bool ShiftToNextSubEvent(unsigned ninp, bool fast=false, bool dropped=false)
Shifts to next subevent in the input queue.
std::string fBnetStat
gener-purpose statistic in text form
std::string fEventRateName
std::string fDataRateName
dabc::TimeStamp fLastProcTm
last time when event building was called
std::string fBNETCalibrDir
name of extra directory where to store calibrations
void BeforeModuleStart() override
std::string fRunInfoToOraFilename
void ModuleCleanup() override
Method, which can be reimplemented by user and should cleanup all references on buffers and other obj...
int CalcTrigNumDiff(const uint32_t &prev, const uint32_t &next)
bool fSkipEmpty
skip empty subevents in final event, default true
dabc::Command fBnetRefreshCmd
current running refresh command
int fTriggerNrTolerance
maximum allowed difference of trigger numbers (subevent sequence number)
uint64_t fAllBuildEventsLimit
maximal number events to build
double fMaxProcDist
maximal time between calls to BuildEvent method
bool ReplyCommand(dabc::Command cmd) override
Reimplement this method to react on command reply Return true if command can be destroyed by framewor...
long fTimerCalls
number of timer events calls
unsigned fHadesTriggerHUB
void ProcessPoolEvent(unsigned) override
Method called by framework when pool event is produced.
CombinerModule(const std::string &name, dabc::Command cmd=nullptr)
dabc::Command fBnetCalibrCmd
current running bnet calibration command
void StartEventsBuilding()
std::string fBNETCalibrPackScript
name of script to pack calibration files
int fBNETNumRecv
number of BNET receivers
virtual ~CombinerModule()
uint64_t fLostEventRateCnt
uint64_t fDataDroppedRateCnt
Read iterator for HADAQ events/subevents.
Terminal for HADAQ event builder.
Write iterator for HADAQ events/subevents.
std::string format(const char *fmt,...)
Support for HADAQ - HADES DAQ
Class for acquiring and holding timestamps.
Hadaq subevent structure.