CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Public Attributes | List of all members
cass::OctalDetector Struct Reference

An Octal Detector. More...

+ Collaboration diagram for cass::OctalDetector:

Public Member Functions

int latestTag (int lastTag)
 get the latest Tag More...
 
int runNumber ()
 get the latest Run Number More...
 
uint64_t copyData (pixeldetector::Device &dev, int tag)
 copy data associtated with the tag to the device of the cassevent More...
 

Public Attributes

vector< DetectorTiletiles
 vector containing the tiles of the detector More...
 
int CASSID
 the id that the detector should have within the pixeldetector part of the CASSEvent More...
 
int tagAdvance
 how much the last tag should be advanced More...
 

Detailed Description

An Octal Detector.

A detector with a user chosen amount of equal tiles

Author
Lutz Foucar

Definition at line 238 of file sacla_online_input.cpp.

Member Function Documentation

uint64_t cass::OctalDetector::copyData ( pixeldetector::Device dev,
int  tag 
)
inline

copy data associtated with the tag to the device of the cassevent

Returns
size of the data that has been retrieved in bytes
Parameters
devreference to the pixeldetector device in the cassevent
tagthe Tag for which the data should be copied

retrieve the right detector from the cassevent and reset it

resize the frame to fit all tiles into it

set where the individual tiles will start and end within the frame

copy the data in the tile to the frame

Note
need to use openmp to parallelize since, the tiles vector is too small to be parallelized automatically by __gnu_parallelize
when compiling with openmp one needs to take special care with the exceptions. They need to be catched within the thread they have been thrown. To work around this a global exception exists that will be filled with the exception thrown. After the execution of the threads it will be checked if the global exeption has been set and if so, it will be thrown in the main thread. To be catched at a convenient time.
All variables that are declared within the 'pragma omp parallel for' statement are local to the specific thread, therefore one has to use the 'shared(error)' statement to tell openmp that 'error' is global to all threads. The 'pragma omp critical' defines a section that will only be executed by one thread at a time. Since its the part that where the exception will be handled it should only be exectued by the thread that is throwing the exception.

gather the size of the copied data

Definition at line 281 of file sacla_online_input.cpp.

References CASSID, cass::pixeldetector::Device::dets(), and cass::pixeldetector::Detector::frame().

int cass::OctalDetector::latestTag ( int  lastTag)
inline

get the latest Tag

if the last Tag is set return the next tag that should be there otherwise retrieve the latest tag and return it

Note
this hack is needed as trying to retrieve the latest tag is currently very slow. Once this issue is fixed one can think of just using the function to retrieve the latest tag.
Returns
the latest available tag
Parameters
lastTagthe last tag that was valid. If 0 the latest tag will retrieved otherwise this number will be increased by tagAdvance

Definition at line 253 of file sacla_online_input.cpp.

int cass::OctalDetector::runNumber ( )
inline

get the latest Run Number

get the latest runnumber for the first tile

Returns
the latest runnumber

Definition at line 270 of file sacla_online_input.cpp.

Member Data Documentation

int cass::OctalDetector::CASSID

the id that the detector should have within the pixeldetector part of the CASSEvent

Definition at line 370 of file sacla_online_input.cpp.

Referenced by cass::SACLAOnlineInput::runthis().

int cass::OctalDetector::tagAdvance

how much the last tag should be advanced

Definition at line 373 of file sacla_online_input.cpp.

vector<DetectorTile> cass::OctalDetector::tiles

vector containing the tiles of the detector

Definition at line 365 of file sacla_online_input.cpp.


The documentation for this struct was generated from the following file: