Jpp - 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 <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 "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 "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/JSocket.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/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

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

Definition at line 1320 of file JDataFilter.cc.

1321 {
1322  using namespace std;
1323  using namespace JPP;
1324  using namespace KM3NETDAQ;
1325 
1326  string server;
1327  string logger;
1328  string hostname;
1329  string client_name;
1330  int port;
1331  int backlog;
1332  int buffer_size;
1333  bool use_cout;
1334  string path;
1335  int debug;
1336 
1337 
1338  try {
1339 
1340  JParser<> zap("Application for real-time filtering of data.");
1341 
1342  zap['H'] = make_field(server) = "localhost";
1343  zap['M'] = make_field(logger) = "localhost";
1344  zap['D'] = make_field(hostname) = "";
1345  zap['u'] = make_field(client_name) = "JDataFilter";
1346  zap['P'] = make_field(port);
1347  zap['q'] = make_field(backlog) = 1024;
1348  zap['s'] = make_field(buffer_size) = 32 * MEGABYTE; // TCP buffer of 32 MB
1349  zap['c'] = make_field(use_cout);
1350  zap['p'] = make_field(path) = "/tmp/";
1351  zap['d'] = make_field(debug) = 0;
1352 
1353  zap(argc, argv);
1354  }
1355  catch(const exception& error) {
1356  FATAL(error.what() << endl);
1357  }
1358 
1359 
1360  JLogger* out = NULL;
1361 
1362  if (use_cout)
1363  out = new JStreamLogger(cout);
1364  else
1365  out = new JControlHostLogger(logger);
1366 
1367  JDataFilter dfilter(client_name,
1368  server,
1369  hostname,
1370  out,
1371  debug,
1372  port,
1373  backlog,
1374  buffer_size,
1375  path);
1376 
1377  dfilter.meta = JMeta(argc, argv);
1378 
1379  dfilter.enter();
1380  dfilter.run();
1381 }
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:1500
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:145
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
static const size_t buffer_size
int debug
debug level
Definition: JSirene.cc:63
static const long long int MEGABYTE
Number of bytes in a kilo-byte.
#define FATAL(A)
Definition: JMessage.hh:67