ImgPixSpectra::CSPadPixSpectra Class Reference
[ImgPixSpectra]

Creates the spectal array for all pixels in the CSPad detector. More...

#include <CSPadPixSpectra.h>

List of all members.

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)


Detailed Description

Creates the spectal array for all pixels in the CSPad detector.

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.

See also:
AdditionalClass
Version:
$Id: CSPadPixSpectra.h$
Author:
Mikhail S. Dubrovin

Definition at line 86 of file CSPadPixSpectra.h.


Member Typedef Documentation

typedef Psana::CsPad::ConfigV3 ImgPixSpectra::CSPadPixSpectra::CSPadConfigType

Definition at line 91 of file CSPadPixSpectra.h.

typedef Psana::CsPad::DataV2 ImgPixSpectra::CSPadPixSpectra::CSPadDataType

Definition at line 89 of file CSPadPixSpectra.h.

typedef Psana::CsPad::ElementV2 ImgPixSpectra::CSPadPixSpectra::CSPadElementType

Definition at line 90 of file CSPadPixSpectra.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

int ImgPixSpectra::CSPadPixSpectra::ampToIndex ( double  amp  )  [protected]

Definition at line 235 of file CSPadPixSpectra.cpp.

Referenced by arrayFill().

void ImgPixSpectra::CSPadPixSpectra::arrayDelete (  )  [protected]

Definition at line 179 of file CSPadPixSpectra.cpp.

Referenced by endJob().

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]

Method which is called at the end of the run.

Definition at line 145 of file CSPadPixSpectra.cpp.

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]

Definition at line 246 of file CSPadPixSpectra.cpp.

Referenced by beginJob().

void ImgPixSpectra::CSPadPixSpectra::loopOverQuads ( shared_ptr< CSPadDataType data  )  [protected]

Definition at line 187 of file CSPadPixSpectra.cpp.

References arrayFill().

Referenced by event().

void ImgPixSpectra::CSPadPixSpectra::printInputPars (  )  [protected]

Definition at line 259 of file CSPadPixSpectra.cpp.

Referenced by beginJob().

void ImgPixSpectra::CSPadPixSpectra::printQuadConfigPars (  )  [protected]

Definition at line 278 of file CSPadPixSpectra.cpp.

Referenced by beginJob().

void ImgPixSpectra::CSPadPixSpectra::saveArrayInFile (  )  [protected]

Definition at line 302 of file CSPadPixSpectra.cpp.

References PlotSpectralArrayFromFile::arr.

Referenced by endJob().

void ImgPixSpectra::CSPadPixSpectra::saveShapeInFile (  )  [protected]

Definition at line 312 of file CSPadPixSpectra.cpp.

Referenced by endJob().


The documentation for this class was generated from the following files:
Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7