Auxiliary data structure to convert event to model.
More...
#include <JEvtToolkit.hh>
|
template<class T > |
| getModel (const T &object) |
| Constructor.
|
|
template<> |
| getModel (const JEvt &evt) |
| Get model of detector.
|
|
template<> |
| getModel (const JSuperEvt &evt) |
| Get model of detector.
|
|
JMODEL::JOption_t | getOption () const |
| Get fit option.
|
|
void | setOption (const int option) |
| Set fit option.
|
|
void | clear () |
| Clear parameters.
|
|
void | reset () |
| Reset parameters.
|
|
JModel & | negate () |
| Negate model.
|
|
JModel & | add (const JModel &model) |
| Add model.
|
|
JModel & | sub (const JModel &model) |
| Subtract model.
|
|
JModel & | mul (const double factor) |
| Scale model.
|
|
JFirst_t & | mul (const JSecond_t &object) |
| Multiply with object.
|
|
JModel & | div (const double factor) |
| Scale model.
|
|
bool | equals (const JModel &model, const double precision=std::numeric_limits< double >::min()) const |
| Check equality.
|
|
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.
|
|
size_t | getIndex (const JEKey &id, double JEmission::*p) const |
| Get index of fit parameter for given emission.
|
|
double | operator[] (const size_t index) const |
| Read access to fit parameter value by index.
|
|
double & | operator[] (const size_t index) |
| Read/write access to fit parameter value by index.
|
|
Auxiliary data structure to convert event to model.
Definition at line 124 of file JAcoustics/JEvtToolkit.hh.
◆ JString
◆ JEmission
◆ getModel() [1/3]
template<class T >
JACOUSTICS::getModel::getModel |
( |
const T & | object | ) |
|
◆ getModel() [2/3]
template<>
JACOUSTICS::getModel::getModel |
( |
const JEvt & | evt | ) |
|
|
inline |
Get model of detector.
- Parameters
-
Definition at line 142 of file JAcoustics/JEvtToolkit.hh.
143 {
144 for (JEvt::const_iterator i = evt.begin(); i != evt.end(); ++i) {
146 }
147 }
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
◆ getModel() [3/3]
template<>
JACOUSTICS::getModel::getModel |
( |
const JSuperEvt & | evt | ) |
|
|
inline |
Get model of detector.
- Parameters
-
Definition at line 29 of file JSuperEvtToolkit.hh.
29 :
31 {
32 for (JSuperEvt::tx_type::const_iterator i = evt.tx.begin(); i != evt.tx.end(); ++i) {
33 this->
emission[JEKey(i->id,i->counter)] = JMODEL::JEmission(i->toe);
34 }
35 }
JACOUSTICS::JModel::emission_type emission
getModel(const T &object)
Constructor.
◆ getOption()
◆ setOption()
void JACOUSTICS::JModel::setOption |
( |
const int | option | ) |
|
|
inlineinherited |
Set fit option.
- Parameters
-
Definition at line 553 of file JAcoustics/JModel.hh.
554 {
555 using namespace JMODEL;
556
558
564 break;
565
566 default:
567 THROW(JValueOutOfRange,
"Invalid option " <<
option);
568 }
569 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
@ FIT_EMITTERS_AND_STRINGS_1st_ORDER_t
fit times of emission of emitters and tilt angles of strings
@ FIT_EMITTERS_AND_STRINGS_2nd_ORDER_t
fit times of emission of emitters and tilt angles of strings with second order correction
@ FIT_EMITTERS_ONLY_t
fit only times of emission of emitters
@ FIT_EMITTERS_AND_STRINGS_2nd_ORDER_AND_STRETCHING_t
fit times of emission of emitters and tilt angles of strings with second order correction and stretch...
◆ clear()
void JACOUSTICS::JModel::clear |
( |
| ) |
|
|
inlineinherited |
◆ reset()
void JACOUSTICS::JModel::reset |
( |
| ) |
|
|
inlineinherited |
◆ negate()
JModel & JACOUSTICS::JModel::negate |
( |
| ) |
|
|
inlineinherited |
Negate model.
- Returns
- this model
Definition at line 597 of file JAcoustics/JModel.hh.
598 {
599 this->string .evaluate(&JString ::negate);
601
602 return *this;
603 }
JEmission & negate()
Negate emission.
void evaluate(value_type &(value_type::*f1)())
Evaluate arithmetic operation.
◆ add()
Add model.
- Parameters
-
- Returns
- this model
Definition at line 612 of file JAcoustics/JModel.hh.
613 {
614 this->
string .evaluate(
model.string, &JString ::add);
616
617 return *this;
618 }
JEmission & add(const JEmission &emission)
Add emission.
◆ sub()
Subtract model.
- Parameters
-
- Returns
- this model
Definition at line 627 of file JAcoustics/JModel.hh.
628 {
629 this->
string .evaluate(
model.string, &JString ::sub);
631
632 return *this;
633 }
JEmission & sub(const JEmission &emission)
Subtract emission.
◆ mul() [1/2]
JModel & JACOUSTICS::JModel::mul |
( |
const double | factor | ) |
|
|
inlineinherited |
Scale model.
- Parameters
-
factor | multiplication factor |
- Returns
- this model
Definition at line 642 of file JAcoustics/JModel.hh.
643 {
644 this->string .evaluate(&JString ::mul, factor);
646
647 return *this;
648 }
JEmission & mul(const double factor)
Scale emission.
◆ mul() [2/2]
template<class JFirst_t , class JSecond_t >
JFirst_t & JMATH::JMath< JFirst_t, JSecond_t >::mul |
( |
const JSecond_t & | object | ) |
|
|
inlineinherited |
Multiply with object.
- Parameters
-
- Returns
- result object
Definition at line 354 of file JMath.hh.
355 {
356 return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357 }
◆ div()
JModel & JACOUSTICS::JModel::div |
( |
const double | factor | ) |
|
|
inlineinherited |
Scale model.
- Parameters
-
- Returns
- this model
Definition at line 657 of file JAcoustics/JModel.hh.
658 {
659 this->string .evaluate(&JString ::div, factor);
661
662 return *this;
663 }
JEmission & div(const double factor)
Scale emission.
◆ equals()
bool JACOUSTICS::JModel::equals |
( |
const JModel & | model, |
|
|
const double | precision = std::numeric_limits<double>::min() ) const |
|
inlineinherited |
Check equality.
- Parameters
-
model | model |
precision | precision |
- Returns
- true if models are equal; else false
Definition at line 673 of file JAcoustics/JModel.hh.
675 {
676 return (this->
string .
equals(
model.string, precision) &&
677 this->emission.equals(
model.emission, precision));
678 }
bool equals(const JModel &model, const double precision=std::numeric_limits< double >::min()) const
Check equality.
◆ getN()
size_t JACOUSTICS::JModel::getN |
( |
| ) |
const |
|
inlineinherited |
Get number of fit parameters.
- Returns
- number of parameters
Definition at line 710 of file JAcoustics/JModel.hh.
711 {
713 }
size_t getN(const JMODEL::JOption_t option) const
Get number of fit parameters.
◆ getIndex() [1/2]
size_t JACOUSTICS::JModel::getIndex |
( |
int | id, |
|
|
double JString::* | p ) const |
|
inlineinherited |
Get index of fit parameter for given string.
- Parameters
-
id | string identifier |
p | pointer to data member |
- Returns
- parameter
Definition at line 723 of file JAcoustics/JModel.hh.
◆ getIndex() [2/2]
size_t JACOUSTICS::JModel::getIndex |
( |
const JEKey & | id, |
|
|
double JEmission::* | p ) const |
|
inlineinherited |
Get index of fit parameter for given emission.
- Parameters
-
id | emission key |
p | pointer to data member |
- Returns
- parameter
Definition at line 736 of file JAcoustics/JModel.hh.
737 {
739 }
size_t getIndex(const key_type key, double value_type::*p, const JMODEL::JOption_t option) const
Get index of parameter.
◆ operator[]() [1/2]
double JACOUSTICS::JModel::operator[] |
( |
const size_t | index | ) |
const |
|
inlineinherited |
Read access to fit parameter value by index.
- Parameters
-
- Returns
- value
Definition at line 748 of file JAcoustics/JModel.hh.
749 {
750 size_t i = index;
751
753
755
756 if (i <
string .
getN(this->
option)) {
return string .getParameter(i, this->
option); }
757
758 THROW(JIndexOutOfRange,
"Invalid index " << index <<
" >= " <<
getN());
759 }
double getParameter(const size_t index, const JMODEL::JOption_t option) const
Get read access to fit parameter value at given index in buffer.
size_t getN() const
Get number of fit parameters.
◆ operator[]() [2/2]
double & JACOUSTICS::JModel::operator[] |
( |
const size_t | index | ) |
|
|
inlineinherited |
Read/write access to fit parameter value by index.
- Parameters
-
- Returns
- value
Definition at line 768 of file JAcoustics/JModel.hh.
769 {
770 size_t i = index;
771
773
775
776 if (i <
string .
getN(this->
option)) {
return string .getParameter(i, this->
option); }
777
778 THROW(JIndexOutOfRange,
"Invalid index " << index <<
" >= " <<
getN());
779 }
◆ emission
◆ string
◆ option
The documentation for this struct was generated from the following files: