ImgPixSpectra::CSPad2x2PixSpectra Class Reference
[ImgPixSpectra]

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

#include <CSPad2x2PixSpectra.h>

List of all members.

Public Member Functions

 CSPad2x2PixSpectra (const std::string &name)
virtual ~CSPad2x2PixSpectra ()
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 printInputPars ()
void arrayInit ()
void arrayDelete ()
void arrayFill (const int16_t *data)
void saveArrayInFile ()
void saveShapeInFile ()
int ampToIndex (double amp)


Detailed Description

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

CSPad2x2PixSpectra class is a psana module which creates and fills the spectral array for all pixels in the CSPad2x2 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/cxi49812/xtc/e157-r0203-s00-c00.xtc
    modules       = ImgPixSpectra.CSPad2x2PixSpectra
    
    [ImgPixSpectra.CSPad2x2PixSpectra]
    source        = CxiSc1.0:Cspad2x2.0
    amin          =   500.
    amax          =  1000.
    nbins         =   100
    arr_fname     = cspad2x2-pix-spectra.txt
    #events       =   500                                                  

The output file "cspad2x2-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 cspad2x2-pix-spectra.txt

This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.

Version:
$Id: CSPad2x2PixSpectra.h$
Author:
Mikhail S. Dubrovin

Definition at line 82 of file CSPad2x2PixSpectra.h.


Constructor & Destructor Documentation

ImgPixSpectra::CSPad2x2PixSpectra::CSPad2x2PixSpectra ( const std::string &  name  ) 

Definition at line 55 of file CSPad2x2PixSpectra.cpp.

ImgPixSpectra::CSPad2x2PixSpectra::~CSPad2x2PixSpectra (  )  [virtual]

Definition at line 81 of file CSPad2x2PixSpectra.cpp.


Member Function Documentation

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

Definition at line 247 of file CSPad2x2PixSpectra.cpp.

Referenced by arrayFill().

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

Definition at line 198 of file CSPad2x2PixSpectra.cpp.

Referenced by endJob().

void ImgPixSpectra::CSPad2x2PixSpectra::arrayFill ( const int16_t *  data  )  [protected]

Definition at line 206 of file CSPad2x2PixSpectra.cpp.

References ampToIndex().

Referenced by event().

void ImgPixSpectra::CSPad2x2PixSpectra::arrayInit (  )  [protected]

Definition at line 185 of file CSPad2x2PixSpectra.cpp.

References CalibPars::size.

Referenced by beginJob().

void ImgPixSpectra::CSPad2x2PixSpectra::beginCalibCycle ( Event &  evt,
Env &  env 
) [virtual]

Method which is called at the beginning of the calibration cycle.

Definition at line 101 of file CSPad2x2PixSpectra.cpp.

void ImgPixSpectra::CSPad2x2PixSpectra::beginJob ( Event &  evt,
Env &  env 
) [virtual]

Method which is called once at the beginning of the job.

Definition at line 87 of file CSPad2x2PixSpectra.cpp.

References arrayInit(), and printInputPars().

void ImgPixSpectra::CSPad2x2PixSpectra::beginRun ( Event &  evt,
Env &  env 
) [virtual]

Method which is called at the beginning of the run.

Definition at line 95 of file CSPad2x2PixSpectra.cpp.

void ImgPixSpectra::CSPad2x2PixSpectra::endCalibCycle ( Event &  evt,
Env &  env 
) [virtual]

Method which is called at the end of the calibration cycle.

Definition at line 159 of file CSPad2x2PixSpectra.cpp.

void ImgPixSpectra::CSPad2x2PixSpectra::endJob ( Event &  evt,
Env &  env 
) [virtual]

Method which is called once at the end of the job.

Definition at line 171 of file CSPad2x2PixSpectra.cpp.

References arrayDelete(), saveArrayInFile(), and saveShapeInFile().

void ImgPixSpectra::CSPad2x2PixSpectra::endRun ( Event &  evt,
Env &  env 
) [virtual]

Method which is called at the end of the run.

Definition at line 165 of file CSPad2x2PixSpectra.cpp.

void ImgPixSpectra::CSPad2x2PixSpectra::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 108 of file CSPad2x2PixSpectra.cpp.

References arrayFill(), and h5constants::data.

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

Definition at line 258 of file CSPad2x2PixSpectra.cpp.

Referenced by beginJob().

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

Definition at line 219 of file CSPad2x2PixSpectra.cpp.

References PlotSpectralArrayFromFile::arr.

Referenced by endJob().

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

Definition at line 229 of file CSPad2x2PixSpectra.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