#ifndef __JCOMPASS__JEVTTOOLKIT__ #define __JCOMPASS__JEVTTOOLKIT__ #include #include "JCompass/JModel.hh" #include "JCompass/JEvt.hh" /** * \file * * Compass event fit. * \author mdejong */ namespace JCOMPASS {} namespace JPP { using namespace JCOMPASS; } namespace JCOMPASS { /** * Get quaternion. * * \param Q quaternion * \return quaternion */ inline JQuaternion3D getQuaternion(const JQuaternion& Q) { return JQuaternion3D(Q.a, Q.b, Q.c, Q.d); } /** * Get quaternion. * * \param Q quaternion * \return quaternion */ inline JQuaternion getQuaternion(const JQuaternion3D& Q) { return JQuaternion(Q.getA(), Q.getB(), Q.getC(), Q.getD()); } /** * Get model. * * \param evt event * \return model */ inline JModel getModel(const JEvt& evt) { JModel model; if (evt.size() >= 2) { model.Q0 = getQuaternion(evt[0]); model.Q1 = getQuaternion(evt[1]); } return model; } /** * Get event. * * \param header header * \param model model * \return event */ inline JEvt getEvt(const JHead& header, const JModel& model) { JEvt evt(header); evt.push_back(getQuaternion(model.Q0)); evt.push_back(getQuaternion(model.Q1)); return evt; } } #endif