Jpp
Classes | Namespaces | Functions
JDataFilter.cc File Reference
#include <string>
#include <iostream>
#include <iomanip>
#include <list>
#include <limits>
#include <algorithm>
#include <unistd.h>
#include "JLang/JSinglePointer.hh"
#include "JLang/JLangToolkit.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 "JDAQ/JDAQTags.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "km3net-dataformat/online/JDAQAbstractPreamble.hh"
#include "JDAQ/JDAQPreambleIO.hh"
#include "JDAQ/JDAQFrameIO.hh"
#include "JDAQ/JDAQSuperFrameIO.hh"
#include "JDAQ/JDAQSummarysliceIO.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/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/JSocket.hh"
#include "JNet/JSocketChannel.hh"
#include "JNet/JServerSocket.hh"
#include "JTools/JConstants.hh"
#include "JTools/JQuantile.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JTreeRecorder.hh"
#include "JSupport/JMeta.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
 Interprocess communication.
 
 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

◆ main()

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

Definition at line 1250 of file JDataFilter.cc.

1251 {
1252  using namespace std;
1253  using namespace JPP;
1254  using namespace KM3NETDAQ;
1255 
1256  string server;
1257  string logger;
1258  string hostname;
1259  string client_name;
1260  int port;
1261  int backlog;
1262  int buffer_size;
1263  bool use_cout;
1264  string path;
1265  int debug;
1266 
1267 
1268  try {
1269 
1270  JParser<> zap("Application for real-time filtering of data.");
1271 
1272  zap['H'] = make_field(server) = "localhost";
1273  zap['M'] = make_field(logger) = "localhost";
1274  zap['D'] = make_field(hostname) = "";
1275  zap['u'] = make_field(client_name) = "JDataFilter";
1276  zap['P'] = make_field(port);
1277  zap['q'] = make_field(backlog) = 1024;
1278  zap['s'] = make_field(buffer_size) = 32 * MEGABYTE; // TCP buffer of 32 MB
1279  zap['c'] = make_field(use_cout);
1280  zap['p'] = make_field(path) = "/tmp/";
1281  zap['d'] = make_field(debug) = 0;
1282 
1283  zap(argc, argv);
1284  }
1285  catch(const exception& error) {
1286  FATAL(error.what() << endl);
1287  }
1288 
1289 
1290  JLogger* out = NULL;
1291 
1292  if (use_cout)
1293  out = new JStreamLogger(cout);
1294  else
1295  out = new JControlHostLogger(logger);
1296 
1297  JDataFilter dfilter(client_name,
1298  server,
1299  hostname,
1300  out,
1301  debug,
1302  port,
1303  backlog,
1304  buffer_size,
1305  path);
1306 
1307  dfilter.meta = JMeta(argc, argv);
1308 
1309  dfilter.enter();
1310  dfilter.run();
1311 }
JLOGGER::JLogger
Interface for logging messages.
Definition: JLogger.hh:22
KM3NETDAQ::JDataFilter
Main class for real-time filtering of data.
Definition: JDataFilter.cc:144
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
buffer_size
const static size_t buffer_size
Definition: clb_swiss_knife.cpp:169
JLOGGER::JStreamLogger
Message logging based on std::ostream.
Definition: JStreamLogger.hh:22
JLOGGER::JControlHostLogger
Message logging based on ControlHost.
Definition: JControlHostLogger.hh:26
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
JTOOLS::MEGABYTE
static const long long int MEGABYTE
Number of bytes in a kilobyte.
Definition: JConstants.hh:80
JSUPPORT::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:71
std
Definition: jaanetDictionary.h:36
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
FATAL
#define FATAL(A)
Definition: JMessage.hh:67