#include <CSPadPixSpectra.h>
Public Types | |
typedef Psana::CsPad::DataV2 | CSPadDataType |
typedef Psana::CsPad::ElementV2 | CSPadElementType |
typedef Psana::CsPad::ConfigV3 | CSPadConfigType |
Public Member Functions | |
CSPadPixSpectra (const std::string &name) | |
virtual | ~CSPadPixSpectra () |
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 | getQuadConfigPars (Env &env) |
void | printQuadConfigPars () |
void | printInputPars () |
void | arrayInit () |
void | arrayDelete () |
void | loopOverQuads (shared_ptr< CSPadDataType > data) |
void | arrayFill (int quad, const int16_t *data, uint32_t roiMask) |
void | saveArrayInFile () |
void | saveShapeInFile () |
int | ampToIndex (double amp) |
CSPadPixSpectra class is a psana module which creates and fills the spectral array for all pixels in the CSPad array. The spectral array has two dimensions, the total number of pixels and the number of amplitude bins requested in the list of configuration parameters.
An example of the configuration file (psana.cfg) for this module:
[psana]
files = /reg/d/psdm/CXI/cxi35711/xtc/e86-r0009-s00-c00.xtc
modules = ImgPixSpectra.CSPadPixSpectra
[ImgPixSpectra.CSPadPixSpectra]
source = CxiDs1.0:Cspad.0
amin = 10.
amax = 2010.
nbins = 100
arr_fname = cspad-pix-spectra.txt
#events = 500
The output file "cspad-pix-spectra.txt" contains the spectral array for CSPad pixels accumulated in job. Axillary file with additional name extension ".sha" contains the shape parameters of the spectral array. The file(s) can be used for further analysis or presentation, for example, using the python script:
ImgPixSpectra/data/PlotSpectralArrayFromFile.py cspad-pix-spectra.txt
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 86 of file CSPadPixSpectra.h.
typedef Psana::CsPad::ConfigV3 ImgPixSpectra::CSPadPixSpectra::CSPadConfigType |
Definition at line 91 of file CSPadPixSpectra.h.
Definition at line 89 of file CSPadPixSpectra.h.
Definition at line 90 of file CSPadPixSpectra.h.
ImgPixSpectra::CSPadPixSpectra::CSPadPixSpectra | ( | const std::string & | name | ) |
Definition at line 51 of file CSPadPixSpectra.cpp.
ImgPixSpectra::CSPadPixSpectra::~CSPadPixSpectra | ( | ) | [virtual] |
Definition at line 77 of file CSPadPixSpectra.cpp.
int ImgPixSpectra::CSPadPixSpectra::ampToIndex | ( | double | amp | ) | [protected] |
void ImgPixSpectra::CSPadPixSpectra::arrayDelete | ( | ) | [protected] |
void ImgPixSpectra::CSPadPixSpectra::arrayFill | ( | int | quad, | |
const int16_t * | data, | |||
uint32_t | roiMask | |||
) | [protected] |
Definition at line 207 of file CSPadPixSpectra.cpp.
References ampToIndex().
Referenced by loopOverQuads().
void ImgPixSpectra::CSPadPixSpectra::arrayInit | ( | ) | [protected] |
Definition at line 164 of file CSPadPixSpectra.cpp.
References CalibPars::size.
Referenced by beginJob().
void ImgPixSpectra::CSPadPixSpectra::beginCalibCycle | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the beginning of the calibration cycle.
Definition at line 99 of file CSPadPixSpectra.cpp.
void ImgPixSpectra::CSPadPixSpectra::beginJob | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called once at the beginning of the job.
Definition at line 83 of file CSPadPixSpectra.cpp.
References arrayInit(), getQuadConfigPars(), printInputPars(), and printQuadConfigPars().
void ImgPixSpectra::CSPadPixSpectra::beginRun | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the beginning of the run.
Definition at line 93 of file CSPadPixSpectra.cpp.
void ImgPixSpectra::CSPadPixSpectra::endCalibCycle | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called at the end of the calibration cycle.
Definition at line 139 of file CSPadPixSpectra.cpp.
void ImgPixSpectra::CSPadPixSpectra::endJob | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
Method which is called once at the end of the job.
Definition at line 151 of file CSPadPixSpectra.cpp.
References arrayDelete(), saveArrayInFile(), and saveShapeInFile().
void ImgPixSpectra::CSPadPixSpectra::endRun | ( | Event & | evt, | |
Env & | env | |||
) | [virtual] |
void ImgPixSpectra::CSPadPixSpectra::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 106 of file CSPadPixSpectra.cpp.
References h5constants::data, and loopOverQuads().
void ImgPixSpectra::CSPadPixSpectra::getQuadConfigPars | ( | Env & | env | ) | [protected] |
void ImgPixSpectra::CSPadPixSpectra::loopOverQuads | ( | shared_ptr< CSPadDataType > | data | ) | [protected] |
void ImgPixSpectra::CSPadPixSpectra::printInputPars | ( | ) | [protected] |
void ImgPixSpectra::CSPadPixSpectra::printQuadConfigPars | ( | ) | [protected] |
void ImgPixSpectra::CSPadPixSpectra::saveArrayInFile | ( | ) | [protected] |
Definition at line 302 of file CSPadPixSpectra.cpp.
References PlotSpectralArrayFromFile::arr.
Referenced by endJob().
void ImgPixSpectra::CSPadPixSpectra::saveShapeInFile | ( | ) | [protected] |