Jpp 20.0.0-rc.9-29-gccc23c492-D
the software that should make you happy
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
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
 

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 JToA.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 39 of file JToA.cc.

40{
41 using namespace std;
42 using namespace JPP;
43
44 JFileRecorder<JTYPELIST<JToA, JMeta>::typelist> outputFile;
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
78 JDBToolkit::initialise(getDetector);
79
80 outputFile.open();
81
82 outputFile.put(JMeta(argc, argv));
83
84 JToA toa;
85
86 for (JDatabaseObjectIterator<JToAshort> in(JToAshort::getName(), selection); in.hasNext();) {
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();
97 toa.QUALITYFACTOR = p->QUALITYFACTOR;
98 toa.QUALITYNORMALISATION = p->QUALITYNORMALISATION;
99
100 outputFile.put(toa);
101 }
102
103 outputFile.close();
104 }
105 catch (const exception& error) {
106 FATAL(error.what() << endl);
107 }
108}
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