Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
KM3NETDAQ::JDataFilter Class Reference

Main class for real-time filtering of data. More...

Inheritance diagram for KM3NETDAQ::JDataFilter:
KM3NETDAQ::JDAQClient JDAQStateMachine KM3NETDAQ::JDAQClient_t JDAQCHSM

Classes

struct  JCircularBuffer_t
 Circular buffer. More...
 

Public Types

typedef JSocketInputChannel
< JDAQAbstractPreamble
JSocketInputChannel_t
 
typedef std::vector
< JSocketInputChannel_t
JChannelList_t
 
typedef double hit_type
 
typedef JSuperFrame1D< hit_typeJSuperFrame1D_t
 
typedef JSuperFrame2D< hit_typeJSuperFrame2D_t
 
typedef JTimeslice< hit_typeJTimeslice_t
 
typedef JBuildL1< hit_typeJBuildL1_t
 
typedef JBuildL2< hit_typeJBuildL2_t
 

Public Member Functions

 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 std::string &path, const std::string &archive)
 Constructor. More...
 
virtual void actionEnter () override
 Interface methods for actions corresponding to state transitions. More...
 
virtual void actionExit () override
 
virtual void actionInit (int length, const char *buffer) override
 
virtual void actionConfigure (int length, const char *buffer) override
 
virtual void actionStart (int length, const char *buffer) override
 
virtual void actionPause (int length, const char *buffer) override
 
virtual void actionContinue (int length, const char *buffer) override
 
virtual void actionStop (int length, const char *buffer) override
 
virtual void actionReset (int length, const char *buffer) override
 
virtual void actionQuit (int length, const char *buffer) override
 
virtual void setSelect (JFileDescriptorMask &mask) const override
 Set the file descriptor mask for the select call. More...
 
virtual void actionSelect (const JFileDescriptorMask &mask) override
 Action method following last select call. More...
 
virtual void actionRunning () override
 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 &timeslice)
 Process time slice. More...
 
void typeout ()
 Report status to message logger. More...
 
virtual void actionTagged (const JTag &tag, int length, const char *buffer) override
 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_tfindEvent (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 &parameter)
 Add parameter to parser used in method enter(). More...
 
template<class T >
void addParameter (const char option, T &parameter, 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. for debugging). 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::stringgetName () const
 Get name of state machine. More...
 
const std::stringgetName () const
 Get name of state machine. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getDetectorID () const
 Get detector identifier. More...
 
int getRunNumber () const
 Get run number. More...
 
int getRunNumber () const
 Get run number. More...
 
virtual void actionError ()
 
virtual void actionError ()
 
virtual void actionRecover (int, const char *)
 
virtual void actionRecover (int, const char *)
 
const std::stringgetHostname () const
 Get hostname. More...
 
const std::stringgetFullName () const
 Get full name of this run control client. More...
 
const JTaggetUniqueTag () 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...
 
const std::stringgetEventInfo () const
 Get last event information. More...
 
void setEventInfo (const std::string &info)
 Set last event information. More...
 

Static Public Member Functions

static bool compare (const JDAQProcess &first, const JDAQProcess &second)
 Sort DAQ process by index. More...
 

Public Attributes

JMeta meta
 meta data More...
 
JDAQStateMachine::state_root root
 
JDAQStateMachine::state_Main Main
 
JDAQStateMachine::ev_daq_event ev_daq
 
char ev_daq_param_block [sizeof(ev_daq_event::param_block)]
 
JDAQStateMachine::ev_init_event ev_init
 
char ev_init_param_block [sizeof(ev_init_event::param_block)]
 
JDAQStateMachine::ev_configure_event ev_configure
 
char ev_configure_param_block [sizeof(ev_configure_event::param_block)]
 
JDAQStateMachine::ev_start_event ev_start
 
char ev_start_param_block [sizeof(ev_start_event::param_block)]
 
JDAQStateMachine::ev_pause_event ev_pause
 
char ev_pause_param_block [sizeof(ev_pause_event::param_block)]
 
JDAQStateMachine::ev_continue_event ev_continue
 
char ev_continue_param_block [sizeof(ev_continue_event::param_block)]
 
JDAQStateMachine::ev_stop_event ev_stop
 
char ev_stop_param_block [sizeof(ev_stop_event::param_block)]
 
JDAQStateMachine::ev_reset_event ev_reset
 
char ev_reset_param_block [sizeof(ev_reset_event::param_block)]
 
JDAQStateMachine::ev_quit_event ev_quit
 
char ev_quit_param_block [sizeof(ev_quit_event::param_block)]
 
JDAQStateMachine::ev_off_event ev_off
 
char ev_off_param_block [sizeof(ev_off_event::param_block)]
 
JDAQStateMachine::ev_check_event ev_check
 
char ev_check_param_block [sizeof(ev_check_event::param_block)]
 
JDAQStateMachine::ev_input_event ev_input
 
char ev_input_param_block [sizeof(ev_input_event::param_block)]
 
JDAQStateMachine::ev_recover_event ev_recover
 
char ev_recover_param_block [sizeof(ev_recover_event::param_block)]
 
JDAQStateMachine::ev_error_event ev_error
 
char ev_error_param_block [sizeof(ev_error_event::param_block)]
 

Static Public Attributes

static const int TIMEOUT_S = 1
 time out of update [s] More...
 

Protected Types

typedef void(JDAQCHSM::* action )(int, const char *)
 Type definition of action method. More...
 
typedef void(JDAQCHSM::* action )(int, const char *)
 Type definition of action method. More...
 

Protected Attributes

JSharedPointer< JControlHostserver
 message server More...
 
JMessageLogger logger
 message logger More...
 
std::string name
 
int detector_id
 
int run_number
 
JEventTable eventTable
 event table More...
 
std::string fullname
 
JTag unique_tag
 
JTimekeeper clock
 central clock More...
 
std::string event_info
 event information More...
 

Private Types

typedef
JControlHostObjectOutput
< JDAQTypes_t
JControlHost_t
 

Private Member Functions

template<class T >
void put (const T &object)
 Auxiliary method to send object to data server. More...
 

Private Attributes

JSinglePointer< JControlHost_tdatawriter
 controlhost of data server (to which data writer should be connected) More...
 
std::string hostname
 host name of data server More...
 
int port
 server socket port More...
 
int backlog
 
JSinglePointer< JServerSocketserversocket
 server for data queue connections More...
 
JChannelList_t channelList
 connections to data queue More...
 
JTimer timer
 
JQuantile Qt
 
std::deque< JDAQTimesliceL0timeslices
 buffer with pending time slice data More...
 
int current_slice_index
 
unsigned int frames_per_slice
 
unsigned int maximum_frames_per_slice
 
int maximal_frame_index
 
JTriggerParameters parameters
 
JSinglePointer< JTimesliceRoutertimesliceRouter
 
JDetector detector
 
JSinglePointer< JModuleRoutermoduleRouter
 
JSinglePointer< JBuildL1_tbuildL1
 
JSinglePointer< JBuildL2_tbuildL2
 
JSinglePointer< JBuildL2_tbuildSN
 
JSinglePointer< JBuildL2_tbuildNB
 
JSinglePointer< JTriggerNBtriggerNB
 
JSinglePointer< JTrigger3DMuontrigger3DMuon
 
JSinglePointer< JTrigger3DShowertrigger3DShower
 
JSinglePointer< JTriggerMXShowertriggerMXShower
 
JMessageScheduler logErrorRun
 
JMessageScheduler logErrorDetector
 
JMessageScheduler logErrorIndex
 
JMessageScheduler logErrorIncomplete
 
int dumpCount
 
int dumpLimit
 
std::vector< JDAQProcessdataFilters
 
std::vector< JDAQProcessdataQueues
 
long long int totalCPURAM
 
unsigned int maxQueueDepth
 
long long int maxQueueSize
 
long long int queueSize
 
bool reporting
 
long long int numberOfEvents
 
long long int numberOfBytes
 
long long int numberOfTimeslicesProcessed
 
long long int numberOfIncompleteTimeslicesProcessed
 
int minFrameNumber
 
int maxFrameNumber
 
long long int number_of_packets_received
 
long long int number_of_packets_discarded
 
long long int number_of_reads
 
long long int number_of_bytes_received
 
JCircularBuffer_t c_buffer
 

Detailed Description

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 setSelect and actionSelect.

In state Running, all incoming data from the DataQueue.cc are buffered, referred to as "queue".
These data are formatted as a JDAQSuperFrame and aggregated into a JDAQTimeslice.
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 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 one of the corresponding pre-set limits:

  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, up to the original value set at 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 temporary circular buffer>;
  archive  = <write directory for archival of 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 one (or more) of the buffer sizes is non-zero and the path corresponds to a valid directory:

In this, YYYY, MM and DD correspond to the year, month and day at the time of the alert, respectively.
The <tag> corresponds to the unique JNET::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).

Note that the application JConvert.cc can be used to readily convert multiple input files to a single output file.

The script $JPP_DIR/tests/JDataFilter/JDataFilter.sh can be used to test this application.

Definition at line 152 of file JDataFilter.cc.

Member Typedef Documentation

Definition at line 157 of file JDataFilter.cc.

Definition at line 158 of file JDataFilter.cc.

Definition at line 160 of file JDataFilter.cc.

Definition at line 161 of file JDataFilter.cc.

Definition at line 162 of file JDataFilter.cc.

Definition at line 163 of file JDataFilter.cc.

Definition at line 164 of file JDataFilter.cc.

Definition at line 165 of file JDataFilter.cc.

Definition at line 1324 of file JDataFilter.cc.

typedef void(JDAQCHSM::* JDAQCHSM::action)(int, const char *)
protectedinherited

Type definition of action method.

Definition at line 141 of file JDAQCHSM.chsm.

typedef void(JDAQCHSM::* JDAQCHSM::action)(int, const char *)
protectedinherited

Type definition of action method.

Definition at line 152 of file JDAQCHSM.hh.

Constructor & Destructor Documentation

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 std::string path,
const std::string archive 
)
inline

Constructor.

Parameters
namename of client
servername of command message server
hostnamename of data server
loggerpointer to logger
leveldebug level
portserver port
backlogserver backlog
pathdirectory for temporary storage
archivedirectory for parmanent archival

replace tag to receive dfilter specific messages in configure

Definition at line 365 of file JDataFilter.cc.

373  :
374  JDAQClient (name,server,logger,level),
375  hostname (hostname),
376  port (port),
377  backlog (backlog),
379  {
380  replaceEvent(RC_CMD, RC_DFILTER, ev_configure); /// replace tag to receive dfilter specific messages in configure
381 
383 
384  totalCPURAM = getRAM();
385  current_slice_index = -1;
386  reporting = false;
387 
388  this->server->setReceiveBufferSize(DFILTER_RECEIVE_BUFFER_SIZE);
389  }
JDAQStateMachine::ev_configure_event ev_configure
static const JNET::JTag RC_DFILTER
Definition: JDAQTags.hh:65
std::string name
Definition: JDAQCHSM.chsm:154
void replaceEvent(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace tag of given event in event table.
Definition: JDAQClient.hh:518
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
JCircularBuffer_t c_buffer
then fatal Invalid path $argv[1] fi setopt extendedglob typeset Z8 ID function archive()
Definition: getArchive.sh:42
static const int DFILTER_RECEIVE_BUFFER_SIZE
socket JDataFilter.cc &lt;- JLigier.cc
Definition: JDAQTags.hh:29
long long int totalCPURAM
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null &))';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null &))';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DQSIM<$WORKDIR/ev_configure_dqsimulator.txt > RC_DWRT path
Auxiliary class for all subscription.
Definition: JControlHost.hh:97
int port
server socket port
std::string hostname
host name of data server
static const JNET::JTag RC_ALERT
Definition: JDAQTags.hh:71
unsigned long long int getRAM()
Get RAM of this CPU.
const JTag & getUniqueTag() const
Get unique tag of this run control client.
Definition: JDAQClient.hh:131
JDAQClient(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
Definition: JDAQClient.hh:316
static const JNET::JTag RC_CMD
Definition: JDAQTags.hh:58
void addSubscription(const JSubscription &subscription)
Add custom subscription.
Definition: JDAQClient.hh:549

Member Function Documentation

static bool KM3NETDAQ::JDataFilter::compare ( const JDAQProcess first,
const JDAQProcess second 
)
inlinestatic

Sort DAQ process by index.

Parameters
firstfirst DAQ process
secondsecond DAQ process
Returns
true if index of first DAQ process less than that of second; else false

Definition at line 346 of file JDataFilter.cc.

347  {
348  return first.index < second.index;
349  }
std::string index
index in process list
virtual void KM3NETDAQ::JDataFilter::actionEnter ( )
inlineoverridevirtual

Interface methods for actions corresponding to state transitions.

Reimplemented from JDAQCHSM.

Definition at line 392 of file JDataFilter.cc.

393  {}
virtual void KM3NETDAQ::JDataFilter::actionExit ( )
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 396 of file JDataFilter.cc.

397  {
398  if (c_buffer.is_open()) {
399 
400  JStatusStream(logger) << "Close and remove circular buffer " << c_buffer;
401 
402  c_buffer.close(false);
403  }
404 
405  datawriter.reset();
406  }
void close(const bool option)
Close file.
Definition: JDataFilter.cc:231
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
JCircularBuffer_t c_buffer
virtual bool is_open() const =0
Check is device is open.
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
virtual void KM3NETDAQ::JDataFilter::actionInit ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 409 of file JDataFilter.cc.

410  {
411  JDebugStream(logger) << "actionInit() " << std::string(buffer,length);
412 
413  try {
414 
415  JDebugStream(logger) << "Start server.";
416 
417  if (serversocket.is_valid()) {
419  }
420 
422  }
423  catch(const std::exception& error) {
424  JErrorStream(logger) << "Error \"" << error.what() << "\"; trigger ev_error.";
425  ev_error();
426  }
427  }
JDAQStateMachine::ev_error_event ev_error
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
JSinglePointer< JServerSocket > serversocket
server for data queue connections
TCP server socket.
bool is_valid() const
Check validity of pointer.
int shutdown()
Shut down socket.
Definition: JSocket.hh:72
then awk string
Level specific message streamers.
int port
server socket port
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
virtual void KM3NETDAQ::JDataFilter::actionConfigure ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 430 of file JDataFilter.cc.

431  {
432  using namespace std;
433 
434  JDebugStream(logger) << "actionConfigure() " << endl << std::string(buffer,length);
435 
436  long long int update_s = 10;
437  long long int logger_s = 5;
438 
439  parameters .reset();
440  dataFilters.clear();
441  dataQueues .clear();
442 
443  reporting = false;
444  dumpCount = 0;
445  dumpLimit = numeric_limits<int>::max();
446 
447  detector.clear();
448 
449  JProperties properties(JEquationParameters("=", ";", "", ""), 0);
450 
451  properties["dataWriter"] = hostname;
452  properties["numberOfFramesPerSlice"] = frames_per_slice = 1;
453  properties["detector"] = detector;
454  properties["triggerParameters"] = parameters;
455  properties["queueSize"] = maxQueueSize = (totalCPURAM - GIGABYTE); // leave 1 GB left ...
456  properties["queueDepth"] = maxQueueDepth = 20; // to be optimized
457  properties["frameIndex"] = maximal_frame_index = 100000;
458  properties["logger_s"] = logger_s;
459  properties["update_s"] = update_s;
460  properties["JDataFilter"] = dataFilters;
461  properties["DataQueue"] = dataQueues;
462  properties["path"] = c_buffer.path;
463  properties["archive"] = c_buffer.archive;
464  properties["c_sizeL0"] = c_buffer.sizeL0;
465  properties["c_sizeL1"] = c_buffer.sizeL1;
466  properties["c_sizeL2"] = c_buffer.sizeL2;
467  properties["c_sizeSN"] = c_buffer.sizeSN;
468  properties["dumpLimit"] = dumpLimit;
469 
470  try {
471  properties.read(string(buffer, length));
472  }
473  catch(const std::exception& error) {
474  JErrorStream(logger) << error.what();
475  }
476 
477  if (update_s <= 0) { update_s = 1; }
478  if (logger_s <= 0) { logger_s = 1; }
479 
480  setClockInterval(update_s * 1000000LL);
481 
483 
484  if (hostname != "")
486  else
487  throw JException("Undefined data writer host name.");
488 
489  datawriter->setSendBufferSize(DFILTER_SEND_BUFFER_SIZE);
490 
492 
493  // process processlist
494 
495  if (dataFilters.empty()) {
496  JNoticeStream(logger) << "No DataFilters in process list, or no process list. "
497  << "Assuming that this process is the only process on this CPU and setting parameters accordingly.";
498  }
499 
500  sort(dataFilters.begin(), dataFilters.end(), compare);
501 
502  unsigned int numberOfDataFiltersOnThisMachine = 0;
503  vector<JDAQProcess>::iterator thisProcess = dataFilters.end();
504 
506 
507  {
508  JNoticeStream notice(logger);
509 
510  notice << "My IP addresses:";
511 
512  for (vector<string>::const_iterator i = IP.begin(); i != IP.end(); ++i) {
513  notice << ' ' << *i;
514  }
515  }
516 
517  for (vector<JDAQProcess>::iterator i = dataFilters.begin(); i != dataFilters.end(); ++i) {
518 
519  JDebugStream(logger) << "Test IP address \"" << i->hostname << "\" " << (find(IP.begin(), IP.end(), i->hostname) != IP.end());
520 
521  if (find(IP.begin(), IP.end(), i->hostname) != IP.end()) {
522 
523  numberOfDataFiltersOnThisMachine++;
524 
525  if (i->port == this->port) {
526  thisProcess = i;
527  }
528  }
529  }
530 
531  if (numberOfDataFiltersOnThisMachine == 0) {
532  JNoticeStream(logger) << "Zero data filters on this machine according to process list (if it exists). "
533  << "Assuming one datafilter on this machine.";
534  numberOfDataFiltersOnThisMachine = 1;
535  }
536 
537  if (thisProcess == dataFilters.end()) {
538  JErrorStream(logger) << "This process cannot be found in the process list. Why do I exist?";
539  }
540 
541  if (thisProcess != dataFilters.end() && thisProcess->index != getName()) {
542  JErrorStream(logger) << "Mismatch between given process names: "
543  << "I am called " << getName()
544  << ", but in the process list I am referred to as " << thisProcess->index;
545  }
546 
547  if (dataFilters.begin() == thisProcess || dataFilters.empty()) { // set reporting
548  reporting = true;
549  }
550 
551  if (maxQueueSize > (totalCPURAM-GIGABYTE)/(numberOfDataFiltersOnThisMachine)) { // check maximum size of queue
552 
553  maxQueueSize = (totalCPURAM-GIGABYTE)/(numberOfDataFiltersOnThisMachine);
554 
555  JNoticeStream(logger) << "Maximum queue size is too large given the number of processes on this machine. "
556  << "Queue size reduced to "
557  << maxQueueSize << " bytes." ;
558  }
559 
560  // detector
561 
562  if (parameters.disableHighRateVeto) {
563 
564  JNoticeStream(logger) << "Disabling high-rate veto of all PMTs.";
565 
566  detector.setPMTStatus(HIGH_RATE_VETO_DISABLE);
567  }
568 
569  // trigger parameters
570 
572 
577 
579 
580  if (reporting) {
581  JNoticeStream(logger) << "This data filter process will report.";
582  JNoticeStream(logger) << "Detector version/size " << detector.getVersion() << '/' << detector.size();
583  JDebugStream (logger) << "Trigger parameters: " << parameters;
584  JDebugStream (logger) << "Detector description: " << endl << detector;
585  JNoticeStream(logger) << "Update period [s]: " << getClockInterval();
586  }
587 
589 
590  // set L1, L2 and SN builders
591 
596 
597  if (buildL1.get() == NULL) { JErrorStream(logger) << "Failed to allocate buildL1."; }
598  if (buildL2.get() == NULL) { JErrorStream(logger) << "Failed to allocate buildL2."; }
599  if (buildSN.get() == NULL) { JErrorStream(logger) << "Failed to allocate buildSN."; }
600  if (buildNB.get() == NULL) { JErrorStream(logger) << "Failed to allocate buildSN."; }
601 
606 
607  if (c_buffer.is_enabled()) {
608 
609  if (!c_buffer.is_open()) {
610 
611  c_buffer.open();
612 
613  if (c_buffer.is_open()) {
614 
616 
617  JStatusStream(logger) << "Created circular buffer " << c_buffer;
618 
619  } else {
620 
621  JErrorStream (logger) << "Failed to create circular buffer in directory <" << c_buffer.path << ">; disable functionality.";
622  }
623 
624  } else {
625 
626  JNoticeStream(logger) << "Continue using circular buffer " << c_buffer;
627  }
628  }
629 
630  if (c_buffer.is_open()) {
631  if (c_buffer.sizeL0 > 0) { static_cast<JTreeWriterObjectOutput<JDAQTimesliceL0>&>(c_buffer).SetCircular(c_buffer.sizeL0); }
632  if (c_buffer.sizeL1 > 0) { static_cast<JTreeWriterObjectOutput<JDAQTimesliceL1>&>(c_buffer).SetCircular(c_buffer.sizeL1); }
633  if (c_buffer.sizeL2 > 0) { static_cast<JTreeWriterObjectOutput<JDAQTimesliceL2>&>(c_buffer).SetCircular(c_buffer.sizeL2); }
634  if (c_buffer.sizeSN > 0) { static_cast<JTreeWriterObjectOutput<JDAQTimesliceSN>&>(c_buffer).SetCircular(c_buffer.sizeSN); }
635  } else {
636  c_buffer.disable();
637  }
638  }
Message logger with time scheduler.
static bool compare(const JDAQProcess &first, const JDAQProcess &second)
Sort DAQ process by index.
Definition: JDataFilter.cc:346
General exception.
Definition: JException.hh:24
JMeta meta
meta data
JSinglePointer< JTriggerNB > triggerNB
Router for fast addressing of hits in KM3NETDAQ::JDAQTimeslice data structure as a function of the op...
JBuildL2< hit_type > JBuildL2_t
Definition: JDataFilter.cc:165
JMessageScheduler logErrorIndex
Long64_t sizeL1
Number of L1 time slices.
Definition: JDataFilter.cc:329
static const int DFILTER_SEND_BUFFER_SIZE
socket JDataFilter.cc -&gt; JDataWriter.cc
Definition: JDAQTags.hh:30
Router for direct addressing of module data in detector data structure.
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
long long int getClockInterval() const
Get interval time.
Definition: JDAQClient.hh:154
Utility class to parse parameter values.
Definition: JProperties.hh:496
void setClockInterval(const long long int interval_us)
Set interval time.
Definition: JDAQClient.hh:165
static const int HIGH_RATE_VETO_DISABLE
Enable (disable) use of high-rate veto test if this status bit is 0 (1);.
Definition: pmt_status.hh:13
unsigned int maximum_frames_per_slice
JMessageScheduler logErrorIncomplete
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Time keeper.
Definition: JTimekeeper.hh:34
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
JTriggerParameters parameters
std::string path
Directory for temporary storage.
Definition: JDataFilter.cc:333
JBuildL1< hit_type > JBuildL1_t
Definition: JDataFilter.cc:164
JCircularBuffer_t c_buffer
bool is_enabled() const
Check whether writing of data is enabled.
Definition: JDataFilter.cc:295
std::string trim(const std::string &buffer)
Trim string.
Definition: JLangToolkit.hh:79
JSinglePointer< JBuildL2_t > buildL2
JSinglePointer< JTriggerMXShower > triggerMXShower
JSinglePointer< JBuildL1_t > buildL1
TFile * getFile() const
Get file.
Definition: JRootFile.hh:66
long long int totalCPURAM
JSinglePointer< JTrigger3DShower > trigger3DShower
Detector file.
Definition: JHead.hh:226
std::vector< JDAQProcess > dataFilters
JMessageScheduler logErrorDetector
then awk string
JSinglePointer< JBuildL2_t > buildSN
JSinglePointer< JBuildL2_t > buildNB
Level specific message streamers.
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
Nano-beacon trigger.
Definition: JTriggerNB.hh:19
Long64_t sizeSN
Number of SN time slices.
Definition: JDataFilter.cc:331
std::string hostname
host name of data server
unsigned int maxQueueDepth
JControlHostObjectOutput< JDAQTypes_t > JControlHost_t
std::vector< JDAQProcess > dataQueues
long long int maxQueueSize
JSinglePointer< JTimesliceRouter > timesliceRouter
static const long long int GIGABYTE
Number of bytes in a mega-byte.
virtual bool is_open() const =0
Check is device is open.
std::vector< std::string > getListOfIPaddresses()
Get list of IP address (decimal-dot notation).
Definition: JNetwork.hh:216
Long64_t sizeL0
Number of L0 time slices.
Definition: JDataFilter.cc:328
JSinglePointer< JTrigger3DMuon > trigger3DMuon
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
double getMaximalDistance(const JDetector &detector, const bool option=false)
Get maximal distance between modules in detector.
JMessageScheduler logErrorRun
JSinglePointer< JModuleRouter > moduleRouter
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
const std::string & getName() const
Get name of state machine.
Definition: JDAQCHSM.chsm:78
Long64_t sizeL2
Number of L2 time slices.
Definition: JDataFilter.cc:330
virtual JClass_t * get() const override
Get pointer.
Definition: JPointer.hh:64
unsigned int frames_per_slice
std::string archive
Directory for permanent archival.
Definition: JDataFilter.cc:334
virtual void KM3NETDAQ::JDataFilter::actionStart ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 641 of file JDataFilter.cc.

642  {
643  using namespace std;
644 
645  if (reporting) {
646  JNoticeStream(logger) << "Start run " << getRunNumber();
647  }
648 
649  timeslices.clear();
650 
651  current_slice_index = -1;
652  queueSize = 0;
653 
654  numberOfEvents = 0;
655  numberOfBytes = 0;
658 
662  number_of_reads = 0;
663 
664  minFrameNumber = numeric_limits<int>::max();
665  maxFrameNumber = numeric_limits<int>::min();
666 
667  // Reset global trigger counter.
668 
670 
671  logErrorRun .reset();
673  logErrorIndex .reset();
675 
676  timer.reset();
677  timer.start();
678 
679  Qt.reset();
680 
681  // send trigger parameters to the datawriter
682 
683  ostringstream os;
684 
685  os << getRunNumber() << ' ' << parameters;
686 
687  datawriter->PutFullString(IO_TRIGGER_PARAMETERS, os.str());
688  }
void reset()
Reset.
Definition: JQuantile.hh:87
long long int numberOfTimeslicesProcessed
std::deque< JDAQTimesliceL0 > timeslices
buffer with pending time slice data
JMessageScheduler logErrorIndex
JMessageScheduler logErrorIncomplete
static const JNET::JTag IO_TRIGGER_PARAMETERS
Definition: JDAQTags.hh:82
JTriggerParameters parameters
long long int number_of_packets_discarded
void reset()
Reset timer.
Definition: JTimer.hh:76
long long int numberOfBytes
JMessageScheduler logErrorDetector
long long int numberOfIncompleteTimeslicesProcessed
long long int number_of_packets_received
static void reset()
Reset counter of unique instance of this class object.
long long int queueSize
int getRunNumber() const
Get run number.
Definition: JDAQCHSM.chsm:100
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
JMessageScheduler logErrorRun
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
long long int number_of_bytes_received
long long int number_of_reads
long long int numberOfEvents
void start()
Start timer.
Definition: JTimer.hh:89
virtual void KM3NETDAQ::JDataFilter::actionPause ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 691 of file JDataFilter.cc.

692  {
693  using namespace std;
694 
695  if (!timeslices.empty()) {
696 
697  JNoticeStream(logger) << "Flushing " << timeslices.size() << " slices.";
698 
699  for (deque<JDAQTimesliceL0>::const_iterator i = timeslices.begin(); i != timeslices.end(); ++i) {
700  queueSize -= getSizeof(*i);
701  }
702 
703  timeslices.clear();
704  }
705 
706  { // force clearance of memory
707 
708  deque<JDAQTimesliceL0> buffer;
709 
710  timeslices.swap(buffer);
711  }
712 
713  if (queueSize != 0) {
714  JWarningStream(logger) << "Pending data in queue " << queueSize << " [B]";
715  }
716 
717  current_slice_index = -1;
718  queueSize = 0;
719 
720  timer.stop();
721  }
std::deque< JDAQTimesliceL0 > timeslices
buffer with pending time slice data
void stop()
Stop timer.
Definition: JTimer.hh:113
long long int queueSize
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
size_t getSizeof(const JDAQEvent &object)
Get size of object.
Definition: JDAQEventIO.hh:26
virtual void KM3NETDAQ::JDataFilter::actionContinue ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 724 of file JDataFilter.cc.

725  {
726  timer.start();
727  }
void start()
Start timer.
Definition: JTimer.hh:89
virtual void KM3NETDAQ::JDataFilter::actionStop ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 730 of file JDataFilter.cc.

731  {
732  typeout();
733 
734  datawriter.reset();
735  }
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
void typeout()
Report status to message logger.
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
virtual void KM3NETDAQ::JDataFilter::actionReset ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 738 of file JDataFilter.cc.

739  {
740  if (serversocket.is_valid()) {
742  }
743 
745  }
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
JSinglePointer< JServerSocket > serversocket
server for data queue connections
bool is_valid() const
Check validity of pointer.
int shutdown()
Shut down socket.
Definition: JSocket.hh:72
virtual void KM3NETDAQ::JDataFilter::actionQuit ( int  length,
const char *  buffer 
)
inlineoverridevirtual

Reimplemented from JDAQCHSM.

Definition at line 748 of file JDataFilter.cc.

749  {
750  datawriter.reset();
751  }
virtual void reset() override
Reset pointer.
Definition: JStorage.hh:42
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
virtual void KM3NETDAQ::JDataFilter::setSelect ( JFileDescriptorMask mask) const
inlineoverridevirtual

Set the file descriptor mask for the select call.

This implementation does nothing but may be redefined by the derived class.

Parameters
maskfile descriptor mask

Reimplemented from KM3NETDAQ::JDAQClient.

Definition at line 754 of file JDataFilter.cc.

755  {
756  if (serversocket.is_valid()) {
757  mask.set(*serversocket);
758  }
759 
760  for (JChannelList_t::const_iterator channel = channelList.begin(); channel != channelList.end(); ++channel) {
761  if (!channel->isReady()) {
762  mask.set(channel->getFileDescriptor());
763  }
764  }
765  }
void set(const int file_descriptor)
Set file descriptor.
JSinglePointer< JServerSocket > serversocket
server for data queue connections
bool is_valid() const
Check validity of pointer.
JChannelList_t channelList
connections to data queue
virtual void KM3NETDAQ::JDataFilter::actionSelect ( const JFileDescriptorMask mask)
inlineoverridevirtual

Action method following last select call.

This implementation does nothing but may be redefined by the derived class.

Parameters
maskfile descriptor mask

Reimplemented from KM3NETDAQ::JDAQClient.

Definition at line 768 of file JDataFilter.cc.

769  {
770  using namespace std;
771 
772  for (JChannelList_t::iterator channel = channelList.begin(); channel != channelList.end(); ) {
773 
774  try {
775 
776  if (mask.has(channel->getFileDescriptor())) {
777  channel->read();
778  }
779 
780  if (channel->isReady()) {
781 
783  number_of_reads += channel->getCounter();
784  number_of_bytes_received += channel->size();
785 
786  if (isRunning()) {
787 
788  updateFrameQueue(channel);
789 
790  } else {
791 
792  JErrorStream(logErrorRun) << "Receiving data while not running.";
793 
795  }
796 
797  channel->reset();
798  }
799 
800  ++channel;
801  }
802  catch(const std::exception& error) {
803 
804  JNoticeStream(logger) << "Disconnecting channel " << channel->getFileDescriptor() << ' ' << error.what();
805 
806  channel->shutdown();
807 
808  channel = channelList.erase(channel);
809  }
810  }
811 
812 
813  if (serversocket.is_valid()) {
814 
815  if (mask.has(*serversocket)) {
816 
817  JTCPSocket socket;
818 
820 
822 
823  socket.setKeepAlive (true);
824  socket.setNonBlocking(true);
825 
826  JNoticeStream(logger) << "New channel" << '[' << socket.getFileDescriptor() << ']';
827 
828  channelList.push_back(JSocketInputChannel_t(socket));
829  }
830  }
831 
832 
833  if (!timeslices.empty() && ((timeslices[0].size() >= frames_per_slice) ||
834  (timeslices.size() >= 2u &&
835  timeslices[1].size() >= frames_per_slice) ||
836  (timeslices.size() >= maxQueueDepth) ||
837  (queueSize >= maxQueueSize))) {
838 
839  const JDAQTimesliceL0& pending_slice = timeslices.front();
840  queueSize -= getSizeof(pending_slice);
841 
842  current_slice_index = pending_slice.getFrameIndex();
843  minFrameNumber = min(minFrameNumber, pending_slice.getFrameIndex());
844  maxFrameNumber = max(maxFrameNumber, pending_slice.getFrameIndex());
845 
846  if (pending_slice.size() > frames_per_slice) {
847 
848  JErrorStream(logger) << "More frames in timeslice than expected "
849  << pending_slice.size() << " > " << frames_per_slice;
850 
851  if (pending_slice.size() <= maximum_frames_per_slice) {
852 
853  JErrorStream(logger) << "Adjusting expected frames per timeslice to " << pending_slice.size();
854 
855  frames_per_slice = pending_slice.size();
856  }
857  }
858 
859  if (!pending_slice.empty()) {
860 
861  const localtime_t t0 = getLocalTime();
862 
863  processTimeSlice(pending_slice);
864 
865  const localtime_t t1 = getLocalTime();
866 
868 
869  Qt.put(t1 - t0);
870 
871  if (pending_slice.size() < frames_per_slice) {
872 
874 
875  ostringstream error;
876 
877  error << "Timeout -> processed incomplete timeslice: "
878  << "Frame index = " << pending_slice.getFrameIndex() << ';'
879  << "Size of timeslice = " << pending_slice.size() << ';'
880  << "Queue depth = " << timeslices.size() << ';'
881  << "Queue size = " << queueSize << ';';
882 
883  if ((timeslices.size() >= 2u &&
884  timeslices[1].size() >= frames_per_slice)) {
885 
886  error << " intermittent problem -> continues as-is";
887 
888  } else {
889 
890  error << " adjusting expected frames per timeslice from " << frames_per_slice << " to " << pending_slice.size();
891 
892  frames_per_slice = pending_slice.size();
893  }
894 
895  JErrorStream(logErrorIncomplete) << error.str();
896  }
897  }
898 
899  timeslices.pop_front();
900  }
901  }
void processTimeSlice(const JDAQTimesliceL0 &timeslice)
Process time slice.
long long int numberOfTimeslicesProcessed
std::deque< JDAQTimesliceL0 > timeslices
buffer with pending time slice data
bool has(const int file_descriptor) const
Has file descriptor.
JSocketInputChannel< JDAQAbstractPreamble > JSocketInputChannel_t
Definition: JDataFilter.cc:157
JSinglePointer< JServerSocket > serversocket
server for data queue connections
unsigned int maximum_frames_per_slice
JMessageScheduler logErrorIncomplete
long long int number_of_packets_discarded
bool is_valid() const
Check validity of pointer.
int getFrameIndex() const
Get frame index.
int getFileDescriptor() const
Get file descriptor.
void accept(const int server)
Accept connection from a server.
Definition: JTCPSocket.hh:139
static const JLocalTime getLocalTime
Function object to get local time in micro seconds.
static const int DFILTER_DQUEUE_BUFFER_SIZE
socket JDataFilter.cc &lt;- DataQueue.cc
Definition: JDAQTags.hh:28
long long int numberOfIncompleteTimeslicesProcessed
void put(const double x, const double w=1.0)
Put value.
Definition: JQuantile.hh:133
void updateFrameQueue(const JChannelList_t::const_iterator channel)
Update queue with data frames.
Definition: JDataFilter.cc:919
long long int number_of_packets_received
bool isRunning() const
Check if this client is in runnig state.
Definition: JDAQClient.hh:505
long long int localtime_t
Type definition of local time.
void setReceiveBufferSize(const int size)
Set receive buffer size.
Definition: JSocket.hh:131
unsigned int maxQueueDepth
long long int maxQueueSize
TCP socket.
Definition: JTCPSocket.hh:25
long long int queueSize
JChannelList_t channelList
connections to data queue
JMessageScheduler logErrorRun
void setNonBlocking(const bool on)
Set non-blocking of I/O.
Definition: JTCPSocket.hh:42
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
void setKeepAlive(const bool on)
Set keep alive of socket.
Definition: JSocket.hh:87
long long int number_of_bytes_received
double u[N+1]
Definition: JPolint.hh:776
size_t getSizeof(const JDAQEvent &object)
Get size of object.
Definition: JDAQEventIO.hh:26
long long int number_of_reads
unsigned int frames_per_slice
Timeslice data structure for L0 data.
virtual void KM3NETDAQ::JDataFilter::actionRunning ( )
inlineoverridevirtual

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 904 of file JDataFilter.cc.

905  {
906  if (reporting) {
907  typeout();
908  }
909  }
void typeout()
Report status to message logger.
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
channelincoming data channel

Definition at line 919 of file JDataFilter.cc.

920  {
921  using namespace std;
922 
923  JByteArrayReader in(channel->data(), channel->size());
924 
925  JDAQPreamble preamble;
926  JDAQSuperFrameHeader header;
927 
928  in >> preamble;
929  in >> header;
930 
931  if (preamble.getLength() != channel->size()) {
932 
933  JErrorStream(logErrorRun) << "Size of received data does not match size reported by preamble: "
934  << "preamble.getLength() = " << preamble.getLength() << ';'
935  << "channel->size(): " << channel->size() << ';';
936 
938 
939  return;
940  }
941 
942  if (header.getRunNumber() != getRunNumber()) {
943 
944  JErrorStream(logErrorRun) << "Run number " << header.getRunNumber()
945  << " != " << getRunNumber()
946  << " -> Dropping frame.";
947 
949 
950  return;
951  }
952 
953  if (header.getFrameIndex() <= current_slice_index) {
954 
955  JErrorStream(logErrorIndex) << "Frame index " << header.getFrameIndex() << " <= " << current_slice_index
956  << " module " << header.getModuleID()
957  << " -> Dropping frame.";
958 
960 
962 
964 
965  JErrorStream(logErrorIndex) << "Increase number of frames expected to: " << frames_per_slice;
966  }
967 
968  return;
969  }
970 
971  if (current_slice_index != -1 && header.getFrameIndex() > current_slice_index + maximal_frame_index) {
972 
973  JErrorStream(logErrorIndex) << "Frame index " << header.getFrameIndex() << " > " << current_slice_index + maximal_frame_index
974  << " module " << header.getModuleID()
975  << " -> Dropping frame.";
976 
978 
979  return;
980  }
981 
982  deque<JDAQTimesliceL0>::iterator timesliceIterator = timeslices.begin();
983 
984  while (timesliceIterator != timeslices.end() && timesliceIterator->getFrameIndex() < header.getFrameIndex()) {
985  ++timesliceIterator;
986  }
987 
988  if (timesliceIterator != timeslices.end() && timesliceIterator->getFrameIndex() == header.getFrameIndex()) {
989 
990  // The corresponding time slice already exists
991 
992  } else {
993 
994  // This is the first frame of this time slice; insert a new time slice in the buffer at the right position in the list
995 
996  timesliceIterator = timeslices.insert(timesliceIterator, JDAQTimesliceL0());
997 
998  timesliceIterator->setDAQChronometer(header.getDAQChronometer());
999 
1000  queueSize += getSizeof(*timesliceIterator);
1001  }
1002 
1003  timesliceIterator->push_back(JDAQSuperFrame(header));
1004 
1005  in >> static_cast<JDAQFrame&>(*(timesliceIterator->rbegin()));
1006 
1007  queueSize += getSizeof(*timesliceIterator->rbegin());
1008  }
std::deque< JDAQTimesliceL0 > timeslices
buffer with pending time slice data
JMessageScheduler logErrorIndex
unsigned int maximum_frames_per_slice
long long int number_of_packets_discarded
Byte array binary input.
Definition: JByteArrayIO.hh:25
Data frame.
Definition: JDAQFrame.hh:64
long long int queueSize
int getRunNumber() const
Get run number.
Definition: JDAQCHSM.chsm:100
JMessageScheduler logErrorRun
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
size_t getSizeof(const JDAQEvent &object)
Get size of object.
Definition: JDAQEventIO.hh:26
Data frame of one optical module.
unsigned int frames_per_slice
Timeslice data structure for L0 data.
void KM3NETDAQ::JDataFilter::processTimeSlice ( const JDAQTimesliceL0 timeslice)
inline

Process time slice.

Parameters
timeslicetime slice

Definition at line 1016 of file JDataFilter.cc.

1017  {
1018  using namespace std;
1019 
1020  try {
1021 
1022  timesliceRouter->configure(timeslice);
1023 
1024  if (parameters.writeSummary()) {
1025  this->put(JDAQSummaryslice(timeslice));
1026  }
1027 
1028  if (parameters.trigger3DMuon.enabled ||
1029  parameters.trigger3DShower.enabled ||
1030  parameters.triggerMXShower.enabled ||
1031  parameters.triggerNB.enabled ||
1032  parameters.writeL0.prescale ||
1033  parameters.writeL1.prescale ||
1034  parameters.writeL2.prescale ||
1035  parameters.writeSN.prescale ||
1036  c_buffer.is_enabled()) {
1037 
1038  JTimeslice_t timesliceL0(timeslice.getDAQChronometer());
1039  JTimeslice_t timesliceL1(timeslice.getDAQChronometer());
1040  JTimeslice_t timesliceL2(timeslice.getDAQChronometer());
1041  JTimeslice_t timesliceSN(timeslice.getDAQChronometer());
1042  JTimeslice_t timesliceNB(timeslice.getDAQChronometer());
1043  JDAQTimeslice timesliceTX(timeslice.getDAQChronometer());
1044 
1045  for (JDAQTimesliceL0::const_iterator frame = timeslice.begin(); frame != timeslice.end(); ++frame) {
1046 
1047  if (moduleRouter->hasModule(frame->getModuleID())) {
1048 
1049  if (!checksum(*frame)) {
1050 
1051  JErrorStream(logger) << "Invalid data at "
1052  << "run = " << timeslice.getRunNumber() << ";"
1053  << "frame index = " << timeslice.getFrameIndex() << ";"
1054  << "module = " << frame->getModuleID() << ";"
1055  << "discard" << (dumpCount < dumpLimit ? " and dump" : "");
1056 
1057  timesliceTX.push_back(*frame);
1058 
1059  continue;
1060  }
1061 
1062  const JModule& module = moduleRouter->getModule(frame->getModuleID());
1063  JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame, module);
1064 
1065  // Apply high-rate veto
1066 
1067  buffer.applyHighRateVeto(parameters.highRateVeto_Hz);
1068 
1069  // L0
1070 
1071  timesliceL0.push_back(JSuperFrame1D_t(buffer));
1072 
1073  // Nano-beacon trigger
1074 
1075  if (parameters.triggerNB.enabled) {
1076 
1077  JSuperFrame2D_t::iterator __end = partition(buffer.begin(), buffer.end(), parameters.triggerNB.pmts);
1078 
1079  if (buffer.begin() != __end) {
1080 
1081  timesliceNB.push_back(JSuperFrame1D_t(frame->getDAQChronometer(),
1082  frame->getModuleIdentifier(),
1083  module.getPosition()));
1084 
1085  JSuperFrame1D_t zbuf;
1086 
1087  (*buildL1)(buffer.begin(), __end , back_inserter(zbuf));
1088 
1089  (*buildNB)(buffer.begin() , __end, zbuf, back_inserter(*timesliceNB.rbegin()));
1090  }
1091  }
1092 
1093  // L1
1094 
1095  timesliceL1.push_back(JSuperFrame1D_t(frame->getDAQChronometer(),
1096  frame->getModuleIdentifier(),
1097  module.getPosition()));
1098 
1099  (*buildL1)(*timesliceL0.rbegin(), back_inserter(*timesliceL1.rbegin()));
1100 
1101  // L2
1102 
1103  timesliceL2.push_back(JSuperFrame1D_t(frame->getDAQChronometer(),
1104  frame->getModuleIdentifier(),
1105  module.getPosition()));
1106 
1107  (*buildL2)(buffer, *timesliceL1.rbegin(), back_inserter(*timesliceL2.rbegin()));
1108 
1109  // SN
1110 
1111  timesliceSN.push_back(JSuperFrame1D_t(frame->getDAQChronometer(),
1112  frame->getModuleIdentifier(),
1113  module.getPosition()));
1114 
1115  (*buildSN)(buffer, *timesliceL1.rbegin(), back_inserter(*timesliceSN.rbegin()));
1116 
1117  } else {
1118 
1119  JErrorStream(logErrorDetector) << "No detector information for module " << frame->getModuleID();
1120  }
1121  }
1122 
1123  if (!timesliceTX.empty()) {
1124 
1125  if (dumpCount < dumpLimit) {
1126 
1127  this->put(timesliceTX);
1128 
1129  dumpCount += 1;
1130  }
1131  }
1132 
1133  // Trigger
1134 
1135  if (parameters.triggerNB.enabled) {
1136 
1137  const JTriggerInput trigger_input(timesliceNB);
1138 
1139  for (JTriggerInput::const_iterator hit = trigger_input.begin(); hit != trigger_input.end(); ++hit) {
1140 
1141  if (parameters.triggerNB.write()) {
1142 
1143  JTriggeredEvent tev(timesliceNB.getDAQChronometer(),
1145  *hit,
1146  *timesliceRouter,
1147  *moduleRouter,
1148  parameters.TMaxLocal_ns,
1149  parameters.triggerNB.DMax_m,
1150  getTimeRange(parameters.triggerNB));
1151 
1152  this->put(tev);
1153  }
1154  }
1155  }
1156 
1157  JTriggerInput trigger_input(timesliceL2);
1158  JTriggerOutput trigger_output;
1159 
1160  (*trigger3DMuon) (trigger_input, back_inserter(trigger_output));
1161  (*trigger3DShower)(trigger_input, back_inserter(trigger_output));
1162  (*triggerMXShower)(trigger_input, timesliceL0, back_inserter(trigger_output));
1163 
1164  trigger_output.merge(JEventOverlap(parameters.TMaxEvent_ns));
1165 
1166  for (JTriggerOutput::const_iterator event = trigger_output.begin(); event != trigger_output.end(); ++event) {
1167 
1168  const JTriggeredEvent object(*event, *timesliceRouter, *moduleRouter, parameters.TMaxLocal_ns, getTimeRange(parameters));
1169 
1170  this->put(object);
1171 
1172  numberOfEvents += 1;
1173  }
1174 
1175  if (parameters.writeL1() || c_buffer.sizeL1 > 0) {
1176 
1177  const JTimesliceL1<JDAQTimesliceL1> object(timesliceL1, *timesliceRouter, *moduleRouter, parameters.TMaxLocal_ns);
1178 
1179  if (parameters.writeL1) { this->put(object); }
1180  if (c_buffer.sizeL1 > 0) { c_buffer.put(object); }
1181  }
1182 
1183  if (parameters.writeL2() || c_buffer.sizeL2 > 0) {
1184 
1185  const JTimesliceL1<JDAQTimesliceL2> object(timesliceL2, *timesliceRouter, *moduleRouter, parameters.L2.TMaxLocal_ns);
1186 
1187  if (parameters.writeL2) { this->put(object); }
1188  if (c_buffer.sizeL2 > 0) { c_buffer.put(object); }
1189  }
1190 
1191  if (parameters.writeSN() || c_buffer.sizeSN > 0) {
1192 
1193  const JTimesliceL1<JDAQTimesliceSN> object(timesliceSN, *timesliceRouter, *moduleRouter, parameters.SN.TMaxLocal_ns);
1194 
1195  if (parameters.writeSN) { this->put(object); }
1196  if (c_buffer.sizeSN > 0) { c_buffer.put(object); }
1197  }
1198 
1199  if (parameters.writeL0() || c_buffer.sizeL0 > 0) {
1200 
1201  if (parameters.writeL0) { this->put(timeslice); }
1202  if (c_buffer.sizeL0 > 0) { c_buffer.put(timeslice); }
1203  }
1204  }
1205 
1206  } catch(const std::exception& error) {
1207 
1208  JErrorStream(logger) << "Error = " << error.what() << ";"
1209  << "run = " << timeslice.getRunNumber() << ";"
1210  << "frame index = " << timeslice.getFrameIndex() << ";"
1211  << "time slice not correctly processed;"
1212  << "discard" << (dumpCount < dumpLimit ? " and dump" : "");
1213 
1214  if (dumpCount < dumpLimit) {
1215 
1216  this->put(static_cast<const JDAQTimeslice&>(timeslice));
1217 
1218  dumpCount += 1;
1219  }
1220  }
1221 
1223  }
JTriggerMask_t getTriggerMask(const unsigned int bit)
Convert trigger bit to trigger mask.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition: JModule.hh:68
JSinglePointer< JTriggerNB > triggerNB
JSuperFrame2D< hit_type > JSuperFrame2D_t
Definition: JDataFilter.cc:162
Long64_t sizeL1
Number of L1 time slices.
Definition: JDataFilter.cc:329
void configure(const JDAQTimeslice &timeslice)
Configure.
JTriggerParameters parameters
int getRunNumber() const
Get run number.
static const JChecksum checksum
Function object to perform check-sum of raw data.
Definition: JChecksum.hh:176
int getFrameIndex() const
Get frame index.
JCircularBuffer_t c_buffer
JTimeRange getTimeRange(const Evt &event)
Get time range (i.e. time between earliest and latest hit) of Monte Carlo event.
bool is_enabled() const
Check whether writing of data is enabled.
Definition: JDataFilter.cc:295
JSuperFrame1D< hit_type > JSuperFrame1D_t
Definition: JDataFilter.cc:161
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
JTimeslice< hit_type > JTimeslice_t
Definition: JDataFilter.cc:163
void merge(const JMatch_t &match)
Merge events.
JMessageScheduler logErrorDetector
void put(const T &object)
Auxiliary method to send object to data server.
const JDAQChronometer & getDAQChronometer() const
Get DAQ chronometer.
Data time slice.
Auxiliary class to build JDAQEvent for a triggered event.
virtual bool put(const T &object) override
Object output.
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
Long64_t sizeSN
Number of SN time slices.
Definition: JDataFilter.cc:331
std::vector< value_type >::iterator iterator
JSinglePointer< JTimesliceRouter > timesliceRouter
Auxiliary class to build JDAQTimeslice for L1 timeslice.
Definition: JTimesliceL1.hh:36
JTriggerbit_t getTriggerBit() const
Get the trigger bit.
Long64_t sizeL0
Number of L0 time slices.
Definition: JDataFilter.cc:328
bool hasModule(const JObjectID &id) const
Has module.
JSinglePointer< JModuleRouter > moduleRouter
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
Data structure for input to trigger algorithm.
Match of two events considering overlap in time.
Long64_t sizeL2
Number of L2 time slices.
Definition: JDataFilter.cc:330
long long int numberOfEvents
virtual void reset() override
Reset pointer.
Definition: JPointer.hh:84
void KM3NETDAQ::JDataFilter::typeout ( )
inline

Report status to message logger.

Definition at line 1229 of file JDataFilter.cc.

1230  {
1231  timer.stop();
1232 
1233  const double T_us = (double) timer.usec_wall;
1234 
1235  JStatusStream(logger) << "Elapsed real (wall) time [s] " << T_us / 1e6;
1236  JStatusStream(logger) << "Elapsed user CPU time [s] " << (double) timer.usec_ucpu/ 1e6;
1237  JStatusStream(logger) << "Elapsed system CPU time [s] " << (double) timer.usec_scpu/ 1e6;
1238  try {
1239  JStatusStream(logger) << "Elapsed real time per time slice [ms] " << Qt.getMean() * 1.0e-3 << " +/- " << Qt.getDeviation() * 1.0e-3;
1240  }
1241  catch(const std::exception&) {}
1242  JStatusStream(logger) << "Number of packets received/discarded " << number_of_packets_received << "/" << number_of_packets_discarded;
1243  JStatusStream(logger) << "Number of events/MB sent " << numberOfEvents << "/" << numberOfBytes/1e6;
1244 
1245  if (number_of_packets_received > 0) {
1246  JStatusStream(logger) << "Number of reads/packet " << (double) number_of_reads / (double) number_of_packets_received;
1247  }
1248 
1249  JStatusStream(logger) << "Current queue depth/size " << timeslices.size() << "/" << queueSize;
1250  JStatusStream(logger) << "Current number of frames per slice expected: " << frames_per_slice;
1251 
1252  JStatusStream(logger) << "Number of timeslices processed total/incomplete " << numberOfTimeslicesProcessed << "/" << numberOfIncompleteTimeslicesProcessed;
1253 
1254  if (numberOfTimeslicesProcessed > 0) {
1255  JStatusStream(logger) << "Real time per timeslice [ms] " << timer.usec_wall / 1000 / numberOfTimeslicesProcessed;
1256  JStatusStream(logger) << "User CPU time per timeslice [ms] " << timer.usec_ucpu / 1000 / numberOfTimeslicesProcessed;
1257  JStatusStream(logger) << "System CPU time per timeslice [ms] " << timer.usec_scpu / 1000 / numberOfTimeslicesProcessed;
1258  }
1259 
1260  const double processedSlicesTime_us = numberOfTimeslicesProcessed * getFrameTime() / 1000;
1261  const double processedDetectorTime_us = (maxFrameNumber - minFrameNumber) * getFrameTime() / 1000;
1262 
1263  if (processedSlicesTime_us > 0) {
1264  JStatusStream(logger) << "Performance factor (inaccurate estimate): " << T_us / processedSlicesTime_us;
1265  }
1266  if (processedDetectorTime_us > 0) {
1267  JStatusStream(logger) << "Performance factor whole detector (inaccurate estimate): " << T_us / processedDetectorTime_us;
1268  }
1269 
1270  timer.start();
1271  }
long long int numberOfTimeslicesProcessed
std::deque< JDAQTimesliceL0 > timeslices
buffer with pending time slice data
unsigned long long usec_ucpu
Definition: JTimer.hh:225
long long int number_of_packets_discarded
void stop()
Stop timer.
Definition: JTimer.hh:113
double getMean() const
Get mean value.
Definition: JQuantile.hh:252
unsigned long long usec_scpu
Definition: JTimer.hh:226
long long int numberOfBytes
double getFrameTime()
Get frame time duration.
Definition: JDAQClock.hh:162
long long int numberOfIncompleteTimeslicesProcessed
long long int number_of_packets_received
double getDeviation(const bool relative=true) const
Get maximal deviation from average.
Definition: JQuantile.hh:311
long long int queueSize
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
long long int number_of_reads
long long int numberOfEvents
unsigned int frames_per_slice
unsigned long long usec_wall
Definition: JTimer.hh:224
void start()
Start timer.
Definition: JTimer.hh:89
virtual void KM3NETDAQ::JDataFilter::actionTagged ( const JTag tag,
int  length,
const char *  buffer 
)
inlineoverridevirtual

Tagged action to handle alerts.

Parameters
tagtag
lengthnumber of characters
buffermessage

Reimplemented from KM3NETDAQ::JDAQClient.

Definition at line 1281 of file JDataFilter.cc.

1282  {
1283  using namespace std;
1284 
1285  JDebugStream(logger) << "Received message <" << tag.toString() << "> \"" << string(buffer, length) << "\"";
1286 
1287  if (tag == RC_ALERT) {
1288 
1289  if (c_buffer.is_open()) {
1290 
1291  JStatusStream(logger) << "Archive circular buffer in <" << c_buffer.archive << ">";
1292 
1293  c_buffer.close(true);
1294  }
1295 
1296  if (c_buffer.is_enabled()) {
1297 
1298  c_buffer.open();
1299 
1300  if (c_buffer.is_open()) {
1301 
1302  JStatusStream(logger) << "Created circular buffer " << c_buffer;
1303 
1305 
1306  } else {
1307 
1308  JErrorStream (logger) << "Failed to create circular buffer in directory <" << c_buffer.path << ">; disable functionality.";
1309 
1310  c_buffer.disable();
1311  }
1312  }
1313 
1314  } else {
1315 
1316  JWarningStream(logger) << "Tag <" << tag.toString() << "> not implemented";
1317  }
1318  }
JMeta meta
meta data
void close(const bool option)
Close file.
Definition: JDataFilter.cc:231
std::string path
Directory for temporary storage.
Definition: JDataFilter.cc:333
JCircularBuffer_t c_buffer
bool is_enabled() const
Check whether writing of data is enabled.
Definition: JDataFilter.cc:295
TFile * getFile() const
Get file.
Definition: JRootFile.hh:66
then awk string
Level specific message streamers.
bool putObject(TDirectory &dir, const TObject &object)
Write object to ROOT directory.
std::string toString() const
Convert tag to string.
Definition: JTag.hh:171
virtual bool is_open() const =0
Check is device is open.
static const JNET::JTag RC_ALERT
Definition: JDAQTags.hh:71
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
std::string archive
Directory for permanent archival.
Definition: JDataFilter.cc:334
template<class T >
void KM3NETDAQ::JDataFilter::put ( const T object)
inlineprivate

Auxiliary method to send object to data server.

Parameters
objectobject to be sent

Definition at line 1334 of file JDataFilter.cc.

1335  {
1336  try {
1337 
1338  datawriter->put(object);
1339 
1340  numberOfBytes += getSizeof(object);
1341  }
1342  catch(const std::exception& error) {
1343  JErrorStream(logger) << "Error \"" << error.what() << "\"; trigger ev_error.";
1344  ev_error();
1345  }
1346  }
JDAQStateMachine::ev_error_event ev_error
virtual bool put(const T &object) override
Object output.
long long int numberOfBytes
JSinglePointer< JControlHost_t > datawriter
controlhost of data server (to which data writer should be connected)
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
size_t getSizeof(const JDAQEvent &object)
Get size of object.
Definition: JDAQEventIO.hh:26
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
argsarray of command line arguments
Returns
true if okay; else false

Definition at line 389 of file JDAQClient.hh.

390  {
391  using namespace std;
392 
393  string server;
394  string logger;
395  int level;
396  bool use_cout;
397 
398  try {
399 
400  parser['H'] = make_field(server) = "localhost";
401  parser['M'] = make_field(logger) = "localhost";
402  parser['d'] = make_field(level) = 0;
403  parser['c'] = make_field(use_cout);
404 
405  if (parser.read(args) != 0) {
406  return false;
407  }
408  }
409  catch(const std::exception &error) {
410  cerr << error.what() << endl;
411  return false;
412  }
413 
414  try {
415 
416  JLogger* out = NULL;
417 
418  if (use_cout)
419  out = new JStreamLogger(cout);
420  else
421  out = new JControlHostLogger(logger);
422 
423  this->logger = JMessageLogger(out, getName(), level);
424 
425  this->server.reset(new JControlHost(server));
426 
427  return enter();
428  }
429  catch(const std::exception& error) {
430  cerr << error.what() << endl;
431  return false;
432  }
433  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1057
Message logging based on std::ostream.
Interface for logging messages.
Definition: JLogger.hh:22
Message logging based on ControlHost.
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
virtual bool enter()
Enter the state machine.
Definition: JDAQClient.hh:444
int read(const int argc, const char *const argv[])
Parse the program&#39;s command line options.
Definition: JParser.hh:1811
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
const std::string & getName() const
Get name of state machine.
Definition: JDAQCHSM.chsm:78
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 444 of file JDAQClient.hh.

445  {
446  using namespace std;
447  using namespace JPP;
448 
449  if (server.is_valid() && logger.is_valid()) {
450 
451  const JSubscriptionList buffer = getSubscription(eventTable) + subscription;
452 
453  try {
454 
455  server->Subscribe(buffer);
456  server->SendMeAlways();
457  server->MyId(getFullName());
458 
459  JStatusStream(logger) << "Process with nick name \"" << getFullName() << "\" version \"" << getGITVersion() << "\" subscription: " << buffer.toString();
460 
461  return CHSM::machine::enter();
462  }
463  catch(const std::exception& error) {
464  JErrorStream(logger) << error.what();
465  }
466 
467  } else {
468  cerr << "Message server or logger not properly initialised." << endl;
469  }
470 
471  return false;
472  }
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
JSubscriptionList subscription
custom subscription
Definition: JDAQClient.hh:1058
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
bool is_valid() const
Check validity of logger object.
const std::string & getFullName() const
Get full name of this run control client.
Definition: JDAQClient.hh:120
JSubscriptionList getSubscription(const JEventTable &event_table)
Convert event table to ControlHost subscription.
Definition: JEventTable.hh:129
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
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 482 of file JDAQClient.hh.

483  {
484  try {
485  if (server.is_valid()) { server.reset(NULL); }
486  }
487  catch(const std::exception& error) {
488  }
489 
490  try {
491  if (logger.is_valid()) { logger.reset(NULL); }
492  }
493  catch(const std::exception& error) {
494  }
495 
496  return CHSM::machine::exit();
497  }
void reset(JLogger *__logger=NULL)
Reset logger.
exit
Definition: JPizza.sh:36
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
bool is_valid() const
Check validity of logger object.
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
bool KM3NETDAQ::JDAQClient::isRunning ( ) const
inlineinherited

Check if this client is in runnig state.

Returns
true if running; else false

Definition at line 505 of file JDAQClient.hh.

506  {
507  return Main.RunControl.Operational.Running.active();
508  }
JDAQStateMachine::state_Main Main
JDAQStateMachine::state_Main::state_RunControl::state_Operational Operational
JDAQStateMachine::state_Main::state_RunControl RunControl
void KM3NETDAQ::JDAQClient::replaceEvent ( const JTag oldTag,
const JTag newTag,
JDAQEvent_t event 
)
inlineinherited

Replace tag of given event in event table.

Parameters
oldTagold tag
newTagnew tag
eventevent

Definition at line 518 of file JDAQClient.hh.

521  {
522  eventTable.replace(oldTag, newTag, event);
523  }
void replace(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace entry in table.
Definition: JEventTable.hh:96
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
JDAQEvent_t* KM3NETDAQ::JDAQClient::findEvent ( const JTag tag,
const std::string event_name 
)
inlineinherited

Find event in event table.

Parameters
tagtag
event_nameevent name
Returns
pointer to event or NULL

Definition at line 533 of file JDAQClient.hh.

534  {
535  JEventTable::const_iterator i = eventTable.find(tag, event_name);
536 
537  if (i != eventTable.end())
538  return i->second;
539  else
540  return NULL;
541  }
JEventTable eventTable
event table
Definition: JDAQClient.hh:203
const_iterator find(const JTag &tag, const std::string &event_name) const
Find entry.
Definition: JEventTable.hh:116
void KM3NETDAQ::JDAQClient::addSubscription ( const JSubscription subscription)
inlineinherited

Add custom subscription.

Parameters
subscriptionsubscription

Definition at line 549 of file JDAQClient.hh.

550  {
552  }
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.
JSubscriptionList subscription
custom subscription
Definition: JDAQClient.hh:1058
template<class T >
void KM3NETDAQ::JDAQClient::addParameter ( const char  option,
T parameter 
)
inlineinherited

Add parameter to parser used in method enter().

Parameters
optionoption
parameterparameter

Definition at line 562 of file JDAQClient.hh.

563  {
564  parser[option] = make_field(parameter);
565  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1057
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
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
optionoption
parameterparameter
valuedefault value

Definition at line 576 of file JDAQClient.hh.

577  {
578  parser[option] = make_field(parameter) = value;
579  }
JParser parser
parser method enter()
Definition: JDAQClient.hh:1057
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
void KM3NETDAQ::JDAQClient::setSelect ( )
inlineinherited

Set the file descriptor mask for the select call.

Definition at line 585 of file JDAQClient.hh.

586  {
587  select.reset();
588 
590 
592  }
JSelectReader select
select call
Definition: JDAQClient.hh:1056
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
JFileDescriptorMask & getReaderMask()
Get reader mask.
void setReaderMask(const JAbstractFile &file)
Set reader mask.
void reset()
Reset.
void setSelect()
Set the file descriptor mask for the select call.
Definition: JDAQClient.hh:585
virtual void KM3NETDAQ::JDAQClient::actionInput ( int  length,
const char *  buffer 
)
inlinevirtualinherited

This method is called at ev_input.

Parameters
lengthlength of data
bufferpointer to data

Reimplemented from JDAQCHSM.

Reimplemented in KM3NETDAQ::DataQueue, and AcousticDataFilter.

Definition at line 632 of file JDAQClient.hh.

633  {
634  using namespace std;
635 
636  JProperties properties(JEquationParameters("=", ";", "", ""), 1);
637 
638  int level = this->logger.getLevel();
639 
640  properties["debug"] = level;
641 
642  properties.read(string(buffer, length));
643 
644  this->logger.setLevel(level);
645  }
Utility class to parse parameter values.
Definition: JProperties.hh:496
Simple data structure to support I/O of equations (see class JLANG::JEquation).
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
void setLevel(const int __level)
Set debug level.
JLevel_t getLevel()
Get debug level.
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
tagtag
lengthnumber of characters
buffermessage
Returns
skip message or not

Definition at line 659 of file JDAQClient.hh.

660  {
661  return false;
662  }
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 687 of file JDAQClient.hh.

688  {
689  using namespace std;
690 
691  while (active()) {
692 
693  try {
694 
695  setSelect();
696 
697  if (select(JTimeval(TIMEOUT_S,0)) > 0) {
698 
699  if (select.hasReaderMask(*server)) {
700  update();
701  }
702 
704 
705  } else {
706 
707  continue;
708  }
709 
710 
711  if (isRunning() && clock.getInterval() != 0LL) {
712 
713  long long int numberOfCalls = 0;
714 
715  clock.reset();
716 
717  do {
718 
719  ++numberOfCalls;
720 
721  setSelect();
722 
723  if (clock.wait(select.getReaderMask())) {
724 
725  if (select.hasReaderMask(*server)) {
726  update();
727  }
728 
730 
731  } else {
732 
733  try {
734  actionRunning();
735  }
736  catch(const std::exception& error) {
737  logger.error(error.what());
738  }
739  }
740 
741  } while (isRunning());
742 
743  if (numberOfCalls != 0) {
744  JNoticeStream(logger) << "Delay per call " << clock.getDelay() / numberOfCalls / 1000 << " ms";
745  }
746  }
747  }
748  catch(const std::exception& error) {
749  JErrorStream(logger) << "method run(): " << error.what();
750  }
751  }
752  }
long long int getDelay() const
Get total delay time.
Definition: JTimekeeper.hh:78
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
static const int TIMEOUT_S
time out of update [s]
Definition: JDAQClient.hh:63
JSelectReader select
select call
Definition: JDAQClient.hh:1056
void reset(const long long int t0)
Reset time.
Definition: JTimekeeper.hh:100
JSharedPointer< JControlHost > server
message server
Definition: JDAQClient.hh:826
JFileDescriptorMask & getReaderMask()
Get reader mask.
void wait() const
Wait until the number of time intervals has elapsed since the last call to the reset method...
Definition: JTimekeeper.hh:145
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
Definition: JDAQClient.hh:622
bool isRunning() const
Check if this client is in runnig state.
Definition: JDAQClient.hh:505
void update()
Update state machine.
Definition: JDAQClient.hh:834
long long int getInterval() const
Get interval time.
Definition: JTimekeeper.hh:67
JMessageLogger logger
message logger
Definition: JDAQClient.hh:827
void error(const JMessage_t &message)
void setSelect()
Set the file descriptor mask for the select call.
Definition: JDAQClient.hh:585
virtual void actionSelect(const JFileDescriptorMask &mask)
Action method following last select call.
Definition: JDAQClient.hh:611
bool hasReaderMask(const JAbstractFile &file) const
Has reader file.
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
portport number

Definition at line 767 of file JDAQClient.hh.

768  {
769  JControlHostServer local_server(port);
770 
771  for ( ; ; ) {
772 
773  JControlHost* ps = local_server.AcceptClient();
774 
775  ps->Connected();
776 
777  JNET::JPrefix prefix;
778 
779  ps->WaitHead(prefix);
780 
781  const int length = prefix.getSize();
782 
783  char* buffer = new char[length];
784 
785  ps->GetFullData(buffer, length);
786  ps->PutFullData(prefix.toString(), buffer, length);
787 
788  delete ps;
789 
790  enter(JArgs(std::string(buffer, length)));
791 
792  delete [] buffer;
793 
794  run();
795 
796  exit();
797  }
798  }
ControlHost prefix.
Definition: JPrefix.hh:31
void run()
Run as run control client following command messages via JNET::JControlHost.
Definition: JDAQClient.hh:687
int getSize() const
Get size.
Definition: JPrefix.hh:62
virtual bool enter()
Enter the state machine.
Definition: JDAQClient.hh:444
then awk string
virtual bool exit()
Exit the state machine.
Definition: JDAQClient.hh:482
std::string toString() const
Convert tag to string.
Definition: JTag.hh:171
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
ininput stream

Definition at line 812 of file JDAQClient.hh.

813  {
814  using namespace std;
815 
816  string tag;
817  string buffer;
818 
819  while (in >> tag && in >> skipws && getline(in, buffer, ';')) {
820  update(tag, buffer.length(), buffer.data());
821  }
822  }
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
void update()
Update state machine.
Definition: JDAQClient.hh:834
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
void JDAQStateMachine::A1 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 344 of file JDAQCHSM.cc.

344 { actionError(); }
virtual void actionError()
Definition: JDAQCHSM.chsm:124
void JDAQStateMachine::A2 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 346 of file JDAQCHSM.cc.

346 { execute(&JDAQCHSM::actionInit, event); }
virtual void actionInit(int, const char *)
Definition: JDAQCHSM.chsm:112
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A3 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 348 of file JDAQCHSM.cc.

348 { JDAQCHSM::exit(); }
exit
Definition: JPizza.sh:36
void JDAQStateMachine::A4 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 350 of file JDAQCHSM.cc.

virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionConfigure(int, const char *)
Definition: JDAQCHSM.chsm:113
void JDAQStateMachine::A5 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 352 of file JDAQCHSM.cc.

352 { execute(&JDAQCHSM::actionReset, event); }
virtual void actionReset(int, const char *)
Definition: JDAQCHSM.chsm:118
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A6 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 354 of file JDAQCHSM.cc.

354  {
355 
356  std::istringstream is(std::string(ev_start->buffer, ev_start->length));
357 
358  is >> run_number >> detector_id;
359 
361 
362  }
JDAQStateMachine::ev_start_event ev_start
int run_number
Definition: JDAQCHSM.chsm:156
is
Definition: JDAQCHSM.chsm:167
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
then awk string
virtual void actionStart(int, const char *)
Definition: JDAQCHSM.chsm:114
int detector_id
Definition: JDAQCHSM.chsm:155
void JDAQStateMachine::A7 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 364 of file JDAQCHSM.cc.

364 { execute(&JDAQCHSM::actionQuit, event); }
virtual void actionQuit(int, const char *)
Definition: JDAQCHSM.chsm:119
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A8 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 366 of file JDAQCHSM.cc.

366 { execute(&JDAQCHSM::actionContinue, event); }
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
virtual void actionContinue(int, const char *)
Definition: JDAQCHSM.chsm:116
void JDAQStateMachine::A9 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 368 of file JDAQCHSM.cc.

368 { execute(&JDAQCHSM::actionStop, event); }
virtual void actionStop(int, const char *)
Definition: JDAQCHSM.chsm:117
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A10 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 370 of file JDAQCHSM.cc.

370 { execute(&JDAQCHSM::actionPause, event); }
virtual void actionPause(int, const char *)
Definition: JDAQCHSM.chsm:115
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A11 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 372 of file JDAQCHSM.cc.

372 { execute(&JDAQCHSM::actionRecover, event); }
virtual void actionRecover(int, const char *)
Definition: JDAQCHSM.chsm:125
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A12 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 374 of file JDAQCHSM.cc.

374 { JDAQCHSM::exit(); }
exit
Definition: JPizza.sh:36
void JDAQStateMachine::A13 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 376 of file JDAQCHSM.cc.

376 { execute(&JDAQCHSM::actionCheck, event); }
virtual void actionCheck(int, const char *)
Definition: JDAQCHSM.chsm:121
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
void JDAQStateMachine::A14 ( CHSM_ns_alias::event const &  event)
inherited

Definition at line 378 of file JDAQCHSM.cc.

378 { execute(&JDAQCHSM::actionInput, event); }
virtual void actionInput(int, const char *)
Definition: JDAQCHSM.chsm:122
virtual void execute(action __action, const CHSM::event &__event)=0
The method to execute the action.
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.

337  {
338 #line 164 "JDAQCHSM.chsm"
339  CHSM_ns_alias::cluster const &state = (CHSM_ns_alias::cluster const&)chsm_state_; actionEnter(); }
virtual void actionEnter()
Interface methods for actions corresponding to state transitions.
Definition: JDAQCHSM.chsm:109
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.

340  {
341 #line 165 "JDAQCHSM.chsm"
342  CHSM_ns_alias::cluster const &state = (CHSM_ns_alias::cluster const&)chsm_state_; actionExit(); }
virtual void actionExit()
Definition: JDAQCHSM.chsm:110
const std::string& JDAQCHSM::getName ( ) const
inlineinherited

Get name of state machine.

Returns
name

Definition at line 78 of file JDAQCHSM.chsm.

79  {
80  return name;
81  }
std::string name
Definition: JDAQCHSM.chsm:154
const std::string& JDAQCHSM::getName ( ) const
inlineinherited

Get name of state machine.

Returns
name

Definition at line 89 of file JDAQCHSM.hh.

90  {
91  return name;
92  }
std::string name
Definition: JDAQCHSM.chsm:154
int JDAQCHSM::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 89 of file JDAQCHSM.chsm.

90  {
91  return detector_id;
92  }
int detector_id
Definition: JDAQCHSM.chsm:155
int JDAQCHSM::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 100 of file JDAQCHSM.hh.

101  {
102  return detector_id;
103  }
int detector_id
Definition: JDAQCHSM.chsm:155
int JDAQCHSM::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 100 of file JDAQCHSM.chsm.

101  {
102  return run_number;
103  }
int run_number
Definition: JDAQCHSM.chsm:156
int JDAQCHSM::getRunNumber ( ) const
inlineinherited

Get run number.

Returns
run number

Definition at line 111 of file JDAQCHSM.hh.

112  {
113  return run_number;
114  }
int run_number
Definition: JDAQCHSM.chsm:156
virtual void JDAQCHSM::actionError ( )
inlinevirtualinherited

Definition at line 124 of file JDAQCHSM.chsm.

124 {}
virtual void JDAQCHSM::actionError ( )
inlinevirtualinherited

Definition at line 135 of file JDAQCHSM.hh.

135 {}
virtual void JDAQCHSM::actionRecover ( int  ,
const char *   
)
inlinevirtualinherited

Definition at line 125 of file JDAQCHSM.chsm.

125 {}
virtual void JDAQCHSM::actionRecover ( int  ,
const char *   
)
inlinevirtualinherited

Definition at line 136 of file JDAQCHSM.hh.

136 {}
const std::string& KM3NETDAQ::JDAQClient_t::getHostname ( ) const
inlineinherited

Get hostname.

Returns
host name

Definition at line 109 of file JDAQClient.hh.

110  {
111  return hostname;
112  }
const std::string& KM3NETDAQ::JDAQClient_t::getFullName ( ) const
inlineinherited

Get full name of this run control client.

Returns
full name

Definition at line 120 of file JDAQClient.hh.

121  {
122  return fullname;
123  }
const JTag& KM3NETDAQ::JDAQClient_t::getUniqueTag ( ) const
inlineinherited

Get unique tag of this run control client.

Returns
unique tag

Definition at line 131 of file JDAQClient.hh.

132  {
133  return unique_tag;
134  }
long long int KM3NETDAQ::JDAQClient_t::getClockDelay ( ) const
inlineinherited

Get total delay time.

Returns
delay time [us]

Definition at line 142 of file JDAQClient.hh.

143  {
144  return clock.getDelay();
145  }
long long int getDelay() const
Get total delay time.
Definition: JTimekeeper.hh:78
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
long long int KM3NETDAQ::JDAQClient_t::getClockInterval ( ) const
inlineinherited

Get interval time.

Returns
interval time [us]

Definition at line 154 of file JDAQClient.hh.

155  {
156  return clock.getInterval();
157  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
long long int getInterval() const
Get interval time.
Definition: JTimekeeper.hh:67
void KM3NETDAQ::JDAQClient_t::setClockInterval ( const long long int  interval_us)
inlineinherited

Set interval time.

Parameters
interval_usinterval time [us]

Definition at line 165 of file JDAQClient.hh.

166  {
167  clock.setInterval(interval_us);
168  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
void setInterval(const long long int interval_us)
Set interval time.
Definition: JTimekeeper.hh:89
void KM3NETDAQ::JDAQClient_t::resetClock ( )
inlineinherited

Reset clock.

Definition at line 174 of file JDAQClient.hh.

175  {
176  clock.reset();
177  }
JTimekeeper clock
central clock
Definition: JDAQClient.hh:207
void reset(const long long int t0)
Reset time.
Definition: JTimekeeper.hh:100
const std::string& KM3NETDAQ::JDAQClient_t::getEventInfo ( ) const
inlineinherited

Get last event information.

Returns
event information

Definition at line 185 of file JDAQClient.hh.

186  {
187  return event_info;
188  }
std::string event_info
event information
Definition: JDAQClient.hh:208
void KM3NETDAQ::JDAQClient_t::setEventInfo ( const std::string info)
inlineinherited

Set last event information.

Parameters
infoevent information

Definition at line 196 of file JDAQClient.hh.

197  {
198  this->event_info = info;
199  }
std::string event_info
event information
Definition: JDAQClient.hh:208

Member Data Documentation

JMeta KM3NETDAQ::JDataFilter::meta

meta data

Definition at line 1320 of file JDataFilter.cc.

JSinglePointer<JControlHost_t> KM3NETDAQ::JDataFilter::datawriter
private

controlhost of data server (to which data writer should be connected)

Definition at line 1325 of file JDataFilter.cc.

std::string KM3NETDAQ::JDataFilter::hostname
private

host name of data server

Definition at line 1326 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::port
private

server socket port

Definition at line 1349 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::backlog
private

Definition at line 1350 of file JDataFilter.cc.

JSinglePointer<JServerSocket> KM3NETDAQ::JDataFilter::serversocket
private

server for data queue connections

Definition at line 1352 of file JDataFilter.cc.

JChannelList_t KM3NETDAQ::JDataFilter::channelList
private

connections to data queue

Definition at line 1353 of file JDataFilter.cc.

JTimer KM3NETDAQ::JDataFilter::timer
private

Definition at line 1355 of file JDataFilter.cc.

JQuantile KM3NETDAQ::JDataFilter::Qt
private

Definition at line 1356 of file JDataFilter.cc.

std::deque<JDAQTimesliceL0> KM3NETDAQ::JDataFilter::timeslices
private

buffer with pending time slice data

Definition at line 1358 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::current_slice_index
private

Definition at line 1359 of file JDataFilter.cc.

unsigned int KM3NETDAQ::JDataFilter::frames_per_slice
private

Definition at line 1360 of file JDataFilter.cc.

unsigned int KM3NETDAQ::JDataFilter::maximum_frames_per_slice
private

Definition at line 1361 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::maximal_frame_index
private

Definition at line 1362 of file JDataFilter.cc.

JTriggerParameters KM3NETDAQ::JDataFilter::parameters
private

Definition at line 1366 of file JDataFilter.cc.

JSinglePointer<JTimesliceRouter> KM3NETDAQ::JDataFilter::timesliceRouter
private

Definition at line 1367 of file JDataFilter.cc.

JDetector KM3NETDAQ::JDataFilter::detector
private

Definition at line 1369 of file JDataFilter.cc.

JSinglePointer<JModuleRouter> KM3NETDAQ::JDataFilter::moduleRouter
private

Definition at line 1370 of file JDataFilter.cc.

JSinglePointer<JBuildL1_t> KM3NETDAQ::JDataFilter::buildL1
private

Definition at line 1371 of file JDataFilter.cc.

JSinglePointer<JBuildL2_t> KM3NETDAQ::JDataFilter::buildL2
private

Definition at line 1372 of file JDataFilter.cc.

JSinglePointer<JBuildL2_t> KM3NETDAQ::JDataFilter::buildSN
private

Definition at line 1373 of file JDataFilter.cc.

JSinglePointer<JBuildL2_t> KM3NETDAQ::JDataFilter::buildNB
private

Definition at line 1374 of file JDataFilter.cc.

JSinglePointer<JTriggerNB> KM3NETDAQ::JDataFilter::triggerNB
private

Definition at line 1376 of file JDataFilter.cc.

JSinglePointer<JTrigger3DMuon> KM3NETDAQ::JDataFilter::trigger3DMuon
private

Definition at line 1377 of file JDataFilter.cc.

JSinglePointer<JTrigger3DShower> KM3NETDAQ::JDataFilter::trigger3DShower
private

Definition at line 1378 of file JDataFilter.cc.

JSinglePointer<JTriggerMXShower> KM3NETDAQ::JDataFilter::triggerMXShower
private

Definition at line 1379 of file JDataFilter.cc.

JMessageScheduler KM3NETDAQ::JDataFilter::logErrorRun
private

Definition at line 1381 of file JDataFilter.cc.

JMessageScheduler KM3NETDAQ::JDataFilter::logErrorDetector
private

Definition at line 1382 of file JDataFilter.cc.

JMessageScheduler KM3NETDAQ::JDataFilter::logErrorIndex
private

Definition at line 1383 of file JDataFilter.cc.

JMessageScheduler KM3NETDAQ::JDataFilter::logErrorIncomplete
private

Definition at line 1384 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::dumpCount
private

Definition at line 1386 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::dumpLimit
private

Definition at line 1387 of file JDataFilter.cc.

std::vector<JDAQProcess> KM3NETDAQ::JDataFilter::dataFilters
private

Definition at line 1391 of file JDataFilter.cc.

std::vector<JDAQProcess> KM3NETDAQ::JDataFilter::dataQueues
private

Definition at line 1392 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::totalCPURAM
private

Definition at line 1396 of file JDataFilter.cc.

unsigned int KM3NETDAQ::JDataFilter::maxQueueDepth
private

Definition at line 1397 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::maxQueueSize
private

Definition at line 1398 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::queueSize
private

Definition at line 1399 of file JDataFilter.cc.

bool KM3NETDAQ::JDataFilter::reporting
private

Definition at line 1403 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::numberOfEvents
private

Definition at line 1405 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::numberOfBytes
private

Definition at line 1406 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::numberOfTimeslicesProcessed
private

Definition at line 1407 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::numberOfIncompleteTimeslicesProcessed
private

Definition at line 1408 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::minFrameNumber
private

Definition at line 1410 of file JDataFilter.cc.

int KM3NETDAQ::JDataFilter::maxFrameNumber
private

Definition at line 1411 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::number_of_packets_received
private

Definition at line 1415 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::number_of_packets_discarded
private

Definition at line 1416 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::number_of_reads
private

Definition at line 1417 of file JDataFilter.cc.

long long int KM3NETDAQ::JDataFilter::number_of_bytes_received
private

Definition at line 1418 of file JDataFilter.cc.

JCircularBuffer_t KM3NETDAQ::JDataFilter::c_buffer
private

Definition at line 1422 of file JDataFilter.cc.

JSharedPointer<JControlHost> KM3NETDAQ::JDAQClient::server
protectedinherited

message server

Definition at line 826 of file JDAQClient.hh.

JMessageLogger KM3NETDAQ::JDAQClient::logger
protectedinherited

message logger

Definition at line 827 of file JDAQClient.hh.

JDAQStateMachine::state_root JDAQStateMachine::root
inherited
JDAQStateMachine::state_Main JDAQStateMachine::Main
inherited
JDAQStateMachine::ev_daq_event JDAQStateMachine::ev_daq
inherited
char JDAQStateMachine::ev_daq_param_block[sizeof(ev_daq_event::param_block)]
inherited

Definition at line 238 of file JDAQCHSM.hh.

JDAQStateMachine::ev_init_event JDAQStateMachine::ev_init
inherited
char JDAQStateMachine::ev_init_param_block[sizeof(ev_init_event::param_block)]
inherited

Definition at line 258 of file JDAQCHSM.hh.

JDAQStateMachine::ev_configure_event JDAQStateMachine::ev_configure
inherited
char JDAQStateMachine::ev_configure_param_block[sizeof(ev_configure_event::param_block)]
inherited

Definition at line 278 of file JDAQCHSM.hh.

JDAQStateMachine::ev_start_event JDAQStateMachine::ev_start
inherited
char JDAQStateMachine::ev_start_param_block[sizeof(ev_start_event::param_block)]
inherited

Definition at line 298 of file JDAQCHSM.hh.

JDAQStateMachine::ev_pause_event JDAQStateMachine::ev_pause
inherited
char JDAQStateMachine::ev_pause_param_block[sizeof(ev_pause_event::param_block)]
inherited

Definition at line 318 of file JDAQCHSM.hh.

JDAQStateMachine::ev_continue_event JDAQStateMachine::ev_continue
inherited
char JDAQStateMachine::ev_continue_param_block[sizeof(ev_continue_event::param_block)]
inherited

Definition at line 338 of file JDAQCHSM.hh.

JDAQStateMachine::ev_stop_event JDAQStateMachine::ev_stop
inherited
char JDAQStateMachine::ev_stop_param_block[sizeof(ev_stop_event::param_block)]
inherited

Definition at line 358 of file JDAQCHSM.hh.

JDAQStateMachine::ev_reset_event JDAQStateMachine::ev_reset
inherited
char JDAQStateMachine::ev_reset_param_block[sizeof(ev_reset_event::param_block)]
inherited

Definition at line 378 of file JDAQCHSM.hh.

JDAQStateMachine::ev_quit_event JDAQStateMachine::ev_quit
inherited
char JDAQStateMachine::ev_quit_param_block[sizeof(ev_quit_event::param_block)]
inherited

Definition at line 398 of file JDAQCHSM.hh.

JDAQStateMachine::ev_off_event JDAQStateMachine::ev_off
inherited
char JDAQStateMachine::ev_off_param_block[sizeof(ev_off_event::param_block)]
inherited

Definition at line 418 of file JDAQCHSM.hh.

JDAQStateMachine::ev_check_event JDAQStateMachine::ev_check
inherited
char JDAQStateMachine::ev_check_param_block[sizeof(ev_check_event::param_block)]
inherited

Definition at line 438 of file JDAQCHSM.hh.

JDAQStateMachine::ev_input_event JDAQStateMachine::ev_input
inherited
char JDAQStateMachine::ev_input_param_block[sizeof(ev_input_event::param_block)]
inherited

Definition at line 458 of file JDAQCHSM.hh.

JDAQStateMachine::ev_recover_event JDAQStateMachine::ev_recover
inherited
char JDAQStateMachine::ev_recover_param_block[sizeof(ev_recover_event::param_block)]
inherited

Definition at line 478 of file JDAQCHSM.hh.

JDAQStateMachine::ev_error_event JDAQStateMachine::ev_error
inherited
char JDAQStateMachine::ev_error_param_block[sizeof(ev_error_event::param_block)]
inherited

Definition at line 495 of file JDAQCHSM.hh.

std::string JDAQCHSM::name
protectedinherited

Definition at line 154 of file JDAQCHSM.chsm.

int JDAQCHSM::detector_id
protectedinherited

Definition at line 155 of file JDAQCHSM.chsm.

int JDAQCHSM::run_number
protectedinherited

Definition at line 156 of file JDAQCHSM.chsm.

const int KM3NETDAQ::JDAQClient_t::TIMEOUT_S = 1
staticinherited

time out of update [s]

Definition at line 63 of file JDAQClient.hh.

JEventTable KM3NETDAQ::JDAQClient_t::eventTable
protectedinherited

event table

Definition at line 203 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::fullname
protectedinherited

Definition at line 205 of file JDAQClient.hh.

JTag KM3NETDAQ::JDAQClient_t::unique_tag
protectedinherited

Definition at line 206 of file JDAQClient.hh.

JTimekeeper KM3NETDAQ::JDAQClient_t::clock
protectedinherited

central clock

Definition at line 207 of file JDAQClient.hh.

std::string KM3NETDAQ::JDAQClient_t::event_info
protectedinherited

event information

Definition at line 208 of file JDAQClient.hh.


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