Jpp  18.0.0-rc.4
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JCompass/JEvtToolkit.hh
Go to the documentation of this file.
1 #ifndef __JCOMPASS__JEVTTOOLKIT__
2 #define __JCOMPASS__JEVTTOOLKIT__
3 
4 #include <set>
5 
6 #include "JCompass/JModel.hh"
7 #include "JCompass/JEvt.hh"
8 
9 
10 /**
11  * \file
12  *
13  * Compass event fit.
14  * \author mdejong
15  */
16 namespace JCOMPASS {}
17 namespace JPP { using namespace JCOMPASS; }
18 
19 namespace JCOMPASS {
20 
21  /**
22  * Get quaternion.
23  *
24  * \param Q quaternion
25  * \return quaternion
26  */
28  {
29  return JQuaternion3D(Q.a, Q.b, Q.c, Q.d);
30  }
31 
32 
33  /**
34  * Get quaternion.
35  *
36  * \param Q quaternion
37  * \return quaternion
38  */
40  {
41  return JQuaternion(Q.getA(), Q.getB(), Q.getC(), Q.getD());
42  }
43 
44 
45  /**
46  * Get model.
47  *
48  * \param evt event
49  * \return model
50  */
51  inline JModel getModel(const JEvt& evt)
52  {
53  JModel model;
54 
55  if (evt.size() >= 2) {
56  model.Q0 = getQuaternion(evt[0]);
57  model.Q1 = getQuaternion(evt[1]);
58  }
59 
60  return model;
61  }
62 
63 
64  /**
65  * Get event.
66  *
67  * \param header header
68  * \param model model
69  * \return event
70  */
71  inline JEvt getEvt(const JHead& header,
72  const JModel& model)
73  {
74  JEvt evt(header);
75 
76  evt.push_back(getQuaternion(model.Q0));
77  evt.push_back(getQuaternion(model.Q1));
78 
79  return evt;
80  }
81 }
82 
83 #endif
JModel getModel(const JEvt &evt)
Get model.
Q(UTCMax_s-UTCMin_s)-livetime_s
double getB() const
Get b value.
Compass single fit.
JQuaternion3D getQuaternion(const JQuaternion &Q)
Get quaternion.
JQuaternion3D Q0
tilt
double getD() const
Get d value.
Data structure for unit quaternion in three dimensions.
JQuaternion3D Q1
twist
double getC() const
Get c value.
JEvt getEvt(const JHead &header, const JModel &model)
Get event.
double getA() const
Get a value.
Compass event data types.
Compass event header.