Jpp  18.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  JWeight
 Auxiliary data structure to unify weights of acoustics data according to the number of pings per emitter. 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  getModel
 Auxiliary data structure to convert event to model. More...
 
struct  getEvt
 Auxiliary data structure to convert model to event. More...
 
struct  JFitParameters
 Fit parameters. More...
 
class  JFremantle
 Thread pool for global fits. More...
 
struct  JGlobalfit
 Global fit of prameterised detector geometry to acoustics data. More...
 
struct  JHit
 Acoustics hit. More...
 
struct  JKatoomba
 Template definition of fit function of acoustic model. More...
 
struct  JKatoomba< JType >
 Auxiliary base class for fit function of acoustic model. More...
 
struct  JKatoomba< JAbstractMinimiser >
 Template specialisation of fit function of acoustic model based on JAbstractMinimiser minimiser. More...
 
struct  TMatrixDS
 Auxiliary data structure for compatibility of symmetric matrix. 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
 Place holder for custom implementation. More...
 
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...
 
class  JPlatypus
 Thread pool for global fits. More...
 
struct  JReceiver
 Acoustic receiver. More...
 
struct  JSoundVelocity
 Implementation for depth dependend velocity of sound. More...
 
struct  JSuperEvt
 Acoustic super event fit. More...
 
struct  getSuperEvt
 Auxiliary data structure to convert model to super event. More...
 
struct  JFilenames
 Auxiliary data structure for handling file names. More...
 
struct  JSetup
 Auxiliary data structure for setup of complete system. More...
 
struct  JSydney
 Main class for pre-calibration using acoustics data. 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 std::vector< JHitdata_type
 
typedef JGEOMETRY::JDetector JGeometry
 Type definition of detector geometry. More...
 
typedef JTOOLS::JHashMap< int,
JEmitter
JEmitters
 
typedef JContainer
< std::vector< JTripod > > 
tripods_container
 
typedef JContainer
< std::vector< JTransmitter > > 
transmitters_container
 
typedef JContainer
< std::vector< JHydrophone > > 
hydrophones_container
 
typedef JContainer< std::set
< JTransmission_t > > 
disable_container
 
typedef JTOOLS::JRange< double > JTimeRange
 Type definition for time range (unit [s]). More...
 

Enumerations

enum  JMatrix_t { SVD_t = 1, LDU_t = 2 }
 Algorithm for matrix inversion. 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 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 getString (const JFit &fit)
 Get model parameters of string. More...
 
JFit getFit (const int id, const JMODEL::JString &string)
 Get fit parameters of string. More...
 
template<class T >
double getWeight (T __begin, T __end)
 Get total weight of data points. More...
 
JTreeParameters getTreeParameters (const JType< JEvent > &type)
 
JTreeParameters getTreeParameters (const JType< JEvt > &type)
 
JTreeParameters getTreeParameters (const JType< JSuperEvt > &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...
 
double getVelocity (const double D, const double S, const double T)
 Get sound velocity according UNESCO equation. 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...
 
static const std::string initialise_t = "initialise"
 initialise More...
 
static const std::string fix_t = "fix"
 fix objects More...
 
static const std::string string_t = "string"
 string More...
 
static const std::string tripod_t = "tripod"
 tripod More...
 
static const std::string stage_t = "stage"
 fit stage More...
 

Detailed Description

Auxiliary classes and methods for acoustic position calibration.

Author
mdejong

Typedef Documentation

Definition at line 29 of file JFremantle_t.hh.

Type definition of detector geometry.

Definition at line 625 of file JGeometry.hh.

Definition at line 29 of file JPlatypus_t.hh.

Definition at line 73 of file JSydney.cc.

Definition at line 74 of file JSydney.cc.

Definition at line 75 of file JSydney.cc.

Definition at line 76 of file JSydney.cc.

Type definition for time range (unit [s]).

Definition at line 19 of file JAcoustics/JTimeRange.hh.

Enumeration Type Documentation

Algorithm for matrix inversion.

Enumerator
SVD_t 

SVD.

LDU_t 

LDU.

Definition at line 334 of file JKatoomba_t.hh.

334  {
335  SVD_t = 1, //!< SVD
336  LDU_t = 2 //!< LDU
337  };

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 132 of file JAcousticsToolkit.hh.

135  {
136  T p = std::find_if(__begin, __end, predicate);
137 
138  if (p != __end)
139  return p->getPosition();
140  else
141  THROW(JValueOutOfRange, "No element in container which corresponds to given predicate.");
142  }
#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 155 of file JAcousticsToolkit.hh.

159  {
160  try {
161  return getPosition(__begin, __end, predicate);
162  }
163  catch(const std::exception&) {
164  return position;
165  }
166  }
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 175 of file JAcousticsToolkit.hh.

176  {
177  return chronometer.getTimesliceStart().getTimeNanoSecond() * 1.0e-9;
178  }
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 100 of file JAcoustics/JCounter.hh.

101  {
102  return first.getCounter() < second.getCounter();
103  }
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 113 of file JAcoustics/JCounter.hh.

114  {
115  return first.getCounter() == second.getCounter();
116  }
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 276 of file JAcoustics/JEvt.hh.

277  {
278  if (first.oid == second.oid) {
279 
280  if (first.UNIXTimeStart == second.UNIXTimeStart) {
281 
282  return first.UNIXTimeStop < second.UNIXTimeStop;
283 
284  } else {
285 
286  return first.UNIXTimeStart < second.UNIXTimeStart;
287  }
288 
289  } else {
290 
291  return first.oid < second.oid;
292  }
293  }
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  }
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
Definition: JMatrixNZ.sh:106
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::getString ( 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  }
std::vector< double > vs
template<class T >
double JACOUSTICS::getWeight ( T  __begin,
T  __end 
)
inline

Get total weight of data points.

Parameters
__beginbegin of data
__endend of data
Returns
total weight

Definition at line 59 of file JKatoomba_t.hh.

60  {
61  double W = 0;
62 
63  for (T i = __begin; i != __end; ++i) {
64  W += i->getWeight();
65  }
66 
67  return W;
68  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JTreeParameters JACOUSTICS::getTreeParameters ( const JType< JEvent > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

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

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

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

45  {
46  return JTreeParameters("ACOUSTICS_FIT", "acoustics_fit", "", 2, 65536, 2);
47  }
Data structure for TTree parameters.
JTreeParameters JACOUSTICS::getTreeParameters ( const JType< JSuperEvt > &  type)
inline
Parameters
typedata type
Returns
TTree parameters

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

54  {
55  return JTreeParameters("ACOUSTICS_SUPER_FIT", "acoustics_super_fit", "", 2, 65536, 2);
56  }
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 288 of file JTransmission.hh.

289  {
290  if (first.getToE() == second.getToE())
291  return first.getID() < second.getID();
292  else
293  return first.getToE() < second.getToE();
294  }
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 306 of file JTransmission.hh.

307  {
308  return (first.getID() == second.getID() &&
309  first.getToE() == second.getToE());
310  }
double getToE() const
Get estimated time of emission.
int getID() const
Get identifier.
double JACOUSTICS::getVelocity ( const double  D,
const double  S,
const double  T 
)
inline

Get sound velocity according UNESCO equation.

Parameters
DDepth [m]
SSalinity [ppk]
TTemperature [C]
Returns
sound velocity [m/s]

Definition at line 23 of file JUNESCO.hh.

24  {
25  return (1448.96
26  + 4.591 * T
27  - 5.304e-2 * T*T
28  + 2.374e-4 * T*T*T
29  + 1.340 * (S - 35)
30  + 1.630e-2 * D
31  + 1.675e-7 * D*D
32  - 1.025e-2 * T * (S - 35)
33  - 7.139e-13 * T*D*D*D);
34  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
do echo Generating $dir eval D
Definition: JDrawLED.sh:53

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 242 of file JMechanics.hh.

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

Function object for velocity of sound.

const std::string JACOUSTICS::initialise_t = "initialise"
static

initialise

Definition at line 79 of file JSydney.cc.

const std::string JACOUSTICS::fix_t = "fix"
static

fix objects

Definition at line 80 of file JSydney.cc.

const std::string JACOUSTICS::string_t = "string"
static

string

Definition at line 81 of file JSydney.cc.

const std::string JACOUSTICS::tripod_t = "tripod"
static

tripod

Definition at line 82 of file JSydney.cc.

const std::string JACOUSTICS::stage_t = "stage"
static

fit stage

Definition at line 83 of file JSydney.cc.