#include <PixCoordsCSPadV2.h>
Inheritance diagram for CSPadPixCoords::PixCoordsCSPadV2:
Public Member Functions | |
PixCoordsCSPadV2 (PSCalib::CSPadCalibPars *cspad_calibpars=new PSCalib::CSPadCalibPars(), bool tiltIsApplied=true, bool use_wide_pix_center=false) | |
PixCoordsCSPadV2 class fills and provides access to the CSPad pixel coordinates. | |
virtual | ~PixCoordsCSPadV2 () |
Destructor. | |
void | fillPixelCoordinateArrays () |
Protected method for filling pixel coordinate array in constructor. | |
void | fillOneSectionInDet (uint32_t sect, double xcenter, double ycenter, double zcenter, double rotation) |
Protected method for filling pixel coordinate array for specified sensor. | |
void | resetXYOriginAndMinMax () |
Protected method which resets the origin of the pixel coordinate map to (0,0). | |
void | printXYLimits () |
Prints X and Y limits of the pixel coordinate map. | |
void | printConstants () |
Prints member data and partial coordinate map. | |
void | printCoordArray (unsigned r1=10, unsigned r2=21, unsigned c1=15, unsigned c2=18) |
Prints the part of the 2-D coordinate array in the specified ranges of rows and columns. | |
double | getPixCoor_um (AXIS axis, unsigned sect, unsigned row, unsigned col) |
Returns coordimate of the pixel in [um](micrometers) for specified axis, section, row, and column. | |
double | getPixCoor_pix (AXIS axis, unsigned sect, unsigned row, unsigned col) |
Returns coordimate of the pixel in [pix](pixel size) for specified axis, section, row, and column. | |
double * | getPixCoorArr_um (AXIS axis) |
Returns pointer to the pixel coordimate array of entire CSPAD in [um](micrometers). | |
ndarray< double, 3 > | getPixCoorNDArrShapedAsData_um (AXIS axis, CSPadConfigPars *cspad_configpars=new CSPadConfigPars()) |
double | get_x_min () |
Returns minimal x coordinate of the pixel in [um]. | |
double | get_x_max () |
Returns maximal x coordinate of the pixel in [um]. | |
double | get_y_min () |
Returns minimal y coordinate of the pixel in [um]. | |
double | get_y_max () |
Returns maximal y coordinate of the pixel in [um]. | |
double | get_z_min () |
Returns minimal z coordinate of the pixel in [um]. | |
double | get_z_max () |
Returns maximal z coordinate of the pixel in [um]. | |
Static Public Attributes | |
static const unsigned | N2X1_IN_DET = 32 |
Number of 2x1s in the entire detector. |
#include "PSCalib/CSPadCalibPars.h" #include "CSPadPixCoords/CSPadConfigPars.h" #include "CSPadPixCoords/PixCoordsCSPadV2.h" typedef PSCalib::CSPadCalibPars CALIB; typedef CSPadPixCoords::CSPadConfigPars CONFIG; typedef CSPadPixCoords::PixCoordsCSPadV2 PC;
PC *pix_coords = new PC();
PC *pix_coords = new PC(calibpars);
const std::string calibDir = "/reg/d/psdm/cxi/cxitut13/calib"; const std::string groupName = "CsPad::CalibV1"; const std::string source = "CxiDs1.0:Cspad.0"; unsigned runNumber = 10; CALIB *calibpars = new CALIB(calibDir, groupName, source, runNumber); calibpars->printCalibPars();
pix_coords -> printXYLimits(); pix_coords -> printConstants(); unsigned row_begin=15, row_end=20, col_begin=40, col_end=50; pix_coords -> printCoordArray(row_begin, row_end, col_begin, col_end);
unsigned s=23, r=123, c=235; double ix = pix_coords -> getPixCoor_pix(PC::AXIS_X, s, r, c); double iy = pix_coords -> getPixCoor_pix(PC::AXIS_Y, s, r, c);
// Reservation of memory for image array unsigned NX = (unsigned)(pix_coords -> get_x_max() * PC::UM_TO_PIX + 1); unsigned NY = (unsigned)(pix_coords -> get_x_max() * PC::UM_TO_PIX + 1); double* img_arr = new double[NX*NY]; std::fill_n(img_arr, int(NX*NY), double(0)); // Assignment to coordinates for (unsigned s=0; s<PC::N2X1_IN_DET; s++){ for (unsigned r=0; r<PC::ROWS2X1; r++){ for (unsigned c=0; c<PC::COLS2X1; c++){ int ix = int (pix_coords -> getPixCoor_pix(PC::AXIS_X, s, r, c) + 0.1); int iy = int (pix_coords -> getPixCoor_pix(PC::AXIS_Y, s, r, c) + 0.1); img_arr[ix + iy*NX] = r+c; } } }
ndarray<double,3> nda_pix_coord_x = pix_coords -> getPixCoorNDArrShapedAsData_um (PC::AXIS_X, config); ndarray<double,3> nda_pix_coord_y = pix_coords -> getPixCoorNDArrShapedAsData_um (PC::AXIS_Y, config);
uint32_t numQuads = 4; // 4; uint32_t quadNumber[] = {0,1,2,3}; // {0,1,2,3}; uint32_t roiMask[] = {0375,0337,0177,0376}; // {0377,0377,0377,0377}; CONFIG *config = new CONFIG( numQuads, quadNumber, roiMask ); config -> printCSPadConfigPars();
// Assignment to coordinates for entire array int ix, iy; ndarray<double, 3>::iterator xit; ndarray<double, 3>::iterator yit; for(xit=nda_pix_coord_x.begin(), yit=nda_pix_coord_y.begin(); xit!=nda_pix_coord_x.end(); ++xit, ++yit) { ix = int ( *xit * PC::UM_TO_PIX + 0.1); iy = int ( *yit * PC::UM_TO_PIX + 0.1); img_arr[ix + iy*NX] = ix+iy; }
Definition at line 163 of file PixCoordsCSPadV2.h.
CSPadPixCoords::PixCoordsCSPadV2::PixCoordsCSPadV2 | ( | PSCalib::CSPadCalibPars * | cspad_calibpars = new PSCalib::CSPadCalibPars() , |
|
bool | tiltIsApplied = true , |
|||
bool | use_wide_pix_center = false | |||
) |
PixCoordsCSPadV2 class fills and provides access to the CSPad pixel coordinates.
Fills/holds/provides access to the array of the quad coordinates, indexed by the quad, section, row, and column.
[in] | cspad_calibpars | - pointer to the store of CSPAD calibration parameters |
[in] | tiltIsApplied | - boolean key indicating if the tilt angle correction for 2x1 in the detector is applied. |
[in] | use_wide_pix_center | - boolean parameter defining coordinate of the wide pixel; true-use wide pixel center as its coordinate, false-use ASIC-uniform pixel coordinate. |
Definition at line 59 of file PixCoordsCSPadV2.cpp.
References fillPixelCoordinateArrays(), and resetXYOriginAndMinMax().
CSPadPixCoords::PixCoordsCSPadV2::~PixCoordsCSPadV2 | ( | ) | [virtual] |
void CSPadPixCoords::PixCoordsCSPadV2::fillOneSectionInDet | ( | uint32_t | sect, | |
double | xcenter, | |||
double | ycenter, | |||
double | zcenter, | |||
double | rotation | |||
) |
Protected method for filling pixel coordinate array for specified sensor.
Definition at line 110 of file PixCoordsCSPadV2.cpp.
References CSPadPixCoords::PixCoords2x1V2::AXIS_X, CSPadPixCoords::PixCoords2x1V2::AXIS_Y, CSPadPixCoords::PixCoords2x1V2::COLS2X1, CSPadPixCoords::PixCoords2x1V2::get_coord_map_2x1(), CSPadPixCoords::PixCoords2x1V2::ROWS2X1, and CSPadPixCoords::PixCoords2x1V2::UM.
Referenced by fillPixelCoordinateArrays().
void CSPadPixCoords::PixCoordsCSPadV2::fillPixelCoordinateArrays | ( | ) |
Protected method for filling pixel coordinate array in constructor.
Definition at line 71 of file PixCoordsCSPadV2.cpp.
References fillOneSectionInDet(), N2X1_IN_DET, CSPadPixCoords::PixCoords2x1V2::PIX_SIZE_UM, and CSPadPixCoords::rotation().
Referenced by PixCoordsCSPadV2().
double CSPadPixCoords::PixCoordsCSPadV2::get_x_max | ( | ) | [inline] |
Returns maximal x coordinate of the pixel in [um].
Definition at line 238 of file PixCoordsCSPadV2.h.
double CSPadPixCoords::PixCoordsCSPadV2::get_x_min | ( | ) | [inline] |
Returns minimal x coordinate of the pixel in [um].
Definition at line 235 of file PixCoordsCSPadV2.h.
double CSPadPixCoords::PixCoordsCSPadV2::get_y_max | ( | ) | [inline] |
Returns maximal y coordinate of the pixel in [um].
Definition at line 244 of file PixCoordsCSPadV2.h.
double CSPadPixCoords::PixCoordsCSPadV2::get_y_min | ( | ) | [inline] |
Returns minimal y coordinate of the pixel in [um].
Definition at line 241 of file PixCoordsCSPadV2.h.
double CSPadPixCoords::PixCoordsCSPadV2::get_z_max | ( | ) | [inline] |
Returns maximal z coordinate of the pixel in [um].
Definition at line 250 of file PixCoordsCSPadV2.h.
double CSPadPixCoords::PixCoordsCSPadV2::get_z_min | ( | ) | [inline] |
Returns minimal z coordinate of the pixel in [um].
Definition at line 247 of file PixCoordsCSPadV2.h.
double CSPadPixCoords::PixCoordsCSPadV2::getPixCoor_pix | ( | AXIS | axis, | |
unsigned | sect, | |||
unsigned | row, | |||
unsigned | col | |||
) |
Returns coordimate of the pixel in [pix](pixel size) for specified axis, section, row, and column.
[in] | axis | - enumerated axes, can be set to PC2X2::AXIS_X or PC2X2::AXIS_Y |
[in] | sect | - section index [0,1] (two 2x1 sensors in CSPAD2x2) |
[in] | row | - row index [0,184] |
[in] | col | - column index [0,387] |
Definition at line 173 of file PixCoordsCSPadV2.cpp.
References getPixCoor_um(), and CSPadPixCoords::PixCoords2x1V2::UM_TO_PIX.
double CSPadPixCoords::PixCoordsCSPadV2::getPixCoor_um | ( | AXIS | axis, | |
unsigned | sect, | |||
unsigned | row, | |||
unsigned | col | |||
) |
Returns coordimate of the pixel in [um](micrometers) for specified axis, section, row, and column.
[in] | axis | - enomerated axes, can be PC2X2::AXIS_X or PC2X2::AXIS_Y |
[in] | sect | - section index [0,1] |
[in] | row | - row index [0,184] |
[in] | col | - column index [0,387] |
Definition at line 159 of file PixCoordsCSPadV2.cpp.
References CSPadPixCoords::PixCoords2x1V2::AXIS_X, CSPadPixCoords::PixCoords2x1V2::AXIS_Y, and CSPadPixCoords::PixCoords2x1V2::AXIS_Z.
Referenced by getPixCoor_pix().
double * CSPadPixCoords::PixCoordsCSPadV2::getPixCoorArr_um | ( | AXIS | axis | ) |
Returns pointer to the pixel coordimate array of entire CSPAD in [um](micrometers).
Definition at line 180 of file PixCoordsCSPadV2.cpp.
References CSPadPixCoords::PixCoords2x1V2::AXIS_X, CSPadPixCoords::PixCoords2x1V2::AXIS_Y, and CSPadPixCoords::PixCoords2x1V2::AXIS_Z.
ndarray< double, 3 > CSPadPixCoords::PixCoordsCSPadV2::getPixCoorNDArrShapedAsData_um | ( | AXIS | axis, | |
CSPadConfigPars * | cspad_configpars = new CSPadConfigPars() | |||
) |
Returns the ndarray with data for specified axis and configuration parameters
[in] | axis | - enumerated axis |
[in] | cspad_configpars | - pointer to the store of CSPAD configuration parameters |
Definition at line 194 of file PixCoordsCSPadV2.cpp.
References CSPadPixCoords::PixCoords2x1V2::AXIS_X, CSPadPixCoords::PixCoords2x1V2::AXIS_Y, CSPadPixCoords::PixCoords2x1V2::AXIS_Z, CSPadPixCoords::PixCoords2x1V2::COLS2X1, CSPadPixCoords::CSPadConfigPars::getCSPadPixNDArrShapedAsData(), N2X1_IN_DET, and CSPadPixCoords::PixCoords2x1V2::ROWS2X1.
void CSPadPixCoords::PixCoordsCSPadV2::printConstants | ( | ) |
Prints member data and partial coordinate map.
Definition at line 229 of file PixCoordsCSPadV2.cpp.
References CSPadPixCoords::PixCoords2x1V2::COLS2X1, CSPadPixCoords::PixCoords2x1V2::COLS2X1HALF, CSPadPixCoords::PixCoords2x1V2::PIX_SIZE_COLS, CSPadPixCoords::PixCoords2x1V2::PIX_SIZE_ROWS, CSPadPixCoords::PixCoords2x1V2::PIX_SIZE_UM, CSPadPixCoords::PixCoords2x1V2::PIX_SIZE_WIDE, CSPadPixCoords::PixCoords2x1V2::ROWS2X1, CSPadPixCoords::PixCoords2x1V2::SIZE2X1, and CSPadPixCoords::PixCoords2x1V2::UM_TO_PIX.
void CSPadPixCoords::PixCoordsCSPadV2::printCoordArray | ( | unsigned | r1 = 10 , |
|
unsigned | r2 = 21 , |
|||
unsigned | c1 = 15 , |
|||
unsigned | c2 = 18 | |||
) |
Prints the part of the 2-D coordinate array in the specified ranges of rows and columns.
Definition at line 246 of file PixCoordsCSPadV2.cpp.
References N2X1_IN_DET.
void CSPadPixCoords::PixCoordsCSPadV2::printXYLimits | ( | ) |
Prints X and Y limits of the pixel coordinate map.
Definition at line 214 of file PixCoordsCSPadV2.cpp.
void CSPadPixCoords::PixCoordsCSPadV2::resetXYOriginAndMinMax | ( | ) |
Protected method which resets the origin of the pixel coordinate map to (0,0).
Definition at line 137 of file PixCoordsCSPadV2.cpp.
References CSPadPixCoords::PixCoords2x1V2::COLS2X1, N2X1_IN_DET, and CSPadPixCoords::PixCoords2x1V2::ROWS2X1.
Referenced by PixCoordsCSPadV2().
const unsigned CSPadPixCoords::PixCoordsCSPadV2::N2X1_IN_DET = 32 [static] |
Number of 2x1s in the entire detector.
Definition at line 166 of file PixCoordsCSPadV2.h.
Referenced by fillPixelCoordinateArrays(), getPixCoorNDArrShapedAsData_um(), printCoordArray(), resetXYOriginAndMinMax(), test02(), and test03().