CFEL - ASG Software Suite
2.5.0
CASS
|
SACLA Offline Input for cass. More...
#include <sacla_offline_input.h>
Public Member Functions | |
void | runthis () |
function with the main loop More... | |
void | load () |
load the parameters used for the input More... | |
double | progress () |
retrieve the progress state More... | |
uint64_t | eventcounter () |
retrieve the number of processed events More... | |
uint64_t | skippedeventcounter () |
retrieve the number of skipped processed events More... | |
![]() | |
virtual | ~InputBase () |
destructor More... | |
void | newEventAdded (const size_t eventsize) |
increment the numer of events received in the ratemeter More... | |
RingBuffer< CASSEvent > & | ringbuffer () |
retrieve a reference to the the ringbuffer More... | |
rbItem_t | getNextFillable (unsigned timeout=500) |
retrieve an iterator to the next fillable event More... | |
![]() | |
PausableThread (control_t control=_run, QObject *parent=0) | |
constructor More... | |
virtual | ~PausableThread () |
destructor More... | |
void | run () |
run the thread More... | |
void | pause (bool block=false) |
pause the thread More... | |
void | waitUntilPaused () |
waits until thread is paused More... | |
void | resume () |
resume the thread More... | |
status_t | status () const |
return the current status of the thread More... | |
bool | shouldQuit () const |
query whether this thread is told to quit More... | |
void | rethrowException () const |
rethrow the thrown exception More... | |
exception_t | exceptionThrown () const |
![]() | |
QThread (QObject *parent=0) | |
currentThread () | |
HANDLE QThread::currentThreadId() | |
exec () | |
exit (int returnCode=0) | |
finished () | |
idealThreadCount () | |
isFinished () | |
isRunning () | |
msleep (unsigned long msecs) | |
priority () | |
quit () | |
run () | |
setPriority (Priority priority) | |
setStackSize (uint stackSize) | |
setTerminationEnabled (bool enabled=true) | |
sleep (unsigned long secs) | |
stackSize () | |
start (Priority priority=InheritPriority) | |
started () | |
terminate () | |
terminated () | |
usleep (unsigned long usecs) | |
wait (unsigned long time=ULONG_MAX) | |
yieldCurrentThread () | |
Static Public Member Functions | |
static void | instance (std::string runlistname, RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, bool quitwhendone, QObject *parent=0) |
create instance of this More... | |
![]() | |
static shared_pointer | instance () |
get the signelton instance More... | |
static shared_pointer::element_type & | reference () |
get reference to the singelton instance More... | |
Private Types | |
typedef std::vector< std::tr1::shared_ptr< TagListProcessor > > | proc_t |
define the processors container More... | |
Private Member Functions | |
SACLAOfflineInput (std::string runlistname, RingBuffer< CASSEvent > &, Ratemeter &ratemeter, Ratemeter &loadmeter, bool quitwhendone, QObject *parent=0) | |
constructor More... | |
Private Attributes | |
int | _chunks |
number of chuncks that the list should be split into More... | |
bool | _quitWhenDone |
flag to tell the thread to quit when its done with all files More... | |
std::string | _runlistname |
name of the file containing all files that we need to process More... | |
proc_t | _procs |
the processor container More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< InputBase > | shared_pointer |
shared pointer of this type More... | |
typedef RingBuffer< CASSEvent >::iter_type | rbItem_t |
define an item in the ringbuffer More... | |
![]() | |
enum | status_t { running, paused, notstarted } |
enum describing the internal status of the thread More... | |
enum | control_t { _run, _quit, _pause } |
enum describing the control status of the thread More... | |
enum | exception_t { NO_EXCEPTION, INVALID_ARGUMENT_EXCEPTION, RUNTIME_ERROR_EXCEPTION, OUT_OF_RANGE_EXCEPTION, LOGIC_ERROR_EXCEPTION, STANDART_EXCEPTION, UNKNOWN_EXCEPTION } |
enum describing which exception was thrown More... | |
![]() | |
virtual void | end () |
tell the thread to quit More... | |
![]() | |
QMutex | lock |
a mutex so that external program can lock access to this More... | |
![]() | |
InputBase (RingBuffer< CASSEvent > &ringbuffer, Ratemeter &ratemeter, Ratemeter &loadmeter, QObject *parent=0) | |
protected constructor since it should be a singelton More... | |
![]() | |
void | pausePoint () |
point where the thread will be paused More... | |
![]() | |
RingBuffer< CASSEvent > & | _ringbuffer |
reference to the ringbuffer More... | |
Ratemeter & | _ratemeter |
ratemeter to measure the rate More... | |
Ratemeter & | _loadmeter |
meter to measure the data load More... | |
![]() | |
QMutex | _pauseMutex |
mutex to wait on until thread is paused More... | |
QWaitCondition | _pauseCondition |
wait condition to wait on until thread is resumed More... | |
QWaitCondition | _waitUntilPausedCondition |
wait condition to wait unitl thread is paused More... | |
status_t | _status |
the internal status of the thread More... | |
control_t | _control |
the internal control status of the thread More... | |
size_t | _pausecount |
a counter how many threads have pause this thread More... | |
exception_t | _exception_thrown |
flag to show that general exception was thrown More... | |
std::invalid_argument | _invarg_excep |
the invalid arguemnt exception thrown More... | |
std::runtime_error | _runt_excep |
the invalid arguemnt exception thrown More... | |
std::out_of_range | _outrange_excep |
the invalid arguemnt exception thrown More... | |
std::logic_error | _logic_excep |
the invalid arguemnt exception thrown More... | |
![]() | |
static shared_pointer | _instance |
singelton instance More... | |
SACLA Offline Input for cass.
This class will be used in offline modus. I will take an string that contains a filename. In the file that the filename points to has to be a list with beamline number and runnumbers to analyse. These need to be given as a comma separated list. If only these two numbers are provided the list of tags will be retrieved for the given run. Optionally one can also provide a list of tags to be analysed for that given run / beamline number combination. This has to be provided as comma separated list immediatly following the beamline / runnumber combination. The filename name must be passed to the program with the -i parameter.
For each run in the list it will retrieve the tagnumbers and extract the data associated with the tag number using the cass::SACLAConverter
Definition at line 46 of file sacla_offline_input.h.
|
private |
define the processors container
Definition at line 121 of file sacla_offline_input.h.
|
private |
constructor
runlistname | name of the file containing all runs that should be processed |
ringbuffer | reference to the ringbuffer containing the CASSEvents |
ratemeter | reference to the ratemeter to measure the rate of the input |
loadmeter | reference to the ratemeter to measure the load of the input |
quitwhendone | flag that tells this class that it should quit the Program when its done reading all events |
parent | The parent QT Object of this class |
Definition at line 278 of file sacla_offline_input.cpp.
References cass::Log::add(), load(), and cass::Log::VERBOSEINFO.
|
virtual |
retrieve the number of processed events
Reimplemented from cass::InputBase.
Definition at line 458 of file sacla_offline_input.cpp.
References _procs.
Referenced by runthis().
|
static |
create instance of this
runlistname | name of the file containing all runs that should be processed |
ringbuffer | reference to the ringbuffer containing the CASSEvents |
ratemeter | reference to the ratemeter to measure the rate of the input |
loadmeter | reference to the ratemeter to measure the load of the input |
quitwhendone | flag that tells this class that it should quit the Program when its done reading all events |
parent | The parent QT Object of this class |
Definition at line 267 of file sacla_offline_input.cpp.
|
virtual |
load the parameters used for the input
Implements cass::InputBase.
Definition at line 291 of file sacla_offline_input.cpp.
References _chunks, QSettings::beginGroup(), and QSettings::value().
Referenced by SACLAOfflineInput().
|
virtual |
retrieve the progress state
Reimplemented from cass::InputBase.
Definition at line 450 of file sacla_offline_input.cpp.
References _procs.
|
virtual |
function with the main loop
get a list of all runs to process
add an eventcounter
iterate through the list of runs
split the runname into the run and beamline combination
check if the runstatus is set to 'run ended' and thus the data is available to read
the rest of the line could be a separated list of tags, add them to the id list
if the user did not provide a tag list, get the tag list from the API If there was an error, then continue with the next run in the runlist
otherwise check if the provided tags are part of the provided run
split the taglist into the user requested amount of chunks and process the splittet tag list in separate threads
generate a processor for the chunk
start the processor
put the processor in the processor container
if there are tags in the list remaining, add the into the last processor
start the processor
put the processor in the processor container
wait until all threads are finished and sum up the total events
in case the input should not quit when everything has been processed, wait until the input thread is told to quit
Implements cass::InputBase.
Definition at line 298 of file sacla_offline_input.cpp.
References _chunks, _procs, _quitWhenDone, _runlistname, lmf::PausableThread::_status, cass::Log::add(), cass::Log::ERROR, eventcounter(), cass::getCompleteTagList(), cass::Log::INFO, lmf::PausableThread::running, lmf::PausableThread::shouldQuit(), QThread::sleep(), cass::toString(), value, and cass::Log::VERBOSEINFO.
|
virtual |
retrieve the number of skipped processed events
Reimplemented from cass::InputBase.
Definition at line 466 of file sacla_offline_input.cpp.
References _procs.
|
private |
number of chuncks that the list should be split into
Definition at line 112 of file sacla_offline_input.h.
|
private |
the processor container
Definition at line 124 of file sacla_offline_input.h.
Referenced by eventcounter(), progress(), runthis(), and skippedeventcounter().
|
private |
flag to tell the thread to quit when its done with all files
Definition at line 115 of file sacla_offline_input.h.
Referenced by runthis().
|
private |
name of the file containing all files that we need to process
Definition at line 118 of file sacla_offline_input.h.
Referenced by runthis().