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
JSuperEvt.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JSUPEREVT__
2 #define __JACOUSTICS__JSUPEREVT__
3 
4 #include <string>
5 #include <ostream>
6 #include <iomanip>
7 #include <vector>
8 
9 #include <TROOT.h>
10 #include <TObject.h>
11 
12 #include "JLang/JManip.hh"
13 #include "JAcoustics/JEvt.hh"
14 
15 
16 /**
17  * \file
18  *
19  * Acoustic event fit.
20  * \author mdejong
21  */
22 namespace JACOUSTICS {}
23 namespace JPP { using namespace JACOUSTICS; }
24 
25 namespace JACOUSTICS {
26 
27  /**
28  * Acoustic super event fit.
29  */
30  struct JSuperEvt :
31  public JEvt
32  {
33  /**
34  * Default constructor.
35  */
37  JEvt()
38  {}
39 
40 
41  /**
42  * Constructor.
43  *
44  * \param event event
45  */
46  JSuperEvt(const JEvt& event) :
47  JEvt(event)
48  {}
49 
50 
51  /**
52  * Acoustics emission.
53  */
54  struct tx_t {
55  tx_t() :
56  id (-1),
57  counter(-1),
58  toe (0.0)
59  {}
60 
61  tx_t(const int id,
62  const int counter,
63  const double toe) :
64  id (id),
65  counter(counter),
66  toe (toe)
67  {}
68 
69  int id;
70  int counter;
71  double toe;
72  };
73 
74  /**
75  * Acoustics transmission.
76  */
77  struct rx_t {
78  rx_t() :
79  id (-1),
80  counter(-1),
81  string (-1),
82  floor (-1),
83  toa (0.0),
84  weight (0.0)
85  {}
86 
87  rx_t(const int id,
88  const int counter,
89  const int string,
90  const int floor,
91  const double toa,
92  const double weight) :
93  id (id),
94  counter(counter),
95  string (string),
96  floor (floor),
97  toa (toa),
98  weight (weight)
99  {}
100 
101  int id;
102  int counter;
103  int string;
104  int floor;
105  double toa;
106  double weight;
107  };
108 
111 
114 
115  /**
116  * Write super event to output.
117  *
118  * \param out output stream
119  * \param event super event
120  * \return output stream
121  */
122  friend inline std::ostream& operator<<(std::ostream& out, const JSuperEvt& event)
123  {
124  using namespace std;
125 
126  out << static_cast<const JEvt&>(event);
127 
128  for (JSuperEvt::tx_type::const_iterator i = event.tx.begin(); i != event.tx.end(); ++i) {
129  out << setw(2) << i->id << ' '
130  << setw(6) << i->counter << ' '
131  << FIXED(20,6) << i->toe << endl;
132  }
133 
134  for (JSuperEvt::rx_type::const_iterator i = event.rx.begin(); i != event.rx.end(); ++i) {
135  out << setw(2) << i->id << ' '
136  << setw(6) << i->counter << ' '
137  << setw(4) << i->string << ' '
138  << setw(2) << i->floor << ' '
139  << FIXED(20,6) << i->toa << ' '
140  << FIXED( 5,2) << i->weight << endl;
141  }
142 
143  return out;
144  }
145 
146  ClassDef(JSuperEvt, 1);
147  };
148 }
149 
150 #endif
Acoustics transmission.
Definition: JSuperEvt.hh:77
rx_t(const int id, const int counter, const int string, const int floor, const double toa, const double weight)
Definition: JSuperEvt.hh:87
ClassDef(JSuperEvt, 1)
friend std::ostream & operator<<(std::ostream &out, const JSuperEvt &event)
Write super event to output.
Definition: JSuperEvt.hh:122
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:446
tx_t(const int id, const int counter, const double toe)
Definition: JSuperEvt.hh:61
Acoustic event fit.
JSuperEvt()
Default constructor.
Definition: JSuperEvt.hh:36
I/O manipulators.
Acoustic super event fit.
Definition: JSuperEvt.hh:30
std::vector< rx_t > rx_type
Definition: JSuperEvt.hh:110
Acoustics emission.
Definition: JSuperEvt.hh:54
Acoustic event fit.
JSuperEvt(const JEvt &event)
Constructor.
Definition: JSuperEvt.hh:46
std::vector< tx_t > tx_type
Definition: JSuperEvt.hh:109