Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JACOUSTICS::JKatoomba< JEstimator > Struct Reference

Template specialisation of fit function of acoustic model based on linear approximation. More...

#include <JKatoomba_t.hh>

Inheritance diagram for JACOUSTICS::JKatoomba< JEstimator >:
JACOUSTICS::JKatoomba< JMinimiser_t >

Public Member Functions

 JKatoomba (const JGeometry &geometry, const JSoundVelocity &velocity, const int option)
 Constructor The option corresponds to the use of fit parameters in the model of the detector geometry.
 
template<class T >
JModeloperator() (T __begin, T __end) const
 Get start values of string parameters.
 

Static Public Attributes

static JMatrix_t MATRIX_INVERSION
 

Private Member Functions

template<class T , class JMatrixNS_t >
JModelevaluate (T __begin, T __end, JMatrixNS_t &V) const
 Get start values of string parameters.
 

Private Attributes

JMatrixNS ldu
 
TMatrixDS svd
 
JMATH::JVectorND Y
 
JModel value
 

Detailed Description

Template specialisation of fit function of acoustic model based on linear approximation.

Definition at line 436 of file JKatoomba_t.hh.

Constructor & Destructor Documentation

◆ JKatoomba()

JACOUSTICS::JKatoomba< JEstimator >::JKatoomba ( const JGeometry & geometry,
const JSoundVelocity & velocity,
const int option )
inline

Constructor The option corresponds to the use of fit parameters in the model of the detector geometry.


A negative implies that all strings in the detector use common fit parameters.

Parameters
geometrydetector geometry
velocitysound velocity
optionoption

Definition at line 448 of file JKatoomba_t.hh.

450 :
451 JKatoomba<>(geometry, velocity, option)
452 {};
Template definition of fit function of acoustic model.

Member Function Documentation

◆ operator()()

template<class T >
JModel & JACOUSTICS::JKatoomba< JEstimator >::operator() ( T __begin,
T __end ) const
inline

Get start values of string parameters.


Note that this method may throw an exception.

Parameters
__beginbegin of hits
__endend of hits
Returns
model

Definition at line 464 of file JKatoomba_t.hh.

465 {
466 switch (MATRIX_INVERSION) {
467
468 case SVD_t:
469 return this->evaluate(__begin, __end, svd);
470
471 case LDU_t:
472 return this->evaluate(__begin, __end, ldu);
473
474 default:
475 THROW(JValueOutOfRange, "Invalid matrix type " << MATRIX_INVERSION);
476 }
477 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
JModel & evaluate(T __begin, T __end, JMatrixNS_t &V) const
Get start values of string parameters.

◆ evaluate()

template<class T , class JMatrixNS_t >
JModel & JACOUSTICS::JKatoomba< JEstimator >::evaluate ( T __begin,
T __end,
JMatrixNS_t & V ) const
inlineprivate

Get start values of string parameters.


Note that this method may throw an exception.

Parameters
__beginbegin of hits
__endend of hits
Vmatrix
Returns
model

Definition at line 498 of file JKatoomba_t.hh.

499 {
500 using namespace std;
501 using namespace JPP;
502 using namespace JGEOMETRY;
503
504 value = JModel(__begin, __end); // set up global model according data
505
506 if (this->option == JMODEL::FIT_EMITTERS_ONLY_t)
508 else
510
511 H_t H; // H-equation as per hit
512 I_t i; // indices of H-equation in global model
513
514 const size_t N = value.getN();
515
516 V.resize(N);
517 Y.resize(N);
518
519 V.reset();
520 Y.reset();
521
522 for (T hit = __begin; hit != __end; ++hit) {
523
524 const JString& string = geometry[hit->getString()];
525 const JPosition3D position = string.getPosition(hit->getFloor());
526 const double Vi = velocity.getInverseVelocity(hit->getDistance(position), hit->getZ(), position.getZ());
527
528 const double h1 = string.getHeight(hit->getFloor());
529 const JPosition3D p1 = string.getPosition() - hit->getPosition();
530 const double ds = sqrt(p1.getLengthSquared() + h1*h1 + 2.0*p1.getZ()*h1);
531 const double y = hit->getValue() - Vi*ds;
532 const double W = sqrt(hit->getWeight());
533
534 H.t1 = W * 1.0;
535 H.tx = W * Vi * p1.getX() * h1 / ds;
536 H.ty = W * Vi * p1.getY() * h1 / ds;
537
538 i.t1 = value.getIndex(hit->getEKey(), &H_t::t1);
539 i.tx = value.getIndex(hit->getString(), &H_t::tx);
540 i.ty = value.getIndex(hit->getString(), &H_t::ty);
541
542 V(i.t1, i.t1) += H.t1 * H.t1;
543
544 Y[i.t1] += W * H.t1 * y;
545
546 if (hit->getFloor() != 0) {
547
548 if (this->option != JMODEL::FIT_EMITTERS_ONLY_t) {
549
550 V(i.t1, i.tx) += H.t1 * H.tx; V(i.t1, i.ty) += H.t1 * H.ty;
551 V(i.tx, i.t1) += H.tx * H.t1; V(i.ty, i.t1) += H.ty * H.t1;
552
553 V(i.tx, i.tx) += H.tx * H.tx; V(i.tx, i.ty) += H.tx * H.ty;
554 V(i.ty, i.tx) += H.ty * H.tx; V(i.ty, i.ty) += H.ty * H.ty;
555
556 Y[i.tx] += W * H.tx * y;
557 Y[i.ty] += W * H.ty * y;
558 }
559 }
560 }
561
562 // solve A x = b
563
564 V.solve(Y);
565
566 for (size_t row = 0; row != N; ++row) {
567 value[row] += Y[row];
568 }
569
570 return value;
571 }
TPaveText * p1
Data structure for position in three dimensions.
const JPosition3D & getPosition() const
Get position.
double getZ() const
Get z position.
Definition JVector3D.hh:115
Wrapper class around STL string class.
Definition JString.hh:29
@ FIT_EMITTERS_AND_STRINGS_1st_ORDER_t
fit times of emission of emitters and tilt angles of strings
@ FIT_EMITTERS_ONLY_t
fit only times of emission of emitters
static const double H
Planck constant [eV s].
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Model for fit to acoustics data.
void setOption(const int option)
Set fit option.
size_t getN() const
Get number of fit parameters.
size_t getIndex(int id, double JString::*p) const
Get index of fit parameter for given string.
void reset()
Reset.
Definition JVectorND.hh:45

Member Data Documentation

◆ MATRIX_INVERSION

JMatrix_t JACOUSTICS::JKatoomba< JEstimator >::MATRIX_INVERSION
static

Definition at line 480 of file JKatoomba_t.hh.

◆ ldu

JMatrixNS JACOUSTICS::JKatoomba< JEstimator >::ldu
mutableprivate

Definition at line 483 of file JKatoomba_t.hh.

◆ svd

TMatrixDS JACOUSTICS::JKatoomba< JEstimator >::svd
mutableprivate

Definition at line 484 of file JKatoomba_t.hh.

◆ Y

Definition at line 486 of file JKatoomba_t.hh.

◆ value

JModel JACOUSTICS::JKatoomba< JEstimator >::value
mutableprivate

Definition at line 574 of file JKatoomba_t.hh.


The documentation for this struct was generated from the following file: