Main class for real-time filtering of data.
More...
|
| JDataFilter (const std::string &name, const std::string &server, const std::string &hostname, JLogger *logger, const int level, const int port, const int backlog, const int buffer_size, const std::string &path) |
| Constructor. More...
|
|
virtual void | actionEnter () |
| Interface methods for actions corresponding to state transitions. More...
|
|
virtual void | actionExit () |
|
virtual void | actionInit (int length, const char *buffer) |
|
virtual void | actionConfigure (int length, const char *buffer) |
|
virtual void | actionStart (int length, const char *buffer) |
|
virtual void | actionPause (int length, const char *buffer) |
|
virtual void | actionContinue (int length, const char *buffer) |
|
virtual void | actionStop (int length, const char *buffer) |
|
virtual void | actionReset (int length, const char *buffer) |
|
virtual void | actionQuit (int length, const char *buffer) |
|
virtual void | setSelect (JFileDescriptorMask &mask) const |
| Set the file descriptor mask for the select call. More...
|
|
virtual void | actionSelect (const JFileDescriptorMask &mask) |
| Action method following last select call. More...
|
|
virtual void | actionRunning () |
| This method is repeatedly called when this client machine is in state Running and the clock interval time is non-zero. More...
|
|
void | updateFrameQueue (const JChannelList_t::const_iterator channel) |
| Update queue with data frames. More...
|
|
void | processTimeSlice (const JDAQTimesliceL0 ×lice) |
| Process time slice. More...
|
|
void | typeout () |
| Report status to message logger. More...
|
|
virtual void | actionTagged (const JTag &tag, int length, const char *buffer) |
| Tagged action to handle alerts. More...
|
|
virtual bool | enter (const JArgs &args) |
| Enter the state machine. More...
|
|
virtual bool | enter () |
| Enter the state machine. More...
|
|
virtual bool | exit () |
| Exit the state machine. More...
|
|
bool | isRunning () const |
| Check if this client is in runnig state. More...
|
|
void | replaceEvent (const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event) |
| Replace tag of given event in event table. More...
|
|
JDAQEvent_t * | findEvent (const JTag &tag, const std::string &event_name) |
| Find event in event table. More...
|
|
void | addSubscription (const JSubscription &subscription) |
| Add custom subscription. More...
|
|
template<class T > |
void | addParameter (const char option, T ¶meter) |
| Add parameter to parser used in method enter(). More...
|
|
template<class T > |
void | addParameter (const char option, T ¶meter, const T &value) |
| Add parameter to parser used in method enter(). More...
|
|
void | setSelect () |
| Set the file descriptor mask for the select call. More...
|
|
virtual void | actionInput (int length, const char *buffer) |
| This method is called at ev_input . More...
|
|
virtual bool | filter (const JTag &tag, int length, const char *buffer) |
| Filter message. More...
|
|
void | run () |
| Run as run control client following command messages via JNET::JControlHost. More...
|
|
void | run (const int port) |
| Run for ever. More...
|
|
void | run (std::istream &in) |
| Run client with commands from input stream (e.g. More...
|
|
void | A1 (CHSM_ns_alias::event const &) |
|
void | A2 (CHSM_ns_alias::event const &) |
|
void | A3 (CHSM_ns_alias::event const &) |
|
void | A4 (CHSM_ns_alias::event const &) |
|
void | A5 (CHSM_ns_alias::event const &) |
|
void | A6 (CHSM_ns_alias::event const &) |
|
void | A7 (CHSM_ns_alias::event const &) |
|
void | A8 (CHSM_ns_alias::event const &) |
|
void | A9 (CHSM_ns_alias::event const &) |
|
void | A10 (CHSM_ns_alias::event const &) |
|
void | A11 (CHSM_ns_alias::event const &) |
|
void | A12 (CHSM_ns_alias::event const &) |
|
void | A13 (CHSM_ns_alias::event const &) |
|
void | A14 (CHSM_ns_alias::event const &) |
|
void | EAM4root (CHSM_ns_alias::state const &, CHSM_ns_alias::event const &) |
|
void | XAM4root (CHSM_ns_alias::state const &, CHSM_ns_alias::event const &) |
|
const std::string & | getName () const |
| Get name of state machine. More...
|
|
int | getDetectorID () const |
| Get detector identifier. More...
|
|
int | getRunNumber () const |
| Get run number. More...
|
|
virtual void | actionError () |
|
virtual void | actionRecover (int, const char *) |
|
const std::string & | getHostname () const |
| Get hostname. More...
|
|
const std::string & | getFullName () const |
| Get full name of this run control client. More...
|
|
const JTag & | getUniqueTag () const |
| Get unique tag of this run control client. More...
|
|
long long int | getClockDelay () const |
| Get total delay time. More...
|
|
long long int | getClockInterval () const |
| Get interval time. More...
|
|
void | setClockInterval (const long long int interval_us) |
| Set interval time. More...
|
|
void | resetClock () |
| Reset clock. More...
|
|
int | getEventNumber () const |
| Get last event number. More...
|
|
void | setEventNumber (const int event_number) |
| Set last event number. More...
|
|
|
typedef void(JDAQCHSM::* | action) (int, const char *) |
| Type definition of action method. More...
|
|
|
template<class T > |
bool | put (const T &object) |
| Auxiliary method to send object to data server. More...
|
|
void | update () |
| Update state machine. More...
|
|
void | update (const JTag &tag, int length, const char *buffer) |
| Update state machine. More...
|
|
void | configure () |
| Configure client. More...
|
|
std::string | getMessage (const CHSM::state &state, const CHSM::event &event) const |
| Get event message. More...
|
|
virtual void | enterState (const CHSM::state &state, const CHSM::event &event) |
| Action when entering state. More...
|
|
virtual void | actionCheck (int length, const char *buffer) |
| This method is called at ev_check and reports a system check by mimicing an enter state action. More...
|
|
void | execute (action __action, const CHSM::event &__event) |
| The method to execute the action. More...
|
|
const CHSM::state * | getState () const |
| Get current state. More...
|
|
Main class for real-time filtering of data.
This class implements the action methods for each transition of the state machine.
When the state machine is entered, data are continually collected using custom implementation of virtual methods JDataFilter::setSelect and JDataFilter::actionSelect.
In state Running
, all incoming data are buffered, referred to as "queue".
When a JDAQTimeslice is complete, it processed in the same way as applications JTriggerProcessor.cc and JTriggerEfficiency.cc.
The completeness of a time slice is defined by the parameter frames_per_slice
which, together with other parameters, is parsed in method JDataFilter::actionConfigure.
numberOfFramesPerSlice = frames_per_slice = 1;
Note that this parameter can change during operation (see below).
A timeout may occur when the total amount of data or the number of incomplete time slices in the queue exceeds the corresponding pre-set limit:
queueSize = <maximal queue size [B]>;
queueDepth = <maximal queue depth>;
Note that these values apply per JDataFilter.
When a timeout occurs, the parameter frames_per_slice<
is set to the number of frames in the oldest time slice.
When data are received with a frame index below the current frame index, the parameter frames_per_slice
is incremented by one, upto the original value set at JDataFilter::actionConfigure.
In addition, a circular buffer based on a ROOT TTree for each JDAQTimeslice type can be maintained.
The following parameters can be used to configure the circular buffer.
path = <write directory for circular buffer>;
c_sizeL0 = <L0 buffer size>;
c_sizeL1 = <L1 buffer size>;
c_sizeL2 = <L2 buffer size>;
c_sizeSN = <SN buffer size>;
Note that when path is set to a valid director:
- There will always be a file created which is closed when the state machine is exited;
- The file name is
<path>/KM3NeT_YYYY-MM-DD_<tag>[_<index>].root
;
- L0, L1, L2 and SN buffer sizes are per JDataFilter;
- The tag KM3NETDAQ::RC_ALERT defined in JDAQTags.hh has tentatively been reserved to trigger the closure of the file following an external alert;
After closure of the file, a new file will be opened if path is set;
In this, YYYY
, MM
and DD
are the year, month and day at the time of the configuration or alert and <tag>
corresponds to the unique JTag of the JDataFilter process.
The <index>
is optional and will only be used to prevent overwriting of an existing file (e.g. when there is more than one alert on a given day).
The application/script JConvert.cc/JConvert.sh can be used to readily convert multiple input files to a single output file.
The script JDOMandDataFilter.sh can be used to test this application.
Definition at line 145 of file JDataFilter.cc.
◆ JSocketInputChannel_t
◆ JChannelList_t
◆ hit_type
◆ JSuperFrame1D_t
◆ JSuperFrame2D_t
◆ JTimeslice_t
◆ JBuildL1_t
◆ JBuildL2_t
◆ JControlHost_t
◆ action
typedef void(JDAQCHSM::* JDAQCHSM::action) (int, const char *) |
|
protectedinherited |
Type definition of action method.
Definition at line 152 of file JDAQCHSM.hh.
◆ JDataFilter()
KM3NETDAQ::JDataFilter::JDataFilter |
( |
const std::string & |
name, |
|
|
const std::string & |
server, |
|
|
const std::string & |
hostname, |
|
|
JLogger * |
logger, |
|
|
const int |
level, |
|
|
const int |
port, |
|
|
const int |
backlog, |
|
|
const int |
buffer_size, |
|
|
const std::string & |
path |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
name | name of client |
server | name of command message server |
hostname | name of data server |
logger | pointer to logger |
level | debug level |
port | server port |
backlog | server backlog |
buffer_size | server buffer |
path | directory for writing circular buffer |
replace tag to receive dfilter specific messages in configure
Definition at line 289 of file JDataFilter.cc.
◆ processIndexSorter()
static bool KM3NETDAQ::JDataFilter::processIndexSorter |
( |
const JDAQProcess & |
first, |
|
|
const JDAQProcess & |
second |
|
) |
| |
|
inlinestatic |
Sort DAQ process by index.
- Parameters
-
first | first DAQ process |
second | second DAQ process |
- Returns
- true if index of first DAQ process less than that of second; else false
Definition at line 270 of file JDataFilter.cc.
◆ actionEnter()
virtual void KM3NETDAQ::JDataFilter::actionEnter |
( |
| ) |
|
|
inlinevirtual |
Interface methods for actions corresponding to state transitions.
Reimplemented from JDAQCHSM.
Definition at line 315 of file JDataFilter.cc.
◆ actionExit()
virtual void KM3NETDAQ::JDataFilter::actionExit |
( |
| ) |
|
|
inlinevirtual |
◆ actionInit()
virtual void KM3NETDAQ::JDataFilter::actionInit |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
Reimplemented from JDAQCHSM.
Definition at line 332 of file JDataFilter.cc.
334 JDebugStream(
logger) <<
"actionInit() " << std::string(buffer,length);
338 JDebugStream(
logger) <<
"Start server.";
342 catch(
const std::exception& error) {
343 JErrorStream(
logger) <<
"Error \"" << error.what() <<
"\"; trigger ev_error.";
◆ actionConfigure()
virtual void KM3NETDAQ::JDataFilter::actionConfigure |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
Reimplemented from JDAQCHSM.
Definition at line 349 of file JDataFilter.cc.
353 JDebugStream(
logger) <<
"actionConfigure() " << endl << std::string(buffer,length);
355 long long int update_s = 10;
356 long long int logger_s = 5;
366 properties[
"dataWriter"] =
hostname;
373 properties[
"logger_s"] = logger_s;
374 properties[
"update_s"] = update_s;
377 properties[
"path"] =
path;
384 properties.read(
string(buffer, length));
386 catch(
const exception& error) {
387 JErrorStream(
logger) << error.what();
390 if (update_s <= 0) { update_s = 1; }
391 if (logger_s <= 0) { logger_s = 1; }
400 throw JException(
"Undefined data writer host name.");
407 JNoticeStream(
logger) <<
"No DataFilters in process list, or no process list. "
408 <<
"Assuming that this process is the only process on this CPU and setting parameters accordingly.";
413 unsigned int numberOfDataFiltersOnThisMachine = 0;
419 JNoticeStream notice(
logger);
421 notice <<
"My IP addresses:";
430 JDebugStream(
logger) <<
"Test IP address \"" << i->hostname <<
"\" " << (find(IP.begin(), IP.end(), i->hostname) != IP.end());
432 if (find(IP.begin(), IP.end(), i->hostname) != IP.end()) {
434 numberOfDataFiltersOnThisMachine++;
436 if (i->port == this->port) {
442 if (numberOfDataFiltersOnThisMachine == 0) {
443 JNoticeStream(
logger) <<
"Zero data filters on this machine according to process list (if it exists). "
444 <<
"Assuming one datafilter on this machine.";
445 numberOfDataFiltersOnThisMachine = 1;
449 JErrorStream(
logger) <<
"This process cannot be found in the process list. Why do I exist?";
453 JErrorStream(
logger) <<
"Mismatch between given process names: "
455 <<
", but in the process list I am referred to as " << thisProcess->index;
466 JNoticeStream(
logger) <<
"Maximum queue size is too large given the number of processes on this machine. "
467 <<
"Queue size reduced to "
483 JNoticeStream(
logger) <<
"This data filter process will report.";
484 JNoticeStream(
logger) <<
"Number of modules: " << (*moduleRouter)->size();
486 JDebugStream (
logger) <<
"Detector description: " << endl <<
detector;
498 if (
buildL1.
get() == NULL) { JErrorStream(
logger) <<
"Failed to allocate buildL1."; }
499 if (
buildL2.
get() == NULL) { JErrorStream(
logger) <<
"Failed to allocate buildL2."; }
500 if (
buildSN.
get() == NULL) { JErrorStream(
logger) <<
"Failed to allocate buildSN."; }
521 JErrorStream (
logger) <<
"Failed to create circular buffer in directory <" <<
path <<
">; disable functionality.";
528 JNoticeStream(
logger) <<
"Continue using circular buffer " <<
c_buffer;
◆ actionStart()
virtual void KM3NETDAQ::JDataFilter::actionStart |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ actionPause()
virtual void KM3NETDAQ::JDataFilter::actionPause |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ actionContinue()
virtual void KM3NETDAQ::JDataFilter::actionContinue |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ actionStop()
virtual void KM3NETDAQ::JDataFilter::actionStop |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ actionReset()
virtual void KM3NETDAQ::JDataFilter::actionReset |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ actionQuit()
virtual void KM3NETDAQ::JDataFilter::actionQuit |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
◆ setSelect() [1/2]
Set the file descriptor mask for the select call.
This implementation does nothing but may be redefined by the derived class.
- Parameters
-
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 654 of file JDataFilter.cc.
660 for (JChannelList_t::const_iterator channel =
channelList.begin(); channel !=
channelList.end(); ++channel) {
661 if (!channel->isReady()) {
662 mask.set(channel->getFileDescriptor());
◆ actionSelect()
Action method following last select call.
This implementation does nothing but may be redefined by the derived class.
- Parameters
-
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 668 of file JDataFilter.cc.
676 if (mask.has(channel->getFileDescriptor())) {
680 if (channel->isReady()) {
692 JErrorStream(
logErrorRun) <<
"Receiving data while not running.";
702 catch(
const exception& error) {
704 JNoticeStream(
logger) <<
"Disconnecting channel " << channel->getFileDescriptor() <<
' ' << error.what();
724 socket.setKeepAlive (
true);
725 socket.setNonBlocking(
true);
727 JNoticeStream(
logger) <<
"New channel" <<
'[' << socket.getFileDescriptor() <<
']';
747 JErrorStream(
logger) <<
"More frames in timeslice than expected "
752 JErrorStream(
logger) <<
"Adjusting expected frames per timeslice to " << pending_slice.size();
758 if (!pending_slice.empty()) {
776 <<
"Size of timeslice = " << pending_slice.size() <<
';'
777 <<
"Queue depth = " <<
timeslices.size() <<
';'
782 JErrorStream(
logger) <<
"Adjusting expected frames per timeslice from " <<
frames_per_slice <<
" to " << pending_slice.size();
◆ actionRunning()
virtual void KM3NETDAQ::JDataFilter::actionRunning |
( |
| ) |
|
|
inlinevirtual |
This method is repeatedly called when this client machine is in state Running and the clock interval time is non-zero.
This implementation does nothing but may be redefined by the derived class. Care has to be taken so that the time needed to execute this method should be less than the specified clock interval time (see method setClockInterval()).
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 794 of file JDataFilter.cc.
◆ updateFrameQueue()
void KM3NETDAQ::JDataFilter::updateFrameQueue |
( |
const JChannelList_t::const_iterator |
channel | ) |
|
|
inline |
Update queue with data frames.
Note that any discarded data will be reported.
- Parameters
-
channel | incoming data channel |
Definition at line 809 of file JDataFilter.cc.
813 JByteArrayReader in(channel->data(), channel->size());
821 if (preamble.getLength() != channel->size()) {
823 JErrorStream(
logErrorRun) <<
"Size of received data does not match size reported by preamble: "
824 <<
"preamble.getLength() = " << preamble.getLength() <<
';'
825 <<
"channel->size(): " << channel->size() <<
';';
834 JErrorStream(
logErrorRun) <<
"Run number " << header.getRunNumber()
836 <<
" -> Dropping frame.";
846 <<
" -> Dropping frame.";
863 <<
" -> Dropping frame.";
872 while (timesliceIterator !=
timeslices.end() && timesliceIterator->getFrameIndex() < header.getFrameIndex()) {
876 if (timesliceIterator !=
timeslices.end() && timesliceIterator->getFrameIndex() == header.getFrameIndex()) {
886 timesliceIterator->setDAQChronometer(header.getDAQChronometer());
888 queueSize += timesliceIterator->getSize();
893 in >> static_cast<JDAQFrame&>(*(timesliceIterator->rbegin()));
895 queueSize += timesliceIterator->rbegin()->getSize();
◆ processTimeSlice()
void KM3NETDAQ::JDataFilter::processTimeSlice |
( |
const JDAQTimesliceL0 & |
timeslice | ) |
|
|
inline |
Process time slice.
- Parameters
-
Definition at line 904 of file JDataFilter.cc.
933 for (JDAQTimesliceL0::const_iterator frame = timeslice.begin(); frame != timeslice.end(); ++frame) {
939 JErrorStream(
logger) <<
"Invalid data at "
942 <<
"module = " << frame->getModuleID() <<
";"
943 <<
"discard and dump";
945 timesliceTX.push_back(*frame);
950 const JModule& module =
moduleRouter->getModule(frame->getModuleID());
967 if (buffer.begin() != __end) {
970 frame->getModuleIdentifier(),
971 module.getPosition()));
973 (*buildL1)(buffer.begin(), __end , back_inserter(*timesliceNB.rbegin()));
980 frame->getModuleIdentifier(),
981 module.getPosition()));
983 (*buildL1)(*timesliceL0.rbegin(), back_inserter(*timesliceL1.rbegin()));
988 frame->getModuleIdentifier(),
989 module.getPosition()));
991 (*buildL2)(buffer, *timesliceL1.rbegin(), back_inserter(*timesliceL2.rbegin()));
996 frame->getModuleIdentifier(),
997 module.getPosition()));
999 (*buildSN)(buffer, *timesliceL1.rbegin(), back_inserter(*timesliceSN.rbegin()));
1003 JErrorStream(
logErrorDetector) <<
"No detector information for module " << frame->getModuleID();
1007 if (!timesliceTX.empty()) {
1008 this->
put(timesliceTX);
1015 const JTriggerInput trigger_input(timesliceNB);
1017 for (JTriggerInput::const_iterator hit = trigger_input.begin(); hit != trigger_input.end(); ++hit) {
1019 JTriggeredEvent tev(timesliceNB.getDAQChronometer(),
1032 JTriggerInput trigger_input(timesliceL2);
1033 JTriggerOutput trigger_output;
1035 (*trigger3DMuon) (trigger_input, back_inserter(trigger_output));
1036 (*trigger3DShower)(trigger_input, back_inserter(trigger_output));
1037 (*triggerMXShower)(trigger_input, timesliceL0, back_inserter(trigger_output));
1041 for (JTriggerOutput::const_iterator event = trigger_output.begin();
event != trigger_output.end(); ++event) {
1045 if (this->
put(
object)) {
1081 }
catch(
const exception& error) {
1082 JErrorStream(
logger) <<
"Error = " << error.what() <<
";"
1085 <<
"time slice not correctly processed!";
◆ typeout()
void KM3NETDAQ::JDataFilter::typeout |
( |
| ) |
|
|
inline |
Report status to message logger.
Definition at line 1093 of file JDataFilter.cc.
1099 JNoticeStream(
logger) <<
"Elapsed real (wall) time [s] " << T_us / 1e6;
1105 catch(
const std::exception&) {}
1127 if (processedSlicesTime_us > 0) {
1128 JNoticeStream(
logger) <<
"Performance factor (inaccurate estimate): " << T_us / processedSlicesTime_us;
1130 if (processedDetectorTime_us > 0) {
1131 JNoticeStream(
logger) <<
"Performance factor whole detector (inaccurate estimate): " << T_us / processedDetectorTime_us;
◆ actionTagged()
virtual void KM3NETDAQ::JDataFilter::actionTagged |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtual |
Tagged action to handle alerts.
- Parameters
-
tag | tag |
length | number of characters |
buffer | message |
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 1145 of file JDataFilter.cc.
1147 using namespace std;
1149 JDebugStream(
logger) <<
"Received message <" << tag.toString() <<
"> \"" << string(buffer, length) <<
"\"";
1172 JErrorStream (
logger) <<
"Failed to create circular buffer in directory <" <<
path <<
">; disable functionality.";
1180 JWarningStream(
logger) <<
"Tag <" << tag.toString() <<
"> not implemented";
◆ put()
template<class T >
bool KM3NETDAQ::JDataFilter::put |
( |
const T & |
object | ) |
|
|
inlineprivate |
Auxiliary method to send object to data server.
- Parameters
-
- Returns
- true if sent; else false
Definition at line 1201 of file JDataFilter.cc.
1211 catch(
const std::exception& error) {
1212 JErrorStream(
logger) << error.what();
◆ enter() [1/2]
virtual bool KM3NETDAQ::JDAQClient::enter |
( |
const JArgs & |
args | ) |
|
|
inlinevirtualinherited |
Enter the state machine.
This overloaded method enter reproduces the constructor. All necessary input is parsed from the list of arguments. In case of an error, the state machine is not entered.
- Parameters
-
args | array of command line arguments |
- Returns
- true if okay; else false
Definition at line 363 of file JDAQClient.hh.
383 catch(
const exception &error) {
384 cerr << error.what() << endl;
399 this->server.reset(
new JControlHost(
server));
403 catch(
const JControlHostException& error) {
404 cerr << error << endl;
◆ enter() [2/2]
virtual bool KM3NETDAQ::JDAQClient::enter |
( |
| ) |
|
|
inlinevirtualinherited |
Enter the state machine.
This method activates the subscription to JNET::JControlHost messages. In case of an error, the state machine is not entered.
- Returns
- true if okay; else false
Reimplemented in KM3NETDAQ::JDAQDriver.
Definition at line 418 of file JDAQClient.hh.
429 server->Subscribe(buffer);
435 return CHSM::machine::enter();
437 catch(
const JControlHostException& error) {
442 cerr <<
"Message server or logger not properly initialised." << endl;
◆ exit()
virtual bool KM3NETDAQ::JDAQClient::exit |
( |
| ) |
|
|
inlinevirtualinherited |
Exit the state machine.
This method releases the various resources.
- Returns
- true if okay; else false
Definition at line 456 of file JDAQClient.hh.
461 catch(
const JControlHostException& error) {
467 catch(
const JControlHostException& error) {
470 return CHSM::machine::exit();
◆ isRunning()
bool KM3NETDAQ::JDAQClient::isRunning |
( |
| ) |
const |
|
inlineinherited |
Check if this client is in runnig state.
- Returns
- true if running; else false
Definition at line 479 of file JDAQClient.hh.
◆ replaceEvent()
void KM3NETDAQ::JDAQClient::replaceEvent |
( |
const JTag & |
oldTag, |
|
|
const JTag & |
newTag, |
|
|
JDAQEvent_t & |
event |
|
) |
| |
|
inlineinherited |
Replace tag of given event in event table.
- Parameters
-
oldTag | old tag |
newTag | new tag |
event | event |
Definition at line 492 of file JDAQClient.hh.
◆ findEvent()
JDAQEvent_t* KM3NETDAQ::JDAQClient::findEvent |
( |
const JTag & |
tag, |
|
|
const std::string & |
event_name |
|
) |
| |
|
inlineinherited |
Find event in event table.
- Parameters
-
tag | tag |
event_name | event name |
- Returns
- pointer to event or NULL
Definition at line 507 of file JDAQClient.hh.
◆ addSubscription()
void KM3NETDAQ::JDAQClient::addSubscription |
( |
const JSubscription & |
subscription | ) |
|
|
inlineinherited |
Add custom subscription.
- Parameters
-
Definition at line 523 of file JDAQClient.hh.
◆ addParameter() [1/2]
template<class T >
void KM3NETDAQ::JDAQClient::addParameter |
( |
const char |
option, |
|
|
T & |
parameter |
|
) |
| |
|
inlineinherited |
Add parameter to parser used in method enter().
- Parameters
-
option | option |
parameter | parameter |
Definition at line 536 of file JDAQClient.hh.
◆ addParameter() [2/2]
template<class T >
void KM3NETDAQ::JDAQClient::addParameter |
( |
const char |
option, |
|
|
T & |
parameter, |
|
|
const T & |
value |
|
) |
| |
|
inlineinherited |
Add parameter to parser used in method enter().
- Parameters
-
option | option |
parameter | parameter |
value | default value |
Definition at line 550 of file JDAQClient.hh.
◆ setSelect() [2/2]
void KM3NETDAQ::JDAQClient::setSelect |
( |
| ) |
|
|
inlineinherited |
Set the file descriptor mask for the select call.
Definition at line 559 of file JDAQClient.hh.
◆ actionInput()
virtual void KM3NETDAQ::JDAQClient::actionInput |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
◆ filter()
virtual bool KM3NETDAQ::JDAQClient::filter |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlinevirtualinherited |
Filter message.
The filter method can be overwritten so that a specific action is made before the corresponding message is processed by the state machine. The message is ignored if true is returned, else it is normally processed.
- Parameters
-
tag | tag |
length | number of characters |
buffer | message |
- Returns
- skip message or not
Definition at line 633 of file JDAQClient.hh.
◆ run() [1/3]
void KM3NETDAQ::JDAQClient::run |
( |
| ) |
|
|
inlineinherited |
Run as run control client following command messages via JNET::JControlHost.
This method can be called once the state machine is entered. It returns when the state machine is exited. If the clock interval is non-zero, the method actionRunning() is repeatedly called when this client machine is in state Running. The file descriptor mask can be set to interrupt the timeout of the select call and clock method wait() in this calling sequence (see methods setSelect() and actionSelect()).
Definition at line 661 of file JDAQClient.hh.
687 long long int numberOfCalls = 0;
710 catch(
const exception& error) {
717 if (numberOfCalls != 0) {
722 catch(
const exception& error) {
◆ run() [2/3]
void KM3NETDAQ::JDAQClient::run |
( |
const int |
port | ) |
|
|
inlineinherited |
Run for ever.
This method can be used when the run control client is started before the run control (e.g. at boot time of the host processor). This method should be called before the state machine is entered. It launches a server which accepts a JNET::JControlHost connection from a designated application e.g. the JDAQClientStarter.cc program. The state machine is entered using the available data in the JNET::JControlHost message. After the state machine is exited, it accepts a new a JNET::JControlHost connection.
- Parameters
-
Definition at line 741 of file JDAQClient.hh.
743 JControlHostServer local_server(port);
747 JControlHost* ps = local_server.AcceptClient();
753 ps->WaitHead(prefix);
755 const int length = prefix.
getSize();
757 char* buffer =
new char[length];
759 ps->GetFullData(buffer, length);
760 ps->PutFullData(prefix.
toString(), buffer, length);
◆ run() [3/3]
void KM3NETDAQ::JDAQClient::run |
( |
std::istream & |
in | ) |
|
|
inlineinherited |
Run client with commands from input stream (e.g.
for debugging).
Example input format:
<tag> <event name>[#data];
<tag> <event name>[#data];
- Parameters
-
Definition at line 786 of file JDAQClient.hh.
793 while (in >> tag && in >> skipws &&
getline(in, buffer,
';')) {
794 update(tag, buffer.length(), buffer.data());
◆ update() [1/2]
void KM3NETDAQ::JDAQClient::update |
( |
| ) |
|
|
inlineprivateinherited |
Update state machine.
This method waits for a message from JNET::JControlHost server.
Definition at line 808 of file JDAQClient.hh.
814 const int length = prefix.
getSize();
816 char* buffer =
new char[length];
818 server->GetFullData(buffer, length);
◆ update() [2/2]
void KM3NETDAQ::JDAQClient::update |
( |
const JTag & |
tag, |
|
|
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlineprivateinherited |
Update state machine.
- Parameters
-
tag | tag |
length | number of characters |
buffer | message |
Definition at line 833 of file JDAQClient.hh.
838 if (
filter(tag, length, buffer)) {
851 string::size_type pos = 0;
853 while (pos != (string::size_type) length &&
TOKEN_DELIMETER.find(*(buffer + pos)) == string::npos) {
861 while (pos != (string::size_type) length &&
TOKEN_DELIMETER.find(*(buffer + pos)) != string::npos) {
866 JEventTable::const_iterator i =
eventTable.
find(tag, event.getName());
870 const CHSM::state*
const s0 =
getState();
872 if (!i->second->active()) {
874 JWarningStream(
logger) <<
"Event " << i->second->name() <<
" not active (" << (s0 != NULL ? s0->name() :
"") <<
")";
876 if (
server.is_valid() && s0 != NULL) {
887 JRedirectStream redirect[] = { JRedirectStream(cin,
JLANG::null),
888 JRedirectStream(cout,
debug),
889 JRedirectStream(cerr, error) };
895 (*(i->second))(length - pos, buffer + pos);
899 const CHSM::state*
const s1 =
getState();
902 << (s0 != NULL ? s0->name() :
"")
903 <<
"->(" << i->second->name() <<
")->"
904 << (s1 != NULL ? s1->name() :
"");
◆ configure()
void KM3NETDAQ::JDAQClient::configure |
( |
| ) |
|
|
inlineprivateinherited |
Configure client.
This method is used to setup the event table.
Definition at line 916 of file JDAQClient.hh.
◆ getMessage()
std::string KM3NETDAQ::JDAQClient::getMessage |
( |
const CHSM::state & |
state, |
|
|
const CHSM::event & |
event |
|
) |
| const |
|
inlineprivateinherited |
Get event message.
- Parameters
-
- Returns
- message
Definition at line 928 of file JDAQClient.hh.
930 std::ostringstream os;
◆ enterState()
virtual void KM3NETDAQ::JDAQClient::enterState |
( |
const CHSM::state & |
state, |
|
|
const CHSM::event & |
event |
|
) |
| |
|
inlineprivatevirtualinherited |
Action when entering state.
This method provides for the hand shaking with the run control program.
- Parameters
-
state | entered state |
event | event that triggered transition |
Implements JDAQCHSM.
Reimplemented in KM3NETDAQ::JDAQDriver.
Definition at line 949 of file JDAQClient.hh.
◆ actionCheck()
virtual void KM3NETDAQ::JDAQClient::actionCheck |
( |
int |
length, |
|
|
const char * |
buffer |
|
) |
| |
|
inlineprivatevirtualinherited |
This method is called at ev_check
and reports a system check by mimicing an enter state action.
- Parameters
-
length | number of characters |
buffer | message |
Reimplemented from JDAQCHSM.
Definition at line 963 of file JDAQClient.hh.
973 if (state->active()) {
◆ execute()
void KM3NETDAQ::JDAQClient::execute |
( |
action |
__action, |
|
|
const CHSM::event & |
__event |
|
) |
| |
|
inlineprivatevirtualinherited |
The method to execute the action.
- Parameters
-
__action | pointer to action method |
__event | event that triggered the action |
Implements JDAQCHSM.
Definition at line 990 of file JDAQClient.hh.
996 (this->*__action)(event->length, event->buffer);
998 catch(
const std::exception& error) {
999 JErrorStream(
logger) <<
"Error at event " << __event.name() <<
" \"" << error.what() <<
"\"; trigger ev_error.";
◆ getState()
const CHSM::state* KM3NETDAQ::JDAQClient::getState |
( |
| ) |
const |
|
inlineprivateinherited |
Get current state.
- Returns
- state
Definition at line 1010 of file JDAQClient.hh.
1013 if (state->active()) {
◆ A1()
void JDAQStateMachine::A1 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A2()
void JDAQStateMachine::A2 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A3()
void JDAQStateMachine::A3 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A4()
void JDAQStateMachine::A4 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A5()
void JDAQStateMachine::A5 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A6()
void JDAQStateMachine::A6 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A7()
void JDAQStateMachine::A7 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A8()
void JDAQStateMachine::A8 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A9()
void JDAQStateMachine::A9 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A10()
void JDAQStateMachine::A10 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A11()
void JDAQStateMachine::A11 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A12()
void JDAQStateMachine::A12 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A13()
void JDAQStateMachine::A13 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ A14()
void JDAQStateMachine::A14 |
( |
CHSM_ns_alias::event const & |
event | ) |
|
|
inherited |
◆ EAM4root()
void JDAQStateMachine::EAM4root |
( |
CHSM_ns_alias::state const & |
chsm_state_, |
|
|
CHSM_ns_alias::event const & |
event |
|
) |
| |
|
inherited |
Definition at line 337 of file JDAQCHSM.cc.
338 #line 164 "JDAQCHSM.chsm"
339 CHSM_ns_alias::cluster
const &state = (CHSM_ns_alias::cluster
const&)chsm_state_;
actionEnter(); }
◆ XAM4root()
void JDAQStateMachine::XAM4root |
( |
CHSM_ns_alias::state const & |
chsm_state_, |
|
|
CHSM_ns_alias::event const & |
event |
|
) |
| |
|
inherited |
Definition at line 340 of file JDAQCHSM.cc.
341 #line 165 "JDAQCHSM.chsm"
342 CHSM_ns_alias::cluster
const &state = (CHSM_ns_alias::cluster
const&)chsm_state_;
actionExit(); }
◆ getName()
const std::string& JDAQCHSM::getName |
( |
| ) |
const |
|
inlineinherited |
Get name of state machine.
- Returns
- name
Definition at line 89 of file JDAQCHSM.hh.
◆ getDetectorID()
int JDAQCHSM::getDetectorID |
( |
| ) |
const |
|
inlineinherited |
Get detector identifier.
- Returns
- detector identifier.
Definition at line 100 of file JDAQCHSM.hh.
◆ getRunNumber()
int JDAQCHSM::getRunNumber |
( |
| ) |
const |
|
inlineinherited |
Get run number.
- Returns
- run number
Definition at line 111 of file JDAQCHSM.hh.
◆ actionError()
virtual void JDAQCHSM::actionError |
( |
| ) |
|
|
inlinevirtualinherited |
◆ actionRecover()
virtual void JDAQCHSM::actionRecover |
( |
int |
, |
|
|
const char * |
|
|
) |
| |
|
inlinevirtualinherited |
◆ getHostname()
const std::string& KM3NETDAQ::JDAQClient_t::getHostname |
( |
| ) |
const |
|
inlineinherited |
◆ getFullName()
const std::string& KM3NETDAQ::JDAQClient_t::getFullName |
( |
| ) |
const |
|
inlineinherited |
Get full name of this run control client.
- Returns
- full name
Definition at line 119 of file JDAQClient.hh.
◆ getUniqueTag()
const JTag& KM3NETDAQ::JDAQClient_t::getUniqueTag |
( |
| ) |
const |
|
inlineinherited |
Get unique tag of this run control client.
- Returns
- unique tag
Definition at line 130 of file JDAQClient.hh.
◆ getClockDelay()
long long int KM3NETDAQ::JDAQClient_t::getClockDelay |
( |
| ) |
const |
|
inlineinherited |
Get total delay time.
- Returns
- delay time [us]
Definition at line 141 of file JDAQClient.hh.
◆ getClockInterval()
long long int KM3NETDAQ::JDAQClient_t::getClockInterval |
( |
| ) |
const |
|
inlineinherited |
Get interval time.
- Returns
- interval time [us]
Definition at line 153 of file JDAQClient.hh.
◆ setClockInterval()
void KM3NETDAQ::JDAQClient_t::setClockInterval |
( |
const long long int |
interval_us | ) |
|
|
inlineinherited |
Set interval time.
- Parameters
-
interval_us | interval time [us] |
Definition at line 164 of file JDAQClient.hh.
◆ resetClock()
void KM3NETDAQ::JDAQClient_t::resetClock |
( |
| ) |
|
|
inlineinherited |
◆ getEventNumber()
int KM3NETDAQ::JDAQClient_t::getEventNumber |
( |
| ) |
const |
|
inlineinherited |
Get last event number.
- Returns
- event number
Definition at line 184 of file JDAQClient.hh.
◆ setEventNumber()
void KM3NETDAQ::JDAQClient_t::setEventNumber |
( |
const int |
event_number | ) |
|
|
inlineinherited |
◆ meta
JMeta KM3NETDAQ::JDataFilter::meta |
◆ MAXIMUM_FILE_NUMBER
const int KM3NETDAQ::JDataFilter::MAXIMUM_FILE_NUMBER = 100 |
|
static |
maximum file number for overwrite protection.
Definition at line 1186 of file JDataFilter.cc.
◆ datawriter
controlhost of data server (to which data writer should be connected)
Definition at line 1191 of file JDataFilter.cc.
◆ hostname
std::string KM3NETDAQ::JDataFilter::hostname |
|
private |
◆ port
int KM3NETDAQ::JDataFilter::port |
|
private |
◆ backlog
int KM3NETDAQ::JDataFilter::backlog |
|
private |
◆ buffer_size
int KM3NETDAQ::JDataFilter::buffer_size |
|
private |
◆ serversocket
◆ channelList
◆ timer
JTimer KM3NETDAQ::JDataFilter::timer |
|
private |
◆ Qt
◆ timeslices
◆ current_slice_index
int KM3NETDAQ::JDataFilter::current_slice_index |
|
private |
◆ frames_per_slice
unsigned int KM3NETDAQ::JDataFilter::frames_per_slice |
|
private |
◆ maximum_frames_per_slice
unsigned int KM3NETDAQ::JDataFilter::maximum_frames_per_slice |
|
private |
◆ maximal_frame_index
int KM3NETDAQ::JDataFilter::maximal_frame_index |
|
private |
◆ parameters
◆ timesliceRouter
◆ detector
◆ moduleRouter
◆ buildL1
◆ buildL2
◆ buildSN
◆ triggerNB
◆ trigger3DMuon
◆ trigger3DShower
◆ triggerMXShower
◆ logErrorRun
◆ logErrorDetector
◆ logErrorIndex
◆ logErrorIncomplete
◆ dataFilters
◆ dataQueues
◆ totalCPURAM
long long int KM3NETDAQ::JDataFilter::totalCPURAM |
|
private |
◆ maxQueueDepth
unsigned int KM3NETDAQ::JDataFilter::maxQueueDepth |
|
private |
◆ maxQueueSize
long long int KM3NETDAQ::JDataFilter::maxQueueSize |
|
private |
◆ queueSize
long long int KM3NETDAQ::JDataFilter::queueSize |
|
private |
◆ reporting
bool KM3NETDAQ::JDataFilter::reporting |
|
private |
◆ numberOfEvents
long long int KM3NETDAQ::JDataFilter::numberOfEvents |
|
private |
◆ numberOfBytes
long long int KM3NETDAQ::JDataFilter::numberOfBytes |
|
private |
◆ numberOfTimeslicesProcessed
long long int KM3NETDAQ::JDataFilter::numberOfTimeslicesProcessed |
|
private |
◆ numberOfIncompleteTimeslicesProcessed
long long int KM3NETDAQ::JDataFilter::numberOfIncompleteTimeslicesProcessed |
|
private |
◆ minFrameNumber
int KM3NETDAQ::JDataFilter::minFrameNumber |
|
private |
◆ maxFrameNumber
int KM3NETDAQ::JDataFilter::maxFrameNumber |
|
private |
◆ number_of_packets_received
long long int KM3NETDAQ::JDataFilter::number_of_packets_received |
|
private |
◆ number_of_packets_discarded
long long int KM3NETDAQ::JDataFilter::number_of_packets_discarded |
|
private |
◆ number_of_reads
long long int KM3NETDAQ::JDataFilter::number_of_reads |
|
private |
◆ number_of_bytes_received
long long int KM3NETDAQ::JDataFilter::number_of_bytes_received |
|
private |
◆ c_buffer
◆ path
std::string KM3NETDAQ::JDataFilter::path |
|
private |
◆ server
◆ logger
◆ select
◆ parser
JParser KM3NETDAQ::JDAQClient::parser |
|
privateinherited |
◆ subscription
◆ root
◆ Main
◆ ev_daq_transitions
const int JDAQStateMachine::ev_daq_transitions |
|
staticprivateinherited |
◆ ev_daq
◆ ev_daq_param_block
char JDAQStateMachine::ev_daq_param_block[sizeof(ev_daq_event::param_block)] |
|
inherited |
◆ ev_init_transitions
const int JDAQStateMachine::ev_init_transitions |
|
staticprivateinherited |
◆ ev_init
◆ ev_init_param_block
char JDAQStateMachine::ev_init_param_block[sizeof(ev_init_event::param_block)] |
|
inherited |
◆ ev_configure_transitions
const int JDAQStateMachine::ev_configure_transitions |
|
staticprivateinherited |
◆ ev_configure
◆ ev_configure_param_block
char JDAQStateMachine::ev_configure_param_block[sizeof(ev_configure_event::param_block)] |
|
inherited |
◆ ev_start_transitions
const int JDAQStateMachine::ev_start_transitions |
|
staticprivateinherited |
◆ ev_start
◆ ev_start_param_block
char JDAQStateMachine::ev_start_param_block[sizeof(ev_start_event::param_block)] |
|
inherited |
◆ ev_pause_transitions
const int JDAQStateMachine::ev_pause_transitions |
|
staticprivateinherited |
◆ ev_pause
◆ ev_pause_param_block
char JDAQStateMachine::ev_pause_param_block[sizeof(ev_pause_event::param_block)] |
|
inherited |
◆ ev_continue_transitions
const int JDAQStateMachine::ev_continue_transitions |
|
staticprivateinherited |
◆ ev_continue
◆ ev_continue_param_block
char JDAQStateMachine::ev_continue_param_block[sizeof(ev_continue_event::param_block)] |
|
inherited |
◆ ev_stop_transitions
const int JDAQStateMachine::ev_stop_transitions |
|
staticprivateinherited |
◆ ev_stop
◆ ev_stop_param_block
char JDAQStateMachine::ev_stop_param_block[sizeof(ev_stop_event::param_block)] |
|
inherited |
◆ ev_reset_transitions
const int JDAQStateMachine::ev_reset_transitions |
|
staticprivateinherited |
◆ ev_reset
◆ ev_reset_param_block
char JDAQStateMachine::ev_reset_param_block[sizeof(ev_reset_event::param_block)] |
|
inherited |
◆ ev_quit_transitions
const int JDAQStateMachine::ev_quit_transitions |
|
staticprivateinherited |
◆ ev_quit
◆ ev_quit_param_block
char JDAQStateMachine::ev_quit_param_block[sizeof(ev_quit_event::param_block)] |
|
inherited |
◆ ev_off_transitions
const int JDAQStateMachine::ev_off_transitions |
|
staticprivateinherited |
◆ ev_off
◆ ev_off_param_block
char JDAQStateMachine::ev_off_param_block[sizeof(ev_off_event::param_block)] |
|
inherited |
◆ ev_check_transitions
const int JDAQStateMachine::ev_check_transitions |
|
staticprivateinherited |
◆ ev_check
◆ ev_check_param_block
char JDAQStateMachine::ev_check_param_block[sizeof(ev_check_event::param_block)] |
|
inherited |
◆ ev_input_transitions
const int JDAQStateMachine::ev_input_transitions |
|
staticprivateinherited |
◆ ev_input
◆ ev_input_param_block
char JDAQStateMachine::ev_input_param_block[sizeof(ev_input_event::param_block)] |
|
inherited |
◆ ev_recover_transitions
const int JDAQStateMachine::ev_recover_transitions |
|
staticprivateinherited |
◆ ev_recover
◆ ev_recover_param_block
char JDAQStateMachine::ev_recover_param_block[sizeof(ev_recover_event::param_block)] |
|
inherited |
◆ ev_error_transitions
const int JDAQStateMachine::ev_error_transitions |
|
staticprivateinherited |
◆ ev_error
◆ ev_error_param_block
char JDAQStateMachine::ev_error_param_block[sizeof(ev_error_event::param_block)] |
|
inherited |
◆ state_
CHSM_ns_alias::state* JDAQStateMachine::state_[11] |
|
privateinherited |
◆ transition_
const CHSM_ns_alias::transition JDAQStateMachine::transition_ |
|
staticprivateinherited |
◆ taken_
const CHSM_ns_alias::event* JDAQStateMachine::taken_[14] |
|
privateinherited |
◆ target_
CHSM_ns_alias::state* JDAQStateMachine::target_[14] |
|
privateinherited |
◆ name
std::string JDAQCHSM::name |
|
protectedinherited |
◆ detector_id
int JDAQCHSM::detector_id |
|
protectedinherited |
◆ run_number
◆ TIMEOUT_S
const int KM3NETDAQ::JDAQClient_t::TIMEOUT_S = 1 |
|
staticinherited |
◆ eventTable
◆ fullname
std::string KM3NETDAQ::JDAQClient_t::fullname |
|
protectedinherited |
◆ unique_tag
JTag KM3NETDAQ::JDAQClient_t::unique_tag |
|
protectedinherited |
◆ clock
◆ event_number
int KM3NETDAQ::JDAQClient_t::event_number |
|
protectedinherited |
The documentation for this class was generated from the following file:
virtual void actionStart(int, const char *)
Level specific message streamers.
Interface for logging messages.
std::string hostname
host name of data server
bool enabled
enabled status of trigger
long long int maxQueueSize
static const JNET::JTag RC_FAIL
unsigned long long usec_scpu
std::string path
directory for writing circular buffer
JTriggerParameters parameters
static const std::string TOKEN_DELIMETER
JChannelList_t channelList
connections to data queue
long long int number_of_reads
int numberOfBins
number of bins for lookup table of timeslice
void setSelect()
Set the file descriptor mask for the select call.
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
unsigned int maximum_frames_per_slice
const CHSM::state * getState() const
Get current state.
Long64_t sizeL2
Number of L2 time slices.
virtual void actionContinue(int, const char *)
double getMaximalDistance(const JDetector &detector)
Get maximal distance between modules in detector.
virtual JClass_t * get() const
Get pointer.
Data structure to store command line arguments.
JSuperFrame1D< hit_type > JSuperFrame1D_t
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void open(const std::string &path, const JTag &tag)
Open file.
long long int numberOfBytes
void A5(CHSM_ns_alias::event const &)
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e.
JPMTSelector pmts
PMT selection.
virtual void enterState(const CHSM::state &state, const CHSM::event &event)
Action when entering state.
virtual void actionRecover(int, const char *)
virtual void actionReset(int, const char *)
int getRunNumber() const
Get run number.
JSinglePointer< JTimesliceRouter > timesliceRouter
void set(const double DMax_m=0.0)
Set dependent trigger parameters.
JCircularBuffer_t c_buffer
JSinglePointer< JTrigger3DShower > trigger3DShower
JParser parser
parser method enter()
void wait() const
Wait until the number of time intervals has elapsed since the last call to the reset method.
double TMaxLocal_ns
maximal time difference between L0 hits for L1
static const int TIMEOUT_S
time out of update [s]
void A3(CHSM_ns_alias::event const &)
JSinglePointer< JTriggerNB > triggerNB
long long int numberOfEvents
JDAQStateMachine::ev_check_event ev_check
JFileDescriptorMask & getReaderMask()
Get reader mask.
JMessageScheduler logErrorRun
JTriggerNB_t::JParameters triggerNB
unsigned long long usec_wall
long long int number_of_packets_discarded
double TMaxEvent_ns
maximal time before and after event for snapshot
JBuildL1< hit_type > JBuildL1_t
void run()
Run as run control client following command messages via JNET::JControlHost.
static const JNET::JTag RC_REPLY
JTriggerMXShower_t::JParameters triggerMXShower
const JTag & getTag() const
Get tag.
int port
server socket port
int getFrameIndex() const
Get frame index.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
const std::string & getName() const
Get name of state machine.
std::list< JDAQTimesliceL0 > timeslices
buffer with pending time slice data
static JNullStream null
Null I/O stream.
virtual bool is_open() const =0
Check is device is open.
void disable()
Disable writing.
JSinglePointer< JBuildL1_t > buildL1
JLevel_t getLevel()
Get debug level.
JSinglePointer< JTrigger3DMuon > trigger3DMuon
void A6(CHSM_ns_alias::event const &)
JEventTable eventTable
event table
virtual int getSize() const
Get size of object.
JSharedPointer< JControlHost > server
message server
Long64_t sizeL1
Number of L1 time slices.
JTrigger3DShower_t::JParameters trigger3DShower
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
virtual bool filter(const JTag &tag, int length, const char *buffer)
Filter message.
void setLevel(const int __level)
Set debug level.
JSelectReader select
select call
JL2Parameters L2
L2 processing.
JSinglePointer< JBuildL2_t > buildL2
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
void error(const JMessage_t &message)
void reset(const long long int t0)
Reset time.
double DMax_m
maximal distance between PMTs [m]
double getFrameTime()
Get frame time duration.
TFile * getFile() const
Get file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static JEvent_t toValue(const std::string &buffer)
Convert string to event.
void replaceEvent(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace tag of given event in event table.
void A8(CHSM_ns_alias::event const &)
JDAQStateMachine::ev_start_event ev_start
JTimeslice< hit_type > JTimeslice_t
JPrescaler writeL2
write JDAQTimeslice with L2 data
bool is_enabled() const
Check whether writing of data is enabled.
virtual void actionPause(int, const char *)
Long64_t sizeSN
Number of SN time slices.
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
JTriggerMask_t getTriggerMask(const unsigned int bit)
Convert trigger bit to trigger mask.
JMessageScheduler logErrorIncomplete
JSinglePointer< JModuleRouter > moduleRouter
virtual bool put(const T &object)
Object output.
void A2(CHSM_ns_alias::event const &)
virtual void actionTagged(const JTag &tag, int length, const char *buffer)
This method is called when a custom tag is encountered.
bool hasReaderMask(const JAbstractFile &file) const
Has reader file.
std::vector< JDAQProcess > dataFilters
JSinglePointer< JServerSocket > serversocket
server for data queue connections
unsigned int maxQueueDepth
static const JLocalTime getLocalTime
Function object to get local time in micro seconds.
JControlHostObjectOutput< JDAQTypes_t > JControlHost_t
Timeslice data structure for L0 data.
Message logging based on std::ostream.
virtual bool exit()
Exit the state machine.
void A12(CHSM_ns_alias::event const &)
void setInterval(const long long int interval_us)
Set interval time.
virtual bool enter()
Enter the state machine.
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
virtual void actionConfigure(int, const char *)
unsigned long long usec_ucpu
bool isRunning() const
Check if this client is in runnig state.
void update()
Update state machine.
JMessageScheduler logErrorDetector
bool is_valid() const
Check validity of logger object.
virtual void actionQuit(int, const char *)
static const JNET::JTag RC_ALERT
long long int localtime_t
Type definition of local time.
void A14(CHSM_ns_alias::event const &)
static const JChecksum checksum
Function object to perform check-sum of raw data.
Message logging based on ControlHost.
bool enabled
enabled status of trigger
void replace(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace entry in table.
void reset(JLogger *__logger=NULL)
Reset logger.
JDAQStateMachine::state_Main::state_RunControl RunControl
void A4(CHSM_ns_alias::event const &)
unsigned int frames_per_slice
JDAQStateMachine::ev_error_event ev_error
const JTag & getUniqueTag() const
Get unique tag of this run control client.
JL2Parameters SN
Supernova trigger.
static const JNET::JTag IO_TRIGGER_PARAMETERS
JSubscriptionList subscription
custom subscription
JMessageLogger logger
message logger
long long int number_of_bytes_received
int getRunNumber() const
Get run number.
long long int number_of_packets_received
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
Simple data structure to support I/O of equations (see class JLANG::JEquation).
virtual void actionCheck(int, const char *)
JPrescaler writeSummary
write JDAQSummaryslice
static bool processIndexSorter(const JDAQProcess &first, const JDAQProcess &second)
Sort DAQ process by index.
double highRateVeto_Hz
high-rate veto [Hz]
void A1(CHSM_ns_alias::event const &)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
long long int getInterval() const
Get interval time.
void processTimeSlice(const JDAQTimesliceL0 ×lice)
Process time slice.
const std::string & getFullName() const
Get full name of this run control client.
virtual void actionError()
void setReaderMask(const JAbstractFile &file)
Set reader mask.
Long64_t sizeL0
Number of L0 time slices.
Utility class to parse parameter values.
JDAQStateMachine::ev_configure_event ev_configure
std::string getStateName(const std::string &name)
Get name of state.
virtual bool put(const T &object)
Object output.
const JDAQChronometer & getDAQChronometer() const
Get DAQ chronometer.
bool enabled
enabled status of trigger
void typeout()
Report status to message logger.
bool put(const T &object)
Auxiliary method to send object to data server.
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription.
void A13(CHSM_ns_alias::event const &)
long long int numberOfIncompleteTimeslicesProcessed
JPrescaler writeSN
write JDAQTimeslice with SN data
void A7(CHSM_ns_alias::event const &)
std::string getMessage(const CHSM::state &state, const CHSM::event &event) const
Get event message.
Data frame of one optical module.
static const JNET::JTag RC_CMD
virtual void actionStop(int, const char *)
virtual void actionExit()
JTrigger3DMuon_t::JParameters trigger3DMuon
std::vector< value_type >::iterator iterator
JBuildL2< hit_type > JBuildL2_t
void setClockInterval(const long long int interval_us)
Set interval time.
int event_number
number of last event
unsigned long long int getRAM()
Get RAM of this CPU.
JDAQStateMachine::state_Main Main
JPrescaler writeL1
write JDAQTimeslice with L1 data
char getTokenDelimeter()
Get the token delimeter for command messages.
std::string toString() const
Convert tag to string.
JDAQClient(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
JSinglePointer< JBuildL2_t > buildSN
JMessageScheduler logErrorIndex
JSinglePointer< JTriggerMXShower > triggerMXShower
void reset()
Reset trigger parameters.
virtual void actionInit(int, const char *)
JPrescaler writeL0
write JDAQTimeslice with L0 data
std::vector< JDAQProcess > dataQueues
std::string trim(const std::string &buffer)
Trim string.
virtual void reset()
Reset pointer.
std::string index
index in process list
virtual void close()
Close file.
int getSize() const
Get size.
long long int getClockInterval() const
Get interval time.
virtual void actionInput(int, const char *)
void updateFrameQueue(const JChannelList_t::const_iterator channel)
Update queue with data frames.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
std::vector< std::string > getListOfIPaddresses()
Get list of IP address (decimal-dot notation).
static void reset()
Reset counter of unique instance of this class object.
void A11(CHSM_ns_alias::event const &)
double TMaxLocal_ns
maximal time difference [ns]
long long int getDelay() const
Get total delay time.
JSuperFrame2D< hit_type > JSuperFrame2D_t
static const JNET::JTag RC_DFILTER
void A10(CHSM_ns_alias::event const &)
JTimekeeper clock
central clock
JSocketInputChannel< JDAQAbstractPreamble > JSocketInputChannel_t
long long int numberOfTimeslicesProcessed
virtual void actionSelect(const JFileDescriptorMask &mask)
Action method following last select call.
bool enabled
enabled status of trigger
int read(const int argc, const char *const argv[])
Parse the program's command line options.
bool is_valid() const
Check validity of pointer.
void setEventNumber(const int event_number)
Set last event number.
void addSubscription(const JSubscription &subscription)
Add custom subscription.
long long int totalCPURAM
void A9(CHSM_ns_alias::event const &)