Jpp
17.3.1
the software that should make you happy
|
Main class for real-time filtering of data. More...
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_type > | JSuperFrame1D_t |
typedef JSuperFrame2D< hit_type > | JSuperFrame2D_t |
typedef JTimeslice< hit_type > | JTimeslice_t |
typedef JBuildL1< hit_type > | JBuildL1_t |
typedef JBuildL2< hit_type > | JBuildL2_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 int buffer_size, 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 ×lice) |
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_t * | findEvent (const JTag &tag, const std::string &event_name) |
Find event in event table. More... | |
void | addSubscription (const JSubscription &subscription) |
Add custom subscription. More... | |
template<class T > | |
void | addParameter (const char option, T ¶meter) |
Add parameter to parser used in method enter(). More... | |
template<class T > | |
void | addParameter (const char option, T ¶meter, const T &value) |
Add parameter to parser used in method enter(). More... | |
void | setSelect () |
Set the file descriptor mask for the select call. More... | |
virtual void | actionInput (int length, const char *buffer) |
This method is called at ev_input . More... | |
virtual bool | filter (const JTag &tag, int length, const char *buffer) |
Filter message. More... | |
void | run () |
Run as run control client following command messages via JNET::JControlHost. More... | |
void | run (const int port) |
Run for ever. More... | |
void | run (std::istream &in) |
Run client with commands from input stream (e.g. 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::string & | getName () const |
Get name of state machine. More... | |
const std::string & | getName () 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::string & | getHostname () const |
Get hostname. More... | |
const std::string & | getFullName () const |
Get full name of this run control client. More... | |
const JTag & | getUniqueTag () const |
Get unique tag of this run control client. More... | |
long long int | getClockDelay () const |
Get total delay time. More... | |
long long int | getClockInterval () const |
Get interval time. More... | |
void | setClockInterval (const long long int interval_us) |
Set interval time. More... | |
void | resetClock () |
Reset clock. More... | |
int | getEventNumber () const |
Get last event number. More... | |
void | setEventNumber (const int event_number) |
Set last event number. More... | |
Static Public Member Functions | |
static bool | compare (const JDAQProcess &first, const JDAQProcess &second) |
Sort DAQ process by index. More... | |
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< JControlHost > | server |
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... | |
int | event_number |
number of last event 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... | |
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:
<path>/KM3NeT_<tag>.root
;<path>/KM3NeT_YYYY-MM-DD_<tag>[_<index>].root
;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 151 of file JDataFilter.cc.
Definition at line 156 of file JDataFilter.cc.
Definition at line 157 of file JDataFilter.cc.
typedef double KM3NETDAQ::JDataFilter::hit_type |
Definition at line 159 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.
|
private |
Definition at line 1321 of file JDataFilter.cc.
|
protectedinherited |
Type definition of action method.
Definition at line 141 of file JDAQCHSM.chsm.
|
protectedinherited |
Type definition of action method.
Definition at line 152 of file JDAQCHSM.hh.
|
inline |
Constructor.
name | name of client |
server | name of command message server |
hostname | name of data server |
logger | pointer to logger |
level | debug level |
port | server port |
backlog | server backlog |
buffer_size | server buffer |
path | directory for temporary storage |
archive | directory for parmanent archival |
replace tag to receive dfilter specific messages in configure
Definition at line 363 of file JDataFilter.cc.
|
inlinestatic |
Sort DAQ process by index.
first | first DAQ process |
second | second DAQ process |
Definition at line 343 of file JDataFilter.cc.
|
inlineoverridevirtual |
Interface methods for actions corresponding to state transitions.
Reimplemented from JDAQCHSM.
Definition at line 390 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 394 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 407 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 428 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 637 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 687 of file JDataFilter.cc.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 726 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 734 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 744 of file JDataFilter.cc.
|
inlineoverridevirtual |
Set the file descriptor mask for the select call.
This implementation does nothing but may be redefined by the derived class.
mask | file descriptor mask |
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 750 of file JDataFilter.cc.
|
inlineoverridevirtual |
Action method following last select call.
This implementation does nothing but may be redefined by the derived class.
mask | file descriptor mask |
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 764 of file JDataFilter.cc.
|
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 901 of file JDataFilter.cc.
|
inline |
Update queue with data frames.
Note that any discarded data will be reported.
channel | incoming data channel |
Definition at line 916 of file JDataFilter.cc.
|
inline |
Process time slice.
timeslice | time slice |
Definition at line 1013 of file JDataFilter.cc.
|
inline |
Report status to message logger.
Definition at line 1226 of file JDataFilter.cc.
|
inlineoverridevirtual |
Tagged action to handle alerts.
tag | tag |
length | number of characters |
buffer | message |
Reimplemented from KM3NETDAQ::JDAQClient.
Definition at line 1278 of file JDataFilter.cc.
|
inlineprivate |
Auxiliary method to send object to data server.
object | object to be sent |
Definition at line 1331 of file JDataFilter.cc.
|
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.
args | array of command line arguments |
Definition at line 364 of file JDAQClient.hh.
|
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.
Reimplemented in KM3NETDAQ::JDAQDriver.
Definition at line 419 of file JDAQClient.hh.
|
inlinevirtualinherited |
Exit the state machine.
This method releases the various resources.
Definition at line 457 of file JDAQClient.hh.
|
inlineinherited |
Check if this client is in runnig state.
Definition at line 480 of file JDAQClient.hh.
|
inlineinherited |
Replace tag of given event in event table.
oldTag | old tag |
newTag | new tag |
event | event |
Definition at line 493 of file JDAQClient.hh.
|
inlineinherited |
Find event in event table.
tag | tag |
event_name | event name |
Definition at line 508 of file JDAQClient.hh.
|
inlineinherited |
Add custom subscription.
subscription | subscription |
Definition at line 524 of file JDAQClient.hh.
|
inlineinherited |
Add parameter to parser used in method enter().
option | option |
parameter | parameter |
Definition at line 537 of file JDAQClient.hh.
|
inlineinherited |
Add parameter to parser used in method enter().
option | option |
parameter | parameter |
value | default value |
Definition at line 551 of file JDAQClient.hh.
|
inlineinherited |
Set the file descriptor mask for the select call.
Definition at line 560 of file JDAQClient.hh.
|
inlinevirtualinherited |
This method is called at ev_input
.
length | length of data |
buffer | pointer to data |
Reimplemented from JDAQCHSM.
Reimplemented in KM3NETDAQ::DataQueue, and AcousticDataFilter.
Definition at line 607 of file JDAQClient.hh.
|
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.
tag | tag |
length | number of characters |
buffer | message |
Definition at line 634 of file JDAQClient.hh.
|
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 662 of file JDAQClient.hh.
|
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.
port | port number |
Definition at line 742 of file JDAQClient.hh.
|
inlineinherited |
Run client with commands from input stream (e.g. for debugging).
Example input format:
<tag> <event name>[#data]; <tag> <event name>[#data];
in | input stream |
Definition at line 787 of file JDAQClient.hh.
|
inherited |
Definition at line 344 of file JDAQCHSM.cc.
|
inherited |
Definition at line 346 of file JDAQCHSM.cc.
|
inherited |
Definition at line 348 of file JDAQCHSM.cc.
|
inherited |
Definition at line 350 of file JDAQCHSM.cc.
|
inherited |
Definition at line 352 of file JDAQCHSM.cc.
|
inherited |
Definition at line 354 of file JDAQCHSM.cc.
|
inherited |
Definition at line 364 of file JDAQCHSM.cc.
|
inherited |
Definition at line 366 of file JDAQCHSM.cc.
|
inherited |
Definition at line 368 of file JDAQCHSM.cc.
|
inherited |
Definition at line 370 of file JDAQCHSM.cc.
|
inherited |
Definition at line 372 of file JDAQCHSM.cc.
|
inherited |
Definition at line 374 of file JDAQCHSM.cc.
|
inherited |
Definition at line 376 of file JDAQCHSM.cc.
|
inherited |
Definition at line 378 of file JDAQCHSM.cc.
|
inherited |
Definition at line 337 of file JDAQCHSM.cc.
|
inherited |
Definition at line 340 of file JDAQCHSM.cc.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Definition at line 124 of file JDAQCHSM.chsm.
|
inlinevirtualinherited |
Definition at line 135 of file JDAQCHSM.hh.
|
inlinevirtualinherited |
Definition at line 125 of file JDAQCHSM.chsm.
|
inlinevirtualinherited |
Definition at line 136 of file JDAQCHSM.hh.
|
inlineinherited |
|
inlineinherited |
Get full name of this run control client.
Definition at line 120 of file JDAQClient.hh.
|
inlineinherited |
Get unique tag of this run control client.
Definition at line 131 of file JDAQClient.hh.
|
inlineinherited |
Get total delay time.
Definition at line 142 of file JDAQClient.hh.
|
inlineinherited |
Get interval time.
Definition at line 154 of file JDAQClient.hh.
|
inlineinherited |
Set interval time.
interval_us | interval time [us] |
Definition at line 165 of file JDAQClient.hh.
|
inlineinherited |
Reset clock.
Definition at line 174 of file JDAQClient.hh.
|
inlineinherited |
Get last event number.
Definition at line 185 of file JDAQClient.hh.
|
inlineinherited |
Set last event number.
event_number | event number |
Definition at line 196 of file JDAQClient.hh.
JMeta KM3NETDAQ::JDataFilter::meta |
meta data
Definition at line 1317 of file JDataFilter.cc.
|
private |
controlhost of data server (to which data writer should be connected)
Definition at line 1322 of file JDataFilter.cc.
|
private |
host name of data server
Definition at line 1323 of file JDataFilter.cc.
|
private |
server socket port
Definition at line 1346 of file JDataFilter.cc.
|
private |
Definition at line 1347 of file JDataFilter.cc.
|
private |
Definition at line 1348 of file JDataFilter.cc.
|
private |
server for data queue connections
Definition at line 1350 of file JDataFilter.cc.
|
private |
connections to data queue
Definition at line 1351 of file JDataFilter.cc.
|
private |
Definition at line 1353 of file JDataFilter.cc.
|
private |
Definition at line 1354 of file JDataFilter.cc.
|
private |
buffer with pending time slice data
Definition at line 1356 of file JDataFilter.cc.
|
private |
Definition at line 1357 of file JDataFilter.cc.
|
private |
Definition at line 1358 of file JDataFilter.cc.
|
private |
Definition at line 1359 of file JDataFilter.cc.
|
private |
Definition at line 1360 of file JDataFilter.cc.
|
private |
Definition at line 1364 of file JDataFilter.cc.
|
private |
Definition at line 1365 of file JDataFilter.cc.
|
private |
Definition at line 1367 of file JDataFilter.cc.
|
private |
Definition at line 1368 of file JDataFilter.cc.
|
private |
Definition at line 1369 of file JDataFilter.cc.
|
private |
Definition at line 1370 of file JDataFilter.cc.
|
private |
Definition at line 1371 of file JDataFilter.cc.
|
private |
Definition at line 1372 of file JDataFilter.cc.
|
private |
Definition at line 1374 of file JDataFilter.cc.
|
private |
Definition at line 1375 of file JDataFilter.cc.
|
private |
Definition at line 1376 of file JDataFilter.cc.
|
private |
Definition at line 1377 of file JDataFilter.cc.
|
private |
Definition at line 1379 of file JDataFilter.cc.
|
private |
Definition at line 1380 of file JDataFilter.cc.
|
private |
Definition at line 1381 of file JDataFilter.cc.
|
private |
Definition at line 1382 of file JDataFilter.cc.
|
private |
Definition at line 1384 of file JDataFilter.cc.
|
private |
Definition at line 1385 of file JDataFilter.cc.
|
private |
Definition at line 1389 of file JDataFilter.cc.
|
private |
Definition at line 1390 of file JDataFilter.cc.
|
private |
Definition at line 1394 of file JDataFilter.cc.
|
private |
Definition at line 1395 of file JDataFilter.cc.
|
private |
Definition at line 1396 of file JDataFilter.cc.
|
private |
Definition at line 1397 of file JDataFilter.cc.
|
private |
Definition at line 1401 of file JDataFilter.cc.
|
private |
Definition at line 1403 of file JDataFilter.cc.
|
private |
Definition at line 1404 of file JDataFilter.cc.
|
private |
Definition at line 1405 of file JDataFilter.cc.
|
private |
Definition at line 1406 of file JDataFilter.cc.
|
private |
Definition at line 1408 of file JDataFilter.cc.
|
private |
Definition at line 1409 of file JDataFilter.cc.
|
private |
Definition at line 1413 of file JDataFilter.cc.
|
private |
Definition at line 1414 of file JDataFilter.cc.
|
private |
Definition at line 1415 of file JDataFilter.cc.
|
private |
Definition at line 1416 of file JDataFilter.cc.
|
private |
Definition at line 1420 of file JDataFilter.cc.
|
protectedinherited |
message server
Definition at line 801 of file JDAQClient.hh.
|
protectedinherited |
message logger
Definition at line 802 of file JDAQClient.hh.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 238 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 258 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 278 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 298 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 318 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 338 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 358 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 378 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 398 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 418 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 438 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 458 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 478 of file JDAQCHSM.hh.
|
inherited |
|
inherited |
Definition at line 495 of file JDAQCHSM.hh.
|
protectedinherited |
Definition at line 154 of file JDAQCHSM.chsm.
|
protectedinherited |
Definition at line 155 of file JDAQCHSM.chsm.
|
protectedinherited |
Definition at line 156 of file JDAQCHSM.chsm.
|
staticinherited |
time out of update [s]
Definition at line 62 of file JDAQClient.hh.
|
protectedinherited |
event table
Definition at line 203 of file JDAQClient.hh.
|
protectedinherited |
Definition at line 205 of file JDAQClient.hh.
|
protectedinherited |
Definition at line 206 of file JDAQClient.hh.
|
protectedinherited |
central clock
Definition at line 207 of file JDAQClient.hh.
|
protectedinherited |
number of last event
Definition at line 208 of file JDAQClient.hh.