CMS 3D CMS Logo

List of all members | Public Types | Static Public Member Functions
MFGridFactory Class Reference

#include <MFGridFactory.h>

Public Types

using binary_ifstream = magneticfield::interpolation::binary_ifstream
 

Static Public Member Functions

static MFGridbuild (const std::string &name, const GloballyPositioned< float > &vol)
 Build interpolator for a binary grid file. More...
 
static MFGridbuild (binary_ifstream &name, const GloballyPositioned< float > &vol)
 
static MFGridbuild (const std::string &name, const GloballyPositioned< float > &vol, double phiMin, double phiMax)
 Build a 2pi phi-symmetric interpolator for a binary grid file. More...
 

Detailed Description

Factory for field interpolators using binary files.

Author
T. Todorov

Definition at line 20 of file MFGridFactory.h.

Member Typedef Documentation

◆ binary_ifstream

Definition at line 22 of file MFGridFactory.h.

Member Function Documentation

◆ build() [1/3]

static MFGrid* MFGridFactory::build ( const std::string &  name,
const GloballyPositioned< float > &  vol 
)
static

Build interpolator for a binary grid file.

Referenced by magneticfield::InterpolatorBuilder::build(), and MagGeoBuilderFromDDD::buildInterpolator().

◆ build() [2/3]

MFGrid * MFGridFactory::build ( binary_ifstream name,
const GloballyPositioned< float > &  vol 
)
static

Definition at line 21 of file MFGridFactory.cc.

References gather_cfg::cout, and mps_fire::result.

21  {
22  int gridType;
23  inFile >> gridType;
24 
25  MFGrid* result;
26  switch (gridType) {
27  case 1:
28  result = new RectangularCartesianMFGrid(inFile, vol);
29  break;
30  case 2:
31  result = new TrapezoidalCartesianMFGrid(inFile, vol);
32  break;
33  case 3:
34  result = new RectangularCylindricalMFGrid(inFile, vol);
35  break;
36  case 4:
37  result = new TrapezoidalCylindricalMFGrid(inFile, vol);
38  break;
39  case 5:
40  result = new SpecialCylindricalMFGrid(inFile, vol, gridType);
41  break;
42  case 6:
43  result = new SpecialCylindricalMFGrid(inFile, vol, gridType);
44  break;
45  default:
46  cout << "ERROR Grid type unknown: " << gridType << endl;
47  // result = new GlobalGridWrapper(vol, name);
48  result = nullptr;
49  break;
50  }
51  return result;
52 }
Definition: MFGrid.h:27

◆ build() [3/3]

static MFGrid* MFGridFactory::build ( const std::string &  name,
const GloballyPositioned< float > &  vol,
double  phiMin,
double  phiMax 
)
static

Build a 2pi phi-symmetric interpolator for a binary grid file.