CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/MagneticField/Interpolation/src/gridTesters.cc File Reference

#include "Grid1D.h"
#include "Grid3D.h"
#include <cassert>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include "LinearGridInterpolator3D.h"

Go to the source code of this file.

Functions

int grid1d_t ()
int grid3d_t ()

Function Documentation

int grid1d_t ( )

Definition at line 36 of file gridTesters.cc.

References reco::print().

               {

  bool ok=true;
  Grid1D grid(-10.,10.,11);

  print(grid, 7.2);
  print(grid, 10.);
  print(grid, -10.2);
  print(grid, 10.2);

  ok &= testGrid1D(grid);

  assert(ok? 0 : 1);
  return ok ? 0 : 1;

}
int grid3d_t ( )

Definition at line 83 of file gridTesters.cc.

References gather_cfg::cout, tests::test_Package01::factory, inter, and LinearGridInterpolator3D::interpolate().

               {

  Grid3D const  * grid = factory();

  LinearGridInterpolator3D inter(*grid);
  
  std::cout << inter.interpolate(7.5,7.2,-3.4) << std::endl;
  std::cout << inter.interpolate(-0.5,10.2,-3.4) << std::endl;


  delete grid;
  return 0;
}