The Gaudi Framework  v30r3 (a5ef0a68)
IntegralInTest.cpp
Go to the documentation of this file.
1 // ============================================================================
2 // Include files
3 // ============================================================================
4 // STD & STL
5 // ============================================================================
6 #include <cmath>
7 #include <cstdio>
8 // ============================================================================
9 // GAUDI
10 // ============================================================================
12 #include "GaudiMath/GaudiMath.h"
13 // ============================================================================
14 // CLHEP
15 // ============================================================================
16 #include "CLHEP/GenericFunctions/Cos.hh"
17 #include "CLHEP/GenericFunctions/Sin.hh"
18 // ============================================================================
19 // Handle CLHEP 2.0.x move to CLHEP namespace
20 namespace CLHEP
21 {
22 }
23 using namespace CLHEP;
24 
25 // ============================================================================
33 // ============================================================================
34 
35 int main()
36 {
37 
38  std::cout << " Test for numerical differentiation of Genfun::Cos(x) " << std::endl;
39 
40  const GaudiMath::IndIntegral& mysin = GaudiMath::IndIntegral( Genfun::Cos(), 0, 0.0 );
41 
42  for ( double x = -90 * Gaudi::Units::degree; x <= 180 * Gaudi::Units::degree; x += 10 * Gaudi::Units::degree ) {
43  double value = mysin( x );
44  double error = mysin.error();
45  printf( "x=%8.3f deg; I(Cos)=%+.19f; ActErr=%+.19f; EstErr=%+.19f;\n", x / Gaudi::Units::degree, value,
46  value - sin( x ), error );
47  }
48 }
49 
50 // ============================================================================
51 // The END
52 // ============================================================================
constexpr double degree
T endl(T...args)
int main()
Genfun::GaudiMathImplementation::NumericalIndefiniteIntegral IndIntegral
Definition: GaudiMath.h:29