Jpp 20.0.0-rc.6
the software that should make you happy
Loading...
Searching...
No Matches
JToA.cc File Reference

Auxiliary program to convert acoustics data from data base into ROOT format. More...

#include <iomanip>
#include <iostream>
#include "JAcoustics/JToA.hh"
#include "JAcoustics/JSupport.hh"
#include "JDB/JDB.hh"
#include "JDB/JDBToolkit.hh"
#include "JDB/JDatabaseObjectIterator.hh"
#include "JDB/JSelector.hh"
#include "JDB/JSupport.hh"
#include "JDB/JToAshort.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JMessage.hh"
#include "Jeep/JParser.hh"
#include "dbclient/KM3NeTDBClient.h"

Go to the source code of this file.

Classes

class  JROOT::JRootCreateFlatTree< JACOUSTICS::JToA >
 

Namespaces

namespace  JROOT
 Auxiliary classes and methods for ROOT I/O.
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to convert acoustics data from data base into ROOT format.

Example usage :

JToA -@ "minrun = 16514"      \
     -@ "maxrun = 16514"      \
     -@ "detid  = D1ORCA015"  \
     -o KM3NeT_00000146_00016514_toa.root
Author
mdejong

Definition in file software/JAcoustics/JToA.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 39 of file software/JAcoustics/JToA.cc.

40{
41 using namespace std;
42 using namespace JPP;
43
45
46 JServer server;
47 string usr;
48 string pwd;
49 string cookie;
50 JSelector selection;
51 int debug;
52
53 try {
54
55 JParser<> zap("Auxiliary program to convert acoustics data from data base into ROOT format.");
56
57 // clang-format off
58 zap['o'] = make_field(outputFile);
59 zap['s'] = make_field(server) = getServernames();
60 zap['u'] = make_field(usr) = "";
61 zap['!'] = make_field(pwd) = "";
62 zap['C'] = make_field(cookie) = "";
63 zap['@'] = make_field(selection) = JPARSER::initialised();
64 zap['d'] = make_field(debug) = 1;
65 // clang-format on
66
67 zap(argc, argv);
68 }
69 catch (const exception& error) {
70 FATAL(error.what() << endl);
71 }
72
73
74 try {
75
76 JDB::reset(usr, pwd, cookie);
77
79
80 outputFile.open();
81
82 outputFile.put(JMeta(argc, argv));
83
84 JToA toa;
85
87
88 const JToAshort* p = in.next();
89
90 toa.DETID = getDetector(p->DETID);
91 toa.RUN = p->RUN;
92 toa.DOMID = p->DOMID;
93 toa.WAVEFORMID = p->EMITTERID;
94 toa.TOA_NS = p->getAbsoluteToA_ns();
95 toa.SECONDS = p->getDAQFrameSeconds();
96 toa.TICKS = p->getDAQFrameTicks();
99
100 outputFile.put(toa);
101 }
102
103 outputFile.close();
104 }
105 catch (const exception& error) {
106 FATAL(error.what() << endl);
107 }
108}
string outputFile
#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
Object iteration from database.
Auxiliary class for specifying selection of database data.
virtual bool hasNext() override
Check availability of next element.
Utility class to parse command line options.
Definition JParser.hh:1698
Object writing to file.
JDetectorsHelper & getDetector()
Auxiliary function for helper object initialisation.
std::vector< JServer > getServernames()
Get list of names of available database servers.
Definition JDB.hh:108
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Time-of-arrival data from acoustic piezo sensor or hydrophone.
Definition JToA.hh:28
uint32_t SECONDS
Time of Arrival, in ns (relative to Unix epoch, 1 January 1970 00:00:00 UTC)
Definition JToA.hh:37
uint32_t DOMID
DAQ run number.
Definition JToA.hh:34
int64_t TOA_NS
Unique ID of the waveform that best described the signal around TOA_NS.
Definition JToA.hh:36
uint32_t QUALITYFACTOR
The ticks (16ns) part of the DAQ frame timestamp.
Definition JToA.hh:39
uint32_t QUALITYNORMALISATION
A measure of how good the waveform match was to the signal.
Definition JToA.hh:40
int32_t WAVEFORMID
DOM unique identifeir.
Definition JToA.hh:35
int32_t DETID
Definition JToA.hh:32
int32_t RUN
detector identifier
Definition JToA.hh:33
uint32_t TICKS
The seconds part of the DAQ frame timestamp.
Definition JToA.hh:38
static void initialise(JHelper_t &helper, const Args &...args)
Initialise.
Wrapper class for server name.
Definition JDB.hh:54
uint32_t getDAQFrameSeconds() const
get the number of seconds (since Unix epoch) of the DAQ Frame start time
Definition JToAshort.hh:52
int EMITTERID
waveform identifier
Definition JToAshort.hh:29
uint32_t getDAQFrameTicks() const
get the number of ticks (16 ns) of the DAQ Frame start time
Definition JToAshort.hh:58
static const char *const getName()
Table name.
Definition JToAshort.hh:22
std::string DETID
constraint
Definition JToAshort.hh:24
int64_t getAbsoluteToA_ns() const
return the absolute Time Of Arrival, in nanoseconds (since Unix epoch 1 January 1970 00:00:00 UTC)
Definition JToAshort.hh:40
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72