Jpp  15.0.1-rc.1-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
JTOOLS::JResultHesse< JResult_t > Struct Template Reference

Data structure for result including value and first derivative of function. More...

#include <JResult.hh>

Inheritance diagram for JTOOLS::JResultHesse< JResult_t >:
JTOOLS::JResultDerivative< JResult_t > JMATH::JMath< JFirst_t, JSecond_t > JMATH::JMath< JFirst_t, JSecond_t >

Public Types

typedef JResultDerivative
< JResult_t >::argument_type 
argument_type
 

Public Member Functions

 JResultHesse ()
 Default constructor. More...
 
 JResultHesse (argument_type f, argument_type fp, argument_type fpp)
 Constructor. More...
 
JResultHessenegate ()
 Prefix unary minus for function value of PDF. More...
 
JResultHesseadd (const JResultHesse &value)
 Addition operator for function value of PDF. More...
 
JResultHessesub (const JResultHesse &value)
 Subtraction operator for function value of PDF. More...
 
JResultHessemul (const double value)
 Multiplication operator for function value of PDF. More...
 
JResultHessediv (const double value)
 Division operator for function value of PDF. More...
 
JResultDerivativeadd (const JResultDerivative &value)
 Addition operator for function value of PDF. More...
 
JResultDerivativesub (const JResultDerivative &value)
 Subtraction operator for function value of PDF. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
double getP (const bool hit) const
 Get probability. More...
 
double getChi2 (const bool hit) const
 Get chi2. More...
 
double getDerivativeOfChi2 (const bool hit) const
 Get derivative of chi2. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 

Public Attributes

JResult_t fpp
 second derivative More...
 
JResult_t f
 function value More...
 
JResult_t fp
 first derivative More...
 

Detailed Description

template<class JResult_t>
struct JTOOLS::JResultHesse< JResult_t >

Data structure for result including value and first derivative of function.

This data structure contains the following data mambers:

   JResultHesse::f   = function value;
   JResultHesse::fp  = first  derivative;
   JResultHesse::fpp = second derivative;

This class implements the JMATH::JMath interface.

Definition at line 212 of file JResult.hh.

Member Typedef Documentation

template<class JResult_t>
typedef JResultDerivative<JResult_t>::argument_type JTOOLS::JResultHesse< JResult_t >::argument_type

Definition at line 217 of file JResult.hh.

Constructor & Destructor Documentation

template<class JResult_t>
JTOOLS::JResultHesse< JResult_t >::JResultHesse ( )
inline

Default constructor.

Definition at line 223 of file JResult.hh.

223  :
226  {}
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
JResult_t fpp
second derivative
Definition: JResult.hh:318
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
template<class JResult_t>
JTOOLS::JResultHesse< JResult_t >::JResultHesse ( argument_type  f,
argument_type  fp,
argument_type  fpp 
)
inline

Constructor.

Parameters
ffunction value
fpfirst derivative
fppsecond derivative

Definition at line 236 of file JResult.hh.

238  :
240  fpp(fpp)
241  {}
JResult_t fp
first derivative
Definition: JResult.hh:195
JResult_t f
function value
Definition: JResult.hh:194
JResult_t fpp
second derivative
Definition: JResult.hh:318
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43

Member Function Documentation

template<class JResult_t>
JResultHesse& JTOOLS::JResultHesse< JResult_t >::negate ( )
inline

Prefix unary minus for function value of PDF.

Returns
function value of PDF

Definition at line 249 of file JResult.hh.

250  {
251  static_cast<JResultDerivative<JResult_t>&>(*this).negate();
252  fpp = -fpp;
253 
254  return *this;
255  }
JResultDerivative & negate()
Prefix unary minus for function value of PDF.
Definition: JResult.hh:77
JResult_t fpp
second derivative
Definition: JResult.hh:318
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
template<class JResult_t>
JResultHesse& JTOOLS::JResultHesse< JResult_t >::add ( const JResultHesse< JResult_t > &  value)
inline

Addition operator for function value of PDF.

Parameters
valuefunction value of PDF
Returns
function value of PDF

Definition at line 264 of file JResult.hh.

265  {
266  static_cast<JResultDerivative<JResult_t>&>(*this).add(value);
267  fpp += value.fpp;
268 
269  return *this;
270  }
JResultDerivative & add(const JResultDerivative &value)
Addition operator for function value of PDF.
Definition: JResult.hh:92
JResult_t fpp
second derivative
Definition: JResult.hh:318
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
template<class JResult_t>
JResultHesse& JTOOLS::JResultHesse< JResult_t >::sub ( const JResultHesse< JResult_t > &  value)
inline

Subtraction operator for function value of PDF.

Parameters
valuefunction value of PDF
Returns
function value of PDF

Definition at line 279 of file JResult.hh.

280  {
281  static_cast<JResultDerivative<JResult_t>&>(*this).sub(value);
282  fpp -= value.fpp;
283 
284  return *this;
285  }
JResult_t fpp
second derivative
Definition: JResult.hh:318
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
JResultDerivative & sub(const JResultDerivative &value)
Subtraction operator for function value of PDF.
Definition: JResult.hh:107
template<class JResult_t>
JResultHesse& JTOOLS::JResultHesse< JResult_t >::mul ( const double  value)
inline

Multiplication operator for function value of PDF.

Parameters
valuemultiplication factor
Returns
function value of PDF

Definition at line 294 of file JResult.hh.

295  {
296  static_cast<JResultDerivative<JResult_t>&>(*this).mul(value);
297  fpp *= value;
298 
299  return *this;
300  }
JResult_t fpp
second derivative
Definition: JResult.hh:318
JResultDerivative & mul(const double value)
Multiplication operator for function value of PDF.
Definition: JResult.hh:122
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
template<class JResult_t>
JResultHesse& JTOOLS::JResultHesse< JResult_t >::div ( const double  value)
inline

Division operator for function value of PDF.

Parameters
valuemultiplication factor
Returns
function value of PDF

Definition at line 309 of file JResult.hh.

310  {
311  static_cast<JResultDerivative<JResult_t>&>(*this).div(value);
312  fpp /= value;
313 
314  return *this;
315  }
JResult_t fpp
second derivative
Definition: JResult.hh:318
JResultDerivative & div(const double value)
Division operator for function value of PDF.
Definition: JResult.hh:137
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
template<class JResult_t>
JResultDerivative& JTOOLS::JResultDerivative< JResult_t >::add ( const JResultDerivative< JResult_t > &  value)
inlineinherited

Addition operator for function value of PDF.

Parameters
valuefunction value of PDF
Returns
function value of PDF

Definition at line 92 of file JResult.hh.

93  {
94  f += value.f;
95  fp += value.fp;
96 
97  return *this;
98  }
JResult_t fp
first derivative
Definition: JResult.hh:195
JResult_t f
function value
Definition: JResult.hh:194
template<class JResult_t>
JResultDerivative& JTOOLS::JResultDerivative< JResult_t >::sub ( const JResultDerivative< JResult_t > &  value)
inlineinherited

Subtraction operator for function value of PDF.

Parameters
valuefunction value of PDF
Returns
function value of PDF

Definition at line 107 of file JResult.hh.

108  {
109  f -= value.f;
110  fp -= value.fp;
111 
112  return *this;
113  }
JResult_t fp
first derivative
Definition: JResult.hh:195
JResult_t f
function value
Definition: JResult.hh:194
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
template<class JResult_t>
double JTOOLS::JResultDerivative< JResult_t >::getP ( const bool  hit) const
inlineinherited

Get probability.


If the given hit is false (true), the return value corresponds to the Poisson probability that zero (one or more) hits occur for the given expectation value JResultDerivative::f.

Parameters
hithit (or not)
Returns
probability

Definition at line 154 of file JResult.hh.

155  {
156  if (!hit)
157  return exp(-f); // probability of 0 hits
158  else
159  return 1.0 - getP(false); // probability of 1 or more hits
160  }
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"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
JResult_t f
function value
Definition: JResult.hh:194
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:154
template<class JResult_t>
double JTOOLS::JResultDerivative< JResult_t >::getChi2 ( const bool  hit) const
inlineinherited

Get chi2.

The chi2 corresponds to -log(P), where P is the probability JResultDerivative::f.

Parameters
hithit (or not)
Returns
chi2

Definition at line 170 of file JResult.hh.

171  {
172  if (!hit)
173  return f; // = -log(getP(false))
174  else
175  return -log(getP(true));
176  }
JResult_t f
function value
Definition: JResult.hh:194
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:154
template<class JResult_t>
double JTOOLS::JResultDerivative< JResult_t >::getDerivativeOfChi2 ( const bool  hit) const
inlineinherited

Get derivative of chi2.

Parameters
hithit (or not)
Returns
derivative

Definition at line 185 of file JResult.hh.

186  {
187  if (!hit)
188  return fp;
189  else
190  return -fp * getP(false) / getP(true);
191  }
JResult_t fp
first derivative
Definition: JResult.hh:195
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:154
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18

Member Data Documentation

template<class JResult_t>
JResult_t JTOOLS::JResultHesse< JResult_t >::fpp

second derivative

Definition at line 318 of file JResult.hh.

template<class JResult_t>
JResult_t JTOOLS::JResultDerivative< JResult_t >::f
inherited

function value

Definition at line 194 of file JResult.hh.

template<class JResult_t>
JResult_t JTOOLS::JResultDerivative< JResult_t >::fp
inherited

first derivative

Definition at line 195 of file JResult.hh.


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