fdhwlib
2.0.25
|
#include <eventloop.h>
Implementation of a simple data acquisition application for the IPE DAQ Electronic used in various experiments.
Features:
Definition at line 150 of file eventloop.h.
EventLoop::EventLoop | ( | Slt * | slt, |
unsigned short | port = 0 |
||
) |
Create server process.
EventLoop::~EventLoop | ( | ) |
Create client process.
The connection to the hardware will be realized by the server process
void EventLoop::analyse | ( | ) |
Analyse timing of the events.
void EventLoop::clear | ( | ) |
Clear memories.
void EventLoop::clearPageBuffer | ( | ) |
Clear page stack.
void EventLoop::closeDatabase | ( | ) |
Close the database connection.
void EventLoop::disableDatabase | ( | ) |
Do not record in database.
void EventLoop::displayDatabase | ( | FILE * | fout | ) |
Display database parameter.
virtual void EventLoop::displayEvent | ( | FILE * | fout | ) | [virtual] |
Display event.
Reimplemented in KaEventLoop.
void EventLoop::displayEventsFromDb | ( | FILE * | fout, |
int | runId, | ||
char * | param = 0 |
||
) |
Display all events of a run in text format.
fout | Output stream |
runId | Run identification |
param | selects parameters from the event table |
virtual void EventLoop::displayHeader | ( | FILE * | fout | ) | [virtual] |
Display header.
Reimplemented in KaEventLoop.
void EventLoop::displayRuns | ( | FILE * | fout, |
int | nStart = 0 , |
||
int | nRow = 0 |
||
) |
Display list of runs.
virtual void EventLoop::displaySummary | ( | FILE * | fout | ) | [virtual] |
Display summary of event loop run.
Reimplemented in KaEventLoop.
void EventLoop::enableDatabase | ( | ) |
Enable storage in the database.
void EventLoop::executeCmd | ( | int | client, |
short | cmd, | ||
unsigned long * | arg, | ||
short | n | ||
) | [virtual] |
Command interface to connect to the running readout server.
List of commands:
Reimplemented from SimpleServer.
void EventLoop::freeMemory | ( | ) |
Free memory of occupied by handled events.
int EventLoop::getActualRunDuration | ( | ) |
Get the actual run duration [s].
virtual int EventLoop::getEvent | ( | FILE * | fout | ) | [virtual] |
Read one event form electronic buffer.
Interface:
Reimplemented in KaEventLoop, and FEEventLoop.
virtual int EventLoop::getEventData | ( | FILE * | fout | ) | [virtual] |
Read event data.
Reimplemented in KaEventLoop, and FEEventLoop.
int EventLoop::getRunDuration | ( | ) |
Get actual run duration [s].
int EventLoop::handle_timeout | ( | ) | [virtual] |
Handler for the timeout.
Reimplemented from BaseServer.
void EventLoop::handleKeyboard | ( | FILE * | fout, |
keyboard * | kb | ||
) |
Handle events from keyboard.
virtual void EventLoop::help | ( | FILE * | fout | ) | [virtual] |
Display commands in interactive mode.
Reimplemented in KaEventLoop, and EventLoopClient.
virtual void EventLoop::initRun | ( | int | n = 0 | ) | [virtual] |
Initialize run, release inhibit, ...
Reimplemented in KaEventLoop.
bool EventLoop::isDeadTimeEnabled | ( | ) |
virtual void EventLoop::keyboard_cmds | ( | FILE * | fout, |
char * | line | ||
) | [virtual] |
Interactive commands.
Reimplemented in KaEventLoop, and EventLoopClient.
int EventLoop::openDatabase | ( | FILE * | fout | ) |
Open the connection to the database.
void EventLoop::print | ( | const char * | fmt, |
... | |||
) |
Print function.
Needed because of output redirection?!
int EventLoop::read_from_keyboard | ( | ) | [virtual] |
Keyboard interface for interactive control (only for compatibility reasons.
Reimplemented from BaseServer.
Reimplemented in EventLoopClient.
void EventLoop::readInifile | ( | char * | inifile | ) |
Read parameter of the eventloop from inifile.
void EventLoop::run | ( | FILE * | fout, |
int | n = 0 |
||
) |
Run eventloop.
fout | Reference to the output stream |
n | number of events to be recorded |
Reimplemented in EventLoopClient.
void EventLoop::setDatabase | ( | EventLoop * | loop | ) |
Copy database parameter from another eventloop implementation.
void EventLoop::setNStoredPages | ( | int | n | ) |
void EventLoop::setPassword | ( | char * | passwd | ) |
Set password for database.
void EventLoop::setRunDuration | ( | int | sec | ) |
Set run duration [s].
void EventLoop::startServer | ( | FILE * | fout | ) |
Run eventloop using the socket server as event handler.
The server will call periodically handle_timeout where the polling of the electronic is done.
virtual int EventLoop::stopRun | ( | ) | [virtual] |
Stop data aqusition.
Reimplemented in KaEventLoop, and EventLoopClient.
void EventLoop::stopServer | ( | ) |
Terminate DAQ server.
The server can only be stopped if no run is active.
virtual void EventLoop::storeConfig | ( | ) | [virtual] |
Store the hardware configuration in the database.
virtual void EventLoop::storeEvent | ( | ) | [virtual] |
Store event in database.
Reimplemented in KaEventLoop, and FEEventLoop.
void EventLoop::storeRunHeader | ( | FILE * | fout | ) |
Store run header to database.
void EventLoop::updateRunHeader | ( | FILE * | fout | ) |
Update run header at end of the run.
float EventLoop::actRate [protected] |
Definition at line 450 of file eventloop.h.
SltTime EventLoop::actTime [protected] |
Definition at line 436 of file eventloop.h.
bool EventLoop::adc [protected] |
Definition at line 429 of file eventloop.h.
bool EventLoop::analysis [protected] |
Definition at line 428 of file eventloop.h.
bool EventLoop::checkDeadTime [protected] |
Definition at line 468 of file eventloop.h.
MYSQL* EventLoop::db [protected] |
MySQL database connection pointer.
Definition at line 516 of file eventloop.h.
std::string EventLoop::dbAdcTable [protected] |
Database table for ADC data.
Definition at line 507 of file eventloop.h.
unsigned long EventLoop::dbEventId [protected] |
Event number in database.
Definition at line 513 of file eventloop.h.
std::string EventLoop::dbEventTable [protected] |
Database table for background data.
Definition at line 504 of file eventloop.h.
std::string EventLoop::dbName [protected] |
Database name.
Definition at line 498 of file eventloop.h.
std::string EventLoop::dbPassword [protected] |
Database password.
Definition at line 495 of file eventloop.h.
bool EventLoop::dbRecord [protected] |
Flag for writing to database.
Definition at line 483 of file eventloop.h.
bool EventLoop::dbRecordPixel [protected] |
Flag to control writing to the pixel table.
Definition at line 486 of file eventloop.h.
unsigned long EventLoop::dbRunId [protected] |
Run number in database.
Definition at line 510 of file eventloop.h.
std::string EventLoop::dbRunTable [protected] |
Database table for background data runs.
Definition at line 501 of file eventloop.h.
std::string EventLoop::dbServer [protected] |
Database server name.
Definition at line 489 of file eventloop.h.
std::string EventLoop::dbUser [protected] |
Database account name.
Definition at line 492 of file eventloop.h.
unsigned long long EventLoop::deadTime [protected] |
Definition at line 469 of file eventloop.h.
unsigned long long EventLoop::deadTimeEnd [protected] |
Definition at line 469 of file eventloop.h.
unsigned long long EventLoop::deadTimeLast [protected] |
Definition at line 469 of file eventloop.h.
unsigned long long EventLoop::deadTimeRef [protected] |
Definition at line 469 of file eventloop.h.
unsigned long EventLoop::delay [protected] |
Definition at line 445 of file eventloop.h.
SltTime EventLoop::delayTime [protected] |
Definition at line 444 of file eventloop.h.
SltTime EventLoop::deltaTime [protected] |
Definition at line 443 of file eventloop.h.
SltTime EventLoop::deltaTimeStamp [protected] |
Definition at line 442 of file eventloop.h.
float EventLoop::diffTime [protected] |
Definition at line 453 of file eventloop.h.
int EventLoop::err [protected] |
Definition at line 421 of file eventloop.h.
sharedMemory* EventLoop::eventBuffer [protected] |
Buffer for the eventloop to store the event data.
Definition at line 384 of file eventloop.h.
std::string EventLoop::evlGuiHost [protected] |
Definition at line 397 of file eventloop.h.
int EventLoop::evlGuiPort [protected] |
Definition at line 398 of file eventloop.h.
bool EventLoop::evlHistogramming [protected] |
Definition at line 393 of file eventloop.h.
bool EventLoop::evlLoadAnalysis [protected] |
Definition at line 392 of file eventloop.h.
bool EventLoop::evlRateAnalysis [protected] |
Definition at line 391 of file eventloop.h.
float EventLoop::evlRateUpdateFactor [protected] |
Definition at line 395 of file eventloop.h.
int EventLoop::evlSampleTime [protected] |
Definition at line 390 of file eventloop.h.
bool EventLoop::evlStopOnError [protected] |
Definition at line 388 of file eventloop.h.
int EventLoop::evlStoredPages [protected] |
Definition at line 389 of file eventloop.h.
int EventLoop::filledPage[PAGE_STACK_LEN] [protected] |
Stack to keep track of the filled pages.
Definition at line 358 of file eventloop.h.
bool EventLoop::first [protected] |
Definition at line 424 of file eventloop.h.
int EventLoop::firstEvent [protected] |
Definition at line 454 of file eventloop.h.
SltTime EventLoop::firstEvTime [protected] |
Definition at line 440 of file eventloop.h.
bool EventLoop::firstTime [protected] |
Definition at line 425 of file eventloop.h.
FILE* EventLoop::floop [protected] |
File descriptor for eventloop output Warning: The descriptor fout is used for simpleserver connection messages.
Definition at line 349 of file eventloop.h.
SimpleSocket* EventLoop::gui [protected] |
Definition at line 463 of file eventloop.h.
float EventLoop::hisBin[24] [protected] |
Definition at line 407 of file eventloop.h.
int EventLoop::hisCol [protected] |
Definition at line 401 of file eventloop.h.
int EventLoop::hisImpact[100] [protected] |
Definition at line 416 of file eventloop.h.
int EventLoop::hisLight[100] [protected] |
Definition at line 415 of file eventloop.h.
int EventLoop::hisN[24] [protected] |
Definition at line 404 of file eventloop.h.
float EventLoop::hisNorm[24] [protected] |
Definition at line 410 of file eventloop.h.
float EventLoop::hisPeak[24] [protected] |
Definition at line 406 of file eventloop.h.
float EventLoop::hisPedestal[24] [protected] |
Definition at line 405 of file eventloop.h.
int EventLoop::hisPix [protected] |
Definition at line 402 of file eventloop.h.
float EventLoop::hisRelPeak[24] [protected] |
Definition at line 408 of file eventloop.h.
float EventLoop::hisStaticNorm[24] [protected] |
Definition at line 411 of file eventloop.h.
bool EventLoop::hisUseStaticNorm [protected] |
Definition at line 413 of file eventloop.h.
bool EventLoop::hwStopped [protected] |
Definition at line 432 of file eventloop.h.
int EventLoop::i [protected] |
Definition at line 421 of file eventloop.h.
int EventLoop::j [protected] |
Definition at line 421 of file eventloop.h.
int EventLoop::lastHeader [protected] |
Definition at line 457 of file eventloop.h.
char EventLoop::lastKey [protected] |
Definition at line 420 of file eventloop.h.
SltPageStatus EventLoop::lastPageStatus [protected] |
Keeps the last analysed page status.
Definition at line 370 of file eventloop.h.
SltTime EventLoop::lastTimeStamp [protected] |
Definition at line 441 of file eventloop.h.
SltPageStatus EventLoop::mask [protected] |
Definition at line 435 of file eventloop.h.
int EventLoop::maxEvents [protected] |
Maximal events requested for this run.
Definition at line 355 of file eventloop.h.
float EventLoop::meanDelay [protected] |
Definition at line 446 of file eventloop.h.
float EventLoop::meanPagesLeft [protected] |
Definition at line 450 of file eventloop.h.
float EventLoop::meanRate [protected] |
Definition at line 450 of file eventloop.h.
float EventLoop::meanStopped [protected] |
Definition at line 450 of file eventloop.h.
int EventLoop::n [protected] |
Definition at line 421 of file eventloop.h.
int EventLoop::nextFreeSlot [protected] |
Pointer to the next free place in the stack.
Definition at line 361 of file eventloop.h.
int EventLoop::nextPage [protected] |
Pointer to the next page to handle.
Definition at line 364 of file eventloop.h.
int EventLoop::nextPageToFree [protected] |
Pointer to the next page to free in the memory.
Definition at line 367 of file eventloop.h.
int EventLoop::nReadout [protected] |
Definition at line 421 of file eventloop.h.
unsigned long EventLoop::nSamples [protected] |
Number of timeouts (Counter)
Reimplemented from BaseServer.
Definition at line 458 of file eventloop.h.
int EventLoop::numEvents [protected] |
Number of handled events.
Definition at line 352 of file eventloop.h.
int EventLoop::numStoredEvents [protected] |
Definition at line 464 of file eventloop.h.
int EventLoop::offset [protected] |
Definition at line 421 of file eventloop.h.
int EventLoop::page [protected] |
Definition at line 421 of file eventloop.h.
SltPageStatus EventLoop::pageStatus [protected] |
Definition at line 434 of file eventloop.h.
int EventLoop::parameter [protected] |
Definition at line 421 of file eventloop.h.
bool EventLoop::paused [protected] |
Definition at line 431 of file eventloop.h.
float EventLoop::pedestal[20][22] [protected] |
Definition at line 459 of file eventloop.h.
fd_set EventLoop::raw_data_fd_set [protected] |
Flag to indicate that this instance is a cleint process.
Socket to connect to the readout server Set of the active sockets that are connected to the raw message stream
Definition at line 340 of file eventloop.h.
unsigned long EventLoop::realFirst [protected] |
Definition at line 447 of file eventloop.h.
float EventLoop::realRate [protected] |
Definition at line 450 of file eventloop.h.
unsigned long EventLoop::realTime [protected] |
Definition at line 447 of file eventloop.h.
int EventLoop::runDaemon [protected] |
Run as daemon.
Definition at line 343 of file eventloop.h.
int EventLoop::runDuration [protected] |
Measurement time (0 = infinite)
Definition at line 519 of file eventloop.h.
bool EventLoop::running [protected] |
Definition at line 423 of file eventloop.h.
float EventLoop::slidingFactor [protected] |
Definition at line 452 of file eventloop.h.
float EventLoop::slidingRate [protected] |
Definition at line 451 of file eventloop.h.
bool EventLoop::slt [protected] |
Definition at line 426 of file eventloop.h.
SltTime EventLoop::startTime [protected] |
Definition at line 438 of file eventloop.h.
int EventLoop::statOffset [protected] |
Definition at line 422 of file eventloop.h.
bool EventLoop::stopped [protected] |
Definition at line 456 of file eventloop.h.
SltTime EventLoop::stopTime [protected] |
Definition at line 439 of file eventloop.h.
unsigned long EventLoop::sumDelay [protected] |
Sum of all delays [us].
Definition at line 373 of file eventloop.h.
unsigned long EventLoop::sumPagesLeft [protected] |
Sum of all pages that need handling.
Definition at line 376 of file eventloop.h.
unsigned long EventLoop::sumStopped [protected] |
Sum of events handled during the system was stopped due to all pages filled up.
Definition at line 380 of file eventloop.h.
bool EventLoop::syntilator [protected] |
Definition at line 433 of file eventloop.h.
Slt* EventLoop::theSlt [protected] |
Definition at line 475 of file eventloop.h.
SltTime EventLoop::timeAct [protected] |
Time variables for analysis of trigger rate.
Definition at line 449 of file eventloop.h.
SltTime EventLoop::timeFirst [protected] |
Definition at line 449 of file eventloop.h.
SltTime EventLoop::timeLast [protected] |
Definition at line 449 of file eventloop.h.
SltTime EventLoop::timeStamp [protected] |
Definition at line 437 of file eventloop.h.
bool EventLoop::tlt [protected] |
Definition at line 427 of file eventloop.h.
int EventLoop::trigAddr [protected] |
Definition at line 455 of file eventloop.h.