Jpp master_rocky-44-g75b7c4f75
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 437 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 449 of file JKatoomba_t.hh.

451 :
452 JKatoomba<>(geometry, velocity, option)
453 {};
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 465 of file JKatoomba_t.hh.

466 {
467 switch (MATRIX_INVERSION) {
468
469 case SVD_t:
470 return this->evaluate(__begin, __end, svd);
471
472 case LDU_t:
473 return this->evaluate(__begin, __end, ldu);
474
475 default:
476 THROW(JValueOutOfRange, "Invalid matrix type " << MATRIX_INVERSION);
477 }
478 }
#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 499 of file JKatoomba_t.hh.

500 {
501 using namespace std;
502 using namespace JPP;
503 using namespace JGEOMETRY;
504
505 value = JModel(__begin, __end); // set up global model according data
506
507 if (this->option == JMODEL::FIT_EMITTERS_ONLY_t)
509 else
511
512 H_t H; // H-equation as per hit
513 I_t i; // indices of H-equation in global model
514
515 const size_t N = value.getN();
516
517 V.resize(N);
518 Y.resize(N);
519
520 V.reset();
521 Y.reset();
522
523 for (T hit = __begin; hit != __end; ++hit) {
524
525 const JString& string = geometry[hit->getString()];
526 const JPosition3D position = string.getPosition(hit->getFloor());
527 const double Vi = velocity.getInverseVelocity(hit->getDistance(position), hit->getZ(), position.getZ());
528
529 const double h1 = string.getHeight(hit->getFloor());
530 const JPosition3D p1 = string.getPosition() - hit->getPosition();
531 const double ds = sqrt(p1.getLengthSquared() + h1*h1 + 2.0*p1.getZ()*h1);
532 const double y = hit->getValue() - Vi*ds;
533 const double W = sqrt(hit->getWeight());
534
535 H.t1 = W * 1.0;
536 H.tx = W * Vi * p1.getX() * h1 / ds;
537 H.ty = W * Vi * p1.getY() * h1 / ds;
538
539 i.t1 = value.getIndex(hit->getEKey(), &H_t::t1);
540 i.tx = value.getIndex(hit->getString(), &H_t::tx);
541 i.ty = value.getIndex(hit->getString(), &H_t::ty);
542
543 V(i.t1, i.t1) += H.t1 * H.t1;
544
545 Y[i.t1] += W * H.t1 * y;
546
547 if (hit->getFloor() != 0) {
548
549 if (this->option != JMODEL::FIT_EMITTERS_ONLY_t) {
550
551 V(i.t1, i.tx) += H.t1 * H.tx; V(i.t1, i.ty) += H.t1 * H.ty;
552 V(i.tx, i.t1) += H.tx * H.t1; V(i.ty, i.t1) += H.ty * H.t1;
553
554 V(i.tx, i.tx) += H.tx * H.tx; V(i.tx, i.ty) += H.tx * H.ty;
555 V(i.ty, i.tx) += H.ty * H.tx; V(i.ty, i.ty) += H.ty * H.ty;
556
557 Y[i.tx] += W * H.tx * y;
558 Y[i.ty] += W * H.ty * y;
559 }
560 }
561 }
562
563 // solve A x = b
564
565 V.solve(Y);
566
567 for (size_t row = 0; row != N; ++row) {
568 value[row] += Y[row];
569 }
570
571 return value;
572 }
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 481 of file JKatoomba_t.hh.

◆ ldu

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

Definition at line 484 of file JKatoomba_t.hh.

◆ svd

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

Definition at line 485 of file JKatoomba_t.hh.

◆ Y

Definition at line 487 of file JKatoomba_t.hh.

◆ value

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

Definition at line 575 of file JKatoomba_t.hh.


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