Jpp  18.0.1-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Functions
JDataFilter.cc File Reference

Application for real-time filtering of data. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <deque>
#include <limits>
#include <algorithm>
#include <unistd.h>
#include "JLang/JSinglePointer.hh"
#include "JLang/JLangToolkit.hh"
#include "JLang/JException.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JProperties.hh"
#include "Jeep/JTimer.hh"
#include "Jeep/JTimekeeper.hh"
#include "Jeep/JMessage.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JeepToolkit.hh"
#include "JLogger/JMessageScheduler.hh"
#include "km3net-dataformat/online/JDAQ.hh"
#include "km3net-dataformat/online/JDAQAbstractPreamble.hh"
#include "km3net-dataformat/online/JDAQPreamble.hh"
#include "km3net-dataformat/online/JDAQSuperFrame.hh"
#include "km3net-dataformat/online/JDAQFrame.hh"
#include "JDAQ/JDAQTags.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDetector/JDetector.hh"
#include "JTrigger/JHit.hh"
#include "JTrigger/JHitToolkit.hh"
#include "JTrigger/JSuperFrame1D.hh"
#include "JTrigger/JSuperFrame2D.hh"
#include "JTrigger/JTimeslice.hh"
#include "JTrigger/JHitL0.hh"
#include "JTrigger/JHitL1.hh"
#include "JTrigger/JBuildL1.hh"
#include "JTrigger/JBuildL2.hh"
#include "JTrigger/JTrigger3DShower.hh"
#include "JTrigger/JTriggerMXShower.hh"
#include "JTrigger/JTrigger3DMuon.hh"
#include "JTrigger/JTriggerNB.hh"
#include "JTrigger/JTriggerBits.hh"
#include "JTrigger/JEventOverlap.hh"
#include "JTrigger/JTimesliceRouter.hh"
#include "JTrigger/JTriggeredEvent.hh"
#include "JTrigger/JTimesliceL1.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JTrigger/JTriggerToolkit.hh"
#include "JTrigger/JChecksum.hh"
#include "JRuncontrol/JDAQClient.hh"
#include "JRuncontrol/JRuncontrolToolkit.hh"
#include "JNet/JControlHost.hh"
#include "JNet/JControlHostObjectOutput.hh"
#include "JNet/JTCPSocket.hh"
#include "JNet/JSocketChannel.hh"
#include "JNet/JServerSocket.hh"
#include "JPhysics/JConstants.hh"
#include "JTools/JQuantile.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JTreeRecorder.hh"
#include "JSupport/JMeta.hh"
#include "JSystem/JStat.hh"
#include "JSystem/JTime.hh"
#include "JSystem/JSystemToolkit.hh"
#include "JSystem/JNetwork.hh"

Go to the source code of this file.

Classes

class  KM3NETDAQ::JDataFilter
 Main class for real-time filtering of data. More...
 
struct  KM3NETDAQ::JDataFilter::JCircularBuffer_t
 Circular buffer. More...
 

Namespaces

 JNET
 
 KM3NETDAQ
 KM3NeT DAQ data structures and auxiliaries.
 

Functions

template<>
int JNET::getSizeOfPacket (const KM3NETDAQ::JDAQAbstractPreamble &preamble)
 Get size of packeet. More...
 
int main (int argc, char *argv[])
 

Detailed Description

Application for real-time filtering of data.

For more information, see KM3NETDAQ::JDataFilter.

Author
rbruijn and mdejong

Definition in file JDataFilter.cc.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 1433 of file JDataFilter.cc.

1434 {
1435  using namespace std;
1436  using namespace JPP;
1437  using namespace KM3NETDAQ;
1438 
1439  string server;
1440  string logger;
1441  string hostname;
1442  string client_name;
1443  int port;
1444  int backlog;
1445  bool use_cout;
1446  string path;
1447  string archive;
1448  int debug;
1449 
1450 
1451  try {
1452 
1453  JParser<> zap("Application for real-time filtering of data.");
1454 
1455  zap['H'] = make_field(server, "host name of server for command messages") = "localhost";
1456  zap['M'] = make_field(logger, "host name of server for logger messages") = "localhost";
1457  zap['D'] = make_field(hostname, "host name of server of data writer") = "";
1458  zap['u'] = make_field(client_name, "client name") = "%";
1459  zap['P'] = make_field(port, "port to listen for incoming data from data queue");
1460  zap['q'] = make_field(backlog, "back log") = 1024;
1461  zap['c'] = make_field(use_cout, "print to terminal");
1462  zap['p'] = make_field(path, "directory for temporary storage of circular buffer") = "/tmp/";
1463  zap['A'] = make_field(archive, "directory for permanent archival of circular buffer") = "/tmp/";
1464  zap['d'] = make_field(debug, "debug level") = 0;
1465 
1466  zap(argc, argv);
1467  }
1468  catch(const exception& error) {
1469  FATAL(error.what() << endl);
1470  }
1471 
1472 
1473  JLogger* out = NULL;
1474 
1475  if (use_cout)
1476  out = new JStreamLogger(cout);
1477  else
1478  out = new JControlHostLogger(logger);
1479 
1480  JDataFilter dfilter(client_name,
1481  server,
1482  hostname,
1483  out,
1484  debug,
1485  port,
1486  backlog,
1487  path,
1488  archive);
1489 
1490  dfilter.meta = JMeta(argc, argv);
1491 
1492  dfilter.enter();
1493  dfilter.run();
1494 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Utility class to parse command line options.
Definition: JParser.hh:1514
Message logging based on std::ostream.
Interface for logging messages.
Definition: JLogger.hh:22
Message logging based on ControlHost.
Main class for real-time filtering of data.
Definition: JDataFilter.cc:151
then fatal Invalid path $argv[1] fi setopt extendedglob typeset Z8 ID function archive()
Definition: getArchive.sh:42
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
$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
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level