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

Application for writing real-time data to disk. More...

#include <string>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <map>
#include "Jeep/JParser.hh"
#include "Jeep/JProperties.hh"
#include "Jeep/JTimer.hh"
#include "Jeep/JTimekeeper.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JeepToolkit.hh"
#include "JNet/JControlHost.hh"
#include "JLang/JException.hh"
#include "JLang/JSharedPointer.hh"
#include "JLogger/JMessageScheduler.hh"
#include "km3net-dataformat/online/JDAQ.hh"
#include "JDAQ/JDAQTags.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JRuncontrol/JDAQClient.hh"
#include "JRuncontrol/JRuncontrolToolkit.hh"
#include "JIO/JByteArrayIO.hh"
#include "JTools/JAutoMap.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JAutoTreeWriter.hh"

Go to the source code of this file.

Classes

class  KM3NETDAQ::JDataWriter
 Runcontrol client to write data to disk. More...
 
struct  KM3NETDAQ::JDataWriter::JValue_t
 Auxiliary data structure for I/O of trigger parameters. More...
 
struct  KM3NETDAQ::JDataWriter::JRunDB
 Map run number to trigger parameters. More...
 

Namespaces

 JSUPPORT
 Support classes and methods for experiment specific I/O.
 
 KM3NETDAQ
 KM3NeT DAQ data structures and auxiliaries.
 

Typedefs

typedef
JSUPPORT::JAutoTreeWriter
< JNET::JTag
JTreeWriter_t
 Type definition of auto map. More...
 

Functions

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

Detailed Description

Application for writing real-time data to disk.

Author
mdejong

Definition in file JDataWriter.cc.

Typedef Documentation

Type definition of auto map.

Definition at line 35 of file JDataWriter.cc.

Function Documentation

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

Definition at line 536 of file JDataWriter.cc.

537 {
538  using namespace std;
539  using namespace JPP;
540  using namespace KM3NETDAQ;
541 
542  string server;
543  string logger;
544  string hostname;
545  string client_name;
546  bool use_cout;
547  string path;
548  int debug;
549 
550  try {
551 
552  JParser<> zap("Application for writing real-time data to disk.");
553 
554  zap['H'] = make_field(server, "host name of server for command messages") = "localhost";
555  zap['M'] = make_field(logger, "host name of server for logger messages") = "localhost";
556  zap['D'] = make_field(hostname, "host name of server for incoming data from data filter") = "localhost";
557  zap['u'] = make_field(client_name, "client name") = "%";
558  zap['c'] = make_field(use_cout, "print to terminal");
559  zap['p'] = make_field(path, "directory for permanent archival of data") = "";
560  zap['d'] = make_field(debug, "debug level") = 0;
561 
562 
563  zap(argc, argv);
564  }
565  catch(const exception &error) {
566  FATAL(error.what() << endl);
567  }
568 
569 
570  JLogger* out = NULL;
571 
572  if (use_cout)
573  out = new JStreamLogger(cout);
574  else
575  out = new JControlHostLogger(logger);
576 
577  JDataWriter dwriter(getProcessName(client_name, argv[0]), server, hostname, out, debug, path);
578 
579  dwriter.meta = JMeta(argc, argv);
580 
581  dwriter.enter();
582  dwriter.run();
583 }
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
Runcontrol client to write data to disk.
Definition: JDataWriter.cc:61
std::string getProcessName(const std::string &name, const std::string &process)
Get process name of run control client.
Message logging based on std::ostream.
Interface for logging messages.
Definition: JLogger.hh:22
Message logging based on ControlHost.
#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