23int main(
int argc,
char **argv)
38 JParser<> zap(
"Auxiliary program to merge the time offsets of two detector files."\
39 "\nThe TDC constraints correspond to those used in conjuction with the detector file.");
41 zap[
'a'] =
make_field(detectorFile_a,
"<detector file> <TDC file>");
42 zap[
'b'] =
make_field(detectorFile_b,
"<detector file> <TDC file>");
49 catch(
const exception &error) {
50 FATAL(error.what() << endl);
58 load(detectorFile_a.first, detector_a);
59 load(detectorFile_b.first, detector_b);
61 catch(
const std::exception& error) {
65 if (detector_a.
getID() != detector_b.
getID()) {
66 FATAL(
"Detector identifier " << detector_a.
getID() <<
" != " << detector_b.
getID() << endl);
71 for (JDetector::iterator module = detector_a.begin(); module != detector_a.end(); ++module) {
74 FATAL(
"Missing module " << module->getID() <<
" in " << detectorFile_b.first << endl);
77 for (
size_t pmt = 0; pmt !=
module->size(); ++pmt) {
79 if (detectorFile_a.second.has(module->getID(), pmt)) {
81 if (detectorFile_b.second.has(module->getID(), pmt))
82 ASSERT(fabs((*module)[pmt].getT0() - router.
getModule(module->getID())[pmt].
getT0()) <= precision,
83 "PMT " << setw(10) << module->getID() <<
'.' <<
FILL(2,
'0') << pmt <<
FILL() <<
" constraint.");
Data structure for detector geometry and calibration.
int main(int argc, char **argv)
General purpose messaging.
#define ASSERT(A,...)
Assert macro.
Direct access to module in detector data structure.
General methods for loading and storing a single object from and to a file, respectively.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getT0() const
Get time offset.
const JCalibration & getCalibration() const
Get calibration.
Router for direct addressing of module data in detector data structure.
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
int getID() const
Get identifier.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.