Class Grid2D#
Defined in File Grid2D.hh
Inheritance Relationships#
Base Type#
public OrbitUtils::CppPyWrapper(Class CppPyWrapper)
Class Documentation#
-
class Grid2D : public OrbitUtils::CppPyWrapper#
This class repersents a 2D rectangular grid.
Public Functions
-
Grid2D(int xSize, int ySize)#
Constructor with just grid sizes
-
Grid2D(int xSize, int ySize, double xMin, double xMax, double yMin, double yMax)#
Constructor with grid limits and sizes
-
virtual ~Grid2D()#
Destructor
-
void setZero()#
Sets all grid points to zero
-
double **getArr()#
Returns the reference to the 2D array
-
double getValue(double x, double y)#
Returns the interpolated value from the 2D grid
-
double getValueOnGrid(int ix, int iy)#
Returns the interpolated value on grid
Returns the value on grid
-
void setValue(double value, int ix, int iy)#
Sets the value to the one point of the 2D grid
-
void binBunch(Bunch *bunch)#
Bins the Bunch into the 2D grid using X and Y coordinates. If bunch has a macrosize particle attribute it will be used.
-
void binBunch(Bunch *bunch, int ind0, int ind1)#
Bins the Bunch into the 2D grid using coordinate indexes ind0 and ind1. If bunch has a macrosize particle attribute it will be used.
-
void binValue(double value, double x, double y)#
Bins the value into the 2D grid
-
void binBunchBilinear(Bunch *bunch)#
Does a bilinear binning scheme on the bunch using X and Y coordinates
-
void binBunchBilinear(Bunch *bunch, int ind0, int ind1)#
Does a bilinear binning scheme on the bunch using coordinate indexes ind0 and ind1.
-
void binValueBilinear(double value, double x, double y)#
Bilinear bin of the value into the 2D grid
-
void calcGradient(double x, double y, double &ex, double &ey)#
Calculates gradient at a position (x,y)
Calculates gradient at a position (x,y) by using 9-points schema
-
void calcGradient(int iX, int iY, double &ex, double &ey)#
Calculates gradient at a grid point (ix,iy)
Calculates gradient at a grid point (ix,iy) by using 9-points schema
-
void calcGradientBilinear(double x, double y, double &ex, double &ey)#
Calculates bilinear interpolated gradient at a position (x,y)
-
void interpolateBilinear(double x, double y, double &value)#
Calculates bilinear interpolation a grid for position (x,y)
Calculates bilinear interpolated value at a position (x,y)
-
int getSizeX()#
Returns the grid size in x-direction
-
int getSizeY()#
Returns the grid size in y-direction
-
void synchronizeMPI(pyORBIT_MPI_Comm *comm)#
synchronizeMPI
-
int isInside(double x, double y)#
Returns 1 if (x,y) is inside the grid region, and 0 otherwise
-
void getIndAndFracX(double x, int &ind, double &frac)#
Returns the index and the fraction of the grid’s point for particular x. The index is a central point in three point interpolation: 1 <= ind <= (nBins-2) The fraction will be : 0 <= frac <= 1.0
-
void getIndAndFracY(double y, int &ind, double &frac)#
Returns the index and the fraction of the grid’s point for particular x. The index is a central point in three point interpolation: 1 <= ind <= (nBins-2) The fraction will be : 0 <= frac <= 1.0
-
void getBilinearIndAndFracX(double x, int &ind, double &frac)#
Returns the index and the fraction of the grid’s point for particular x. The index is the lower left corner for a bilinear interpolation: 0 <= ind <= (nBins-1) The fraction will be : 0 <= frac <= 1.0
Returns the index and fraction for a bilinear scheme
-
void getBilinearIndAndFracY(double y, int &ind, double &frac)#
Returns the index and the fraction of the grid’s point for particular x. The index is the lower left corner for a bilinear interpolation: 0 <= ind <= (nBins-1) The fraction will be : 0 <= frac <= 1.0
Returns the index and fraction for a bilinear scheme
-
double getGridX(int index)#
Returns the grid point x-coordinate for this index.
-
double getGridY(int index)#
Returns the grid point y-coordinate for this index.
-
double getStepX()#
Returns the grid step along x-axis
-
double getStepY()#
Returns the grid step along y-axis
-
double getMaxX()#
Returns the maximal value of the grid in x-axis
Returns the max x in the grid points
-
double getMinX()#
Returns the minimal value of the grid in x-axis
Returns the min x in the grid points
-
double getSum()#
Returns the sum of all grid points
-
double getMaxY()#
Returns the maximal value of the grid in y-axis
Returns the max y in the grid points
-
double getMinY()#
Returns the minimal value of the grid in y-axis
Returns the min y in the grid points
-
void setGridX(double xMin, double xMax)#
Sets x-grid
-
void setGridY(double yMin, double yMax)#
Sets y-grid
-
Grid2D(int xSize, int ySize)#