Jpp  18.0.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JSuperEvtToolkit.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JSUPEREVTTOOLKIT__
2 #define __JACOUSTICS__JSUPEREVTTOOLKIT__
3 
4 #include "JAcoustics/JModel.hh"
5 #include "JAcoustics/JEvt.hh"
8 
9 
10 /**
11  * \file
12  *
13  * Acoustic super event fit toolkit.
14  * \author mdejong
15  */
16 namespace JACOUSTICS {}
17 namespace JPP { using namespace JACOUSTICS; }
18 
19 namespace JACOUSTICS {
20 
21  /**
22  * Get model of detector.
23  *
24  * \param evt super event
25  * \return model
26  */
27  inline JModel getModel(const JSuperEvt& evt)
28  {
29  JModel model = getModel(static_cast<const JEvt&>(evt));
30 
31  for (JSuperEvt::tx_type::const_iterator i = evt.tx.begin(); i != evt.tx.end(); ++i) {
32  model.emission[JEKey(i->id,i->counter)] = JMODEL::JEmission(i->toe);
33  }
34 
35  return model;
36  }
37 
38 
39  /**
40  * Get super event.
41  *
42  * \param header header
43  * \param model model
44  * \param begin begin of hit data
45  * \param end end of hit data
46  * \return event
47  */
48  template<class T>
49  inline JSuperEvt getSuperEvt(const JHead& header,
50  const JModel& model,
51  T begin,
52  T end)
53  {
54  JSuperEvt evt(getEvt(header, model));
55 
56  for (JModel::emission_type::const_iterator i = model.emission.begin(); i != model.emission.end(); ++i) {
57  evt.tx.push_back(JSuperEvt::tx_t(i->first.getID(), i->first.getCounter(), i->second.t1));
58  }
59 
60  for (T i = begin; i != end; ++i) {
61  evt.rx.push_back(JSuperEvt::rx_t(i->getID(), i->getCounter(), i->getString(), i->getFloor(), i->getValue(), i->getWeight()));
62  }
63 
64  return evt;
65  }
66 }
67 
68 #endif
Acoustics transmission.
Definition: JSuperEvt.hh:77
JEvt getEvt(const JHead &header, const JModel &model)
Get event.
JSuperEvt getSuperEvt(const JHead &header, const JModel &model, T begin, T end)
Get super event.
Model for fit to acoustics data.
Acoustic event fit toolkit.
Acoustic event header.
Acoustic event fit.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JACOUSTICS::JModel::emission_type emission
JMODEL::JString getModel(const JFit &fit)
Get model parameters of string.
Acoustic super event fit.
Definition: JSuperEvt.hh:30
Emitter key.
Definition: JEKey.hh:32
Acoustics emission.
Definition: JSuperEvt.hh:54
container_type::const_iterator const_iterator
Definition: JHashMap.hh:86
Model for fit to acoutsics data.
Acoustic event fit.