Jpp
17.1.0
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) | |
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 | processIndexSorter (const JDAQProcess &first, const JDAQProcess &second) |
Sort DAQ process by index. More... | |
Static Public Attributes | |
static const int | MAXIMUM_FILE_NUMBER = 100 |
maximum file number for overwrite protection. More... | |
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 > | |
bool | 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 circular buffer>; c_sizeL0 = <L0 buffer size>; c_sizeL1 = <L1 buffer size>; c_sizeL2 = <L2 buffer size>; c_sizeSN = <SN buffer size>;
Note that when path is set to a valid directory:
<path>/KM3NeT_YYYY-MM-DD_<tag>[_<index>].root
;After closure of the file, a new file will be opened if path is set;
In this, YYYY
, MM
and DD
are the year, month and day at the time of the configuration or alert and <tag>
corresponds to the unique 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).
The application JConvert.cc can be used to readily convert multiple input files to a single output file.
The script JDataFilter.sh can be used to test this application.
Definition at line 147 of file JDataFilter.cc.
Definition at line 152 of file JDataFilter.cc.
Definition at line 153 of file JDataFilter.cc.
typedef double KM3NETDAQ::JDataFilter::hit_type |
Definition at line 155 of file JDataFilter.cc.
Definition at line 156 of file JDataFilter.cc.
Definition at line 157 of file JDataFilter.cc.
Definition at line 158 of file JDataFilter.cc.
Definition at line 159 of file JDataFilter.cc.
Definition at line 160 of file JDataFilter.cc.
|
private |
Definition at line 1251 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 writing circular buffer |
replace tag to receive dfilter specific messages in configure
Definition at line 291 of file JDataFilter.cc.
|
inlinestatic |
Sort DAQ process by index.
first | first DAQ process |
second | second DAQ process |
Definition at line 272 of file JDataFilter.cc.
|
inlineoverridevirtual |
Interface methods for actions corresponding to state transitions.
Reimplemented from JDAQCHSM.
Definition at line 317 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 321 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 334 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 355 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 567 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 617 of file JDataFilter.cc.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 656 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 664 of file JDataFilter.cc.
|
inlineoverridevirtual |
Reimplemented from JDAQCHSM.
Definition at line 674 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 680 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 694 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 831 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 846 of file JDataFilter.cc.
|
inline |
Process time slice.
timeslice | time slice |
Definition at line 941 of file JDataFilter.cc.
|
inline |
Report status to message logger.
Definition at line 1154 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 1206 of file JDataFilter.cc.
|
inlineprivate |
Auxiliary method to send object to data server.
object | object to be sent |
Definition at line 1262 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 363 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 418 of file JDAQClient.hh.
|
inlinevirtualinherited |
Exit the state machine.
This method releases the various resources.
Definition at line 456 of file JDAQClient.hh.
|
inlineinherited |
Check if this client is in runnig state.
Definition at line 479 of file JDAQClient.hh.
|
inlineinherited |
Replace tag of given event in event table.
oldTag | old tag |
newTag | new tag |
event | event |
Definition at line 492 of file JDAQClient.hh.
|
inlineinherited |
Find event in event table.
tag | tag |
event_name | event name |
Definition at line 507 of file JDAQClient.hh.
|
inlineinherited |
Add custom subscription.
subscription | subscription |
Definition at line 523 of file JDAQClient.hh.
|
inlineinherited |
Add parameter to parser used in method enter().
option | option |
parameter | parameter |
Definition at line 536 of file JDAQClient.hh.
|
inlineinherited |
Add parameter to parser used in method enter().
option | option |
parameter | parameter |
value | default value |
Definition at line 550 of file JDAQClient.hh.
|
inlineinherited |
Set the file descriptor mask for the select call.
Definition at line 559 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 606 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 633 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 661 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 741 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 786 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 119 of file JDAQClient.hh.
|
inlineinherited |
Get unique tag of this run control client.
Definition at line 130 of file JDAQClient.hh.
|
inlineinherited |
Get total delay time.
Definition at line 141 of file JDAQClient.hh.
|
inlineinherited |
Get interval time.
Definition at line 153 of file JDAQClient.hh.
|
inlineinherited |
Set interval time.
interval_us | interval time [us] |
Definition at line 164 of file JDAQClient.hh.
|
inlineinherited |
Reset clock.
Definition at line 173 of file JDAQClient.hh.
|
inlineinherited |
Get last event number.
Definition at line 184 of file JDAQClient.hh.
|
inlineinherited |
Set last event number.
event_number | event number |
Definition at line 195 of file JDAQClient.hh.
JMeta KM3NETDAQ::JDataFilter::meta |
meta data
Definition at line 1245 of file JDataFilter.cc.
|
static |
maximum file number for overwrite protection.
Definition at line 1247 of file JDataFilter.cc.
|
private |
controlhost of data server (to which data writer should be connected)
Definition at line 1252 of file JDataFilter.cc.
|
private |
host name of data server
Definition at line 1253 of file JDataFilter.cc.
|
private |
server socket port
Definition at line 1280 of file JDataFilter.cc.
|
private |
Definition at line 1281 of file JDataFilter.cc.
|
private |
Definition at line 1282 of file JDataFilter.cc.
|
private |
server for data queue connections
Definition at line 1284 of file JDataFilter.cc.
|
private |
connections to data queue
Definition at line 1285 of file JDataFilter.cc.
|
private |
Definition at line 1287 of file JDataFilter.cc.
|
private |
Definition at line 1288 of file JDataFilter.cc.
|
private |
buffer with pending time slice data
Definition at line 1290 of file JDataFilter.cc.
|
private |
Definition at line 1291 of file JDataFilter.cc.
|
private |
Definition at line 1292 of file JDataFilter.cc.
|
private |
Definition at line 1293 of file JDataFilter.cc.
|
private |
Definition at line 1294 of file JDataFilter.cc.
|
private |
Definition at line 1298 of file JDataFilter.cc.
|
private |
Definition at line 1299 of file JDataFilter.cc.
|
private |
Definition at line 1301 of file JDataFilter.cc.
|
private |
Definition at line 1302 of file JDataFilter.cc.
|
private |
Definition at line 1303 of file JDataFilter.cc.
|
private |
Definition at line 1304 of file JDataFilter.cc.
|
private |
Definition at line 1305 of file JDataFilter.cc.
|
private |
Definition at line 1306 of file JDataFilter.cc.
|
private |
Definition at line 1308 of file JDataFilter.cc.
|
private |
Definition at line 1309 of file JDataFilter.cc.
|
private |
Definition at line 1310 of file JDataFilter.cc.
|
private |
Definition at line 1311 of file JDataFilter.cc.
|
private |
Definition at line 1313 of file JDataFilter.cc.
|
private |
Definition at line 1314 of file JDataFilter.cc.
|
private |
Definition at line 1315 of file JDataFilter.cc.
|
private |
Definition at line 1316 of file JDataFilter.cc.
|
private |
Definition at line 1318 of file JDataFilter.cc.
|
private |
Definition at line 1319 of file JDataFilter.cc.
|
private |
Definition at line 1323 of file JDataFilter.cc.
|
private |
Definition at line 1324 of file JDataFilter.cc.
|
private |
Definition at line 1328 of file JDataFilter.cc.
|
private |
Definition at line 1329 of file JDataFilter.cc.
|
private |
Definition at line 1330 of file JDataFilter.cc.
|
private |
Definition at line 1331 of file JDataFilter.cc.
|
private |
Definition at line 1335 of file JDataFilter.cc.
|
private |
Definition at line 1337 of file JDataFilter.cc.
|
private |
Definition at line 1338 of file JDataFilter.cc.
|
private |
Definition at line 1339 of file JDataFilter.cc.
|
private |
Definition at line 1340 of file JDataFilter.cc.
|
private |
Definition at line 1342 of file JDataFilter.cc.
|
private |
Definition at line 1343 of file JDataFilter.cc.
|
private |
Definition at line 1347 of file JDataFilter.cc.
|
private |
Definition at line 1348 of file JDataFilter.cc.
|
private |
Definition at line 1349 of file JDataFilter.cc.
|
private |
Definition at line 1350 of file JDataFilter.cc.
|
private |
Definition at line 1354 of file JDataFilter.cc.
|
private |
directory for writing circular buffer
Definition at line 1355 of file JDataFilter.cc.
|
protectedinherited |
message server
Definition at line 800 of file JDAQClient.hh.
|
protectedinherited |
message logger
Definition at line 801 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 61 of file JDAQClient.hh.
|
protectedinherited |
event table
Definition at line 202 of file JDAQClient.hh.
|
protectedinherited |
Definition at line 204 of file JDAQClient.hh.
|
protectedinherited |
Definition at line 205 of file JDAQClient.hh.
|
protectedinherited |
central clock
Definition at line 206 of file JDAQClient.hh.
|
protectedinherited |
number of last event
Definition at line 207 of file JDAQClient.hh.