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 (vector<string>::const_iterator i = detectorFile.begin(); i != detectorFile.end(); ++i) {
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 FATAL(
"Missing PMT " << pmt.getID() << endl);
131 for (
const auto& module : buffer) {
134 if (module.getFloor() != 0)
140 FATAL(
"Missing module " << module.getID() << endl);
158 for (
const auto& module : buffer) {
161 if (module.getFloor() != 0) {
174 FATAL(
"Missing module " << module.getID() << endl);
192 for (
const auto& module : buffer) {
198 FATAL(
"Missing module " << module.getID() << endl);
216 for (
const auto& module : buffer) {
219 detector.getModule(router.
getAddress(module.getID())).setQuaternion(module.getQuaternion());
222 FATAL(
"Missing module " << module.getID() << endl);
240 for (
const auto& module : buffer) {
244 FATAL(
"Missing module " << module.getID() << endl);
250 for (
const auto& module : buffer) {
251 for (
const auto& pmt : module) {
252 if (router.
hasPMT(pmt.getID()))
255 FATAL(
"Missing PMT " << pmt.getID() << endl);
Data structure for detector geometry and calibration.
int main(int argc, char **argv)
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 JObjectID &id) const
Has module.
const JModuleAddress & getAddress(const JObjectID &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 JObjectID &id) const
Has PMT.
const JPMTAddress & getAddress(const JObjectID &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)...