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

container and call handler for all registered processors. More...

#include <processor_manager.h>

+ Collaboration diagram for cass::ProcessorManager:

Public Types

enum  id_t {
  OperationsOn2Histos =1, OperationWithValue =2, ConstantEqual =3, BooleanNOT =4,
  BooleanAND =5, BooleanOR =6, CompareForLess =7, CompareForEqual =8,
  CheckRange =9, ConstantTrue =10, ConstantFalse =11, ConstantValue =12,
  Identity =13, TernaryOperator =14, CheckChange =15, SubtractHistograms =20,
  AddHistograms =21, DivideHistograms =22, MultiplyHistograms =23, SubtractConstant =24,
  AddConstant =25, MultiplyConstant =26, DivideConstant =27, Subtract0DConstant =30,
  Add0DConstant =31, Multiply0DConstant =32, Divide0DConstant =33, Threshold =40,
  ThresholdImage =41, TwoDProjection =50, OneDIntergral =51, RadalProjection =52,
  AngularDistribution =53, R_Phi_Representation =54, imageManip =55, previousHist =56,
  weightedProject =57, ZeroDHistogramming =60, HistogramAveraging =61, HistogramSumming =62,
  TimeAverage =63, running1Dfrom0D =64, ZeroDto2DHistogramming =65, OneDto2DHistogramming =66,
  ZeroDto1DHistogramming =67, ZeroDand1Dto2DHistogramming =68, OneDtoScatterPlot =69, SubsetHistogram =70,
  RetrieveValue =71, RetrieveColFromTable =72, SubsetTable =73, RetrieveValOfRow =74,
  ClearHistogram =75, QuitCASS =76, IdIsOnList =77, Counter =78,
  Table2TwoDHist =79, nbrOfFills =80, maximumBin =81, meanvalue =82,
  standartDev =83, sumbins =84, fwhmPeak =85, step =86,
  centerofmass =87, axisparameter =88, highlowpassfilter =89, qaverage =90,
  nodes =91, SingleCcdImage =100, SingleCcdImageIntegral =101, SingleCcdImageIntegralOverThres =102,
  PixelDetectorImage =105, PixelDetectorImageHistogram =106, CorrectionMaps =107, SumPixels =108,
  RAWPixeldetectorFrame =109, AcqirisWaveform =110, CFDTraceFromWaveform =111, CFDAnalysis =112,
  BlData =120, EvrCode =121, EventID =122, BldSpecData =123,
  EpicsData =130, CCDPhotonHitsSpectrum =140, CCDPhotonHitsImage =141, NbrOfCCDPhotonHits =142,
  CCDCoalescedPhotonHitsSpectrum =143, CCDCoalescedPhotonHitsImage =144, NbrOfCCDCoalescedPhotonHits =145, SplitLevelCoalescedPhotonHits =146,
  NewCCDPhotonHitsSpectrum =147, NewCCDPhotonHitsImage =148, NewNbrOfCCDPhotonHits =149, TofDetNbrSignals =150,
  TofDetAllSignals =151, TofDetMcpHeightVsFwhm =152, TofDetDeadtime =153, SumFoundPixels =155,
  SumPhotonHits =156, WireendNbrSignals =160, WireendHeightvsFwhm =161, AnodeTimesum =162,
  AnodeTimesumVsPos =163, DelaylineFirstGoodHit =164, DelaylineNbrReconstructedHits =165, DelaylineAllReconstuctedHits =166,
  DelaylineAnodeSigDeadtime =167, HEXCalibrator = 170, Cos2Theta =200, RealAngularDistribution =201,
  RealPolarTransformation =202, MedianBoxBackground =203, BraggPeakSNR =204, DrawPeaks =205,
  BraggPeakThreshold =206, ImageFromTable =207, BraggPeakSNRWOOutliers =208, ClusterPixelsAboveThreshold =209,
  BraggPeakMedian =210, AdvancedPhotonFinderDump =212, PIPICO =220, PhotonEnergy =230,
  TestImage =240, fixOffset =241, MaskValue =242, MaskImageValue =243,
  PixelHistogram =244, ParticleValue = 250, ParticleValues = 251, NbrParticles = 252,
  SingleParticleDetection =300, medianLastValues =301, binaryFile2D =302, Autocorrelation =310,
  Autocorrelation2 =311, fft =312, convoluteKernel =313, calibration =330,
  gaincalibration =331, hotpixmap =332, commonmodecalc =333, commonmodecalcCsPad =334,
  tof2energy =400, calcVariance =401, squaredaverage =402, Bin1DHist =403,
  TofToMTC =404, PulseDuration =405, tof2energy0D =406, tof2energylinear =407,
  tof2energylinear0D =408, calcCovarianceMap =410, calcCorrection =412, EventNumber =420,
  AddColumnToTable =500, PnccdHDF5 =1000, HDF5Converter =1001, HDF52dConverter =1002,
  CBFOutput =1500, ChetahConv =1600, CoarseCsPadAligment =1601, GeomFileCsPadAligment =1602,
  ROOTDump =2000, ROOTTreeDump =2001, ElectronEnergy =5000, TrippleCoincidence =5001,
  InvalidPP
}
 List of all currently registered processors. More...
 
typedef std::tr1::shared_ptr< ProcessorManagershared_pointer
 a shared pointer of this class More...
 
typedef Processor::name_t key_t
 type of proccessor accessor key More...
 
typedef std::list< Processor::shared_pointerprocessors_t
 Container of all currently active processors. More...
 
typedef Processor::names_t keyList_t
 List of all processor keys. More...
 

Public Member Functions

void operator() (const CASSEvent &event)
 process event More...
 
std::tr1::shared_ptr< IdListkeys ()
 retrieve all activated processors keys More...
 
ProcessorgetProcessor (const Processor::name_t &name)
 retreive pp with key More...
 
Processor::shared_pointer getProcessorSPointer (const Processor::name_t &name)
 retreive pp with name More...
 
processors_tprocessors ()
 retrieve pp container More...
 
void aboutToQuit ()
 will be called when program will quit More...
 
const keyList_tactiveList ()
 retrieve the list of active processors More...
 
void loadSettings (size_t)
 Load active processors and histograms. More...
 

Static Public Member Functions

static shared_pointer instance (std::string outputfilename)
 create the instance if not it does not exist already. More...
 
static shared_pointer instance ()
 return the already created instance of this More...
 
static shared_pointer::element_type & reference ()
 return a reference to this instance More...
 

Public Attributes

QReadWriteLock lock
 a read write lock More...
 

Protected Member Functions

Processor::shared_pointer create (const key_t &key)
 factory to create new processor with the name key. More...
 

Protected Attributes

std::tr1::shared_ptr< IdList_keys
 the list of keys. More...
 
processors_t _processors
 container for user selected and registered processors More...
 
std::string _outputfilename
 filename of the output file More...
 
keyList_t _active
 list of active keys More...
 

Private Member Functions

 ProcessorManager (std::string outputfilename)
 Private constructor of singleton. More...
 
 ProcessorManager (const ProcessorManager &)
 Prevent copy-construction of singleton. More...
 
ProcessorManageroperator= (const ProcessorManager &)
 Prevent assignment (potentially resulting in a copy) of singleton. More...
 

Static Private Attributes

static shared_pointer _instance
 pointer to the singleton instance More...
 
static QMutex _mutex
 Singleton operation locker. More...
 

Detailed Description

container and call handler for all registered processors.

All currently registered processors are listed here, specifying their id and a short description. The processor classes are named according to their number and placed in the file for the most appropriate group according to their content.

List of Processors

The Classes that implement the processor are pointed out in parenthesis. See the Class description for information about what parameters are user settable. (Keep in mind that cases matter)

---Operations--
00001: Operation on 2 Result
00002: Operation on Result with value or 0D Result
00004: Apply boolean NOT to 0D Result
00014: Ternary Operation (output InputOne when condition is true, InputTwo otherwise)

00009: Check whether Result is in a range
00012: Constant Value

00013: Identity Operation (returns the input)

00015: Check whether value of 0d Result has changed

00040: Threshold result
00041: Set bin value in result to user value, when corresponding bin value of another result is in given range

00050: Project 2D result onto a axis
00057: weighted Project 2D result onto a axis
00051: Integral of 1D result

00055: rotate, transpose or invert axis on 2d result

00056: Contains the result of the previous event

00060: Histogram 0D, 1D or 2D values to a 1D histogram, optionally with
       custom weights and remembering the counts per bin
00061: Average of a result
00062: Summing up of result
00063: Time Average of a result over given time-intervals
00064: 0D, 1D or 2D into 1D (append on right end, shifting old values to the left)
00065: Histogram two 0D values to a 2D histogram
00066: Create 2D result from two 1D results
00068: Create 2D result from 0D and 1D results, 0D defines the y-axis
00069: Use two 0D values for a scatter plot

00070: Subset a Result
00071: retrieve a user choosable value of a Result
00081: retrieve user choosable bin of 1D Result

00072: Returns a user choosable column from a table like 2D result
00073: Returns a subset of a table based on a condition on a chossable column
00074: Returns a specific value of a specific row of a table
00079: 2D Result from 2 Columns of a table with optional weight column
00500: Add a new column with content of another inputs index which is in table

00075: Clear a Result
00076: Quit CASS when Condition is met
00077: Checks if eventid is on a user provided list
00078: Count how many times it has been called (Counter)

00082: user choosable statistics value of all values of a result

00085: full width at half maximum for a peak in given range of 1D result
00086: find step in a given range of 1D result
00087: find center of mass in given range of 1D result

00088: retrieve an axis parameter of the result

00089: high or low pass filter on 1D result

00090: Q average of detector image
00091: Find local minima in a 1D result

---Data retrieval (Histogram contain only last shot)--
## Data used with new pixeldetector device
00109: retrieve raw, untreated pixeldetector Image

## Processors below only work when one has set up the pixel detectors
00105: Pixeldetector Image
00107: Display the Map used for correction and pixel detection

00148: 2d image from detected pixels
00149: Number of detected pixels

00144: 2d image from coalesced detected pixels (hits)
00145: Number of coalesced detected pixels (hits)
00146: Split level of coalesced detected pixels (hits) (how many detected pixels within coalseced hit)


## Beamline Data Retrieval
00120: Beamline data
00121: Eventcode check
00122: EventID retrival
00123: Beamline Spectrometer Data
00130: Epics data


## Waveform and detectors recorded via waveform
00110: Acqiris Waveform
00111: CFD Trace from Acqiris Waveform
00112: CFD Analysis of Waveform

00150: TofDetector number of signals in MCP waveform
00151: TofDetector all signals
00152: TofDetector signal height vs. fwhm
00153: TofDetector Deadtime between two consecutive MCP signals

00160: Delayline wireend number of signals
00161: Delayline wireend signal height vs. fwhm
00162: Delayline timesum on anode
00163: Delayline timesum on anode vs. position
00164: Delayline image of first good hit
00165: Delayline reconstructed Number of detectorhits
00166: Delayline data of all reconstructed detectorhits
00167: Delayline Deadtime between two consecutive anode signals

00170: Hex Delayline Calibrator (see Hexcalibrator for parameters)

---Data analysis--
00200: Scalar value of <cos^2\theta> from 2D Histogram
00201: Angular distribution from a 2D Histogram (interpolating)
00202: transform 2D Histogram kartesian coordinates to polar coordinates (interpolating)
00220: PIPICO Spectrum
00230: Photon energy of Shot
00250: Property of particle
00251: 2d hist with two properties of particle
00252: Number of found particle hits per shot

00203: Local image background using median box
00204: Find Bragg peaks in image using signal to noise ratio
00208: Find Bragg peaks in image using signal to noise ratio without outliers
00210: Find Bragg peaks in image MAD
00209: Cluster connected pixels which are above a threshold in an image
00205: Display Peaks found in an image
00206: Find Pixels that might belong to a bragg peak by looking above threshold

00300: single particle detection
00301: median over last values
00302: binary file 2DHistogram
00310: Autocorrelation of image in polar coordinates
00311: Autocorrelation of image in kartesian coordinates
00312: FFT of an histogram
00313: Convolute a histogram with a kernel
00240: Test Image

00330: Generate Calibration data from raw images
00331: Generate Gain Calibration from images
00332: Generate Hot Pixel Map from images
00333: Generate common mode Background level
00334: Generate common mode Background level for CsPAD

00241: fix distorted offset of pnCCD frames
00242: same as 105, but one can put a user defined value at the masked pixels
00243: apply a mask to an image set the masked values to a user defined value
00244: generate a histogram of the pixelvalues for each pixel in an image

01600: convert cass cspad to cheetah cspad
01601: rearrange cspad to coarsly right orientation (looking from upstream)
01602: rearrange cspad using a geom file

00400: ToF to Energy conversion
00404: ToF to Mass to Charge ratio conversion
00405: Pulse duration of shot
00406: ToF to Energy conversion from 0D histogram
00407: ToF to Energy conversion by linear interpolation
00408: ToF to Energy conversion by linear interpolation and correction from 0D histogram
00410: calculate covariance map
00412: calculate intensity correction

---Output--
01002: Put selectable histograms into HDF5-Files
01500: Put a selectable 2d histogram into CBF Files
02000: Dump all selected 0d, 1d and 2d cass histograms to root file
02001: Write Hits of selected Delayline Detectors to ROOT Tree

---Coltrims Analysis--
05000: Electron Energy from Recoil momenta
05001: Tripple Coincidence Spectra from same detector

---Removed Processors---
00003: removed use pp2 instead
00005: removed use pp1 instead
00006: removed use pp1 instead
00007: removed use pp1 instead
00008: removed use pp1 instead
00010: removed use pp12 instead
00011: removed use pp12 instead
00020: removed used pp1 instead
00021: removed used pp1 instead
00022: removed used pp1 instead
00023: removed used pp1 instead
00024: removed use pp2 instead
00025: removed use pp2 instead
00026: removed use pp2 instead
00027: removed use pp2 instead
00030: removed use pp2 instead
00031: removed use pp2 instead
00032: removed use pp2 instead
00033: removed use pp2 instead
00052: removed use pp202 and pp50 instead
00053: removed use pp202 and pp50 instead
00054: removed use pp202 instead
00067: removed use pp60 instead
00080: removed use pp78 instead
00083: removed use pp82 instead
00084: removed use pp82 instead
00100: removed use pp105 instead
00101: removed use pp105 and pp82 instead
00102: removed use pp105, pp40 and pp82 instead
00106: removed use pp60 instead
00108: removed use pp84 instead
00140: removed use pp105 and pp60 instead
00141: removed use pp148 instead
00142: removed use pp149 instead
00143: removed use pp60 instead
00147: removed use pp60 instead
00155: removed use pp84 instead
00156: removed use pp84 instead
00207: removed use pp79 instead
00212: removed use pp144 or pp148 instead
00401: removed use pp83 instead
00402: removed use pp61 instead
00403: removed use pp70 instead
00420: removed use pp80 instead
01000: removed use pp1002 instead
01001: removed use pp1002 instead

Definition at line 264 of file processor_manager.h.

Member Typedef Documentation

type of proccessor accessor key

Definition at line 491 of file processor_manager.h.

List of all processor keys.

Definition at line 497 of file processor_manager.h.

Container of all currently active processors.

Definition at line 494 of file processor_manager.h.

a shared pointer of this class

Definition at line 488 of file processor_manager.h.

Member Enumeration Documentation

List of all currently registered processors.

Todo:
instead of this list use strings as id

Keep this fully list synchronized with the documentation in the class header!

Enumerator
OperationsOn2Histos 
OperationWithValue 
ConstantEqual 
BooleanNOT 
BooleanAND 
BooleanOR 
CompareForLess 
CompareForEqual 
CheckRange 
ConstantTrue 
ConstantFalse 
ConstantValue 
Identity 
TernaryOperator 
CheckChange 
SubtractHistograms 
AddHistograms 
DivideHistograms 
MultiplyHistograms 
SubtractConstant 
AddConstant 
MultiplyConstant 
DivideConstant 
Subtract0DConstant 
Add0DConstant 
Multiply0DConstant 
Divide0DConstant 
Threshold 
ThresholdImage 
TwoDProjection 
OneDIntergral 
RadalProjection 
AngularDistribution 
R_Phi_Representation 
imageManip 
previousHist 
weightedProject 
ZeroDHistogramming 
HistogramAveraging 
HistogramSumming 
TimeAverage 
running1Dfrom0D 
ZeroDto2DHistogramming 
OneDto2DHistogramming 
ZeroDto1DHistogramming 
ZeroDand1Dto2DHistogramming 
OneDtoScatterPlot 
SubsetHistogram 
RetrieveValue 
RetrieveColFromTable 
SubsetTable 
RetrieveValOfRow 
ClearHistogram 
QuitCASS 
IdIsOnList 
Counter 
Table2TwoDHist 
nbrOfFills 
maximumBin 
meanvalue 
standartDev 
sumbins 
fwhmPeak 
step 
centerofmass 
axisparameter 
highlowpassfilter 
qaverage 
nodes 
SingleCcdImage 
SingleCcdImageIntegral 
SingleCcdImageIntegralOverThres 
PixelDetectorImage 
PixelDetectorImageHistogram 
CorrectionMaps 
SumPixels 
RAWPixeldetectorFrame 
AcqirisWaveform 
CFDTraceFromWaveform 
CFDAnalysis 
BlData 
EvrCode 
EventID 
BldSpecData 
EpicsData 
CCDPhotonHitsSpectrum 
CCDPhotonHitsImage 
NbrOfCCDPhotonHits 
CCDCoalescedPhotonHitsSpectrum 
CCDCoalescedPhotonHitsImage 
NbrOfCCDCoalescedPhotonHits 
SplitLevelCoalescedPhotonHits 
NewCCDPhotonHitsSpectrum 
NewCCDPhotonHitsImage 
NewNbrOfCCDPhotonHits 
TofDetNbrSignals 
TofDetAllSignals 
TofDetMcpHeightVsFwhm 
TofDetDeadtime 
SumFoundPixels 
SumPhotonHits 
WireendNbrSignals 
WireendHeightvsFwhm 
AnodeTimesum 
AnodeTimesumVsPos 
DelaylineFirstGoodHit 
DelaylineNbrReconstructedHits 
DelaylineAllReconstuctedHits 
DelaylineAnodeSigDeadtime 
HEXCalibrator 
Cos2Theta 
RealAngularDistribution 
RealPolarTransformation 
MedianBoxBackground 
BraggPeakSNR 
DrawPeaks 
BraggPeakThreshold 
ImageFromTable 
BraggPeakSNRWOOutliers 
ClusterPixelsAboveThreshold 
BraggPeakMedian 
AdvancedPhotonFinderDump 
PIPICO 
PhotonEnergy 
TestImage 
fixOffset 
MaskValue 
MaskImageValue 
PixelHistogram 
ParticleValue 
ParticleValues 
NbrParticles 
SingleParticleDetection 
medianLastValues 
binaryFile2D 
Autocorrelation 
Autocorrelation2 
fft 
convoluteKernel 
calibration 
gaincalibration 
hotpixmap 
commonmodecalc 
commonmodecalcCsPad 
tof2energy 
calcVariance 
squaredaverage 
Bin1DHist 
TofToMTC 
PulseDuration 
tof2energy0D 
tof2energylinear 
tof2energylinear0D 
calcCovarianceMap 
calcCorrection 
EventNumber 
AddColumnToTable 
PnccdHDF5 
HDF5Converter 
HDF52dConverter 
CBFOutput 
ChetahConv 
CoarseCsPadAligment 
GeomFileCsPadAligment 
ROOTDump 
ROOTTreeDump 
ElectronEnergy 
TrippleCoincidence 
InvalidPP 

Definition at line 274 of file processor_manager.h.

Constructor & Destructor Documentation

ProcessorManager::ProcessorManager ( std::string  outputfilename)
private

Private constructor of singleton.

Parameters
outputfilenamefilename of the file containing the results. Used by special processors.

Definition at line 104 of file processor_manager.cpp.

References _outputfilename, cass::Log::add(), and cass::Log::DEBUG0.

cass::ProcessorManager::ProcessorManager ( const ProcessorManager )
private

Prevent copy-construction of singleton.

Member Function Documentation

void ProcessorManager::aboutToQuit ( )

will be called when program will quit

Note
one should not use for_each macro here, because the procressors rely on beeing processed sequantially in the right order. Using for_each could result in parallel execution via omp.

Definition at line 141 of file processor_manager.cpp.

References _processors.

const keyList_t& cass::ProcessorManager::activeList ( )
inline

retrieve the list of active processors

Definition at line 557 of file processor_manager.h.

References _active.

Processor::shared_pointer ProcessorManager::create ( const key_t key)
protected

factory to create new processor with the name key.

The ID which processor should be used for the name is extracted from the settings and has the property ID.

Returns
instance the newly created processor
Parameters
[in]keythe key of the processor

Definition at line 277 of file processor_manager.cpp.

References _outputfilename, AcqirisWaveform, cass::Log::add(), AddColumnToTable, AnodeTimesum, AnodeTimesumVsPos, Autocorrelation, Autocorrelation2, axisparameter, QSettings::beginGroup(), binaryFile2D, BlData, BldSpecData, BooleanNOT, BraggPeakMedian, BraggPeakSNR, BraggPeakSNRWOOutliers, BraggPeakThreshold, calcCorrection, calcCovarianceMap, calibration, CBFOutput, CCDCoalescedPhotonHitsImage, centerofmass, CFDAnalysis, CFDTraceFromWaveform, CheckChange, CheckRange, ChetahConv, ClearHistogram, ClusterPixelsAboveThreshold, CoarseCsPadAligment, commonmodecalc, commonmodecalcCsPad, ConstantValue, convoluteKernel, CorrectionMaps, Cos2Theta, Counter, cass::Log::DEBUG0, DelaylineAllReconstuctedHits, DelaylineAnodeSigDeadtime, DelaylineFirstGoodHit, DelaylineNbrReconstructedHits, DrawPeaks, ElectronEnergy, EpicsData, EventID, EvrCode, fft, fixOffset, QString::fromStdString(), fwhmPeak, gaincalibration, GeomFileCsPadAligment, HDF52dConverter, HEXCalibrator, highlowpassfilter, HistogramAveraging, HistogramSumming, hotpixmap, Identity, IdIsOnList, imageManip, MaskImageValue, MaskValue, maximumBin, meanvalue, MedianBoxBackground, medianLastValues, NbrOfCCDCoalescedPhotonHits, NbrParticles, NewCCDPhotonHitsImage, NewNbrOfCCDPhotonHits, nodes, OneDIntergral, OneDto2DHistogramming, OneDtoScatterPlot, OperationsOn2Histos, OperationWithValue, ParticleValue, ParticleValues, PhotonEnergy, PIPICO, PixelDetectorImage, PixelHistogram, previousHist, PulseDuration, qaverage, QuitCASS, RAWPixeldetectorFrame, RealAngularDistribution, RealPolarTransformation, RetrieveColFromTable, RetrieveValOfRow, RetrieveValue, ROOTDump, ROOTTreeDump, running1Dfrom0D, SingleParticleDetection, SplitLevelCoalescedPhotonHits, step, SubsetHistogram, SubsetTable, Table2TwoDHist, TernaryOperator, TestImage, Threshold, ThresholdImage, tof2energy, tof2energy0D, tof2energylinear, tof2energylinear0D, TofDetAllSignals, TofDetDeadtime, TofDetMcpHeightVsFwhm, TofDetNbrSignals, TofToMTC, cass::toString(), TrippleCoincidence, TwoDProjection, QSettings::value(), weightedProject, WireendHeightvsFwhm, WireendNbrSignals, ZeroDand1Dto2DHistogramming, ZeroDHistogramming, and ZeroDto2DHistogramming.

Referenced by loadSettings().

Processor & ProcessorManager::getProcessor ( const Processor::name_t name)

retreive pp with key

Definition at line 260 of file processor_manager.cpp.

References getProcessorSPointer().

Processor::shared_pointer ProcessorManager::getProcessorSPointer ( const Processor::name_t name)

retreive pp with name

Parameters
nameThe name of the Processor to retrive

Definition at line 247 of file processor_manager.cpp.

References _processors.

Referenced by getProcessor().

ProcessorManager::shared_pointer ProcessorManager::instance ( std::string  outputfilename)
static

create the instance if not it does not exist already.

Returns
poiner to this singelton class.
Parameters
outputfilenamefilename of the outputfile

Definition at line 71 of file processor_manager.cpp.

References cass::Log::add(), cass::toString(), QMutexLocker::unlock(), and cass::Log::VERBOSEINFO.

ProcessorManager::shared_pointer ProcessorManager::instance ( )
static

return the already created instance of this

check whether static instance has been created and returns if so otherwise throws an exception.

Returns
the instance

Definition at line 85 of file processor_manager.cpp.

Referenced by cass::Workers::end(), and cass::RatePlotter::run().

tr1::shared_ptr< IdList > ProcessorManager::keys ( )

retrieve all activated processors keys

populate the serializable list of keys with the processors that are not hidden and return it

Returns
shared pointer to the key list

Definition at line 265 of file processor_manager.cpp.

References _keys, and _processors.

void ProcessorManager::loadSettings ( size_t  )

Load active processors and histograms.

Reset set of active processors/histograms based on cass.ini

remove all processors

load all processors declared in the ini file and convert them to list of std strings

add a default true and false processors to beginning of list

create all processors in the list

sort the processors such that the ones with no dependencies are ealier in the list

retrive dependencies of processor

move all dependencies of this processor that appear later in the list to one before this processor in the list and set the pointer to the moved processor

when the list has not been reordered we continue with the next element in the next iteration, otherwise we should treat the current element in the next iteration

log which pp are generated and their order

load the settings of the processors

Definition at line 153 of file processor_manager.cpp.

References _processors, cass::Log::add(), QSettings::beginGroup(), QSettings::childGroups(), create(), cass::Log::DEBUG0, cass::Log::DEBUG1, QSettings::fileName(), QSettings::group(), cass::Log::INFO, cass::toString(), and cass::Log::VERBOSEINFO.

void ProcessorManager::operator() ( const CASSEvent event)

process event

This function will call processors operators in the container

Parameters
eventCASSEvent to process by all active processors
Todo:
catch when processor throws an exeption and delete the processor from the active list.
  • create a remove list with all processors that depend on this
  • go through that list and fill all pp that depend on the ones in the list recursivly.
  • remove all pp that made it on the removelist
  • this needs to be done in a locked way since more than one thread do this
Note
one should not use for_each macro here, because the procressors rely on beeing processed sequantially in the right order. Using for_each could result in parallel execution via omp.

tell the pp that the event is completly processed

Definition at line 113 of file processor_manager.cpp.

References _processors, cass::CASSEvent::id(), cass::pixeldetector::DetectorHelper::releaseDetector(), and cass::ACQIRIS::HelperAcqirisDetectors::releaseDetector().

ProcessorManager& cass::ProcessorManager::operator= ( const ProcessorManager )
private

Prevent assignment (potentially resulting in a copy) of singleton.

processors_t& cass::ProcessorManager::processors ( )
inline

retrieve pp container

Definition at line 551 of file processor_manager.h.

References _processors.

ProcessorManager::shared_pointer::element_type & ProcessorManager::reference ( )
static

return a reference to this instance

check whether static instance has been created and returns if so otherwise throws an exception.

Returns
reference to the instance

Definition at line 93 of file processor_manager.cpp.

Referenced by cass::RatePlotter::run(), and cass::Processor::setupDependency().

Member Data Documentation

keyList_t cass::ProcessorManager::_active
protected

list of active keys

Definition at line 597 of file processor_manager.h.

Referenced by activeList().

ProcessorManager::shared_pointer ProcessorManager::_instance
staticprivate

pointer to the singleton instance

Definition at line 614 of file processor_manager.h.

std::tr1::shared_ptr<IdList> cass::ProcessorManager::_keys
protected

the list of keys.

used to create the combobox in cassview

Definition at line 588 of file processor_manager.h.

Referenced by keys().

QMutex ProcessorManager::_mutex
staticprivate

Singleton operation locker.

Definition at line 617 of file processor_manager.h.

std::string cass::ProcessorManager::_outputfilename
protected

filename of the output file

Definition at line 594 of file processor_manager.h.

Referenced by create(), and ProcessorManager().

processors_t cass::ProcessorManager::_processors
protected

container for user selected and registered processors

Definition at line 591 of file processor_manager.h.

Referenced by aboutToQuit(), getProcessorSPointer(), keys(), loadSettings(), operator()(), and processors().

QReadWriteLock cass::ProcessorManager::lock

a read write lock

read write for making sure that reload is not called when someone wants retrieve a list or retrieve a processor.

Definition at line 564 of file processor_manager.h.


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