Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JAcoustics/JHit.hh
Go to the documentation of this file.
1#ifndef __JACOUSTICS__JHIT__
2#define __JACOUSTICS__JHIT__
3
4#include <ostream>
5
7#include "JLang/JManip.hh"
8
11#include "JAcoustics/JEKey.hh"
12
13
14/**
15 * \file
16 *
17 * Acoustic hit.
18 * \author mdejong
19 */
20namespace JACOUSTICS {}
21namespace JPP { using namespace JACOUSTICS; }
22
23namespace JACOUSTICS {
24
27
28 /**
29 * Acoustics hit.
30 */
31 struct JHit :
32 public JEmitter,
33 public JCounter,
34 public JLocation
35 {
36 /**
37 * Default constructor.
38 */
40 {}
41
42
43 /**
44 * Constructor.
45 *
46 * \param emitter emitter
47 * \param counter counter
48 * \param location receiver location
49 * \param toa_s time-of-arrival [s]
50 * \param sigma_s resolution [s]
51 * \param weight weight
52 */
53 JHit(const JEmitter& emitter,
54 const JCounter& counter,
55 const JLocation& location,
56 const double toa_s,
57 const double sigma_s,
58 const double weight) :
59 JEmitter(emitter),
61 JLocation(location),
62 toa(toa_s),
63 sigma(sigma_s),
65 {}
66
67
68 /**
69 * Get emitter hash key of this hit.
70 *
71 * \return hash key
72 */
73 JEKey getEKey() const
74 {
75 return JEKey(getID(), getCounter());
76 }
77
78
79 /**
80 * Get expectation value of time-of-arrival.
81 *
82 * \return time-of-arrival [s]
83 */
84 double getValue() const
85 {
86 return toa;
87 }
88
89
90 /**
91 * Get resolution of time-of-arrival.
92 *
93 * \return resulution [s]
94 */
95 double getSigma() const
96 {
97 return sigma;
98 }
99
100
101 /**
102 * Get weight.
103 *
104 * \return weight
105 */
106 double getWeight() const
107 {
108 return weight;
109 }
110
111
112 /**
113 * Write hit to output stream.
114 *
115 * \param out output stream
116 * \param hit hit
117 * \return output stream
118 */
119 friend inline std::ostream& operator<<(std::ostream& out, const JHit& hit)
120 {
121 using namespace std;
122 using namespace JPP;
123
124 out << setw(3) << hit.getID() << ' '
125 << setw(3) << hit.getCounter() << ' '
126 << getLabel(hit.getLocation())
127 << FIXED(20,5) << hit.getValue() << ' '
128 << FIXED(9,6) << hit.getSigma() << ' '
129 << FIXED(6,2) << hit.getWeight();
130
131 return out;
132 }
133
134
135 protected:
136 double toa;
137 double sigma;
138 double weight;
139 };
140}
141
142#endif
Acoustic counter.
Emitter hash key.
Acoustic emitter.
Logical location of module.
I/O manipulators.
Logical location of module.
Definition JLocation.hh:40
const JLocation & getLocation() const
Get location.
Definition JLocation.hh:70
Data structure for vector in three dimensions.
Definition JVector3D.hh:36
int getID() const
Get identifier.
Definition JObjectID.hh:50
Auxiliary classes and methods for acoustic position calibration.
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
Definition JLocation.hh:247
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448
int getCounter() const
Get counter.
Emitter key.
Definition JEKey.hh:36
Acoustic emitter.
Definition JEmitter.hh:30
Acoustics hit.
friend std::ostream & operator<<(std::ostream &out, const JHit &hit)
Write hit to output stream.
JHit()
Default constructor.
double getSigma() const
Get resolution of time-of-arrival.
JHit(const JEmitter &emitter, const JCounter &counter, const JLocation &location, const double toa_s, const double sigma_s, const double weight)
Constructor.
double getValue() const
Get expectation value of time-of-arrival.
double getWeight() const
Get weight.
JEKey getEKey() const
Get emitter hash key of this hit.