DABC (Data Acquisition Backbone Core)  2.9.9
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
hadaq::CombinerModule Class Reference

#include <hadaq/CombinerModule.h>

Inheritance diagram for hadaq::CombinerModule:
dabc::ModuleAsync dabc::Module dabc::Worker dabc::Object

Data Structures

struct  InputCfg
 

Public Member Functions

int CalcTrigNumDiff (const uint32_t &prev, const uint32_t &next)
 
 CombinerModule (const std::string &name, dabc::Command cmd=nullptr)
 
int ExecuteCommand (dabc::Command cmd) override
 Main method where commands are executed. More...
 
void ModuleCleanup () override
 Method, which can be reimplemented by user and should cleanup all references on buffers and other objects. More...
 
void ProcessInputEvent (unsigned) override
 Method called by framework when input event is produced. More...
 
void ProcessOutputEvent (unsigned) override
 Method called by framework when output event is produced. More...
 
void ProcessPoolEvent (unsigned) override
 Method called by framework when pool event is produced. More...
 
void ProcessTimerEvent (unsigned timer) override
 Method called by framework when timer event is produced. More...
 
void ProcessUserEvent (unsigned item) override
 Method called by framework when custom user event is produced. More...
 
bool ReplyCommand (dabc::Command cmd) override
 Reimplement this method to react on command reply Return true if command can be destroyed by framework. More...
 
virtual ~CombinerModule ()
 
- Public Member Functions inherited from dabc::ModuleAsync
virtual const char * ClassName () const
 Returns class name of the object. More...
 
- Public Member Functions inherited from dabc::Module
std::string GetInfoParName () const
 
- Public Member Functions inherited from dabc::Worker
bool ActivateTimeout (double tmout_sec)
 Method used to produce timeout events in the worker. More...
 
Command Assign (Command cmd)
 ! Assign command with processor before command be submitted to other processor This produce ReplyCommand() call when command execution is finished Command itself returned if operation was successful, otherwise null() command More...
 
void AssignAddon (WorkerAddon *addon)
 Assigns addon to the worker Should be called before worker assigned to the thread. More...
 
bool AssignToThread (ThreadRef thrd, bool sync=true)
 Assign worker to thread, worker becomes active immediately. More...
 
bool CanSubmitCommand () const
 Returns true if command can be submitted to worker. More...
 
RecordField Cfg (const std::string &name, Command cmd=nullptr) const
 Returns configuration field of specified name Configuration value of specified name searched in following places: More...
 
bool DettachFromThread ()
 Detach worker from the thread, later worker can be assigned to some other thread Method especially useful to normally finish object recursion (if it possible). More...
 
bool Execute (Command cmd, double tmout=-1.)
 Execute command in the processor. More...
 
bool Execute (const std::string &cmd, double tmout=-1.)
 
bool HasThread () const
 Indicates if pointer on thread is not zero; thread-safe. More...
 
bool IsOwnThread () const
 Returns true if called from thread. More...
 
bool MakeThreadForWorker (const std::string &thrdname="")
 Creates appropriate thread for worker and assign worker to the thread. More...
 
Parameter Par (const std::string &name) const
 Returns reference on worker parameter object. More...
 
virtual std::string RequiredThrdClass () const
 Method returns name of required thread class for processor. More...
 
void SetWorkerPriority (int nq)
 
bool Submit (Command cmd)
 Submit command for execution in the processor. More...
 
ThreadRef thread ()
 Return reference on the worker thread; thread-safe. More...
 
std::string ThreadName () const
 Returns name of the worker thread; thread-safe
More...
 
 Worker (Reference parent, const std::string &name)
 
std::string WorkerAddress (bool full=true)
 Return address, which can be used to submit command to the worker If full specified, command can be submitted from any node, which has connection to this node. More...
 
uint32_t WorkerId () const
 
int WorkerPriority () const
 
virtual ~Worker ()
 
- Public Member Functions inherited from dabc::Object
bool AddChild (Object *child, bool withmutex=true) throw ()
 Add object to list of child objects, thread safe More...
 
bool AddChildAt (Object *child, unsigned pos, bool withmutex=true)
 Add object to list of child objects at specified position. More...
 
ObjectFindChild (const char *name) const
 returns pointer on child object with given name More...
 
Reference FindChildRef (const char *name, bool force=false) const throw ()
 returns reference on child object with given name More...
 
bool GetAllChildRef (ReferencesVector *vect) const
 
ObjectGetChild (unsigned n) const
 returns pointer on child object More...
 
Reference GetChildRef (unsigned n) const
 returns reference on child object More...
 
Reference GetFolder (const std::string &name, bool force=false) throw ()
 Return folder of specified name, no special symbols allowed. More...
 
const char * GetName () const
 Returns name of the object, thread safe More...
 
ObjectGetParent () const
 Returns pointer on parent object, thread safe More...
 
Reference GetParentRef () const
 
bool IsChildsHidden () const
 Return true if object wants to hide childs from hierarchy scan, thread safe More...
 
bool IsHidden () const
 Return true if object wants to be hidden from hierarchy scan, thread safe More...
 
bool IsLogging () const
 Return true if object selected for logging, thread safe More...
 
bool IsName (const char *str) const
 Checks if object name is same as provided string, thread safe More...
 
bool IsName (const char *str, int len) const
 Checks if object name is same as provided, thread safe More...
 
bool IsName (const std::string &str) const
 Checks if object name is same as provided string, thread safe More...
 
bool IsNameMatch (const std::string &mask) const
 Check if object name match to the mask. More...
 
bool IsOwner () const
 Returns true if object is owner of its children, thread safe More...
 
bool IsParent (Object *obj) const
 Checks if specified argument is in the list of object parents. More...
 
bool IsTopXmlLevel () const
 Return true if object should be searched in the top level of the xml file, thread safe More...
 
std::string ItemName (bool compact=true) const
 Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call. More...
 
unsigned NumChilds () const
 returns number of child objects More...
 
 Object (const std::string &name, unsigned flags=flIsOwner)
 Resolve problem with child-parent mutex locking. More...
 
 Object (Reference parent, const std::string &name, unsigned flags=flIsOwner)
 
virtual void Print (int lvl=0)
 Print object content on debug output. More...
 
bool RemoveChild (Object *child, bool cleanup=true) throw ()
 Detach child from parent object If cleanup==true and parent is owner of child, child will be destroyed. More...
 
bool RemoveChildAt (unsigned n, bool cleanup=true) throw ()
 Detach child object from parent at specified position If cleanup==true and object is owner of child, child will be destroyed. More...
 
bool RemoveChilds (bool cleanup=true)
 Remove all childs. More...
 
void SetLogging (bool on=true)
 Sets logging flag, thread safe More...
 
virtual ~Object ()
 

Protected Member Functions

void AfterModuleStop () override
 
void BeforeModuleStart () override
 
bool BuildEvent ()
 
bool CheckDestination (uint32_t trignr)
 
int DestinationPort (uint32_t trignr)
 
void DoInputSnapshot (unsigned ninp)
 
void DoTerminalOutput ()
 
bool DropAllInputBuffers ()
 
bool FlushOutputBuffer ()
 
std::string GenerateFileName (unsigned runid)
 
void ResetInfoCounters ()
 
void SetInfo (const std::string &info, bool forceinfo=false)
 
bool ShiftToNextBuffer (unsigned ninp)
 Method should be used to skip current buffer from the queue. More...
 
bool ShiftToNextEvent (unsigned ninp, bool fast=false, bool dropped=false)
 Shifts to next event in the input queue. More...
 
bool ShiftToNextHadTu (unsigned ninp)
 
bool ShiftToNextSubEvent (unsigned ninp, bool fast=false, bool dropped=false)
 Shifts to next subevent in the input queue. More...
 
void StartEventsBuilding ()
 
void StoreRunInfoStart ()
 
void StoreRunInfoStop (bool onexit=false, unsigned newrunid=0)
 
char * Unit (unsigned long v)
 
void UpdateBnetInfo ()
 
- Protected Member Functions inherited from dabc::ModuleAsync
void ActivateInput (unsigned port=0)
 Produces event for specified input port Should be used when processing was stopped due to return false in ProcessRecv method. More...
 
void ActivateOutput (unsigned port=0)
 Produces event for specified output port. More...
 
void ActivatePool (unsigned pool)
 Produces event for specified pool handle. More...
 
bool CanRecv (unsigned indx=0) const
 Method return true if recv from specified port can be done. More...
 
bool CanSend (unsigned indx=0) const
 Method return true if send over specified port can be done. More...
 
bool CanTakeBuffer (unsigned pool=0)
 Returns true if memory pool can provide buffer. More...
 
 ModuleAsync (const std::string &name, Command cmd=nullptr)
 Constructor of ModuleAsync class. More...
 
unsigned NumCanRecv (unsigned indx=0) const
 Method return number of buffers which can be received via the port. More...
 
unsigned NumCanSend (unsigned indx=0) const
 Method return number of send operation can be done for specified port. More...
 
unsigned NumCanTake (unsigned pool=0) const
 Method return number of buffers which could be taken from data queue assigned with the pool. More...
 
Buffer PoolQueueItem (unsigned pool=0, unsigned nbuf=0)
 Returns buffer from queue assigned with the pool. More...
 
virtual bool ProcessBuffer (unsigned pool=0)
 Method called by framework when at least one buffer available in pool handle. More...
 
virtual void ProcessConnectEvent (const std::string &name, bool on)
 Method called by framework when connection state of the item is changed. More...
 
virtual bool ProcessRecv (unsigned port=0)
 Method called by framework when at least one buffer available in input port. More...
 
virtual bool ProcessSend (unsigned port=0)
 Method called by framework when at least one buffer can be send to output port. More...
 
Buffer Recv (unsigned indx=0)
 Methods receives buffers from the port. More...
 
bool RecvQueueFull (unsigned port=0)
 Returns true if receive queue is full and block input. More...
 
Buffer RecvQueueItem (unsigned port=0, unsigned nbuf=0)
 Returns buffer from receive queue of the input port. More...
 
bool Send (Buffer &buf)
 Send buffer over first output port. More...
 
bool Send (unsigned indx, Buffer &buf)
 Methods to send buffer via specified output port. More...
 
void SignalRecvWhenFull (unsigned port=0)
 Let input signal only when queue is full. More...
 
bool SkipInputBuffers (unsigned indx=0, unsigned nbuf=1)
 Remove items in input queue. More...
 
Buffer TakeBuffer (unsigned pool=0)
 Take buffer from memory pool. More...
 
BufferSize_t TotalSizeCanRecv (unsigned indx=0) const
 Method return total size of buffers can be received via the port. More...
 
virtual ~ModuleAsync ()
 Destructor of ModuleAsync class. More...
 
- Protected Member Functions inherited from dabc::Module
bool BindPorts (const std::string &inpname, const std::string &outname)
 Bind input and output ports that both will share same connection. More...
 
virtual void BuildFieldsMap (RecordFieldsMap *cont)
 Fill fields map, which is relevant for the object Objects hierarchy produced from dabc::Manager. More...
 
bool CanSendToAllOutputs (bool exclude_disconnected=true) const
 
EventId ConstructUserItemEvent (unsigned indx=0)
 
unsigned CreateInput (const std::string &name, unsigned queue=10)
 
unsigned CreateOutput (const std::string &name, unsigned queue=10)
 
virtual Parameter CreatePar (const std::string &name, const std::string &kind="")
 
unsigned CreatePoolHandle (const std::string &poolname, unsigned queue=10)
 Creates handle for memory pool, which preserves reference on memory pool and provides fast access to memory pool functionality. More...
 
unsigned CreateTimer (const std::string &name, double period_sec=-1., bool synchron=false)
 
unsigned CreateUserItem (const std::string &name)
 
void DisconnectAllPorts (bool witherr=false)
 Method disconnects all module ports, should be called only from Module thread. More...
 
bool DisconnectPort (const std::string &name, bool witherr=false)
 Disconnect port from transport. More...
 
virtual bool DoStop ()
 
void EnsurePorts (unsigned numinp=0, unsigned numout=0, const std::string &poolname="")
 Method ensure that at least specified number of input and output ports will be created. More...
 
virtual bool Find (ConfigIO &cfg)
 Method to locate object in xml file. More...
 
unsigned FindInput (const std::string &name) const
 
unsigned FindOutput (const std::string &name) const
 
unsigned FindPool (const std::string &name) const
 
PortRef FindPort (const std::string &name) const
 
unsigned FindTimer (const std::string &name)
 
unsigned FindUserItem (const std::string &name)
 
ModuleItemGetItem (unsigned id) const
 
std::string InputName (unsigned indx=0, bool fullname=false) const
 
unsigned InputQueueCapacity (unsigned indx=0) const
 
bool InputQueueFull (unsigned indx=0) const
 
bool IsAutoPool (unsigned indx=0) const
 Returns true when handle automatically delivers buffers via the connection. More...
 
bool IsInputConnected (unsigned indx=0) const
 
bool IsOutputConnected (unsigned indx=0) const
 
bool IsPoolConnected (unsigned indx=0) const
 
bool IsPortConnected (const std::string &name) const
 
bool IsRunning () const
 Returns true if module if running. More...
 
bool IsValidInput (unsigned indx=0) const
 
bool IsValidOutput (unsigned indx=0) const
 
bool IsValidPool (unsigned indx=0) const
 
bool IsValidTimer (unsigned indx) const
 
bool IsValidUserItem (unsigned indx) const
 
unsigned NumInputs () const
 
unsigned NumOutputs () const
 
unsigned NumPools () const
 
unsigned NumTimers () const
 
virtual void ObjectCleanup ()
 Inherited method, called during module destroy. More...
 
virtual void OnThreadAssigned ()
 
std::string OutputName (unsigned indx=0, bool fullname=false) const
 
unsigned OutputQueueCapacity (unsigned indx=0) const
 
std::string PoolName (unsigned indx=0, bool fullname=false) const
 
unsigned PortQueueCapacity (const std::string &name) const
 
virtual int PreviewCommand (Command cmd)
 This method called before command will be executed. More...
 
virtual void ProcessConnectionActivated (const std::string &name, bool on)
 
virtual void ProcessEvent (const EventId &)
 
virtual double ProcessTimeout (double last_diff)
 
void ProduceInputEvent (unsigned indx=0, unsigned cnt=1)
 
void ProduceOutputEvent (unsigned indx=0, unsigned cnt=1)
 
void ProducePoolEvent (unsigned indx=0, unsigned cnt=1)
 
void ProduceUserItemEvent (unsigned indx=0, unsigned cnt=1)
 
void SendToAllOutputs (Buffer &buf)
 
void SetAutoStop (bool on=true)
 If set, module will be automatically stopped when all i/o ports are disconnected. More...
 
void SetInfoParName (const std::string &name)
 
virtual void SetModulePriority (int pri=-1)
 
bool SetPortLoopLength (const std::string &name, unsigned cnt)
 
bool SetPortRatemeter (const std::string &name, const Parameter &ref)
 
bool SetPortSignaling (const std::string &name, Port::EventsProducing signal)
 
void ShootTimer (const std::string &name, double delay_sec=0.)
 
void ShootTimer (unsigned indx, double delay_sec=0.)
 
bool Start ()
 Starts execution of the module code. More...
 
bool Stop ()
 Stops execution of the module code. More...
 
bool SubmitCommandToTransport (const std::string &portname, Command cmd)
 Submits command to transport, assigned with the port. More...
 
std::string TimerName (unsigned n=0, bool fullname=false) const
 
std::string UserItemName (unsigned indx=0, bool fullname=false) const
 
- Protected Member Functions inherited from dabc::Worker
bool _FireDoNothingEvent ()
 
bool _FireEvent (uint16_t evid)
 
bool _FireEvent (uint16_t evid, uint32_t arg, int pri=-1)
 
bool _IsFireEvent () const
 
bool ActivateMainLoop ()
 
virtual void BeforeHierarchyScan (Hierarchy &h)
 Method called before publisher makes next snapshot of hierarchy. More...
 
void CancelCommands ()
 
void CleanupPublisher (bool sync=true)
 Release reference on publisher and unsubscribe/unpublish all registered entries. More...
 
CommandDefinition CreateCmdDef (const std::string &name)
 
virtual bool DestroyByOwnThread ()
 Inherited method from Object, invoked at the moment when worker requested to be destroyed by its thread. More...
 
bool DestroyPar (const std::string &name)
 Method must be used if worker wants to destroy parameter. More...
 
virtual void DoWorkerAfterMainLoop ()
 Internal - function executed after leaving main loop. More...
 
virtual void DoWorkerMainLoop ()
 Internal - entrance function for main loop execution. More...
 
bool ExecuteIn (Worker *dest, Command cmd)
 Executes command in specified worker. More...
 
bool FireEvent (uint16_t evid)
 
bool FireEvent (uint16_t evid, uint32_t arg, int pri=-1)
 
Reference GetPublisher ()
 Return reference on publisher. More...
 
bool IsWorkerActive () const
 Method indicates if worker is running in the thread and accepts normal events. More...
 
virtual void ObjectDestroyed (Object *)
 Method to clear object reference, will be called from thread context (when possible) More...
 
virtual void ProcessParameterEvent (const ParameterEvent &evnt)
 Interface method to retrieve subscribed parameter events. More...
 
virtual bool Publish (const Hierarchy &h, const std::string &path)
 
virtual bool PublishPars (const std::string &path)
 
bool RegisterForParameterEvent (const std::string &mask, bool onlychangeevent=true)
 Subscribe to parameter events from local or remote node. More...
 
void SetParValue (const std::string &name, const RecordField &v)
 Set parameter value and sync with worker hierarchy. More...
 
void SetWorkerCfgId (int id=-1)
 Set identifier which can be used in XML configuration ${}# formula It means that correspondent to the ID element of array will be extracted. More...
 
bool SingleLoop (double tmout)
 
virtual bool Subscribe (const std::string &path)
 
virtual bool Unpublish (const Hierarchy &h, const std::string &path)
 
bool UnregisterForParameterEvent (const std::string &mask)
 Unsubscribe to parameter events from local or remote node. More...
 
virtual bool Unsubscribe (const std::string &path)
 
 Worker (const ConstructorPair &pair)
 Special constructor, designed for inherited classes. More...
 
void WorkerSleep (double tmout)
 
- Protected Member Functions inherited from dabc::Object
virtual void _ChildsChanged ()
 Method called when new childs are add or old are removed. More...
 
virtual bool _DoDeleteItself ()
 This method is called at the moment when DecReference think that object can be destroyed and wants to return true. More...
 
bool _IsNormalState ()
 Same as IsNormalState() but without mutex lock - user should lock mutex himself. More...
 
virtual ObjectCreateInstance (const std::string &name)
 Method used to create new item to be placed as child of the object. More...
 
void DeleteThis ()
 Method should be used by the object to delete itself. More...
 
bool DestroyCalledFromOwnThread ()
 Internal DABC method, should be called by thread which was requested to destroy object. More...
 
void FillFullName (std::string &fullname, Object *upto, bool exclude_top_parent=false) const
 Method used to produce full item name,. More...
 
bool GetFlag (unsigned fl) const
 Return value of selected flag, not thread safe
More...
 
bool IsNormalState ()
 Return true if object is in normal state. More...
 
unsigned NumReferences ()
 Return number of references on the object. More...
 
 Object (const ConstructorPair &pair, unsigned flags=flIsOwner)
 
MutexObjectMutex () const
 Returns mutex, used for protection of Object data members. More...
 
void SetAutoDestroy (bool on=true)
 Set autodestroy flag for the object Once enabled, object will be destroyed when last reference will be cleared. More...
 
void SetFlag (unsigned fl, bool on=true)
 Change value of selected flag, not thread safe
More...
 
void SetName (const char *name)
 Changes object name. More...
 
void SetNameDirect (const char *name)
 Changes object name disregard of existing references. More...
 
void SetOwner (bool on=true)
 Specifies if object will be owner of its new childs. More...
 

Protected Attributes

uint64_t fAllBuildEvents
 number of build events More...
 
uint64_t fAllBuildEventsLimit
 maximal number events to build More...
 
uint64_t fAllDiscEvents
 
uint64_t fAllDroppedData
 
uint64_t fAllFullDrops
 number of complete drops More...
 
uint64_t fAllRecvBytes
 
long fBldCalls {0}
 number of build event calls More...
 
dabc::Profiler fBldProfiler
 profiler of build event performance More...
 
int fBNETbunch
 number of events delivered to same event builder More...
 
dabc::Command fBnetCalibrCmd
 current running bnet calibration command More...
 
std::string fBNETCalibrDir
 name of extra directory where to store calibrations More...
 
std::string fBNETCalibrPackScript
 name of script to pack calibration files More...
 
dabc::Command fBnetFileCmd
 current running bnet file command More...
 
std::string fBnetInfo
 info for showing of bnet sender More...
 
int fBNETNumRecv
 number of BNET receivers More...
 
int fBNETNumSend
 number of BNET senders More...
 
bool fBNETrecv
 indicate that second-level event building is performed More...
 
dabc::Command fBnetRefreshCmd
 current running refresh command More...
 
bool fBNETsend
 indicate that combiner used as BNET sender More...
 
std::string fBnetStat
 gener-purpose statistic in text form More...
 
long fBufCalls {0}
 number of buffer processing calls More...
 
std::vector< InputCfgfCfg
 all input-dependent configurations More...
 
bool fCheckTag
 
uint64_t fDataDroppedRateCnt
 
std::string fDataDroppedRateName
 
uint64_t fDataRateCnt
 
std::string fDataRateName
 
int32_t fEBId
 eventbuilder id <- node id More...
 
uint32_t fEpicsRunNumber
 most recent run id from epics, for multi eventbuilder mode More...
 
double fEventBuildTimeout
 timeout in seconds since last complete event when previous buffers are dropped More...
 
unsigned fEventIdCount [HADAQ_NEVTIDS]
 
uint64_t fEventRateCnt
 
std::string fEventRateName
 
bool fEvnumDiffStatistics
 if true, account difference of subsequent build event numbers as lost events if false, do not account it (for multiple event builder mode) More...
 
bool fExtraDebug
 when true, extra debug output is created More...
 
int fFlushCounter
 
double fFlushTimeout
 
unsigned fHadesTriggerHUB
 
bool fHadesTriggerType
 When true, read trigger type as in original hades event builders. More...
 
std::string fInfoName
 
long fInpCalls {0}
 number of input processing calls More...
 
bool fIsTerminating
 
dabc::TimeStamp fLastBuildTm
 last time when complete event was build More...
 
dabc::TimeStamp fLastDebugTm
 timer used to generate rare debugs output More...
 
dabc::TimeStamp fLastDropTm
 timer used to avoid too often drop of data More...
 
double fLastEventRate
 last event rate More...
 
dabc::TimeStamp fLastProcTm
 last time when event building was called More...
 
uint32_t fLastTrigNr
 last number of build event More...
 
uint64_t fLostEventRateCnt
 
std::string fLostEventRateName
 
uint32_t fMaxHadaqTrigger
 Defines trigger sequence number range for overflow. More...
 
double fMaxProcDist
 maximal time between calls to BuildEvent method More...
 
int fNumReadBuffers
 
WriteIterator fOut
 
long fOutCalls {0}
 number of output processing calls More...
 
pid_t fPID
 process id of combiner module More...
 
std::string fPrefix
 
uint64_t fRunBuildEvents
 number of build events More...
 
uint64_t fRunDataErrors
 
uint64_t fRunDiscEvents
 
uint64_t fRunDroppedData
 
std::string fRunInfoToOraFilename
 
uint32_t fRunNumber
 run id from timeofday for eventbuilding More...
 
uint64_t fRunRecvBytes
 
uint64_t fRunTagErrors
 
bool fRunToOracle
 
bool fSkipEmpty
 skip empty subevents in final event, default true More...
 
bool fSpecialFired
 if user event was already fired More...
 
unsigned fSpecialItemId
 item used to create user events More...
 
long fTimerCalls {0}
 number of timer events calls More...
 
int fTriggerNrTolerance
 maximum allowed difference of trigger numbers (subevent sequence number) More...
 
uint32_t fTriggerRangeMask
 
- Protected Attributes inherited from dabc::Module
bool fAutoStop
 module will automatically stop when all i/o ports will be disconnected More...
 
dabc::Reference fDfltPool
 direct reference on memory pool, used when no pool handles are not created More...
 
std::string fInfoParName
 full name of parameter, used as info More...
 
std::vector< InputPort * > fInputs
 array of input ports More...
 
std::vector< ModuleItem * > fItems
 map for fast search of module items More...
 
std::vector< OutputPort * > fOutputs
 array of output ports More...
 
std::vector< PoolHandle * > fPools
 array of pools More...
 
std::string fPublishPars
 path where module pars will be published More...
 
bool fRunState
 true if module in the running state More...
 
unsigned fSysTimerIndex
 index of timer, which will be used with module itself More...
 
std::vector< Timer * > fTimers
 array of timers More...
 
std::vector< ModuleItem * > fUsers
 array of user items More...
 
- Protected Attributes inherited from dabc::Worker
WorkerAddonRef fAddon
 extension of worker for some special events More...
 
Reference fPublisher
 reference on publisher, once found, remain until end of object live More...
 
ThreadRef fThread
 reference on the thread, once assigned remain whole time More...
 
MutexfThreadMutex
 pointer on main thread mutex More...
 
bool fWorkerActive
 indicates if worker can submit events to the thread More...
 
int fWorkerCfgId
 special ID, can be used in XML configuration in ${}# formula More...
 
CommandsQueue fWorkerCommands
 all kinds of commands, processed by the worker More...
 
int fWorkerCommandsLevel
 Number of process commands recursion. More...
 
unsigned fWorkerFiredEvents
 indicate current balance between fired and processed events, used to correctly halt worker More...
 
Hierarchy fWorkerHierarchy
 place for publishing of worker parameters More...
 
uint32_t fWorkerId
 worker id in thread list, used for events submit More...
 
int fWorkerPriority
 priority of events, submitted by worker to the thread More...
 
- Protected Attributes inherited from dabc::Object
int fObjectBlock
 counter for blocking calls, as long as non-zero, non of child can be removed More...
 
ReferencesVectorfObjectChilds
 list of the child objects More...
 
unsigned fObjectFlags
 flag, protected by the mutex More...
 
MutexfObjectMutex
 mutex protects all private property of the object More...
 
std::string fObjectName
 object name More...
 
Reference fObjectParent
 reference on the parent object More...
 
int fObjectRefCnt
 accounts how many references existing on the object, thread safe More...
 

Friends

class TerminalModule
 

Additional Inherited Members

- Public Types inherited from dabc::Worker
enum  EPriotiryLevels { priorityMaximum = 0 , priorityMinimum = -1 , priorityDefault = -7 , priorityMagic = -77 }
 
enum  EWorkerEventsCodes { evntFirstCore = 1 , evntFirstAddOn = 100 , evntFirstSystem = 200 , evntFirstUser = 1000 }
 
- Static Public Member Functions inherited from dabc::Worker
static int cmd_bool (bool v)
 
- Static Public Member Functions inherited from dabc::Object
static void Destroy (Object *obj) throw ()
 User method for object destroyment. More...
 
static void InspectGarbageCollector ()
 \ brief Methods to inspect how many objects pointers are remained More...
 
static bool NameMatch (const std::string &name, const std::string &mask)
 Check if name matches to specified mask. More...
 
static bool NameMatchM (const std::string &name, const std::string &mask)
 Check if name matches to specified mask. More...
 
static unsigned NumInstances ()
 Static variable counts total number of objects instances. More...
 
- Protected Types inherited from dabc::Object
enum  EFlags {
  flStateMask = 0x000f , flIsOwner = 0x0010 , flCleanup = 0x0020 , flHasThread = 0x0040 ,
  flAutoDestroy = 0x0080 , flLogging = 0x0100 , flNoMutex = 0x0200 , flHidden = 0x0400 ,
  flChildsHidden = 0x0800 , flTopXmlLevel = 0x1000
}
 
- Static Protected Member Functions inherited from dabc::Object
static ConstructorPair MakePair (const std::string &fullname, bool withmanager=true)
 Internal DABC method, used to produce pair - object parent and object name, which is typically should be used as argument in class constructor. More...
 
static ConstructorPair MakePair (Object *prnt, const std::string &fullname, bool withmanager=true)
 Internal DABC method, used to produce pair - object parent and object name, which is typically should be used as argument in class constructor. More...
 
static ConstructorPair MakePair (Reference prnt, const std::string &fullname, bool withmanager=true)
 Internal DABC method, used to produce pair - object parent and object name, which is typically should be used as argument in class constructor. More...
 

Detailed Description

Definition at line 49 of file CombinerModule.h.

Constructor & Destructor Documentation

◆ CombinerModule()

hadaq::CombinerModule::CombinerModule ( const std::string &  name,
dabc::Command  cmd = nullptr 
)

Definition at line 29 of file CombinerModule.cxx.

◆ ~CombinerModule()

hadaq::CombinerModule::~CombinerModule ( )
virtual

Definition at line 187 of file CombinerModule.cxx.

Member Function Documentation

◆ BuildEvent()

bool hadaq::CombinerModule::BuildEvent ( )
protected

Definition at line 853 of file CombinerModule.cxx.

◆ FlushOutputBuffer()

bool hadaq::CombinerModule::FlushOutputBuffer ( )
protected

Definition at line 326 of file CombinerModule.cxx.

◆ DoInputSnapshot()

void hadaq::CombinerModule::DoInputSnapshot ( unsigned  ninp)
protected

Definition at line 1255 of file CombinerModule.cxx.

◆ BeforeModuleStart()

void hadaq::CombinerModule::BeforeModuleStart ( )
overrideprotectedvirtual

Reimplemented from dabc::Module.

Definition at line 289 of file CombinerModule.cxx.

◆ AfterModuleStop()

void hadaq::CombinerModule::AfterModuleStop ( )
overrideprotectedvirtual

Reimplemented from dabc::Module.

Definition at line 312 of file CombinerModule.cxx.

◆ ShiftToNextHadTu()

bool hadaq::CombinerModule::ShiftToNextHadTu ( unsigned  ninp)
protected

Definition at line 590 of file CombinerModule.cxx.

◆ ShiftToNextEvent()

bool hadaq::CombinerModule::ShiftToNextEvent ( unsigned  ninp,
bool  fast = false,
bool  dropped = false 
)
protected

Shifts to next event in the input queue.

Definition at line 620 of file CombinerModule.cxx.

◆ ShiftToNextSubEvent()

bool hadaq::CombinerModule::ShiftToNextSubEvent ( unsigned  ninp,
bool  fast = false,
bool  dropped = false 
)
protected

Shifts to next subevent in the input queue.

Definition at line 667 of file CombinerModule.cxx.

◆ ShiftToNextBuffer()

bool hadaq::CombinerModule::ShiftToNextBuffer ( unsigned  ninp)
protected

Method should be used to skip current buffer from the queue.

Definition at line 558 of file CombinerModule.cxx.

◆ DropAllInputBuffers()

bool hadaq::CombinerModule::DropAllInputBuffers ( )
protected

Definition at line 808 of file CombinerModule.cxx.

◆ SetInfo()

void hadaq::CombinerModule::SetInfo ( const std::string &  info,
bool  forceinfo = false 
)
protected

Definition at line 212 of file CombinerModule.cxx.

◆ StoreRunInfoStart()

void hadaq::CombinerModule::StoreRunInfoStart ( )
protected

Definition at line 1444 of file CombinerModule.cxx.

◆ StoreRunInfoStop()

void hadaq::CombinerModule::StoreRunInfoStop ( bool  onexit = false,
unsigned  newrunid = 0 
)
protected

Definition at line 1465 of file CombinerModule.cxx.

◆ ResetInfoCounters()

void hadaq::CombinerModule::ResetInfoCounters ( )
protected

Definition at line 1496 of file CombinerModule.cxx.

◆ Unit()

char * hadaq::CombinerModule::Unit ( unsigned long  v)
protected

Definition at line 1517 of file CombinerModule.cxx.

◆ GenerateFileName()

std::string hadaq::CombinerModule::GenerateFileName ( unsigned  runid)
protected

Definition at line 1532 of file CombinerModule.cxx.

◆ DoTerminalOutput()

void hadaq::CombinerModule::DoTerminalOutput ( )
protected

◆ DestinationPort()

int hadaq::CombinerModule::DestinationPort ( uint32_t  trignr)
protected

Definition at line 839 of file CombinerModule.cxx.

◆ CheckDestination()

bool hadaq::CombinerModule::CheckDestination ( uint32_t  trignr)
protected

Definition at line 846 of file CombinerModule.cxx.

◆ UpdateBnetInfo()

void hadaq::CombinerModule::UpdateBnetInfo ( )
protected

Definition at line 354 of file CombinerModule.cxx.

◆ StartEventsBuilding()

void hadaq::CombinerModule::StartEventsBuilding ( )
protected

Definition at line 259 of file CombinerModule.cxx.

◆ ModuleCleanup()

void hadaq::CombinerModule::ModuleCleanup ( )
overridevirtual

Method, which can be reimplemented by user and should cleanup all references on buffers and other objects.

Reimplemented from dabc::Module.

Definition at line 194 of file CombinerModule.cxx.

◆ ProcessPoolEvent()

void hadaq::CombinerModule::ProcessPoolEvent ( unsigned  pool)
inlineoverridevirtual

Method called by framework when pool event is produced.

Can be reimplemented by the user.

Reimplemented from dabc::ModuleAsync.

Definition at line 348 of file CombinerModule.h.

◆ ProcessInputEvent()

void hadaq::CombinerModule::ProcessInputEvent ( unsigned  port)
inlineoverridevirtual

Method called by framework when input event is produced.

Can be reimplemented by the user. Depending from port configuration it can happen for every new buffer in input queue or only when after previous event was processed

Reimplemented from dabc::ModuleAsync.

Definition at line 349 of file CombinerModule.h.

◆ ProcessOutputEvent()

void hadaq::CombinerModule::ProcessOutputEvent ( unsigned  port)
inlineoverridevirtual

Method called by framework when output event is produced.

Can be reimplemented by the user.

Reimplemented from dabc::ModuleAsync.

Definition at line 350 of file CombinerModule.h.

◆ ProcessTimerEvent()

void hadaq::CombinerModule::ProcessTimerEvent ( unsigned  timer)
overridevirtual

Method called by framework when timer event is produced.

Can be reimplemented by the user.

Reimplemented from dabc::ModuleAsync.

Definition at line 225 of file CombinerModule.cxx.

◆ ProcessUserEvent()

void hadaq::CombinerModule::ProcessUserEvent ( unsigned  item)
overridevirtual

Method called by framework when custom user event is produced.

Can be reimplemented by the user.

Reimplemented from dabc::ModuleAsync.

Definition at line 277 of file CombinerModule.cxx.

◆ ExecuteCommand()

int hadaq::CombinerModule::ExecuteCommand ( dabc::Command  cmd)
overridevirtual

Main method where commands are executed.

Reimplemented from dabc::Module.

Definition at line 1267 of file CombinerModule.cxx.

◆ ReplyCommand()

bool hadaq::CombinerModule::ReplyCommand ( dabc::Command  cmd)
overridevirtual

Reimplement this method to react on command reply Return true if command can be destroyed by framework.

Reimplemented from dabc::Module.

Definition at line 1537 of file CombinerModule.cxx.

◆ CalcTrigNumDiff()

int hadaq::CombinerModule::CalcTrigNumDiff ( const uint32_t &  prev,
const uint32_t &  next 
)

Definition at line 612 of file CombinerModule.cxx.

Friends And Related Function Documentation

◆ TerminalModule

friend class TerminalModule
friend

Definition at line 51 of file CombinerModule.h.

Field Documentation

◆ fTriggerNrTolerance

int hadaq::CombinerModule::fTriggerNrTolerance
protected

maximum allowed difference of trigger numbers (subevent sequence number)

Definition at line 184 of file CombinerModule.h.

◆ fEventBuildTimeout

double hadaq::CombinerModule::fEventBuildTimeout
protected

timeout in seconds since last complete event when previous buffers are dropped

Definition at line 187 of file CombinerModule.h.

◆ fHadesTriggerType

bool hadaq::CombinerModule::fHadesTriggerType
protected

When true, read trigger type as in original hades event builders.

Definition at line 190 of file CombinerModule.h.

◆ fHadesTriggerHUB

unsigned hadaq::CombinerModule::fHadesTriggerHUB
protected

Definition at line 191 of file CombinerModule.h.

◆ fLastTrigNr

uint32_t hadaq::CombinerModule::fLastTrigNr
protected

last number of build event

Definition at line 193 of file CombinerModule.h.

◆ fCfg

std::vector<InputCfg> hadaq::CombinerModule::fCfg
protected

all input-dependent configurations

Definition at line 195 of file CombinerModule.h.

◆ fOut

WriteIterator hadaq::CombinerModule::fOut
protected

Definition at line 197 of file CombinerModule.h.

◆ fFlushCounter

int hadaq::CombinerModule::fFlushCounter
protected

Definition at line 199 of file CombinerModule.h.

◆ fEBId

int32_t hadaq::CombinerModule::fEBId
protected

eventbuilder id <- node id

Definition at line 200 of file CombinerModule.h.

◆ fPID

pid_t hadaq::CombinerModule::fPID
protected

process id of combiner module

Definition at line 201 of file CombinerModule.h.

◆ fIsTerminating

bool hadaq::CombinerModule::fIsTerminating
protected

Definition at line 202 of file CombinerModule.h.

◆ fSkipEmpty

bool hadaq::CombinerModule::fSkipEmpty
protected

skip empty subevents in final event, default true

Definition at line 203 of file CombinerModule.h.

◆ fRunToOracle

bool hadaq::CombinerModule::fRunToOracle
protected

Definition at line 205 of file CombinerModule.h.

◆ fNumReadBuffers

int hadaq::CombinerModule::fNumReadBuffers
protected

Definition at line 207 of file CombinerModule.h.

◆ fSpecialItemId

unsigned hadaq::CombinerModule::fSpecialItemId
protected

item used to create user events

Definition at line 209 of file CombinerModule.h.

◆ fSpecialFired

bool hadaq::CombinerModule::fSpecialFired
protected

if user event was already fired

Definition at line 210 of file CombinerModule.h.

◆ fLastEventRate

double hadaq::CombinerModule::fLastEventRate
protected

last event rate

Definition at line 211 of file CombinerModule.h.

◆ fCheckTag

bool hadaq::CombinerModule::fCheckTag
protected

Definition at line 213 of file CombinerModule.h.

◆ fBNETsend

bool hadaq::CombinerModule::fBNETsend
protected

indicate that combiner used as BNET sender

Definition at line 215 of file CombinerModule.h.

◆ fBNETrecv

bool hadaq::CombinerModule::fBNETrecv
protected

indicate that second-level event building is performed

Definition at line 216 of file CombinerModule.h.

◆ fBNETbunch

int hadaq::CombinerModule::fBNETbunch
protected

number of events delivered to same event builder

Definition at line 217 of file CombinerModule.h.

◆ fBNETNumSend

int hadaq::CombinerModule::fBNETNumSend
protected

number of BNET senders

Definition at line 218 of file CombinerModule.h.

◆ fBNETNumRecv

int hadaq::CombinerModule::fBNETNumRecv
protected

number of BNET receivers

Definition at line 219 of file CombinerModule.h.

◆ fBNETCalibrDir

std::string hadaq::CombinerModule::fBNETCalibrDir
protected

name of extra directory where to store calibrations

Definition at line 220 of file CombinerModule.h.

◆ fBNETCalibrPackScript

std::string hadaq::CombinerModule::fBNETCalibrPackScript
protected

name of script to pack calibration files

Definition at line 221 of file CombinerModule.h.

◆ fBnetCalibrCmd

dabc::Command hadaq::CombinerModule::fBnetCalibrCmd
protected

current running bnet calibration command

Definition at line 222 of file CombinerModule.h.

◆ fFlushTimeout

double hadaq::CombinerModule::fFlushTimeout
protected

Definition at line 224 of file CombinerModule.h.

◆ fBnetFileCmd

dabc::Command hadaq::CombinerModule::fBnetFileCmd
protected

current running bnet file command

Definition at line 225 of file CombinerModule.h.

◆ fBnetRefreshCmd

dabc::Command hadaq::CombinerModule::fBnetRefreshCmd
protected

current running refresh command

Definition at line 226 of file CombinerModule.h.

◆ fDataRateName

std::string hadaq::CombinerModule::fDataRateName
protected

Definition at line 228 of file CombinerModule.h.

◆ fDataDroppedRateName

std::string hadaq::CombinerModule::fDataDroppedRateName
protected

Definition at line 229 of file CombinerModule.h.

◆ fEventRateName

std::string hadaq::CombinerModule::fEventRateName
protected

Definition at line 230 of file CombinerModule.h.

◆ fLostEventRateName

std::string hadaq::CombinerModule::fLostEventRateName
protected

Definition at line 231 of file CombinerModule.h.

◆ fInfoName

std::string hadaq::CombinerModule::fInfoName
protected

Definition at line 232 of file CombinerModule.h.

◆ fDataRateCnt

uint64_t hadaq::CombinerModule::fDataRateCnt
protected

Definition at line 234 of file CombinerModule.h.

◆ fDataDroppedRateCnt

uint64_t hadaq::CombinerModule::fDataDroppedRateCnt
protected

Definition at line 235 of file CombinerModule.h.

◆ fEventRateCnt

uint64_t hadaq::CombinerModule::fEventRateCnt
protected

Definition at line 236 of file CombinerModule.h.

◆ fLostEventRateCnt

uint64_t hadaq::CombinerModule::fLostEventRateCnt
protected

Definition at line 237 of file CombinerModule.h.

◆ fRunRecvBytes

uint64_t hadaq::CombinerModule::fRunRecvBytes
protected

Definition at line 239 of file CombinerModule.h.

◆ fRunBuildEvents

uint64_t hadaq::CombinerModule::fRunBuildEvents
protected

number of build events

Definition at line 240 of file CombinerModule.h.

◆ fRunDroppedData

uint64_t hadaq::CombinerModule::fRunDroppedData
protected

Definition at line 241 of file CombinerModule.h.

◆ fRunDiscEvents

uint64_t hadaq::CombinerModule::fRunDiscEvents
protected

Definition at line 242 of file CombinerModule.h.

◆ fRunTagErrors

uint64_t hadaq::CombinerModule::fRunTagErrors
protected

Definition at line 243 of file CombinerModule.h.

◆ fRunDataErrors

uint64_t hadaq::CombinerModule::fRunDataErrors
protected

Definition at line 244 of file CombinerModule.h.

◆ fAllRecvBytes

uint64_t hadaq::CombinerModule::fAllRecvBytes
protected

Definition at line 246 of file CombinerModule.h.

◆ fAllBuildEvents

uint64_t hadaq::CombinerModule::fAllBuildEvents
protected

number of build events

Definition at line 247 of file CombinerModule.h.

◆ fAllBuildEventsLimit

uint64_t hadaq::CombinerModule::fAllBuildEventsLimit
protected

maximal number events to build

Definition at line 248 of file CombinerModule.h.

◆ fAllDiscEvents

uint64_t hadaq::CombinerModule::fAllDiscEvents
protected

Definition at line 249 of file CombinerModule.h.

◆ fAllDroppedData

uint64_t hadaq::CombinerModule::fAllDroppedData
protected

Definition at line 250 of file CombinerModule.h.

◆ fAllFullDrops

uint64_t hadaq::CombinerModule::fAllFullDrops
protected

number of complete drops

Definition at line 251 of file CombinerModule.h.

◆ fEventIdCount

unsigned hadaq::CombinerModule::fEventIdCount[HADAQ_NEVTIDS]
protected

Definition at line 253 of file CombinerModule.h.

◆ fRunInfoToOraFilename

std::string hadaq::CombinerModule::fRunInfoToOraFilename
protected

Definition at line 255 of file CombinerModule.h.

◆ fPrefix

std::string hadaq::CombinerModule::fPrefix
protected

Definition at line 256 of file CombinerModule.h.

◆ fRunNumber

uint32_t hadaq::CombinerModule::fRunNumber
protected

run id from timeofday for eventbuilding

Definition at line 259 of file CombinerModule.h.

◆ fEpicsRunNumber

uint32_t hadaq::CombinerModule::fEpicsRunNumber
protected

most recent run id from epics, for multi eventbuilder mode

Definition at line 262 of file CombinerModule.h.

◆ fMaxHadaqTrigger

uint32_t hadaq::CombinerModule::fMaxHadaqTrigger
protected

Defines trigger sequence number range for overflow.

Definition at line 265 of file CombinerModule.h.

◆ fTriggerRangeMask

uint32_t hadaq::CombinerModule::fTriggerRangeMask
protected

Definition at line 266 of file CombinerModule.h.

◆ fEvnumDiffStatistics

bool hadaq::CombinerModule::fEvnumDiffStatistics
protected

if true, account difference of subsequent build event numbers as lost events if false, do not account it (for multiple event builder mode)

Definition at line 270 of file CombinerModule.h.

◆ fExtraDebug

bool hadaq::CombinerModule::fExtraDebug
protected

when true, extra debug output is created

Definition at line 272 of file CombinerModule.h.

◆ fLastDebugTm

dabc::TimeStamp hadaq::CombinerModule::fLastDebugTm
protected

timer used to generate rare debugs output

Definition at line 273 of file CombinerModule.h.

◆ fLastDropTm

dabc::TimeStamp hadaq::CombinerModule::fLastDropTm
protected

timer used to avoid too often drop of data

Definition at line 274 of file CombinerModule.h.

◆ fLastProcTm

dabc::TimeStamp hadaq::CombinerModule::fLastProcTm
protected

last time when event building was called

Definition at line 275 of file CombinerModule.h.

◆ fLastBuildTm

dabc::TimeStamp hadaq::CombinerModule::fLastBuildTm
protected

last time when complete event was build

Definition at line 276 of file CombinerModule.h.

◆ fMaxProcDist

double hadaq::CombinerModule::fMaxProcDist
protected

maximal time between calls to BuildEvent method

Definition at line 277 of file CombinerModule.h.

◆ fBnetInfo

std::string hadaq::CombinerModule::fBnetInfo
protected

info for showing of bnet sender

Definition at line 279 of file CombinerModule.h.

◆ fBnetStat

std::string hadaq::CombinerModule::fBnetStat
protected

gener-purpose statistic in text form

Definition at line 280 of file CombinerModule.h.

◆ fBldCalls

long hadaq::CombinerModule::fBldCalls {0}
protected

number of build event calls

Definition at line 282 of file CombinerModule.h.

◆ fInpCalls

long hadaq::CombinerModule::fInpCalls {0}
protected

number of input processing calls

Definition at line 283 of file CombinerModule.h.

◆ fOutCalls

long hadaq::CombinerModule::fOutCalls {0}
protected

number of output processing calls

Definition at line 284 of file CombinerModule.h.

◆ fBufCalls

long hadaq::CombinerModule::fBufCalls {0}
protected

number of buffer processing calls

Definition at line 285 of file CombinerModule.h.

◆ fTimerCalls

long hadaq::CombinerModule::fTimerCalls {0}
protected

number of timer events calls

Definition at line 286 of file CombinerModule.h.

◆ fBldProfiler

dabc::Profiler hadaq::CombinerModule::fBldProfiler
protected

profiler of build event performance

Definition at line 287 of file CombinerModule.h.


The documentation for this class was generated from the following files: