CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
cass::pp331 Class Reference

pixel detector gain calibrations More...

#include <pixel_detector_calibration.h>

+ Inheritance diagram for cass::pp331:
+ Collaboration diagram for cass::pp331:

Public Member Functions

 pp331 (const name_t &)
 constructor. More...
 
virtual void process (const CASSEvent &, result_t &)
 overwrite default behaviour don't do anything More...
 
virtual void loadSettings (size_t)
 load the settings of this pp More...
 
virtual void aboutToQuit ()
 write the calibrations before quitting More...
 
virtual void processCommand (std::string command)
 receive commands from the gui More...
 
- Public Member Functions inherited from cass::AccumulatingProcessor
 AccumulatingProcessor (const name_t &name)
 constructor More...
 
virtual ~AccumulatingProcessor ()
 virtual destructor More...
 
virtual void processEvent (const CASSEvent &evt)
 process the event More...
 
virtual const result_tresult (const CASSEvent::id_t)
 retrieve a result. More...
 
virtual void releaseEvent (const CASSEvent &)
 overwrite default behaviour to do nothing More...
 
virtual void createHistList (result_t::shared_pointer result)
 create the list of results More...
 
- Public Member Functions inherited from cass::Processor
 Processor (const name_t &name)
 constructor More...
 
virtual ~Processor ()
 virtual destructor More...
 
result_t::shared_pointer resultCopy (const uint64_t eventid)
 retrieve histogram for id More...
 
virtual void load ()
 load the general settings More...
 
const names_tdependencies ()
 Define all processors keys a processor depends on. More...
 
void clearDependencies ()
 clear the dependenies More...
 
void clearHistograms ()
 clear the histograms More...
 
const name_t name () const
 retrieve the name of this processor More...
 
bool hide () const
 retrieve the hide flag of this processor More...
 
const std::string & comment () const
 retrieve the comment of this processor More...
 

Protected Member Functions

void loadCalibration ()
 write the calibration data to file More...
 
void writeCalibration ()
 write the calibration data to file More...
 
void calculateGainMap (result_t &gainmap)
 write the calibration data to file More...
 
- Protected Member Functions inherited from cass::Processor
virtual void createHistList (result_t::shared_pointer result)
 create result list. More...
 
void setupGeneral ()
 general setup of the processor More...
 
bool setupCondition (bool defaultConditionType=true)
 setup the condition. More...
 
shared_pointer setupDependency (const std::string &depVarName, const name_t &name="")
 setup the dependecy. More...
 

Private Types

typedef std::pair< size_t, double > statistic_t
 definition of the statistic More...
 
typedef std::vector< statistic_tstatistics_t
 defintion of the statistics More...
 
typedef std::pair< float, float > range_t
 define the range type More...
 

Private Attributes

shared_pointer _image
 the raw image More...
 
statistics_t _statistics
 the statistics for each pixel More...
 
size_t _minPhotonCount
 the number of photons that a pixel should have seen before calculating the gain More...
 
range_t _aduRange
 the range of adu that indicates whether a pixel contains a photon More...
 
float _constGain
 the gain value that will be assinged to the pixel that one could not calculate the gain for More...
 
bool _write
 flag to tell whether the calibration should be written More...
 
std::string _filename
 the filename that is used to save the calibration More...
 
int _nFrames
 the number of frames after which the gain map is calculted More...
 
int _counter
 counter to count how many times this has been called More...
 
size_t _gainOffset
 offset to the gain part More...
 
size_t _countOffset
 offset to the counts part More...
 
size_t _aveOffset
 offset to the average part More...
 
size_t _sizeOfImage
 the size of the input image More...
 
bool _isPnCCDNoCTE
 flag to tell whether its a pnCCD we are not interested in correction the cte More...
 

Additional Inherited Members

- Public Types inherited from cass::Processor
typedef std::tr1::shared_ptr< Processorshared_pointer
 a shared pointer of this More...
 
typedef std::string name_t
 define the name type More...
 
typedef std::list< name_tnames_t
 define the list of names More...
 
typedef CachedList::item_type result_t
 define the results More...
 
typedef CachedList::item_sp resultsp_t
 define the shared pointer to the result More...
 
- Protected Attributes inherited from cass::AccumulatingProcessor
result_t::shared_pointer _result
 the result that accumulates the events More...
 
size_t _nbrEventsAccumulated
 the number of events the processor has accumulated More...
 
- Protected Attributes inherited from cass::Processor
const name_t _name
 the processors name More...
 
bool _hide
 flag to tell whether this pp should be hidden in the dropdown list More...
 
std::string _comment
 optional comment that one can add to a processor. More...
 
CachedList _resultList
 the list of results More...
 
names_t _dependencies
 the list of dependencies More...
 
shared_pointer _condition
 pointer to the processor that will contain the condition More...
 

Detailed Description

pixel detector gain calibrations

Available PostProcessors:
"331": pixel detector gain calibrations
See also
Processor for a list of all commonly available cass.ini settings.

The output of this Processor consits of 3 images stiched together along the y (slow) coordinate. The ouput has the same x width as the input, but 3 times the y width as the input.

Y from 0 * y_input .. 1 * y_input-1: The calculated Gain Map Y from 1 * y_input .. 2 * y_input-1: The photons counts map Y from 2 * y_input .. 3 * y_input-1: The Average value of the photons of interest in that pixel

User definable Parameters:

Processor/%name%/{Image}
the image of the pixel detector

Processor/%name%/{Filename}
the name of the file where the calibration will be written to. Default is out.cal

Processor/%name%/{WriteCal}
Flag to tell whether the calibration should be written. Default is true.

Processor/%name%/{ADURangeLow|ADURangeHigh}
The adu range that indicates that one photon has hit the pixel. Default is 0|0

Processor/%name%/{MinimumNbrPhotons}
The minimum number of photons that a pixel should have seen before the gain is calulated for this pixel. Default is 200

Processor/%name%/{DefaultGainValue}
The gain value that will be assinged to the pixels that haven't seen enough photons. Default is 1.

Processor/%name%/{NbrOfFrames}
The number of frames after which the gain map will be calculated. Default is -1, which sais that it will never be calulated during running and only when the program ends.

Processor/%name%/{IsPnCCDNoCTE}
If the detector is a pnCCD and one doesn't want to correct for the CTE this option will calcultate the gain for a column of a quadrant of the detector. Default is false

Author
Lutz Foucar

Definition at line 359 of file pixel_detector_calibration.h.

Member Typedef Documentation

typedef std::pair<float,float> cass::pp331::range_t
private

define the range type

Definition at line 404 of file pixel_detector_calibration.h.

typedef std::pair<size_t,double> cass::pp331::statistic_t
private

definition of the statistic

Definition at line 392 of file pixel_detector_calibration.h.

typedef std::vector<statistic_t> cass::pp331::statistics_t
private

defintion of the statistics

Definition at line 395 of file pixel_detector_calibration.h.

Constructor & Destructor Documentation

pp331::pp331 ( const name_t name)

constructor.

Definition at line 487 of file pixel_detector_calibration.cpp.

References loadSettings().

Member Function Documentation

void pp331::aboutToQuit ( )
virtual

write the calibrations before quitting

Reimplemented from cass::Processor.

Definition at line 564 of file pixel_detector_calibration.cpp.

References cass::AccumulatingProcessor::_result, _write, calculateGainMap(), and writeCalibration().

void pp331::calculateGainMap ( result_t gainmap)
protected

write the calibration data to file

calculate the average of the average pixelvalues, disregarding pixels that have not seen enough photons in the right ADU range.

assining the gain value for each pixel that has seen enough statistics. gain is calculated by formula $ gain = frac{average_average_pixelvalue}{average_pixelvalue} $ If not enough photons are in the pixel, set the predefined user value

Definition at line 571 of file pixel_detector_calibration.cpp.

References _aveOffset, _constGain, _countOffset, _gainOffset, _minPhotonCount, _sizeOfImage, average, and cass::Result< T >::begin().

Referenced by aboutToQuit(), and process().

void pp331::loadCalibration ( )
protected

write the calibration data to file

Definition at line 549 of file pixel_detector_calibration.cpp.

Referenced by loadSettings().

void pp331::loadSettings ( size_t  )
virtual
void pp331::process ( const CASSEvent evt,
result_t result 
)
virtual

overwrite default behaviour don't do anything

go though all pixels of image

check if pixel is within the 1 photon adu range

calculate the mean pixel value

set the same value as for the pixel for all pixels in the columns in the quadrant

find out which which column and row we're currently working on

get pointers to the corresponding starts of the maps

when the pixel is in the upper half of the detector advance the pointer to the upper half

if we have reached the requested nbr of frames calculate the gain map

Reimplemented from cass::Processor.

Definition at line 601 of file pixel_detector_calibration.cpp.

References _aduRange, _aveOffset, _counter, _countOffset, _gainOffset, _image, _isPnCCDNoCTE, _nFrames, cass::Result< T >::begin(), calculateGainMap(), cass::Result< T >::end(), cass::CASSEvent::id(), cass::Result< T >::lock, and cass::Result< T >::shape().

void pp331::processCommand ( std::string  command)
virtual

receive commands from the gui

Reimplemented from cass::Processor.

Definition at line 541 of file pixel_detector_calibration.cpp.

void pp331::writeCalibration ( )
protected

write the calibration data to file

Definition at line 554 of file pixel_detector_calibration.cpp.

References _filename, cass::AccumulatingProcessor::_result, _sizeOfImage, and cass::Result< T >::front().

Referenced by aboutToQuit().

Member Data Documentation

range_t cass::pp331::_aduRange
private

the range of adu that indicates whether a pixel contains a photon

Definition at line 407 of file pixel_detector_calibration.h.

Referenced by loadSettings(), and process().

size_t cass::pp331::_aveOffset
private

offset to the average part

Definition at line 433 of file pixel_detector_calibration.h.

Referenced by calculateGainMap(), loadSettings(), and process().

float cass::pp331::_constGain
private

the gain value that will be assinged to the pixel that one could not calculate the gain for

Definition at line 412 of file pixel_detector_calibration.h.

Referenced by calculateGainMap(), and loadSettings().

int cass::pp331::_counter
private

counter to count how many times this has been called

Definition at line 424 of file pixel_detector_calibration.h.

Referenced by loadSettings(), and process().

size_t cass::pp331::_countOffset
private

offset to the counts part

Definition at line 430 of file pixel_detector_calibration.h.

Referenced by calculateGainMap(), loadSettings(), and process().

std::string cass::pp331::_filename
private

the filename that is used to save the calibration

Definition at line 418 of file pixel_detector_calibration.h.

Referenced by loadSettings(), and writeCalibration().

size_t cass::pp331::_gainOffset
private

offset to the gain part

Definition at line 427 of file pixel_detector_calibration.h.

Referenced by calculateGainMap(), loadSettings(), and process().

shared_pointer cass::pp331::_image
private

the raw image

Definition at line 389 of file pixel_detector_calibration.h.

Referenced by loadSettings(), and process().

bool cass::pp331::_isPnCCDNoCTE
private

flag to tell whether its a pnCCD we are not interested in correction the cte

Definition at line 439 of file pixel_detector_calibration.h.

Referenced by loadSettings(), and process().

size_t cass::pp331::_minPhotonCount
private

the number of photons that a pixel should have seen before calculating the gain

Definition at line 401 of file pixel_detector_calibration.h.

Referenced by calculateGainMap(), and loadSettings().

int cass::pp331::_nFrames
private

the number of frames after which the gain map is calculted

Definition at line 421 of file pixel_detector_calibration.h.

Referenced by loadSettings(), and process().

size_t cass::pp331::_sizeOfImage
private

the size of the input image

Definition at line 436 of file pixel_detector_calibration.h.

Referenced by calculateGainMap(), loadSettings(), and writeCalibration().

statistics_t cass::pp331::_statistics
private

the statistics for each pixel

Definition at line 398 of file pixel_detector_calibration.h.

bool cass::pp331::_write
private

flag to tell whether the calibration should be written

Definition at line 415 of file pixel_detector_calibration.h.

Referenced by aboutToQuit(), and loadSettings().


The documentation for this class was generated from the following files: