36int main(
int argc,
char **argv)
48 JParser<> zap(
"Auxiliary program to merge detector files.");
52 zap[
'@'] =
make_field(calset,
"import calibration sets \"<key> = <file name>[; <key> = <file name>]\"" << endl
58 catch(
const exception &error) {
59 FATAL(error.what() << endl);
65 for (vector<JEquation_t>::const_iterator i = calset.begin(); i != calset.end(); ++i) {
67 if (keys.count(i->getKey()) == 0)
68 FATAL(
"Invalid calibration set \"" << i->getKey() <<
"\"" << endl);
76 for (
size_t i = 0; i != detectorFile.size(); ++i) {
81 load(detectorFile[i], buffer);
90 copy(buffer.begin(), buffer.end(), back_inserter(
detector));
107 for (
const auto& module : buffer) {
108 for (
const auto& pmt : module) {
109 if (router.
hasPMT(pmt.getID()))
112 ERROR(
"Missing PMT " << pmt.getID() << endl);
131 for (
const auto& module : buffer) {
134 if (module.getFloor() != 0)
140 ERROR(
"Missing module " << module.getID() <<
' ' << module.getLocation() << endl);
158 for (
const auto& module : buffer) {
161 if (module.getFloor() != 0) {
174 ERROR(
"Missing module " << module.getID() <<
' ' << module.getLocation() << endl);
192 for (
const auto& module : buffer) {
198 ERROR(
"Missing module " << module.getID() <<
' ' << module.getLocation() << endl);
216 for (
const auto& module : buffer) {
219 detector.getModule(router.
getAddress(module.getID())).setQuaternion(module.getQuaternion());
222 ERROR(
"Missing module " << module.getID() <<
' ' << module.getLocation() << endl);
240 for (
const auto& module : buffer) {
244 ERROR(
"Missing module " << module.getID() <<
' ' << module.getLocation() << endl);
250 for (
const auto& module : buffer) {
251 for (
const auto& pmt : module) {
252 if (router.
hasPMT(pmt.getID()))
255 ERROR(
"Missing PMT " << pmt.getID() << endl);
Data structure for detector geometry and calibration.
General purpose messaging.
Direct access to module in detector data structure.
Direct access to PMT in detector data structure.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Router for direct addressing of module data in detector data structure.
bool hasModule(const JModuleIdentifier &id) const
Has module.
const JModuleAddress & getAddress(const JModuleIdentifier &id) const
Get address of module.
Data structure for a composite optical module.
Router for direct addressing of PMT data in detector data structure.
bool hasPMT(const int id) const
Has PMT.
const JPMTAddress & getAddress(const int id) const
Get address of PMT.
Data structure for position in three dimensions.
JVector3D & add(const JVector3D &vector)
Add vector.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
static JRotation getRotation
Function object to get rotation matrix to go from first to second module.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
void store(const std::string &file_name, const JDetector &detector)
Store detector to output file.
std::string trim(const std::string &buffer)
Trim string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const std::string TCAL
PMT time offsets.
static const std::string PCAL
(optical|base) module positions
static const std::string SCAL
(module|PMT) status
static const std::string RCAL
optical module orientations
static const std::string ACAL
acoustic time offsets (piezo sensor or hydrophone)
static const std::string CCAL
compass alignment (a.k.a. quaternion calibration)
Auxiliary data structure for streaming of STL containers.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...