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()) {
159 module.setPosition(
JPosition3D(zmap[i->DUID].begin()->second.getX(),
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.
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.
Auxiliary class for specifying selection of database data.
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].
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.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
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.
then usage $script< string identifier >< detectorfile > event file(toashort file)+" "\nNote that the event files and toashort files should be one-to-one related." fi if (( $