34 int main(
int argc,
char **argv)
55 JParser<> zap(
"Auxiliary program to print detector from database.");
61 zap[
'D'] =
make_field(
id,
"detector identifier") =
"";
63 zap[
't'] =
make_field(tcalset,
"tcal: t0 (time offsets) calibration set from DB") =
"";
64 zap[
'p'] =
make_field(pcalset,
"pcal: position (x,y,z) calibration set from DB") =
"";
65 zap[
'q'] =
make_field(rcalset,
"rcal: orientation (quaterions) calibration set from DB") =
"";
73 catch(
const exception &error) {
74 FATAL(error.what() << endl);
78 const int file = ((detectorFile !=
"" ? 1 : 0));
79 const int calset = ((tcalset.empty() ? 0 : 1) +
80 (pcalset.empty() ? 0 : 1) +
81 (rcalset.empty() ? 0 : 1));
82 const int daq = ((run != -1 ? 1 : 0));
84 if (
file != 0 && (
file != 1)) {
FATAL(
"Inconsistent specificaton of detector file."); }
85 if (calset != 0 && (calset != 3 ||
id ==
"")) {
FATAL(
"Inconsistent specificaton of detector identifier, tcal, pcal and rcal calibration sets."); }
86 if (daq != 0 && (daq != 1 ||
id ==
"")) {
FATAL(
"Inconsistent specificaton of detector identifier and run number."); }
90 if (
file == 1) { ++np; }
91 if (calset == 3) { ++np; }
92 if (daq == 1) { ++np; }
94 if (np != 1) {
FATAL(
"Specify detector file; OR detector identifier, tcal, pcal and rcal calibration set; OR detector identifier and run number."); }
100 catch(
const exception& error) {
101 FATAL(error.what() << endl);
110 else if (calset == 3)
111 *(
JDB::get()->DetX)(
id.c_str(), tcalset.c_str(), pcalset.c_str(), rcalset.c_str()) >>
detector;
115 catch(
const exception& error) {
116 FATAL(error.what() << endl);
121 if (
detector.setToLatestVersion()) {
122 NOTICE(
"Set detector version to " <<
detector.getVersion() << endl);
133 selector.
add(&JCLBMap::FLOORID, 0);
135 ResultSet& rs =
getResultSet(getTable<JCLBMap>(), selector);
141 catch(
const exception& error) {
142 FATAL(error.what() << endl);
147 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
148 zmap[module->getString()][module->getFloor()] = module->getPosition();
155 if (i->FLOORID == 0 && p ==
detector.end()) {
160 zmap[i->DUID].begin()->second.getY(),
165 const double t0 = 0.0;
169 NOTICE(
"Adding module " << module << endl);
bool isORCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with that of ORCA.
Utility class to parse command line options.
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
int main(int argc, char *argv[])
Data structure for a composite optical module.
static const double ARCA_TBARZ_M
ORCA T-bar position relative to seabed [m].
bool isARCADetector(const JDetectorHeader &header)
Check if given detector header is compatible with tat of ARCA.
static const double HYDROPHONE_DELAYTIME_US
Hydrophone delay time [us].
T get(const JHead &header)
Get object from header.
then usage $script< string identifier >< detectorfile > input file(toashort file)+" "\nNote that the input files and toashort files should be one-to-one related." fi if (( $
Auxiliary class for specifying selection of database data.
Data structure for detector geometry and calibration.
JDetectorsHelper getDetector
Function object for mapping serial number to object identifier of detector and vice versa...
static const double ORCA_TBARZ_M
ORCA T-bar position relative to seabed [m].
I/O formatting auxiliaries.
Logical location of module.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
JSelector & add(const JSelector &selection)
Add selection.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
General purpose messaging.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Utility class to parse command line options.
void setCalibration(const JCalibration &cal)
Set calibration.
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.
Wrapper class for server name.
Data structure for position in three dimensions.
do set_variable DETECTOR_TXT $WORKDIR detector
Template definition for getting table specific selector.
void setPosition(const JVector3D &pos)
Set position.