Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
JACOUSTICS::JKatoomba< JEstimator > Struct Template 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<>

Public Member Functions

 JKatoomba (const JGeometry &geometry, const JSoundVelocity &velocity, const int option)
 Constructor. More...
 
template<class T >
JModeloperator() (T __begin, T __end) const
 Get start values of string parameters. More...
 

Static Public Attributes

static JMatrix_t MATRIX_INVERSION = SVD_t
 Matrix inversion. More...
 

Private Member Functions

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

Private Attributes

JMatrixNS ldu
 
TMatrixDS svd
 
JMATH::JVectorND Y
 
JModel value
 

Detailed Description

template<>
struct JACOUSTICS::JKatoomba< JEstimator >

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

Definition at line 496 of file JKatoomba_t.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
geometrydetector geometry
velocitysound velocity
optionoption

Definition at line 506 of file JKatoomba_t.hh.

508  :
509  JKatoomba<>(geometry, velocity, option)
510  {};

Member Function Documentation

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 522 of file JKatoomba_t.hh.

523  {
524  switch (MATRIX_INVERSION) {
525 
526  case SVD_t:
527  return this->evaluate(__begin, __end, svd);
528 
529  case LDU_t:
530  return this->evaluate(__begin, __end, ldu);
531 
532  default:
533  THROW(JValueOutOfRange, "Invalid matrix type " << MATRIX_INVERSION);
534  }
535  }
JModel & evaluate(T __begin, T __end, JMatrixNS_t &V) const
Get start values of string parameters.
Definition: JKatoomba_t.hh:556
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
static JMatrix_t MATRIX_INVERSION
Matrix inversion.
Definition: JKatoomba_t.hh:538
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:178
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 556 of file JKatoomba_t.hh.

557  {
558  using namespace std;
559  using namespace JPP;
560  using namespace JGEOMETRY;
561 
562  value = JModel(__begin, __end); // set up global model according data
563 
564  if (this->option == JMODEL::FIT_EMITTERS_ONLY_t)
566  else
568 
569  H_t H; // H-equation as per hit
570  I_t i; // indices of H-equation in global model
571 
572  const size_t N = value.getN();
573 
574  V.resize(N);
575  Y.resize(N);
576 
577  V.reset();
578  Y.reset();
579 
580  for (T hit = __begin; hit != __end; ++hit) {
581 
582  const JString& string = geometry[hit->getString()];
583  const JPosition3D position = string.getPosition(hit->getFloor());
584  const double Vi = velocity.getInverseVelocity(hit->getDistance(position), hit->getZ(), position.getZ());
585 
586  const double h1 = string.getHeight(hit->getFloor());
587  const JPosition3D p1 = string.getPosition() - hit->getPosition();
588  const double ds = sqrt(p1.getLengthSquared() + h1*h1 + 2.0*p1.getZ()*h1);
589  const double y = hit->getValue() - Vi*ds;
590  const double W = sqrt(hit->getWeight());
591 
592  H.t1 = W * 1.0;
593  H.tx = W * Vi * p1.getX() * h1 / ds;
594  H.ty = W * Vi * p1.getY() * h1 / ds;
595 
596  i.t1 = value.getIndex(hit->getEKey(), &H_t::t1);
597  i.tx = value.getIndex(hit->getString(), &H_t::tx);
598  i.ty = value.getIndex(hit->getString(), &H_t::ty);
599 
600  V(i.t1, i.t1) += H.t1 * H.t1;
601 
602  Y[i.t1] += W * H.t1 * y;
603 
604  if (hit->getFloor() != 0) {
605 
606  if (this->option != JMODEL::FIT_EMITTERS_ONLY_t) {
607 
608  V(i.t1, i.tx) += H.t1 * H.tx; V(i.t1, i.ty) += H.t1 * H.ty;
609  V(i.tx, i.t1) += H.tx * H.t1; V(i.ty, i.t1) += H.ty * H.t1;
610 
611  V(i.tx, i.tx) += H.tx * H.tx; V(i.tx, i.ty) += H.tx * H.ty;
612  V(i.ty, i.tx) += H.ty * H.tx; V(i.ty, i.ty) += H.ty * H.ty;
613 
614  Y[i.tx] += W * H.tx * y;
615  Y[i.ty] += W * H.ty * y;
616  }
617  }
618  }
619 
620  // solve A x = b
621 
622  V.solve(Y);
623 
624  for (size_t row = 0; row != N; ++row) {
625  value[row] += Y[row];
626  }
627 
628  return value;
629  }
size_t getN() const
Get number of fit parameters.
void setOption(const int option)
Set fit option.
Wrapper class around STL string class.
Definition: JString.hh:27
TPaveText * p1
void reset()
Reset.
Definition: JVectorND.hh:45
static const double H
Planck constant [eV s].
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Model for fit to acoustics data.
fit times of emission of emitters and tilt angles of strings
do set_variable OUTPUT_DIRECTORY $WORKDIR T
fit only times of emission of emitters
double getY() const
Get y position.
Definition: JVector3D.hh:104
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:235
size_t getIndex(int id, double JString::*p) const
Get index of fit parameter for given string.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
double getX() const
Get x position.
Definition: JVector3D.hh:94
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
double getZ() const
Get z position.
Definition: JVector3D.hh:115

Member Data Documentation

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

Matrix inversion.

Definition at line 538 of file JKatoomba_t.hh.

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

Definition at line 541 of file JKatoomba_t.hh.

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

Definition at line 542 of file JKatoomba_t.hh.

Definition at line 544 of file JKatoomba_t.hh.

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

Definition at line 632 of file JKatoomba_t.hh.


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