#include <PixCoordsCSPad2x2V2.h>
Inheritance diagram for CSPadPixCoords::PixCoordsCSPad2x2V2:
Public Member Functions | |
PixCoordsCSPad2x2V2 (PSCalib::CSPad2x2CalibPars *cspad_calibpars=new PSCalib::CSPad2x2CalibPars(), bool tiltIsApplied=true, bool use_wide_pix_center=false) | |
PixCoordsCSPad2x2V2 class fills and provides access to the CSPAD2x2 pixel coordinates. | |
virtual | ~PixCoordsCSPad2x2V2 () |
Destructor. | |
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 | 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]. | |
Static Public Attributes | |
static const unsigned | N2X1_IN_DET = 2 |
Number of 2x1s in the CSPAD2x2. | |
Protected Member Functions | |
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). |
#include "CSPadPixCoords/PixCoordsCSPad2x2V2.h" #include "PSCalib/CSPad2x2CalibPars.h" //#include "CSPadPixCoords/Image2D.h" typedef CSPadPixCoords::PixCoordsCSPad2x2V2 PC2X2; typedef PSCalib::CSPad2x2CalibPars CALIB2X2;
PC2X2 *pix_coords_2x2 = new PC2X2();
PC2X2 *pix_coords_2x2 = new PC2X2(calibpars2x2);
bool tiltIsApplied = true, bool use_wide_pix_center=false; PC2X2 *pix_coords_2x2 = new PC2X2(calibpars2x2, tiltIsApplied, use_wide_pix_center);
const std::string calibDir = "/reg/d/psdm/xpp/xpptut13/calib"; const std::string groupName = "CsPad2x2::CalibV1"; const std::string source = "XppGon.0:Cspad2x2.1"; unsigned runNumber = 10; CALIB2X2 *calibpars2x2 = new CALIB2X2(calibDir, groupName, source, runNumber);
pix_coords_2x2 -> printXYLimits(); pix_coords_2x2 -> printConstants(); unsigned row_begin=15, row_end=20, col_begin=40, col_end=50; pix_coords_2x2 -> printCoordArray(row_begin, row_end, col_begin, col_end);
unsigned s=1, r=123, c=235; double ix = pix_coords_2x2 -> getPixCoor_pix(PC2X2::AXIS_X, s, r, c); double iy = pix_coords_2x2 -> getPixCoor_pix(PC2X2::AXIS_Y, s, r, c);
const unsigned NX=400, NY=400; double img_arr[NY][NX]; std::fill_n(&img_arr[0][0], int(NX*NY), double(0)); for (unsigned r=0; r<PC2X2::ROWS2X1; r++){ for (unsigned c=0; c<PC2X2::COLS2X1; c++){ for (unsigned s=0; s<PC2X2::N2X1_IN_DET; s++){ int ix = int (pix_coords_2x2 -> getPixCoor_pix(PC2X2::AXIS_X, s, r, c) + 0.1); int iy = int (pix_coords_2x2 -> getPixCoor_pix(PC2X2::AXIS_Y, s, r, c) + 0.1); img_arr[ix][iy] = ix+iy; // <--- This should be an intensity in this pixel. } } }
Definition at line 141 of file PixCoordsCSPad2x2V2.h.
CSPadPixCoords::PixCoordsCSPad2x2V2::PixCoordsCSPad2x2V2 | ( | PSCalib::CSPad2x2CalibPars * | cspad_calibpars = new PSCalib::CSPad2x2CalibPars() , |
|
bool | tiltIsApplied = true , |
|||
bool | use_wide_pix_center = false | |||
) |
PixCoordsCSPad2x2V2 class fills and provides access to the CSPAD2x2 pixel coordinates.
[in] | cspad_calibpars | - pointer to the store of CSPAD2x2 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 58 of file PixCoordsCSPad2x2V2.cpp.
References fillPixelCoordinateArrays(), and resetXYOriginAndMinMax().
CSPadPixCoords::PixCoordsCSPad2x2V2::~PixCoordsCSPad2x2V2 | ( | ) | [virtual] |
void CSPadPixCoords::PixCoordsCSPad2x2V2::fillOneSectionInDet | ( | uint32_t | sect, | |
double | xcenter, | |||
double | ycenter, | |||
double | zcenter, | |||
double | rotation | |||
) | [protected] |
Protected method for filling pixel coordinate array for specified sensor.
Definition at line 97 of file PixCoordsCSPad2x2V2.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::PixCoordsCSPad2x2V2::fillPixelCoordinateArrays | ( | ) | [protected] |
Protected method for filling pixel coordinate array in constructor.
Definition at line 70 of file PixCoordsCSPad2x2V2.cpp.
References fillOneSectionInDet(), N2X1_IN_DET, CSPadPixCoords::PixCoords2x1V2::PIX_SIZE_UM, and CSPadPixCoords::rotation().
Referenced by PixCoordsCSPad2x2V2().
double CSPadPixCoords::PixCoordsCSPad2x2V2::get_x_max | ( | ) | [inline] |
Returns maximal x coordinate of the pixel in [um].
Definition at line 195 of file PixCoordsCSPad2x2V2.h.
double CSPadPixCoords::PixCoordsCSPad2x2V2::get_x_min | ( | ) | [inline] |
Returns minimal x coordinate of the pixel in [um].
Definition at line 192 of file PixCoordsCSPad2x2V2.h.
double CSPadPixCoords::PixCoordsCSPad2x2V2::get_y_max | ( | ) | [inline] |
Returns maximal y coordinate of the pixel in [um].
Definition at line 201 of file PixCoordsCSPad2x2V2.h.
double CSPadPixCoords::PixCoordsCSPad2x2V2::get_y_min | ( | ) | [inline] |
Returns minimal y coordinate of the pixel in [um].
Definition at line 198 of file PixCoordsCSPad2x2V2.h.
double CSPadPixCoords::PixCoordsCSPad2x2V2::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 157 of file PixCoordsCSPad2x2V2.cpp.
References getPixCoor_um(), and CSPadPixCoords::PixCoords2x1V2::UM_TO_PIX.
double CSPadPixCoords::PixCoordsCSPad2x2V2::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 143 of file PixCoordsCSPad2x2V2.cpp.
References CSPadPixCoords::PixCoords2x1V2::AXIS_X, CSPadPixCoords::PixCoords2x1V2::AXIS_Y, and CSPadPixCoords::PixCoords2x1V2::AXIS_Z.
Referenced by getPixCoor_pix().
void CSPadPixCoords::PixCoordsCSPad2x2V2::printConstants | ( | ) |
Prints member data and partial coordinate map.
Definition at line 177 of file PixCoordsCSPad2x2V2.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::PixCoordsCSPad2x2V2::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 194 of file PixCoordsCSPad2x2V2.cpp.
References N2X1_IN_DET.
void CSPadPixCoords::PixCoordsCSPad2x2V2::printXYLimits | ( | ) |
Prints X and Y limits of the pixel coordinate map.
Definition at line 164 of file PixCoordsCSPad2x2V2.cpp.
void CSPadPixCoords::PixCoordsCSPad2x2V2::resetXYOriginAndMinMax | ( | ) | [protected] |
Protected method which resets the origin of the pixel coordinate map to (0,0).
Definition at line 123 of file PixCoordsCSPad2x2V2.cpp.
References CSPadPixCoords::PixCoords2x1V2::COLS2X1, N2X1_IN_DET, and CSPadPixCoords::PixCoords2x1V2::ROWS2X1.
Referenced by PixCoordsCSPad2x2V2().
const unsigned CSPadPixCoords::PixCoordsCSPad2x2V2::N2X1_IN_DET = 2 [static] |
Number of 2x1s in the CSPAD2x2.
Definition at line 144 of file PixCoordsCSPad2x2V2.h.
Referenced by CSPadPixCoords::CSPad2x2ImageProducer::cspad_image_fill(), fillPixelCoordinateArrays(), CSPadPixCoords::CSPad2x2ImageProducer::getCalibPars(), printCoordArray(), CSPadPixCoords::CSPad2x2ImageProducer::procCSPad2x2DataForType(), resetXYOriginAndMinMax(), test02(), and test03().