#include #include #include #include "TRandom3.h" #include "JDetector/JModule.hh" #include "JDetector/JDetectorToolkit.hh" #include "JGeometry3D/JEulerMatrix3D.hh" #include "JGeometry3D/JGeometry3DTestkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * Auxiliary program to test module rotations. */ int main(int argc, char **argv) { using namespace std; using namespace JPP; int numberOfEvents; double precision; UInt_t seed; int debug; try { JParser<> zap; zap['n'] = make_field(numberOfEvents) = 1; zap['e'] = make_field(precision) = 1e-10; zap['S'] = make_field(seed) = 0; zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } gRandom->SetSeed(seed); for (int counter = 0; counter != numberOfEvents; ++counter) { STATUS("event: " << setw(10) << counter << '\r'); DEBUG(endl); JEulerMatrix3D Ri = getRandom(); JModule first = getModule(1001); JModule second = first; second.rotate(Ri); JRotation3D Rp = getRotation(first, second); DEBUG(Ri << endl); DEBUG(Rp << endl); ASSERT(Ri.equals(Rp, precision)); } STATUS(endl); return 0; }