Jpp test-rotations-old-533-g2bdbdb559
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/JStats.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 1614 of file JDataFilter.cc.

1615{
1616 using namespace std;
1617 using namespace JPP;
1618 using namespace KM3NETDAQ;
1619
1620 string server;
1621 string logger;
1622 string hostname;
1623 string client_name;
1624 int port;
1625 int backlog;
1626 bool use_cout;
1627 string path;
1628 string archive;
1629 int debug;
1630
1631
1632 try {
1633
1634 JParser<> zap("Application for real-time filtering of data.");
1635
1636 zap['H'] = make_field(server, "host name of server for command messages") = "localhost";
1637 zap['M'] = make_field(logger, "host name of server for logger messages") = "localhost";
1638 zap['D'] = make_field(hostname, "host name of server of data writer") = "";
1639 zap['u'] = make_field(client_name, "client name") = "%";
1640 zap['P'] = make_field(port, "port to listen for incoming data from data queue");
1641 zap['q'] = make_field(backlog, "back log") = 1024;
1642 zap['c'] = make_field(use_cout, "print to terminal");
1643 zap['p'] = make_field(path, "directory for temporary storage of circular buffer") = "/tmp/";
1644 zap['A'] = make_field(archive, "directory for permanent archival of circular buffer") = "/tmp/";
1645 zap['d'] = make_field(debug, "debug level") = 0;
1646
1647 zap(argc, argv);
1648 }
1649 catch(const std::exception& error) {
1650 FATAL(error.what() << endl);
1651 }
1652
1653
1654 JLogger* out = NULL;
1655
1656 if (use_cout)
1657 out = new JStreamLogger(cout);
1658 else
1659 out = new JControlHostLogger(logger);
1660
1661 JDataFilter dfilter(client_name,
1662 server,
1663 hostname,
1664 out,
1665 debug,
1666 port,
1667 backlog,
1668 path,
1669 archive);
1670
1671 dfilter.meta = JMeta(argc, argv);
1672
1673 dfilter.enter();
1674 dfilter.run();
1675}
#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