Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
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 "JLang/JVectorize.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 "Jeep/JStatus.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"
#include "JSystem/JFilesystem.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

namespace  JNET
 
namespace  KM3NETDAQ
 KM3NeT DAQ data structures and auxiliaries.
 

Functions

template<>
int JNET::getSizeOfPacket (const KM3NETDAQ::JDAQAbstractPreamble &preamble)
 Get size of packeet.
 
size_t KM3NETDAQ::getNumberOfFrames (const size_t number_of_frames, const double factor)
 Get expected number of frames according a given allowed fraction of active modules.
 
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 1598 of file JDataFilter.cc.

1599{
1600 using namespace std;
1601 using namespace JPP;
1602 using namespace KM3NETDAQ;
1603
1604 string server;
1605 string logger;
1606 string hostname;
1607 string client_name;
1608 int port;
1609 int backlog;
1610 bool use_cout;
1611 string path;
1612 string archive;
1613 int debug;
1614
1615
1616 try {
1617
1618 JParser<> zap("Application for real-time filtering of data.");
1619
1620 zap['H'] = make_field(server, "host name of server for command messages") = "localhost";
1621 zap['M'] = make_field(logger, "host name of server for logger messages") = "localhost";
1622 zap['D'] = make_field(hostname, "host name of server of data writer") = "";
1623 zap['u'] = make_field(client_name, "client name") = "%";
1624 zap['P'] = make_field(port, "port to listen for incoming data from data queue");
1625 zap['q'] = make_field(backlog, "back log") = 1024;
1626 zap['c'] = make_field(use_cout, "print to terminal");
1627 zap['p'] = make_field(path, "directory for temporary storage of circular buffer") = "/tmp/";
1628 zap['A'] = make_field(archive, "directory for permanent archival of circular buffer") = "/tmp/";
1629 zap['d'] = make_field(debug, "debug level") = 0;
1630
1631 zap(argc, argv);
1632 }
1633 catch(const std::exception& error) {
1634 FATAL(error.what() << endl);
1635 }
1636
1637
1638 JLogger* out = NULL;
1639
1640 if (use_cout)
1641 out = new JStreamLogger(cout);
1642 else
1643 out = new JControlHostLogger(logger);
1644
1645 JDataFilter dfilter(client_name,
1646 server,
1647 hostname,
1648 out,
1649 debug,
1650 port,
1651 backlog,
1652 path,
1653 archive);
1654
1655 dfilter.meta = JMeta(argc, argv);
1656
1657 dfilter.enter();
1658 dfilter.run();
1659}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Message logging based on ControlHost.
Interface for logging messages.
Definition JLogger.hh:22
Message logging based on std::ostream.
Utility class to parse command line options.
Definition JParser.hh:1698
Main class for real-time filtering of data.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72