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