22 #include "hadaq/HldProcessor.h"
26 #include "dabc/Factory.h"
33 #include "base/Buffer.h"
34 #include "base/StreamProc.h"
39 dabc::ModuleAsync(name, cmd),
54 fHLD =
new hadaq::HldProcessor();
71 base::ProcMgr::ClearInstancePointer();
86 if (CanSendToAllOutputs() && CanRecv()) {
88 if (!fReplace && !CanTakeBuffer())
return false;
91 Par(
"DataRate").SetValue(buf.
GetTotalSize()/1024./1024.);
111 if (len==0) {
EOUT(
"Fail to transform HLD event");
break; }
112 if (tgt.
shift(len)!=len) {
EOUT(
"no enough space to shift to next event"); exit(5);
break; }
126 SendToAllOutputs(buf);
136 if (fProcMgr && fProcMgr->ExecuteHCommand(cmd))
return dabc::cmd_true;
Reference on memory from memory pool.
void SetTotalSize(BufferSize_t len)
Set total length of the buffer to specified value Size cannot be bigger than original size of the buf...
unsigned GetTypeId() const
BufferSize_t GetTotalSize() const
Return total size of all buffer segments.
void SetTypeId(unsigned tid)
Represents command with its arguments.
void SetPtr(const std::string &name, void *p)
Set pointer argument for the command.
void Create(const std::string &name, bool withmutex=false)
Create top-level object with specified name.
virtual Parameter CreatePar(const std::string &name, const std::string &kind="")
virtual void OnThreadAssigned()
virtual int ExecuteCommand(Command cmd)
Main method where commands are executed.
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.
const char * GetName() const
Returns name of the object, thread safe
Parameter & SetUnits(const std::string &unit)
Set units field of parameter.
Parameter & SetRatemeter(bool synchron=false, double interval=1.0)
Converts parameter in ratemeter - all values will be summed up and divided on specified interval.
Manipulator with dabc::Buffer class.
BufferSize_t shift(BufferSize_t sz)
int distance_to_ownbuf() const
BufferSize_t rawsize() const
bool AsBool(bool dflt=false) const
int64_t AsInt(int64_t dflt=0) const
bool Execute(Command cmd, double tmout=-1.)
Hierarchy fWorkerHierarchy
place for publishing of worker parameters
RecordField Cfg(const std::string &name, Command cmd=nullptr) const
Returns configuration field of specified name Configuration value of specified name searched in follo...
virtual bool Publish(const Hierarchy &h, const std::string &path)
Read iterator for HADAQ events/subevents.
bool NextEvent()
Used for ready HLD events.
unsigned evntsize() const
hadaq::RawEvent * evnt() const
void SetTop(dabc::Hierarchy &top, bool withcmds=false)
virtual int ExecuteCommand(dabc::Command cmd)
Main method where commands are executed.
virtual void AfterModuleStop()
virtual ~RecalibrateModule()
hadaq::HldProcessor * fHLD
virtual void OnThreadAssigned()
RecalibrateModule(const std::string &name, dabc::Command cmd=nullptr)
virtual void BeforeModuleStart()
std::string format(const char *fmt,...)