CMS 3D CMS Logo

MFGridFactory.cc
Go to the documentation of this file.
2 #include "binary_ifstream.h"
4 
11 
12 #include <iostream>
13 
14 using namespace std;
15 
16 MFGrid* MFGridFactory::build(const string& name, const GloballyPositioned<float>& vol) {
17  binary_ifstream inFile(name);
18  int gridType;
19  inFile >> gridType;
20 
21  MFGrid* result;
22  switch (gridType) {
23  case 1:
24  result = new RectangularCartesianMFGrid(inFile, vol);
25  break;
26  case 2:
27  result = new TrapezoidalCartesianMFGrid(inFile, vol);
28  break;
29  case 3:
30  result = new RectangularCylindricalMFGrid(inFile, vol);
31  break;
32  case 4:
33  result = new TrapezoidalCylindricalMFGrid(inFile, vol);
34  break;
35  case 5:
36  result = new SpecialCylindricalMFGrid(inFile, vol, gridType);
37  break;
38  case 6:
39  result = new SpecialCylindricalMFGrid(inFile, vol, gridType);
40  break;
41  default:
42  cout << "ERROR Grid type unknown: " << gridType << endl;
43  // result = new GlobalGridWrapper(vol, name);
44  result = nullptr;
45  break;
46  }
47  inFile.close();
48  return result;
49 }
50 
51 MFGrid* MFGridFactory::build(const string& name, const GloballyPositioned<float>& vol, double phiMin, double phiMax) {
52  MFGrid* sectorGrid = build(name, vol);
53  return new CylinderFromSectorMFGrid(vol, phiMin, phiMax, sectorGrid);
54 }
GloballyPositioned< float >
TrapezoidalCylindricalMFGrid
Definition: TrapezoidalCylindricalMFGrid.h:10
TrapezoidalCylindricalMFGrid.h
MFGrid
Definition: MFGrid.h:27
RectangularCylindricalMFGrid.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CylinderFromSectorMFGrid.h
newFWLiteAna.build
build
Definition: newFWLiteAna.py:126
MFGridFactory::build
static MFGrid * build(const std::string &name, const GloballyPositioned< float > &vol)
Build interpolator for a binary grid file.
TrapezoidalCartesianMFGrid
Definition: TrapezoidalCartesianMFGrid.h:19
MFGridFactory.h
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
GloballyPositioned.h
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
binary_ifstream
Definition: binary_ifstream.h:8
CylinderFromSectorMFGrid
Definition: CylinderFromSectorMFGrid.h:7
SpecialCylindricalMFGrid
Definition: SpecialCylindricalMFGrid.h:16
RectangularCartesianMFGrid.h
binary_ifstream.h
SpecialCylindricalMFGrid.h
RectangularCartesianMFGrid
Definition: RectangularCartesianMFGrid.h:9
std
Definition: JetResolutionObject.h:76
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
mps_fire.result
result
Definition: mps_fire.py:311
TrapezoidalCartesianMFGrid.h
RectangularCylindricalMFGrid
Definition: RectangularCylindricalMFGrid.h:9