Jpp
 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< JResultHesse< JResult_t > > JMATH::JMath< JResultDerivative< JResult_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...
 
JResultDerivative< JResult_t > & mul (const JNullType &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...
 
JResultHesse< JResult_t > & mul (const JNullType &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 210 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 215 of file JResult.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 221 of file JResult.hh.

221  :
224  {}
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
JResult_t fpp
second derivative
Definition: JResult.hh:316
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41
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 234 of file JResult.hh.

236  :
238  fpp(fpp)
239  {}
JResult_t fp
first derivative
Definition: JResult.hh:193
JResult_t f
function value
Definition: JResult.hh:192
JResult_t fpp
second derivative
Definition: JResult.hh:316
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41

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 247 of file JResult.hh.

248  {
249  static_cast<JResultDerivative<JResult_t>&>(*this).negate();
250  fpp = -fpp;
251 
252  return *this;
253  }
JResultDerivative & negate()
Prefix unary minus for function value of PDF.
Definition: JResult.hh:75
JResult_t fpp
second derivative
Definition: JResult.hh:316
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41
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 262 of file JResult.hh.

263  {
264  static_cast<JResultDerivative<JResult_t>&>(*this).add(value);
265  fpp += value.fpp;
266 
267  return *this;
268  }
JResultDerivative & add(const JResultDerivative &value)
Addition operator for function value of PDF.
Definition: JResult.hh:90
JResult_t fpp
second derivative
Definition: JResult.hh:316
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41
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 277 of file JResult.hh.

278  {
279  static_cast<JResultDerivative<JResult_t>&>(*this).sub(value);
280  fpp -= value.fpp;
281 
282  return *this;
283  }
JResult_t fpp
second derivative
Definition: JResult.hh:316
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41
JResultDerivative & sub(const JResultDerivative &value)
Subtraction operator for function value of PDF.
Definition: JResult.hh:105
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 292 of file JResult.hh.

293  {
294  static_cast<JResultDerivative<JResult_t>&>(*this).mul(value);
295  fpp *= value;
296 
297  return *this;
298  }
JResult_t fpp
second derivative
Definition: JResult.hh:316
JResultDerivative & mul(const double value)
Multiplication operator for function value of PDF.
Definition: JResult.hh:120
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41
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 307 of file JResult.hh.

308  {
309  static_cast<JResultDerivative<JResult_t>&>(*this).div(value);
310  fpp /= value;
311 
312  return *this;
313  }
JResult_t fpp
second derivative
Definition: JResult.hh:316
JResultDerivative & div(const double value)
Division operator for function value of PDF.
Definition: JResult.hh:135
Data structure for result including value and first derivative of function.
Definition: JResult.hh:41
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 90 of file JResult.hh.

91  {
92  f += value.f;
93  fp += value.fp;
94 
95  return *this;
96  }
JResult_t fp
first derivative
Definition: JResult.hh:193
JResult_t f
function value
Definition: JResult.hh:192
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 105 of file JResult.hh.

106  {
107  f -= value.f;
108  fp -= value.fp;
109 
110  return *this;
111  }
JResult_t fp
first derivative
Definition: JResult.hh:193
JResult_t f
function value
Definition: JResult.hh:192
JResultDerivative< JResult_t > & JMATH::JMath< JResultDerivative< JResult_t > , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
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 152 of file JResult.hh.

153  {
154  if (!hit)
155  return exp(-f); // probability of 0 hits
156  else
157  return 1.0 - getP(false); // probability of 1 or more hits
158  }
JResult_t f
function value
Definition: JResult.hh:192
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:152
then set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable OUTPUT_FILE histogram.root JHistogram1D -o $WORKDIR/$OUTPUT_FILE -F "$FORMULA" -
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 168 of file JResult.hh.

169  {
170  if (!hit)
171  return f; // = -log(getP(false))
172  else
173  return -log(getP(true));
174  }
JResult_t f
function value
Definition: JResult.hh:192
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:152
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 183 of file JResult.hh.

184  {
185  if (!hit)
186  return fp;
187  else
188  return -fp * getP(false) / getP(true);
189  }
JResult_t fp
first derivative
Definition: JResult.hh:193
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:152
JResultHesse< JResult_t > & JMATH::JMath< JResultHesse< JResult_t > , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
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 316 of file JResult.hh.

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

function value

Definition at line 192 of file JResult.hh.

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

first derivative

Definition at line 193 of file JResult.hh.


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