#include <CSPad2x2ImageProducer.h>
Public Types | |
typedef CSPadPixCoords::PixCoordsCSPad2x2V2 | PC2X2 |
Public Member Functions | |
CSPad2x2ImageProducer (const std::string &name) | |
virtual | ~CSPad2x2ImageProducer () |
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. | |
template<typename T> | |
bool | getConfigParsForType (Env &env) |
Get configuration info from Env, return true if configuration is found, othervise false. | |
template<typename TOUT> | |
void | save2DArrayInEventForType (Event &evt) |
template<typename T> | |
void | cspad_image_fill (const ndarray< const T, 3 > &data) |
template<typename TELEMENT> | |
bool | procCSPad2x2DataForType (Event &evt) |
template<typename T> | |
void | procCSPad2x2NDArrForTypeAndNDArr (Event &evt, const ndarray< const T, 3 > &inp_nda) |
template<typename T> | |
bool | procCSPad2x2NDArrForType (Event &evt) |
Static Public Attributes | |
static const int | NX_CSPAD2X2 = 400 |
static const int | NY_CSPAD2X2 = 400 |
Protected Member Functions | |
void | printInputParameters () |
void | getConfigPars (Env &env) |
bool | getGeometryPars (const std::string &calib_dir, const int runnum, const unsigned prbits) |
void | getCalibPars (Event &evt, Env &env) |
void | cspad_image_init () |
void | processEvent (Event &evt, Env &env) |
Do job to process event. | |
void | cspad_image_add_in_event (Event &evt) |
void | checkTypeImplementation () |
CSPad2x2ImageProducer works in psana framework. It does a few operation as follows: 1) get the pixel coordinates from PixCoords2x1 and PixCoordsCSPad2x2 classes, 2) get data from the event, 3) produce the Image2D object with CSPad image for each event, 4) add the Image2D object in the event for further modules.
The CSPad2x2 image array currently is shaped as [400][400] pixels.
This class should not be used directly in the code of users modules. Instead, it should be added as a module in the psana.cfg file with appropriate parameters. Then, the produced Image2D object can be extracted from event and used in other modules.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 72 of file CSPad2x2ImageProducer.h.
Definition at line 75 of file CSPad2x2ImageProducer.h.
CSPadPixCoords::CSPad2x2ImageProducer::CSPad2x2ImageProducer | ( | const std::string & | name | ) |
CSPadPixCoords::CSPad2x2ImageProducer::~CSPad2x2ImageProducer | ( | ) | [virtual] |
Definition at line 91 of file CSPad2x2ImageProducer.cpp.
void CSPadPixCoords::CSPad2x2ImageProducer::beginCalibCycle | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the beginning of the calibration cycle.
Definition at line 142 of file CSPad2x2ImageProducer.cpp.
void CSPadPixCoords::CSPad2x2ImageProducer::beginJob | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called once at the beginning of the job.
Definition at line 125 of file CSPad2x2ImageProducer.cpp.
References printInputParameters(), and CSPadPixCoords::printSizeOfTypes().
void CSPadPixCoords::CSPad2x2ImageProducer::beginRun | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the beginning of the run.
Definition at line 134 of file CSPad2x2ImageProducer.cpp.
void CSPadPixCoords::CSPad2x2ImageProducer::checkTypeImplementation | ( | ) | [protected] |
Definition at line 317 of file CSPad2x2ImageProducer.cpp.
References CSPadPixCoords::ASDATA, CSPadPixCoords::DOUBLE, CSPadPixCoords::FLOAT, CSPadPixCoords::INT, CSPadPixCoords::INT16, and GeometryAccess::msg.
Referenced by CSPad2x2ImageProducer().
void CSPadPixCoords::CSPad2x2ImageProducer::cspad_image_add_in_event | ( | Event & | evt | ) | [protected] |
Definition at line 304 of file CSPad2x2ImageProducer.cpp.
References CSPadPixCoords::ASDATA, CSPadPixCoords::DOUBLE, CSPadPixCoords::FLOAT, CSPadPixCoords::INT, and CSPadPixCoords::INT16.
Referenced by procCSPad2x2DataForType(), and procCSPad2x2NDArrForTypeAndNDArr().
void CSPadPixCoords::CSPad2x2ImageProducer::cspad_image_fill | ( | const ndarray< const T, 3 > & | data | ) | [inline] |
Definition at line 213 of file CSPad2x2ImageProducer.h.
References CSPadPixCoords::PixCoords2x1V2::COLS2X1, CSPadPixCoords::PixCoordsCSPad2x2V2::N2X1_IN_DET, NX_CSPAD2X2, NY_CSPAD2X2, and CSPadPixCoords::PixCoords2x1V2::ROWS2X1.
void CSPadPixCoords::CSPad2x2ImageProducer::cspad_image_init | ( | ) | [protected] |
void CSPadPixCoords::CSPad2x2ImageProducer::endCalibCycle | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the end of the calibration cycle.
Definition at line 167 of file CSPad2x2ImageProducer.cpp.
void CSPadPixCoords::CSPad2x2ImageProducer::endJob | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called once at the end of the job.
Definition at line 181 of file CSPad2x2ImageProducer.cpp.
void CSPadPixCoords::CSPad2x2ImageProducer::endRun | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the end of the run.
Definition at line 174 of file CSPad2x2ImageProducer.cpp.
void CSPadPixCoords::CSPad2x2ImageProducer::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 150 of file CSPad2x2ImageProducer.cpp.
References getCalibPars(), getConfigPars(), CSPadPixCoords::printTimeStamp(), and processEvent().
void CSPadPixCoords::CSPad2x2ImageProducer::getCalibPars | ( | Event & | evt, | |
Env & | env | |||
) | [protected] |
Definition at line 240 of file CSPad2x2ImageProducer.cpp.
References CSPadPixCoords::PixCoords2x1V2::AXIS_X, CSPadPixCoords::PixCoords2x1V2::AXIS_Y, GlobalUtils::calib_dir(), CSPadPixCoords::PixCoords2x1V2::COLS2X1, getGeometryPars(), CSPadPixCoords::getRunNumber(), CSPadPixCoords::PixCoordsCSPad2x2V2::N2X1_IN_DET, CalibPars::printCalibPars(), CSPadPixCoords::PixCoords2x1V2::ROWS2X1, ex-ipython::runnum, and CalibPars::size.
Referenced by event().
void CSPadPixCoords::CSPad2x2ImageProducer::getConfigPars | ( | Env & | env | ) | [protected] |
bool CSPadPixCoords::CSPad2x2ImageProducer::getConfigParsForType | ( | Env & | env | ) | [inline] |
Get configuration info from Env, return true if configuration is found, othervise false.
Definition at line 170 of file CSPad2x2ImageProducer.h.
bool CSPadPixCoords::CSPad2x2ImageProducer::getGeometryPars | ( | const std::string & | calib_dir, | |
const int | runnum, | |||
const unsigned | prbits | |||
) | [protected] |
Definition at line 209 of file CSPad2x2ImageProducer.cpp.
References PSCalib::CalibFileFinder::findCalibFile(), GeometryAccess::geometry, and CalibPars::size.
Referenced by getCalibPars().
void CSPadPixCoords::CSPad2x2ImageProducer::printInputParameters | ( | ) | [protected] |
Definition at line 99 of file CSPad2x2ImageProducer.cpp.
References NX_CSPAD2X2, and NY_CSPAD2X2.
Referenced by beginJob().
bool CSPadPixCoords::CSPad2x2ImageProducer::procCSPad2x2DataForType | ( | Event & | evt | ) | [inline] |
Definition at line 244 of file CSPad2x2ImageProducer.h.
References cspad_image_add_in_event(), and CSPadPixCoords::PixCoordsCSPad2x2V2::N2X1_IN_DET.
bool CSPadPixCoords::CSPad2x2ImageProducer::procCSPad2x2NDArrForType | ( | Event & | evt | ) | [inline] |
Definition at line 274 of file CSPad2x2ImageProducer.h.
void CSPadPixCoords::CSPad2x2ImageProducer::procCSPad2x2NDArrForTypeAndNDArr | ( | Event & | evt, | |
const ndarray< const T, 3 > & | inp_nda | |||
) | [inline] |
void CSPadPixCoords::CSPad2x2ImageProducer::processEvent | ( | Event & | evt, | |
Env & | env | |||
) | [protected] |
Do job to process event.
Definition at line 280 of file CSPad2x2ImageProducer.cpp.
Referenced by event().
void CSPadPixCoords::CSPad2x2ImageProducer::save2DArrayInEventForType | ( | Event & | evt | ) | [inline] |
Definition at line 189 of file CSPad2x2ImageProducer.h.
References NX_CSPAD2X2, NY_CSPAD2X2, and CalibPars::shape().
const int CSPadPixCoords::CSPad2x2ImageProducer::NX_CSPAD2X2 = 400 [static] |
Definition at line 77 of file CSPad2x2ImageProducer.h.
Referenced by cspad_image_fill(), printInputParameters(), and save2DArrayInEventForType().
const int CSPadPixCoords::CSPad2x2ImageProducer::NY_CSPAD2X2 = 400 [static] |
Definition at line 78 of file CSPad2x2ImageProducer.h.
Referenced by cspad_image_fill(), printInputParameters(), and save2DArrayInEventForType().