CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
funct::GaussIntegrator Class Reference

#include <NumericalIntegration.h>

Public Member Functions

double error () const
 
 GaussIntegrator ()
 
 GaussIntegrator (double epsilon)
 
template<typename F >
double operator() (const F &f, double a, double b) const
 

Private Attributes

double aa
 
double aconst
 
double bb
 
double c1
 
double c2
 
double epsilon_
 
double error_
 
double f1
 
double f2
 
double h
 
unsigned int i
 
double s16
 
double s8
 
double u
 
double xx
 

Static Private Attributes

static const double kCST = 5. / 1000
 
static const double kHF = 0.5
 
static const double w [12]
 
static const double x [12]
 

Detailed Description

Definition at line 65 of file NumericalIntegration.h.

Constructor & Destructor Documentation

◆ GaussIntegrator() [1/2]

funct::GaussIntegrator::GaussIntegrator ( )
inline

Definition at line 67 of file NumericalIntegration.h.

67 {}

◆ GaussIntegrator() [2/2]

funct::GaussIntegrator::GaussIntegrator ( double  epsilon)
inline

Definition at line 68 of file NumericalIntegration.h.

Member Function Documentation

◆ error()

double funct::GaussIntegrator::error ( ) const
inline

Definition at line 115 of file NumericalIntegration.h.

References error_.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

115 { return error_; }

◆ operator()()

template<typename F >
double funct::GaussIntegrator::operator() ( const F f,
double  a,
double  b 
) const
inline

Definition at line 70 of file NumericalIntegration.h.

References a, aa, funct::abs(), aconst, b, bb, c1, c2, epsilon_, error_, f, f1, f2, h, i, kCST, kHF, s16, s8, u, w, x, and xx.

70  {
71  h = 0;
72  if (b == a)
73  return h;
74  aconst = kCST / std::abs(b - a);
75  bb = a;
76  CASE1:
77  aa = bb;
78  bb = b;
79  CASE2:
80  c1 = kHF * (bb + aa);
81  c2 = kHF * (bb - aa);
82  s8 = 0;
83  for (i = 0; i < 4; ++i) {
84  u = c2 * x[i];
85  xx = c1 + u;
86  f1 = f(xx);
87  xx = c1 - u;
88  f2 = f(xx);
89  s8 += w[i] * (f1 + f2);
90  }
91  s16 = 0;
92  for (i = 4; i < 12; ++i) {
93  u = c2 * x[i];
94  xx = c1 + u;
95  f1 = f(xx);
96  xx = c1 - u;
97  f2 = f(xx);
98  s16 += w[i] * (f1 + f2);
99  }
100  s16 = c2 * s16;
101  if (std::abs(s16 - c2 * s8) <= epsilon_ * (1. + std::abs(s16))) {
102  h += s16;
103  if (bb != b)
104  goto CASE1;
105  } else {
106  bb = c1;
107  if (1. + aconst * std::abs(c2) != 1)
108  goto CASE2;
109  h = s8;
110  }
111 
112  error_ = std::abs(s16 - c2 * s8);
113  return h;
114  }
static const double kCST
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
double b
Definition: hdecay.h:118
static const double w[12]
double a
Definition: hdecay.h:119
static const double x[12]

Member Data Documentation

◆ aa

double funct::GaussIntegrator::aa
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by geometryXMLparser.Alignable::covariance(), and operator()().

◆ aconst

double funct::GaussIntegrator::aconst
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ bb

double funct::GaussIntegrator::bb
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by geometryXMLparser.Alignable::covariance(), and operator()().

◆ c1

double funct::GaussIntegrator::c1
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ c2

double funct::GaussIntegrator::c2
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ epsilon_

double funct::GaussIntegrator::epsilon_
private

Definition at line 119 of file NumericalIntegration.h.

Referenced by operator()().

◆ error_

double funct::GaussIntegrator::error_
mutableprivate

Definition at line 118 of file NumericalIntegration.h.

Referenced by error(), and operator()().

◆ f1

double funct::GaussIntegrator::f1
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ f2

double funct::GaussIntegrator::f2
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ h

double funct::GaussIntegrator::h
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ i

unsigned int funct::GaussIntegrator::i
mutableprivate

Definition at line 124 of file NumericalIntegration.h.

Referenced by operator()().

◆ kCST

const double funct::GaussIntegrator::kCST = 5. / 1000
staticprivate

Definition at line 122 of file NumericalIntegration.h.

Referenced by operator()().

◆ kHF

const double funct::GaussIntegrator::kHF = 0.5
staticprivate

Definition at line 121 of file NumericalIntegration.h.

Referenced by operator()().

◆ s16

double funct::GaussIntegrator::s16
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ s8

double funct::GaussIntegrator::s8
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ u

double funct::GaussIntegrator::u
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ w

const double funct::GaussIntegrator::w
staticprivate
Initial value:
= {0.10122853629037626,
0.22238103445337447,
0.31370664587788729,
0.36268378337836198,
0.02715245941175409,
0.06225352393864789,
0.09515851168249278,
0.12462897125553387,
0.14959598881657673,
0.16915651939500254,
0.18260341504492359,
0.18945061045506850}

Definition at line 120 of file NumericalIntegration.h.

Referenced by operator()().

◆ x

const double funct::GaussIntegrator::x
staticprivate
Initial value:
= {0.96028985649753623,
0.79666647741362674,
0.52553240991632899,
0.18343464249564980,
0.98940093499164993,
0.94457502307323258,
0.86563120238783174,
0.75540440835500303,
0.61787624440264375,
0.45801677765722739,
0.28160355077925891,
0.09501250983763744}

Definition at line 120 of file NumericalIntegration.h.

Referenced by svgfig.Curve.Sample::__repr__(), svgfig.Ellipse::__repr__(), operator()(), geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

◆ xx

double funct::GaussIntegrator::xx
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by geometryXMLparser.Alignable::covariance(), and operator()().