Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JResult.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JRESULT__
2 #define __JTOOLS__JRESULT__
3 
4 #include <cmath>
5 
6 #include "JTools/JRange.hh"
7 #include "JLang/JClass.hh"
8 #include "JLang/JAssert.hh"
9 #include "JMath/JMath.hh"
10 #include "JMath/JZero.hh"
11 
12 
13 /**
14  * \file
15  *
16  * This include file containes various data structures that
17  * can be used as specific return types for the interpolating methods.
18  * These data structures have standard arithmetic capabilities and
19  * are templated so that they can be expanded in higher dimensions.
20  * \author mdejong
21  */
22 
23 namespace JTOOLS {}
24 namespace JPP { using namespace JTOOLS; }
25 
26 namespace JTOOLS {
27 
28 
29  /**
30  * Data structure for result including value and first derivative of function.
31  *
32  * This data structure contains the following data mambers:
33  * <pre>
34  * JResultDerivative::f = function value;
35  * JResultDerivative::fp = first derivative;
36  * </pre>
37  *
38  * This class implements the JMATH::JMath interface.
39  */
40  template<class JResult_t>
42  public JMATH::JMath< JResultDerivative<JResult_t> >
43  {
44 
46 
47 
48  /**
49  * Default constructor.
50  */
52  f (JMATH::zero),
53  fp (JMATH::zero)
54  {}
55 
56 
57  /**
58  * Constructor.
59  *
60  * \param f function value
61  * \param fp first derivative
62  */
64  argument_type fp) :
65  f (f ),
66  fp (fp)
67  {}
68 
69 
70  /**
71  * Prefix unary minus for function value of PDF.
72  *
73  * \return function value of PDF
74  */
76  {
77  f = -f;
78  fp = -fp;
79 
80  return *this;
81  }
82 
83 
84  /**
85  * Addition operator for function value of PDF.
86  *
87  * \param value function value of PDF
88  * \return function value of PDF
89  */
91  {
92  f += value.f;
93  fp += value.fp;
94 
95  return *this;
96  }
97 
98 
99  /**
100  * Subtraction operator for function value of PDF.
101  *
102  * \param value function value of PDF
103  * \return function value of PDF
104  */
106  {
107  f -= value.f;
108  fp -= value.fp;
109 
110  return *this;
111  }
112 
113 
114  /**
115  * Multiplication operator for function value of PDF.
116  *
117  * \param value multiplication factor
118  * \return function value of PDF
119  */
120  JResultDerivative& mul(const double value)
121  {
122  f *= value;
123  fp *= value;
124 
125  return *this;
126  }
127 
128 
129  /**
130  * Division operator for function value of PDF.
131  *
132  * \param value multiplication factor
133  * \return function value of PDF
134  */
135  JResultDerivative& div(const double value)
136  {
137  f /= value;
138  fp /= value;
139 
140  return *this;
141  }
142 
143 
144  /**
145  * Get probability.\n
146  * If the given hit is false (true), the return value corresponds to the Poisson probability
147  * that zero (one or more) hits occur for the given expectation value JResultDerivative::f.
148  *
149  * \param hit hit (or not)
150  * \return probability
151  */
152  double getP(const bool hit) const
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  }
159 
160 
161  /**
162  * Get chi2.
163  * The chi2 corresponds to <tt>-log(P)</tt>, where <tt>P</tt> is the probability JResultDerivative::f.
164  *
165  * \param hit hit (or not)
166  * \return chi2
167  */
168  double getChi2(const bool hit) const
169  {
170  if (!hit)
171  return f; // = -log(getP(false))
172  else
173  return -log(getP(true));
174  }
175 
176 
177  /**
178  * Get derivative of chi2.
179  *
180  * \param hit hit (or not)
181  * \return derivative
182  */
183  double getDerivativeOfChi2(const bool hit) const
184  {
185  if (!hit)
186  return fp;
187  else
188  return -fp * getP(false) / getP(true);
189  }
190 
191 
192  JResult_t f; //!< function value
193  JResult_t fp; //!< first derivative
194  };
195 
196 
197  /**
198  * Data structure for result including value and first derivative of function.
199  *
200  * This data structure contains the following data mambers:
201  * <pre>
202  * JResultHesse::f = function value;
203  * JResultHesse::fp = first derivative;
204  * JResultHesse::fpp = second derivative;
205  * </pre>
206  *
207  * This class implements the JMATH::JMath interface.
208  */
209  template<class JResult_t>
210  struct JResultHesse :
211  public JResultDerivative<JResult_t>,
212  public JMATH::JMath< JResultHesse<JResult_t> >
213  {
214 
216 
217 
218  /**
219  * Default constructor.
220  */
222  JResultDerivative<JResult_t>(),
223  fpp(JMATH::zero)
224  {}
225 
226 
227  /**
228  * Constructor.
229  *
230  * \param f function value
231  * \param fp first derivative
232  * \param fpp second derivative
233  */
236  argument_type fpp) :
237  JResultDerivative<JResult_t>(f, fp),
238  fpp(fpp)
239  {}
240 
241 
242  /**
243  * Prefix unary minus for function value of PDF.
244  *
245  * \return function value of PDF
246  */
248  {
249  static_cast<JResultDerivative<JResult_t>&>(*this).negate();
250  fpp = -fpp;
251 
252  return *this;
253  }
254 
255 
256  /**
257  * Addition operator for function value of PDF.
258  *
259  * \param value function value of PDF
260  * \return function value of PDF
261  */
263  {
264  static_cast<JResultDerivative<JResult_t>&>(*this).add(value);
265  fpp += value.fpp;
266 
267  return *this;
268  }
269 
270 
271  /**
272  * Subtraction operator for function value of PDF.
273  *
274  * \param value function value of PDF
275  * \return function value of PDF
276  */
278  {
279  static_cast<JResultDerivative<JResult_t>&>(*this).sub(value);
280  fpp -= value.fpp;
281 
282  return *this;
283  }
284 
285 
286  /**
287  * Multiplication operator for function value of PDF.
288  *
289  * \param value multiplication factor
290  * \return function value of PDF
291  */
292  JResultHesse& mul(const double value)
293  {
294  static_cast<JResultDerivative<JResult_t>&>(*this).mul(value);
295  fpp *= value;
296 
297  return *this;
298  }
299 
300 
301  /**
302  * Division operator for function value of PDF.
303  *
304  * \param value multiplication factor
305  * \return function value of PDF
306  */
307  JResultHesse& div(const double value)
308  {
309  static_cast<JResultDerivative<JResult_t>&>(*this).div(value);
310  fpp /= value;
311 
312  return *this;
313  }
314 
315 
316  JResult_t fpp; //!< second derivative
317  };
318 
319 
320  /**
321  * Data structure for result including value, first derivative and integrals of function.
322  *
323  * This data structure contains the following data mambers:
324  * <pre>
325  * JResultPDF::f = function value;
326  * JResultPDF::fp = first derivative;
327  * JResultPDF::v = partial integral;
328  * JResultPDF::V = complete integral.
329  * </pre>
330  * The partial and complete integrals are used to evaluate the probability of the first hit.
331  *
332  * This class implements the JMATH::JMath interface.
333  */
334  template<class JResult_t>
335  struct JResultPDF :
336  public JMATH::JMath< JResultPDF<JResult_t> >
337  {
338 
340 
341 
342  /**
343  * Default constructor.
344  */
346  f (JMATH::zero),
347  fp(JMATH::zero),
348  v (JMATH::zero),
349  V (JMATH::zero)
350  {}
351 
352 
353  /**
354  * Constructor.
355  *
356  * \param f function value
357  * \param fp first derivative
358  * \param v integral <xmin,x]
359  * \param V integral <xmin,xmax>
360  */
364  argument_type V) :
365  f (f ),
366  fp(fp),
367  v (v),
368  V (V)
369  {}
370 
371 
372  /**
373  * Constructor.\n
374  * This constructor refers to the result of a signal with a constant rate <tt>R</tt>
375  * to produce an event occuring at the given moment <tt>x</tt> within the fixed range <tt>X</tt>.
376  *
377  * \param R rate
378  * \param x abscissa value
379  * \param X abscissa range
380  */
382  argument_type x,
383  const JRange<JResult_t>& X) :
384  f (R),
385  fp(JMATH::zero),
386  v (R * (X.constrain(x) - X.getLowerLimit())),
387  V (R * (X.getUpperLimit() - X.getLowerLimit()))
388  {}
389 
390 
391  /**
392  * Prefix unary minus for function value of PDF.
393  *
394  * \return function value of PDF
395  */
397  {
398  f = -f;
399  fp = -fp;
400  v = -v;
401  V = -V;
402 
403  return *this;
404  }
405 
406 
407  /**
408  * Addition operator for function value of PDF.
409  *
410  * \param value function value of PDF
411  * \return function value of PDF
412  */
413  JResultPDF& add(const JResultPDF& value)
414  {
415  f += value.f;
416  fp += value.fp;
417  v += value.v;
418  V += value.V;
419 
420  return *this;
421  }
422 
423 
424  /**
425  * Subtraction operator for function value of PDF.
426  *
427  * \param value function value of PDF
428  * \return function value of PDF
429  */
430  JResultPDF& sub(const JResultPDF& value)
431  {
432  f -= value.f;
433  fp -= value.fp;
434  v -= value.v;
435  V -= value.V;
436 
437  return *this;
438  }
439 
440 
441  /**
442  * Multiplication operator for function value of PDF.
443  *
444  * \param value multiplication factor
445  * \return function value of PDF
446  */
447  JResultPDF& mul(const double value)
448  {
449  f *= value;
450  fp *= value;
451  v *= value;
452  V *= value;
453 
454  return *this;
455  }
456 
457 
458  /**
459  * Division operator for function value of PDF.
460  *
461  * \param value division factor
462  * \return function value of PDF
463  */
464  JResultPDF& div(const double value)
465  {
466  f /= value;
467  fp /= value;
468  v /= value;
469  V /= value;
470 
471  return *this;
472  }
473 
474 
475  /**
476  * Get probability of first hit.\n
477  * The probability is defined at the moment JResultPDF::f and JResultPDF::v have been evaluated
478  * and it is normalised to the total interval corresponding to JResultPDF::V.
479  *
480  * \return probability
481  */
482  double getP() const
483  {
484  return exp(-v) * f / (1.0 - exp(-V));
485  }
486 
487 
488  /**
489  * Get chi2 of first hit.\n
490  * The chi2 corresponds to <tt>-log(P)</tt>, where <tt>P</tt> is the probability JResultPDF::f.
491  *
492  * \return chi2
493  */
494  double getChi2() const
495  {
496  return -log(getP());
497  }
498 
499 
500  /**
501  * Get derivative of chi2 of first hit.
502  *
503  * \return derivative
504  */
505  double getDerivativeOfChi2() const
506  {
507  return fp/f - f;
508  }
509 
510 
511  JResult_t f; //!< function value
512  JResult_t fp; //!< first derivative
513  JResult_t v; //!< integral <xmin,x]
514  JResult_t V; //!< integral <xmin,xmax>
515  };
516 
517 
518  /**
519  * Data structure for result including value and <tt>N</tt> derivatives of function.
520  *
521  * This data structure contains the following data mambers:
522  * <pre>
523  * JResultPolynome::y[0] = function value;
524  * JResultPolynome::y[i] = ith derivative;
525  * JResultPolynome::y[N] = Nth derivative;
526  * </pre>
527  *
528  * This class implements the JMATH::JMath interface.
529  */
530  template<unsigned int N, class JResult_t>
532  public JMATH::JMath< JResultPolynome<N, JResult_t> >
533  {
534 
536 
537  static const int NUMBER_OF_POINTS = N + 1; // number of points (starting at 0)
538 
539 
540  /**
541  * Default constructor.
542  */
544  {
545  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
546  y[i] = JMATH::zero;
547  }
548  }
549 
550 
551  /**
552  * Type conversion operator.
553  *
554  * \return result
555  */
557  {
559  return JResultDerivative<JResult_t>(y[0], y[1]);
560  }
561 
562 
563  /**
564  * Type conversion operator.
565  *
566  * \return result
567  */
568  operator JResultHesse<JResult_t>() const
569  {
571  return JResultHesse<JResult_t>(y[0], y[1], y[2]);
572  }
573 
574 
575  /**
576  * Prefix unary minus for function value of PDF.
577  *
578  * \return function value of PDF
579  */
581  {
582  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
583  y[i] = -y[i];
584  }
585 
586  return *this;
587  }
588 
589 
590  /**
591  * Addition operator for function value of PDF.
592  *
593  * \param value function value of PDF
594  * \return function value of PDF
595  */
597  {
598  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
599  y[i] += value.y[i];
600  }
601 
602  return *this;
603  }
604 
605 
606  /**
607  * Subtraction operator for function value of PDF.
608  *
609  * \param value function value of PDF
610  * \return function value of PDF
611  */
613  {
614  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
615  y[i] -= value.y[i];
616  }
617 
618  return *this;
619  }
620 
621 
622  /**
623  * Multiplication operator for function value of PDF.
624  *
625  * \param value multiplication factor
626  * \return function value of PDF
627  */
628  JResultPolynome& mul(const double value)
629  {
630  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
631  y[i] *= value;
632  }
633 
634  return *this;
635  }
636 
637 
638  /**
639  * Division operator for function value of PDF.
640  *
641  * \param value multiplication factor
642  * \return function value of PDF
643  */
644  JResultPolynome& div(const double value)
645  {
646  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
647  y[i] /= value;
648  }
649 
650  return *this;
651  }
652 
653 
654  /**
655  * Function value.
656  *
657  * \param x abscissa value
658  * \return function value
659  */
660  double getValue(const double x) const
661  {
662  double w = 0.0;
663  double z = 1.0;
664 
665  for (int i = 0; i != NUMBER_OF_POINTS; ++i, z *= x / i) {
666  w += y[i] * z;
667  }
668 
669  return w;
670  }
671 
672 
673  /**
674  * Function value.
675  *
676  * \param x abscissa value
677  * \return function value
678  */
679  double operator()(const double x) const
680  {
681  return getValue(x);
682  }
683 
684 
685  JResult_t y[NUMBER_OF_POINTS]; //!< function and derivative values
686  };
687 
688 
689  /**
690  * Auxiliary class to recursively evaluate to a result.
691  */
692  template<class T>
694  {
695  typedef T result_type;
696 
697  /**
698  * Get function value.
699  *
700  * \return result
701  */
703  {
704  return value;
705  }
706 
707  /**
708  * Get derivative value.
709  *
710  * \return result
711  */
713  {
714  return value;
715  }
716 
717  /**
718  * Get partial integral value.
719  *
720  * \return result
721  */
723  {
724  return value;
725  }
726  };
727 
728 
729  /**
730  * Template specialisation of JResultEvaluator for JResultDerivative.
731  */
732  template<class T>
734  {
736 
737  /**
738  * Get function value.
739  *
740  * \return result
741  */
743  {
744  return JResultEvaluator<T>::get_value(value.f);
745  }
746 
747  /**
748  * Get derivative value.
749  *
750  * \return result
751  */
753  {
754  return JResultEvaluator<T>::get_value(value.fp);
755  }
756 
757  /**
758  * Get partial integral value.
759  *
760  * \return result
761  */
763  {
764  return JMATH::zero;
765  }
766  };
767 
768 
769  /**
770  * Template specialisation of JResultEvaluator for JResultHesse.
771  */
772  template<class T>
774  {
776 
777  /**
778  * Get function value.
779  *
780  * \return result
781  */
782  static result_type get_value(const JResultHesse<T>& value)
783  {
784  return JResultEvaluator<T>::get_value(value.f);
785  }
786 
787  /**
788  * Get derivative value.
789  *
790  * \return result
791  */
793  {
794  return JResultEvaluator<T>::get_value(value.fp);
795  }
796 
797  /**
798  * Get partial integral value.
799  *
800  * \return result
801  */
803  {
804  return JMATH::zero;
805  }
806  };
807 
808 
809  /**
810  * Template specialisation of JResultEvaluator for JResultPDF.
811  */
812  template<class T>
814  {
816 
817  /**
818  * Get function value.
819  *
820  * \return result
821  */
822  static result_type get_value(const JResultPDF<T>& value)
823  {
824  return JResultEvaluator<T>::get_value(value.f);
825  }
826 
827  /**
828  * Get derivative value.
829  *
830  * \return result
831  */
833  {
834  return JResultEvaluator<T>::get_value(value.fp);
835  }
836 
837  /**
838  * Get partial integral value.
839  *
840  * \return result
841  */
843  {
844  return JResultEvaluator<T>::get_value(value.v);
845  }
846  };
847 
848 
849  /**
850  * Template specialisation of JResultEvaluator for JResultPolynome.
851  */
852  template<unsigned int N, class T>
854  {
856 
857  /**
858  * Get function value.
859  *
860  * \return result
861  */
863  {
864  return JResultEvaluator<T>::get_value(value.y[0]);
865  }
866 
867  /**
868  * Get derivative value.
869  *
870  * \return result
871  */
873  {
874  return JResultEvaluator<T>::get_value(value.y[1]);
875  }
876 
877  /**
878  * Get partial integral value.
879  *
880  * \return result
881  */
883  {
884  return JMATH::zero;
885  }
886  };
887 
888 
889  /**
890  * Template specialisation of JResultEvaluator for JResultPolynome.
891  */
892  template<class T>
894  {
896 
897  /**
898  * Get function value.
899  *
900  * \return result
901  */
903  {
904  return JResultEvaluator<T>::get_value(value.y[0]);
905  }
906 
907  /**
908  * Get derivative value.
909  *
910  * \return result
911  */
913  {
914  return JMATH::zero;
915  }
916 
917  /**
918  * Get partial integral value.
919  *
920  * \return result
921  */
923  {
924  return JMATH::zero;
925  }
926  };
927 
928 
929  /**
930  * Helper method to recursively evaluate a to function value.
931  *
932  * \param value result
933  * \return function value
934  */
935  template<class JResult_t>
936  inline typename JResultEvaluator<JResult_t>::result_type get_value(const JResult_t& value)
937  {
939  }
940 
941 
942  /**
943  * Helper method to convert function value to derivative value.
944  *
945  * \param value result
946  * \return derivative value
947  */
948  template<class JResult_t>
949  inline typename JResultEvaluator<JResult_t>::result_type get_derivative(const JResult_t& value)
950  {
952  }
953 
954 
955  /**
956  * Helper method to convert function value to partial integral value.
957  *
958  * \param value result
959  * \return partial integral value
960  */
961  template<class JResult_t>
962  inline typename JResultEvaluator<JResult_t>::result_type get_integral(const JResult_t& value)
963  {
965  }
966 }
967 
968 #endif
JLANG::JClass< JResult_t >::argument_type argument_type
Definition: JResult.hh:45
data_type w[N+1][M+1]
Definition: JPolint.hh:708
JResultEvaluator< T >::result_type result_type
Definition: JResult.hh:735
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:26
JResultPolynome & add(const JResultPolynome &value)
Addition operator for function value of PDF.
Definition: JResult.hh:596
JResultDerivative & add(const JResultDerivative &value)
Addition operator for function value of PDF.
Definition: JResult.hh:90
JLANG::JClass< JResult_t >::argument_type argument_type
Definition: JResult.hh:535
Data structure for result including value and N derivatives of function.
Definition: JResult.hh:531
static result_type get_derivative(const JResultPDF< T > &value)
Get derivative value.
Definition: JResult.hh:832
static result_type get_integral(typename JLANG::JClass< T >::argument_type value)
Get partial integral value.
Definition: JResult.hh:722
JResultPDF()
Default constructor.
Definition: JResult.hh:345
JResultPolynome & sub(const JResultPolynome &value)
Subtraction operator for function value of PDF.
Definition: JResult.hh:612
double getDerivativeOfChi2(const bool hit) const
Get derivative of chi2.
Definition: JResult.hh:183
static result_type get_derivative(typename JLANG::JClass< T >::argument_type value)
Get derivative value.
Definition: JResult.hh:712
JResultDerivative & negate()
Prefix unary minus for function value of PDF.
Definition: JResult.hh:75
double getChi2() const
Get chi2 of first hit.
Definition: JResult.hh:494
JResultDerivative< JResult_t >::argument_type argument_type
Definition: JResult.hh:215
JResultPolynome()
Default constructor.
Definition: JResult.hh:543
Auxiliary class to recursively evaluate to a result.
Definition: JResult.hh:693
static result_type get_integral(const JResultHesse< T > &value)
Get partial integral value.
Definition: JResult.hh:802
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
static result_type get_value(typename JLANG::JClass< T >::argument_type value)
Get function value.
Definition: JResult.hh:702
JResultHesse(argument_type f, argument_type fp, argument_type fpp)
Constructor.
Definition: JResult.hh:234
JResultPDF & mul(const double value)
Multiplication operator for function value of PDF.
Definition: JResult.hh:447
Definition of zero value for any class.
JResult_t fp
first derivative
Definition: JResult.hh:512
JResult_t V
integral &lt;xmin,xmax&gt;
Definition: JResult.hh:514
JResult_t fp
first derivative
Definition: JResult.hh:193
JResultPDF(argument_type f, argument_type fp, argument_type v, argument_type V)
Constructor.
Definition: JResult.hh:361
static result_type get_derivative(const JResultPolynome< N, T > &value)
Get derivative value.
Definition: JResult.hh:872
JResult_t f
function value
Definition: JResult.hh:192
static result_type get_value(const JResultDerivative< T > &value)
Get function value.
Definition: JResult.hh:742
static result_type get_integral(const JResultPolynome< N, T > &value)
Get partial integral value.
Definition: JResult.hh:882
JLANG::JClass< JResult_t >::argument_type argument_type
Definition: JResult.hh:339
JResultEvaluator< T >::result_type result_type
Definition: JResult.hh:855
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
JResultHesse & sub(const JResultHesse &value)
Subtraction operator for function value of PDF.
Definition: JResult.hh:277
JResultPDF & negate()
Prefix unary minus for function value of PDF.
Definition: JResult.hh:396
double getP(const bool hit) const
Get probability.
Definition: JResult.hh:152
JResultHesse & mul(const double value)
Multiplication operator for function value of PDF.
Definition: JResult.hh:292
double getChi2(const bool hit) const
Get chi2.
Definition: JResult.hh:168
static const int NUMBER_OF_POINTS
Definition: JResult.hh:537
Data structure for result including value, first derivative and integrals of function.
Definition: JResult.hh:335
static result_type get_derivative(const JResultPolynome< 0, T > &value)
Get derivative value.
Definition: JResult.hh:912
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JResultPDF & add(const JResultPDF &value)
Addition operator for function value of PDF.
Definition: JResult.hh:413
static result_type get_integral(const JResultDerivative< T > &value)
Get partial integral value.
Definition: JResult.hh:762
double getP() const
Get probability of first hit.
Definition: JResult.hh:482
JResult_t f
function value
Definition: JResult.hh:511
JResultEvaluator< T >::result_type result_type
Definition: JResult.hh:815
static result_type get_value(const JResultHesse< T > &value)
Get function value.
Definition: JResult.hh:782
JResultPolynome & negate()
Prefix unary minus for function value of PDF.
Definition: JResult.hh:580
JResult_t fpp
second derivative
Definition: JResult.hh:316
JResult_t v
integral &lt;xmin,x]
Definition: JResult.hh:513
JResultDerivative & mul(const double value)
Multiplication operator for function value of PDF.
Definition: JResult.hh:120
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
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
Range of values.
Definition: JRange.hh:34
JResultDerivative & sub(const JResultDerivative &value)
Subtraction operator for function value of PDF.
Definition: JResult.hh:105
JResultEvaluator< T >::result_type result_type
Definition: JResult.hh:895
double getValue(const double x) const
Function value.
Definition: JResult.hh:660
static result_type get_derivative(const JResultHesse< T > &value)
Get derivative value.
Definition: JResult.hh:792
JResultDerivative()
Default constructor.
Definition: JResult.hh:51
JResultPDF & sub(const JResultPDF &value)
Subtraction operator for function value of PDF.
Definition: JResult.hh:430
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:685
static result_type get_integral(const JResultPDF< T > &value)
Get partial integral value.
Definition: JResult.hh:842
JResultPolynome & mul(const double value)
Multiplication operator for function value of PDF.
Definition: JResult.hh:628
JResultPolynome & div(const double value)
Division operator for function value of PDF.
Definition: JResult.hh:644
static result_type get_integral(const JResultPolynome< 0, T > &value)
Get partial integral value.
Definition: JResult.hh:922
Auxiliary class to define a range between two values.
JResultEvaluator< JResult_t >::result_type get_derivative(const JResult_t &value)
Helper method to convert function value to derivative value.
Definition: JResult.hh:949
JResultHesse & div(const double value)
Division operator for function value of PDF.
Definition: JResult.hh:307
JResultEvaluator< T >::result_type result_type
Definition: JResult.hh:775
#define STATIC_CHECK(expr)
Definition: JAssert.hh:29
static result_type get_derivative(const JResultDerivative< T > &value)
Get derivative value.
Definition: JResult.hh:752
double getDerivativeOfChi2() const
Get derivative of chi2 of first hit.
Definition: JResult.hh:505
JResultHesse & negate()
Prefix unary minus for function value of PDF.
Definition: JResult.hh:247
Base class for data structures with artithmetic capabilities.
JResultPDF(argument_type R, argument_type x, const JRange< JResult_t > &X)
Constructor.
Definition: JResult.hh:381
JResultHesse()
Default constructor.
Definition: JResult.hh:221
static result_type get_value(const JResultPDF< T > &value)
Get function value.
Definition: JResult.hh:822
JResultEvaluator< JResult_t >::result_type get_integral(const JResult_t &value)
Helper method to convert function value to partial integral value.
Definition: JResult.hh:962
Data structure for result including value and first derivative of function.
Definition: JResult.hh:210
JResultPDF & div(const double value)
Division operator for function value of PDF.
Definition: JResult.hh:464
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
JResultEvaluator< JResult_t >::result_type get_value(const JResult_t &value)
Helper method to recursively evaluate a to function value.
Definition: JResult.hh:936
double operator()(const double x) const
Function value.
Definition: JResult.hh:679
static result_type get_value(const JResultPolynome< N, T > &value)
Get function value.
Definition: JResult.hh:862
JResultHesse & add(const JResultHesse &value)
Addition operator for function value of PDF.
Definition: JResult.hh:262
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" -
JResultDerivative(argument_type f, argument_type fp)
Constructor.
Definition: JResult.hh:63
static result_type get_value(const JResultPolynome< 0, T > &value)
Get function value.
Definition: JResult.hh:902