Jpp
Functions
JDetectorDB.cc File Reference
#include <string>
#include <iostream>
#include <iomanip>
#include "JDB/JDB.hh"
#include "JDetector/JDetector.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to print detector from database.

Author
mdejong

Definition in file JDetectorDB.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

< tcal: t0 (time offsets) calibration set from DB

< pcal: position (x,y,z) calibration set from DB

< rcal: orientation (quarterions) calibration set from DB

Definition at line 19 of file JDetectorDB.cc.

20 {
21  using namespace std;
22  using namespace JPP;
23 
24  string usr;
25  string pwd;
26  string cookie;
27  string id;
28  string tcalset;
29  string pcalset;
30  string rcalset;
31  int run;
32  int debug;
33 
34  try {
35 
36  JParser<> zap("Auxiliary program to print detector from database.");
37 
38  zap['u'] = make_field(usr) = "";
39  zap['!'] = make_field(pwd) = "";
40  zap['C'] = make_field(cookie) = "";
41  zap['D'] = make_field(id);
42  zap['r'] = make_field(run);
43  zap['t'] = make_field(tcalset) = ""; ///< tcal: t0 (time offsets) calibration set from DB
44  zap['p'] = make_field(pcalset) = ""; ///< pcal: position (x,y,z) calibration set from DB
45  zap['q'] = make_field(rcalset) = ""; ///< rcal: orientation (quarterions) calibration set from DB
46 
47  zap['d'] = make_field(debug) = 1;
48 
49  zap(argc, argv);
50  }
51  catch(const exception &error) {
52  FATAL(error.what() << endl);
53  }
54 
55  try {
56 
57  JDB::reset(usr, pwd, cookie);
58 
59  JDetector detector;
60 
61  if (!tcalset.empty() && !pcalset.empty() && !rcalset.empty())
62  *(JDB::get()->DetX)(id.c_str(), tcalset.c_str(), pcalset.c_str(), rcalset.c_str()) >> detector;
63  else
64  *(JDB::get()->DetX)(id.c_str(), run) >> detector;
65 
66  detector.comment.add(JMeta(argc,argv));
67 
68  cout << detector << endl;
69  }
70  catch(const exception& error) {
71  FATAL(error.what() << endl);
72  }
73 }
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
JDETECTOR::reset
void reset(JCLBInput &data, size_t size)
Reset CLB buffers.
Definition: JCLBSimulator.hh:41
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
JAANET::get
T get(const JHead &header)
Get object from header.
Definition: JHeadToolkit.hh:295
FATAL
#define FATAL(A)
Definition: JMessage.hh:67