#include #include #include #include #include "JDetector/JModule.hh" #include "JDetector/JDetectorToolkit.hh" #include "JFit/JPoint3DEstimator.hh" #include "Jeep/JPrint.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example for determination of center of optical module. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; typedef pair pair_type; pair_type precision; int debug; try { JParser<> zap("Example for determination of center of optical module."); zap['e'] = make_field(precision, "precision of fit comparison and centering") = pair_type(1.0e-12, 1.0e-4); zap['d'] = make_field(debug, "debug.") = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } const JModule module = getModule(1001); const JEstimator position(module.begin(), module.end()); const JPosition3D center = module.getCenter(); DEBUG("position " << position << endl); DEBUG("center " << center << endl); ASSERT(center.equals(position, precision.first)); ASSERT(center.equals(JVector3D(0.0, 0.0, 0.0), precision.second)); return 0; }