#include <CSPadInterpolImageProducer.h>
Public Types | |
NQuadsMax = Psana::CsPad::MaxQuadsPerSensor | |
N2x1 = Psana::CsPad::SectorsPerQuad | |
NCols2x1 = Psana::CsPad::ColumnsPerASIC | |
NRows2x1 = Psana::CsPad::MaxRowsPerASIC * 2 | |
SizeOf2x1Arr = NRows2x1 * NCols2x1 | |
enum | { NQuadsMax = Psana::CsPad::MaxQuadsPerSensor } |
enum | { N2x1 = Psana::CsPad::SectorsPerQuad } |
enum | { NCols2x1 = Psana::CsPad::ColumnsPerASIC } |
enum | { NRows2x1 = Psana::CsPad::MaxRowsPerASIC * 2 } |
enum | { SizeOf2x1Arr = NRows2x1 * NCols2x1 } |
Public Member Functions | |
CSPadInterpolImageProducer (const std::string &name) | |
virtual | ~CSPadInterpolImageProducer () |
virtual void | beginJob (Event &evt, Env &env) |
Method which is called once at the beginning of the job. | |
virtual void | beginRun (Event &evt, Env &env) |
Method which is called at the beginning of the run. | |
virtual void | beginCalibCycle (Event &evt, Env &env) |
Method which is called at the beginning of the calibration cycle. | |
virtual void | event (Event &evt, Env &env) |
virtual void | endCalibCycle (Event &evt, Env &env) |
Method which is called at the end of the calibration cycle. | |
virtual void | endRun (Event &evt, Env &env) |
Method which is called at the end of the run. | |
virtual void | endJob (Event &evt, Env &env) |
Method which is called once at the end of the job. | |
Protected Member Functions | |
void | init_address_table_1 () |
void | fill_address_table_1 () |
void | init_address_and_weights_of_4_neighbors () |
void | fill_address_and_weights_of_4_neighbors () |
void | get_address_of_4_neighbors (unsigned ix, unsigned iy) |
void | get_weight_of_4_neighbors (unsigned ix, unsigned iy) |
void | getConfigPars (Env &env) |
void | cspad_image_init () |
void | cspad_image_save_in_file (const std::string &filename="cspad_image.txt") |
void | cspad_image_add_in_event (Event &evt) |
void | cspad_image_interpolated_fill (ndarray< const int16_t, 3 > data[], QuadParameters *quadpars[], bool quadIsAvailable[]) |
Definition at line 90 of file CSPadInterpolImageProducer.h.
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
CSPadPixCoords::CSPadInterpolImageProducer::CSPadInterpolImageProducer | ( | const std::string & | name | ) |
Definition at line 55 of file CSPadInterpolImageProducer.cpp.
CSPadPixCoords::CSPadInterpolImageProducer::~CSPadInterpolImageProducer | ( | ) | [virtual] |
Definition at line 87 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::beginCalibCycle | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the beginning of the calibration cycle.
Definition at line 163 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::beginJob | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called once at the beginning of the job.
Definition at line 95 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::beginRun | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the beginning of the run.
Definition at line 103 of file CSPadInterpolImageProducer.cpp.
References GlobalUtils::calib_dir(), fill_address_and_weights_of_4_neighbors(), fill_address_table_1(), getConfigPars(), CalibPars::printCalibPars(), CSPadPixCoords::PixCoords2x1::X, CSPadPixCoords::PixCoords2x1::Y, and CSPadPixCoords::PixCoords2x1::Z.
void CSPadPixCoords::CSPadInterpolImageProducer::cspad_image_add_in_event | ( | Event & | evt | ) | [protected] |
Add the CSPad image array in the event.
Definition at line 588 of file CSPadInterpolImageProducer.cpp.
References CalibPars::shape().
Referenced by event().
void CSPadPixCoords::CSPadInterpolImageProducer::cspad_image_init | ( | ) | [protected] |
Initialization of the CSPad array
Definition at line 514 of file CSPadInterpolImageProducer.cpp.
Referenced by event().
void CSPadPixCoords::CSPadInterpolImageProducer::cspad_image_interpolated_fill | ( | ndarray< const int16_t, 3 > | data[], | |
QuadParameters * | quadpars[], | |||
bool | quadIsAvailable[] | |||
) | [protected] |
Fill the CSPad array with interpolation.
Definition at line 537 of file CSPadInterpolImageProducer.cpp.
References CSPadPixCoords::QuadParameters::getRoiMask(), and CSPadPixCoords::ArrAddr::quad.
Referenced by event().
void CSPadPixCoords::CSPadInterpolImageProducer::cspad_image_save_in_file | ( | const std::string & | filename = "cspad_image.txt" |
) | [protected] |
Save the CSPad image array in the text file.
Definition at line 577 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::endCalibCycle | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the end of the calibration cycle.
Definition at line 230 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::endJob | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called once at the end of the job.
Definition at line 246 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::endRun | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the end of the run.
Definition at line 238 of file CSPadInterpolImageProducer.cpp.
void CSPadPixCoords::CSPadInterpolImageProducer::event | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called with event data, this is the only required method, all other methods are optional
Definition at line 172 of file CSPadInterpolImageProducer.cpp.
References cspad_image_add_in_event(), cspad_image_init(), cspad_image_interpolated_fill(), h5constants::data, and CalibPars::status().
void CSPadPixCoords::CSPadInterpolImageProducer::fill_address_and_weights_of_4_neighbors | ( | ) | [protected] |
Filling of the tables of addresses and weights of the 4 neighbors from 2x1 matrix surrounding each element of the uniform CSPad matrix.
Definition at line 362 of file CSPadInterpolImageProducer.cpp.
References get_address_of_4_neighbors(), get_weight_of_4_neighbors(), and init_address_and_weights_of_4_neighbors().
Referenced by beginRun().
void CSPadPixCoords::CSPadInterpolImageProducer::fill_address_table_1 | ( | ) | [protected] |
Fills the table of addresses between the CSPad and 2x1 coordinates.
Definition at line 303 of file CSPadInterpolImageProducer.cpp.
References init_address_table_1(), N2x1, NCols2x1, NQuadsMax, and NRows2x1.
Referenced by beginRun().
void CSPadPixCoords::CSPadInterpolImageProducer::get_address_of_4_neighbors | ( | unsigned | ix, | |
unsigned | iy | |||
) | [protected] |
Get the addresses of 4 of the 2x1 neighbor pixels for each element of the uniform CSPad matrix.
Definition at line 401 of file CSPadInterpolImageProducer.cpp.
References CSPadPixCoords::areEqual(), CSPadPixCoords::ArrAddr::col, CSPadPixCoords::PixCoordsCSPad::getPixCoor_pix(), NCols2x1, NRows2x1, CSPadPixCoords::ArrAddr::quad, CSPadPixCoords::ArrAddr::row, and CSPadPixCoords::ArrAddr::sect.
Referenced by fill_address_and_weights_of_4_neighbors().
void CSPadPixCoords::CSPadInterpolImageProducer::get_weight_of_4_neighbors | ( | unsigned | ix, | |
unsigned | iy | |||
) | [protected] |
Get the weights of 4 of the 2x1 neighbor pixels for each element of the uniform CSPad matrix. Interpolation algorithm assumes the 4-node formula:
Term Weight f(x,y) = f00 1 + (f10-f00)*x x + (f01-f00)*y y + (f11+f00-f10-f01)*x*y x*y
Definition at line 459 of file CSPadInterpolImageProducer.cpp.
References CSPadPixCoords::areEqual(), CSPadPixCoords::PixCoordsCSPad::getPixCoor_pix(), CSPadPixCoords::ArrAddr::quad, and CSPadPixCoords::ArrAddr::sect.
Referenced by fill_address_and_weights_of_4_neighbors().
void CSPadPixCoords::CSPadInterpolImageProducer::getConfigPars | ( | Env & | env | ) | [protected] |
Definition at line 144 of file CSPadInterpolImageProducer.cpp.
References NQuadsMax.
Referenced by beginRun().
void CSPadPixCoords::CSPadInterpolImageProducer::init_address_and_weights_of_4_neighbors | ( | ) | [protected] |
Initialization of the tables of addresses and weights of the 4 neighbors from 2x1 matrix surrounding each element of the uniform CSPad matrix.
Definition at line 341 of file CSPadInterpolImageProducer.cpp.
Referenced by fill_address_and_weights_of_4_neighbors().
void CSPadPixCoords::CSPadInterpolImageProducer::init_address_table_1 | ( | ) | [protected] |
Initialization of the table of addresses between the CSPad and 2x1 coordinates.
Definition at line 285 of file CSPadInterpolImageProducer.cpp.
Referenced by fill_address_table_1().