Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
JACOUSTICS Namespace Reference

Auxiliary classes and methods for acoustic position calibration. More...

Namespaces

 JGEOMETRY
 Auxiliary namespace to encapsulate different geometries.
 
 JMODEL
 Auxiliary namespace to encapsulate different model parameters.
 

Classes

struct  JAbstractSoundVelocity
 Interface for depth dependend velocity of sound. More...
 
struct  JAttenuationLength
 Auxiliary data structure for calculation of attenuation length. More...
 
struct  JWaveform
 Utility class for emitter power and frequency. More...
 
struct  JCounter
 Acoustic counter. More...
 
struct  JEKey
 Emitter key. More...
 
struct  JEmitter
 Acoustic emitter. More...
 
struct  JEmitterID
 Auxiliary class for emitter identification. More...
 
struct  JEvent
 Acoustic event. More...
 
struct  JEventOverlap
 Match of two events considering overlap in time. More...
 
struct  JFit
 Acoustic single fit. More...
 
struct  JHead
 Acoustic event header. More...
 
struct  JEvt
 Acoustic event fit. More...
 
struct  JFitParameters
 Fit parameters. More...
 
struct  JPDFGauss
 Custom probability density function of time-of-arrival. More...
 
struct  JHit
 Acoustics hit. More...
 
struct  JKatoomba_t
 Auxiliary base class for fit function of acoustic model. More...
 
struct  JKatoomba
 Template definition of fit function of acoustic model. More...
 
struct  JKatoomba< JAbstractMinimiser >
 Template specialisation of fit function of acoustic model based on JAbstractMinimiser minimiser. More...
 
struct  JKatoomba< JEstimator >
 Template specialisation of fit function of acoustic model based on linear approximation. More...
 
struct  JKatoomba< JSimplex >
 Template specialisation of fit function of acoustic model based on JSimplex minimiser. More...
 
class  JGandalf
 
struct  JKatoomba< JGandalf >
 Template specialisation of fit function of acoustic model based on JGandalf minimiser. More...
 
struct  JMechanics
 Auxiliary data structure for parameters of mechanical model. More...
 
struct  JDetectorMechanics
 Auxiliary data structure for mechanical model parameters of strings in a given detector. More...
 
struct  JModel
 Model for fit to acoustics data. More...
 
struct  JNarrabri
 Dynamic position calibration. More...
 
struct  JReceiver
 Acoustic receiver. More...
 
struct  JSoundVelocity
 Implementation for depth dependend velocity of sound. More...
 
struct  JTransceiver
 Acoustic transceiver. More...
 
struct  JTransmission
 Acoustic transmission. More...
 
struct  JTransmission_t
 Acoustic transmission identifier. More...
 
class  JTriggerOutput
 Set of acoustics events. More...
 
struct  JTriggerParameters
 Trigger parameters. More...
 
struct  hit_type
 Acoustic hit. More...
 
class  JMatch3D
 3D match criterion for acoustic signals. More...
 

Typedefs

typedef JGEOMETRY::JDetector JGeometry
 Type definition of detector geometry. More...
 

Enumerations

enum  JFit_t { linear_t = 0, simplex_t, gandalf_t }
 Enumeration for fit algorithms. More...
 

Functions

double getQ (const double D_m, const double f_kHz, const double d_m)
 Get relative quality for given frequency at given distance. More...
 
template<class T , class JTypename_t , class JComparator_t >
JVector3D getPosition (T __begin, T __end, const JPredicate< JTypename_t, JComparator_t > &predicate)
 Get position from element in data which corresponds to given predicate. More...
 
template<class T , class JTypename_t , class JComparator_t >
JVector3D getPosition (T __begin, T __end, const JPredicate< JTypename_t, JComparator_t > &predicate, const JVector3D &position)
 Get position from element in data which corresponds to given predicate. More...
 
double getUNIXTime (const KM3NETDAQ::JDAQChronometer &chronometer)
 Get UNIX time of given DAQ object. More...
 
static bool operator< (const JCounter &first, const JCounter &second)
 Less-than operator for two counters. More...
 
static bool operator== (const JCounter &first, const JCounter &second)
 Equals operator for two counters. More...
 
bool operator< (const JEvent &first, const JEvent &second)
 Less than operator for acoustics events. More...
 
bool operator< (const JHead &first, const JHead &second)
 Less than operator for acoustics event headers. More...
 
double getQuality (const double chi2, const int NDF)
 Get quality of fit. More...
 
template<class T >
size_t getNumberOfEmitters (T __begin, T __end)
 Get number of emitters. More...
 
JMODEL::JString getModel (const JFit &fit)
 Get model parameters of string. More...
 
JFit getFit (const int id, const JMODEL::JString &string)
 Get fit parameters of string. More...
 
JModel getModel (const JEvt &evt)
 Get model of detector. More...
 
JEvt getEvt (const JHead &header, const JModel &model)
 Get event. More...
 
JTreeParameters getTreeParameters (const JType< JEvent > &type)
 
JTreeParameters getTreeParameters (const JType< JEvt > &type)
 
static bool operator< (const JTransmission &first, const JTransmission &second)
 Less-than operator for two transmissions. More...
 
static bool operator== (const JTransmission &first, const JTransmission &second)
 Equals operator for two transmissions. More...
 

Variables

static const double TOAMIN_S = 0.0000000
 Minimal allowed time-of-arrival [s]. More...
 
static const double TOAMAX_S = 0.6310912
 Maximal allowed time-of-arrival [s]. More...
 
static const JAttenuationLength getAttenuationLength (13.2, 38.0, 8.0)
 Function object to calculate attenutation length. More...
 
static JEmitterID getEmitterID
 Function object for emitter identification. More...
 
static JDetectorMechanics getMechanics
 Function object to get string mechanics. More...
 
static const JSoundVelocity getSoundVelocity (1541.0,-17.0e-3,-2000.0)
 Function object for velocity of sound. More...
 

Detailed Description

Auxiliary classes and methods for acoustic position calibration.

Author
mdejong

Typedef Documentation

Type definition of detector geometry.

Definition at line 593 of file JGeometry.hh.

Enumeration Type Documentation

Enumeration for fit algorithms.

Enumerator
linear_t 

Linear fit.

simplex_t 

Simplex fit.

gandalf_t 

Gandalf fit.

Definition at line 46 of file JKatoomba.hh.

46  {
47  linear_t = 0, //!< Linear fit
48  simplex_t, //!< Simplex fit
49  gandalf_t //!< Gandalf fit
50  };
Linear fit.
Definition: JKatoomba.hh:47
Simplex fit.
Definition: JKatoomba.hh:48
Gandalf fit.
Definition: JKatoomba.hh:49

Function Documentation

double JACOUSTICS::getQ ( const double  D_m,
const double  f_kHz,
const double  d_m 
)
inline

Get relative quality for given frequency at given distance.

Parameters
D_mdepth [m]
f_kHzfrequency [kHz]
d_mdistance [m]
Returns
quality

Definition at line 92 of file JAcousticsSupportkit.hh.

95  {
96  return exp(-0.5 * d_m / getAttenuationLength(D_m, f_kHz)) / d_m;
97  }
static const JAttenuationLength getAttenuationLength(13.2, 38.0, 8.0)
Function object to calculate attenutation length.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
template<class T , class JTypename_t , class JComparator_t >
JVector3D JACOUSTICS::getPosition ( T  __begin,
T  __end,
const JPredicate< JTypename_t, JComparator_t > &  predicate 
)
inline

Get position from element in data which corresponds to given predicate.

Parameters
__beginbegin of data
__endend of data
predicatepredicate
Returns
position

Definition at line 37 of file JAcousticsToolkit.hh.

40  {
41  T p = std::find_if(__begin, __end, predicate);
42 
43  if (p != __end)
44  return p->getPosition();
45  else
46  THROW(JValueOutOfRange, "No element in container which corresponds to given predicate.");
47  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:162
template<class T , class JTypename_t , class JComparator_t >
JVector3D JACOUSTICS::getPosition ( T  __begin,
T  __end,
const JPredicate< JTypename_t, JComparator_t > &  predicate,
const JVector3D position 
)
inline

Get position from element in data which corresponds to given predicate.

Parameters
__beginbegin of data
__endend of data
predicatepredicate
positiondefault position
Returns
position

Definition at line 60 of file JAcousticsToolkit.hh.

64  {
65  try {
66  return getPosition(__begin, __end, predicate);
67  }
68  catch(const std::exception&) {
69  return position;
70  }
71  }
JPosition3D getPosition(const Vec &pos)
Get position.
double JACOUSTICS::getUNIXTime ( const KM3NETDAQ::JDAQChronometer chronometer)
inline

Get UNIX time of given DAQ object.

Parameters
chronometerchronometer
Returns
UNIX time [s]

Definition at line 80 of file JAcousticsToolkit.hh.

81  {
82  return chronometer.getTimesliceStart().getTimeNanoSecond() * 1.0e-9;
83  }
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
double getTimeNanoSecond() const
Get time (limited to 16 ns cycles).
static bool JACOUSTICS::operator< ( const JCounter first,
const JCounter second 
)
inlinestatic

Less-than operator for two counters.

Parameters
firstfirst counter
secondsecond counter
Returns
true if first counter less than second; else false

Definition at line 65 of file JAcoustics/JCounter.hh.

66  {
67  return first.getCounter() < second.getCounter();
68  }
int getCounter() const
Get counter.
static bool JACOUSTICS::operator== ( const JCounter first,
const JCounter second 
)
inlinestatic

Equals operator for two counters.

Parameters
firstfirst counter
secondsecond counter
Returns
true if first counter equal to second; else false

Definition at line 78 of file JAcoustics/JCounter.hh.

79  {
80  return first.getCounter() == second.getCounter();
81  }
int getCounter() const
Get counter.
bool JACOUSTICS::operator< ( const JEvent first,
const JEvent second 
)
inline

Less than operator for acoustics events.

The less than operator is applied to the first hit in the events.
If there are no hits in either event, the counter of the events is used.

Parameters
firstfirst event
secondsecond event
Returns
true if first event earliear than second; else false

Definition at line 261 of file JAcoustics/JEvent.hh.

262  {
263  if (!first.empty() && !second.empty())
264  return first.begin()->getToE() < second.begin()->getToE();
265  else
266  return first.getCounter() < second.getCounter();
267  }
int getCounter() const
Get counter.
bool JACOUSTICS::operator< ( const JHead first,
const JHead second 
)
inline

Less than operator for acoustics event headers.

The less than operator is applied to the object identifier, the UNIX start time and the UNIX stop time, respectively.

Parameters
firstfirst header
secondsecond header
Returns
true if first event header earliear than second; else false

Definition at line 185 of file JAcoustics/JEvt.hh.

186  {
187  if (first.oid == second.oid) {
188 
189  if (first.UNIXTimeStart == second.UNIXTimeStart) {
190 
191  return first.UNIXTimeStop < second.UNIXTimeStop;
192 
193  } else {
194 
195  return first.UNIXTimeStart < second.UNIXTimeStart;
196  }
197 
198  } else {
199 
200  return first.oid < second.oid;
201  }
202  }
std::string oid
detector identifier
double UNIXTimeStop
stop time
double UNIXTimeStart
start time
double JACOUSTICS::getQuality ( const double  chi2,
const int  NDF 
)
inline

Get quality of fit.


The larger the quality, the better the fit.

Parameters
chi2chi2
NDFnumber of degrees of freedom
Returns
quality

Definition at line 29 of file JAcoustics/JEvtToolkit.hh.

30  {
31  return NDF - 0.25 * chi2 / NDF;
32  }
template<class T >
size_t JACOUSTICS::getNumberOfEmitters ( T  __begin,
T  __end 
)
inline

Get number of emitters.

Parameters
__beginbegin of events
__endend of events
Returns
number of emitters

Definition at line 43 of file JAcoustics/JEvtToolkit.hh.

44  {
45  std::set<int> buffer;
46 
47  for (T i = __begin; i != __end; ++i) {
48  if (!i->empty()) {
49  buffer.insert(i->getID());
50  }
51  }
52 
53  return buffer.size();
54  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JMODEL::JString JACOUSTICS::getModel ( const JFit fit)
inline

Get model parameters of string.

Parameters
fitfit parameters
Returns
model parameters

Definition at line 63 of file JAcoustics/JEvtToolkit.hh.

64  {
65  return JMODEL::JString(fit.tx, fit.ty, fit.tx2, fit.ty2, fit.vs);
66  }
double ty
slope dy/dz
double tx
slope dx/dz
double ty2
2nd order correction of slope dy/dz
double vs
stretching factor
double tx2
2nd order correction of slope dx/dz
JFit JACOUSTICS::getFit ( const int  id,
const JMODEL::JString string 
)
inline

Get fit parameters of string.

Parameters
ididentifier
stringmodel parameters
Returns
fit parameters

Definition at line 76 of file JAcoustics/JEvtToolkit.hh.

77  {
78  return JFit(id, string.tx, string.ty, string.tx2, string.ty2, string.vs);
79  }
JModel JACOUSTICS::getModel ( const JEvt evt)
inline

Get model of detector.

Parameters
evtevent
Returns
model

Definition at line 88 of file JAcoustics/JEvtToolkit.hh.

89  {
90  JModel model;
91 
92  for (JEvt::const_iterator i = evt.begin(); i != evt.end(); ++i) {
93  model.string[i->id] = getModel(*i);
94  }
95 
96  return model;
97  }
Model for fit to acoustics data.
JMODEL::JString getModel(const JFit &fit)
Get model parameters of string.
JACOUSTICS::JModel::string_type string
JEvt JACOUSTICS::getEvt ( const JHead header,
const JModel model 
)
inline

Get event.

Parameters
headerheader
modelmodel
Returns
event

Definition at line 107 of file JAcoustics/JEvtToolkit.hh.

109  {
110  JEvt evt(header);
111 
112  for (JModel::string_type::const_iterator i = model.string.begin(); i != model.string.end(); ++i) {
113  evt.push_back(getFit(i->first, i->second));
114  }
115 
116  return evt;
117  }
Acoustic event fit.
JACOUSTICS::JModel::string_type string
JFit getFit(const int id, const JMODEL::JString &string)
Get fit parameters of string.
JTreeParameters JACOUSTICS::getTreeParameters ( const JType< JEvent > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 34 of file JAcoustics/JSupport.hh.

35  {
36  return JTreeParameters("ACOUSTICS", "acoustics_event", "", 2, 65536, 2);
37  }
Data structure for TTree parameters.
JTreeParameters JACOUSTICS::getTreeParameters ( const JType< JEvt > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

Definition at line 43 of file JAcoustics/JSupport.hh.

44  {
45  return JTreeParameters("ACOUSTICS_FIT", "acoustics_fit", "", 2, 65536, 2);
46  }
Data structure for TTree parameters.
static bool JACOUSTICS::operator< ( const JTransmission first,
const JTransmission second 
)
inlinestatic

Less-than operator for two transmissions.

The less-than operator is first applied to the time-of-emission and then to the identifier.

Parameters
firstfirst transmission
secondsecond transmission
Returns
true if first transmission earlier than second; else false

Definition at line 228 of file JTransmission.hh.

229  {
230  if (first.getToE() == second.getToE())
231  return first.getID() < second.getID();
232  else
233  return first.getToE() < second.getToE();
234  }
double getToE() const
Get estimated time of emission.
int getID() const
Get identifier.
static bool JACOUSTICS::operator== ( const JTransmission first,
const JTransmission second 
)
inlinestatic

Equals operator for two transmissions.

The equal operator is applied to the time-of-emission and the identifier.

Parameters
firstfirst transmission
secondsecond transmission
Returns
true if first transmission equal to second; else false

Definition at line 246 of file JTransmission.hh.

247  {
248  return (first.getID() == second.getID() &&
249  first.getToE() == second.getToE());
250  }
double getToE() const
Get estimated time of emission.
int getID() const
Get identifier.

Variable Documentation

const double JACOUSTICS::TOAMIN_S = 0.0000000
static

Minimal allowed time-of-arrival [s].

Definition at line 20 of file JAcousticsSupportkit.hh.

const double JACOUSTICS::TOAMAX_S = 0.6310912
static

Maximal allowed time-of-arrival [s].

Definition at line 21 of file JAcousticsSupportkit.hh.

const JAttenuationLength JACOUSTICS::getAttenuationLength(13.2,38.0,8.0)
static

Function object to calculate attenutation length.

JEmitterID JACOUSTICS::getEmitterID
static

Function object for emitter identification.

Definition at line 119 of file JEmitterID.hh.

JDetectorMechanics JACOUSTICS::getMechanics
static

Function object to get string mechanics.

Definition at line 243 of file JMechanics.hh.

const JSoundVelocity JACOUSTICS::getSoundVelocity(1541.0,-17.0e-3,-2000.0)
static

Function object for velocity of sound.