fdhwlib
2.0.25
|
#include <kaeventloop.h>
Event loop implementation.
Analyse and display the hardware buffer overflow
Implementent a Katrin simulation module...
Implement cyclic reading of measure mode
Add user defined vaibales that are included in the result
Implemtent experiment specific analysis
Implement automatic error detection of the readout loop. Lost data, ... wide energy spread?! Test run with changing parameters to check stability. Is the spread of the energy histogramm small enough?
Add individual histogramm for every pixel
Definition at line 70 of file kaeventloop.h.
KaEventLoop::KaEventLoop | ( | KaSubrack * | s, |
unsigned short | port = 0 |
||
) |
KaEventLoop::~KaEventLoop | ( | ) |
void KaEventLoop::checkEvent | ( | KaEvent * | ev | ) |
Check if the ADC data is consistent.
In the interval [0..0x138] the data has to be around 100 In the interval [0x140 ..0x400] the data has to correspond to the energy level detected by the hardware
void KaEventLoop::displayEvent | ( | FILE * | fout | ) | [virtual] |
Display event.
Reimplemented from EventLoop.
void KaEventLoop::displayHeader | ( | FILE * | fout | ) | [virtual] |
Display header.
Reimplemented from EventLoop.
void KaEventLoop::displayHistogram | ( | FILE * | fout, |
unsigned long * | hist, | ||
unsigned long | min, | ||
unsigned long | max | ||
) |
Display histogram.
void KaEventLoop::displaySummary | ( | FILE * | fout | ) | [virtual] |
Display summary at the end of the run.
Reimplemented from EventLoop.
void KaEventLoop::getEnergyHwFilter | ( | unsigned short * | data, |
int | len, | ||
int | n, | ||
int | thresh, | ||
unsigned long * | energy | ||
) |
Re-implementation of the hardware energy filter.
data | ADC trace of 1024 values |
len | Number of samples in the ADC trace |
n | Filter length |
thresh | Threshold |
energy | Return value |
void KaEventLoop::getEnergyMeanDiff | ( | unsigned short * | data, |
int | len, | ||
int | n, | ||
unsigned long * | energy | ||
) |
Implementation of a simple algorithm to determine the energy of the pulse.
The algorithm calculates the mean values of the intervals ped = [0x138-n, 0x138] and pulse = [0x140, 0x140+n]. The energy is calculated as energy = 8 * (pulse - ped).
data | ADC trace of 1024 values |
len | Number of samples in the ADC trace |
n | number of samples to calculate the mean values |
energy | Return value |
void KaEventLoop::getEnergyScaling | ( | int * | min, |
int * | max | ||
) |
Set energy histogramm scaling.
void KaEventLoop::getEnergyShortFilter | ( | unsigned short * | data, |
int | len, | ||
int | n, | ||
int | thresh, | ||
unsigned long * | energy | ||
) |
int KaEventLoop::getEvent | ( | FILE * | fout | ) | [virtual] |
Read events The algorithm returns only one event.
The order of the events in the FLTs is not checked. This means if two or more events occure at a time shorter than the loop sample time the events will be not in chronical order. The FLTs are always scanned in a consecutive manner starting with the column following the last event column.
Reimplemented from EventLoop.
int KaEventLoop::getEventData | ( | FILE * | fout | ) | [virtual] |
Read more event data.
Reimplemented from EventLoop.
void KaEventLoop::getHistStatistic | ( | unsigned long * | data, |
double * | mean, | ||
double * | var, | ||
int * | n | ||
) |
Calculate mean and variance of the histogram.
void KaEventLoop::help | ( | FILE * | fout | ) | [virtual] |
Display help pages.
Reimplemented from EventLoop.
void KaEventLoop::init | ( | ) |
Initialize event loop.
void KaEventLoop::initRun | ( | int | n = 0 | ) | [virtual] |
Initialize before each run.
Reimplemented from EventLoop.
void KaEventLoop::keyboard_cmds | ( | FILE * | fout, |
char * | line | ||
) | [virtual] |
Special keyboard commands for KATRIN.
Reimplemented from EventLoop.
void KaEventLoop::reset | ( | ) |
Reset event buffer.
void KaEventLoop::setEnergyHist | ( | int | no | ) |
Set energy histogramm number.
void KaEventLoop::setEnergyScaling | ( | int | min, |
int | max | ||
) |
Set energy histogramm scaling.
void KaEventLoop::setFilterLength | ( | int | len | ) |
Set the filter length for the software implementation.
void KaEventLoop::setTriggerSampling | ( | int | len | ) |
Set the filter length for the software implementation.
void KaEventLoop::simPulse | ( | unsigned short * | data | ) |
Simulate pulse data.
int KaEventLoop::stopRun | ( | ) | [virtual] |
Close oen files after end of run.
Reimplemented from EventLoop.
void KaEventLoop::storeEvent | ( | ) | [virtual] |
Store event in database.
Reimplemented from EventLoop.
statistics KaEventLoop::baseline [private] |
Statistic parameter of the baseline.
Definition at line 243 of file kaeventloop.h.
int KaEventLoop::debug [private] |
Debug level (0 = no debug output)
Reimplemented from BaseServer.
Definition at line 207 of file kaeventloop.h.
bool KaEventLoop::debugMode [private] |
Flag to hold the run mode (debug/run)
Definition at line 201 of file kaeventloop.h.
Event structure.
Definition at line 182 of file kaeventloop.h.
FILE* KaEventLoop::fdata [private] |
Reference to the result data file.
Definition at line 258 of file kaeventloop.h.
int KaEventLoop::filterLength [private] |
Filter length for the software implemtation.
Definition at line 252 of file kaeventloop.h.
unsigned long KaEventLoop::histEnergy[2048] [private] |
Array to store the energy values.
Definition at line 210 of file kaeventloop.h.
int KaEventLoop::histEnergyActualBin [private] |
Fixed bin that is used for display.
Definition at line 231 of file kaeventloop.h.
int KaEventLoop::histEnergyMax [private] |
Definition at line 217 of file kaeventloop.h.
int KaEventLoop::histEnergyMin [private] |
Definition at line 215 of file kaeventloop.h.
int KaEventLoop::histNDisplay [private] |
Number of displayed lines.
Definition at line 240 of file kaeventloop.h.
int KaEventLoop::histNo [private] |
Number of the histogram.
0 Hardware 1 Mean calculation for pedestal and pulse 2 Simulated hardware algorithm 3 (2) with extrapolation 4 (2) with length correction
Definition at line 228 of file kaeventloop.h.
unsigned long KaEventLoop::histPulseHeight[2048] [private] |
Array to store the energy values.
Definition at line 213 of file kaeventloop.h.
int KaEventLoop::histPulseHeightActualBin [private] |
Fixed bin that is used for display.
Definition at line 234 of file kaeventloop.h.
SltTime KaEventLoop::histTDisplay [private] |
Time of last histogram display.
Definition at line 237 of file kaeventloop.h.
int KaEventLoop::lastEventCol [private] |
Number of the last column with an event [0..19].
Definition at line 189 of file kaeventloop.h.
int KaEventLoop::lastEventPage[20] [private] |
Read pointer in every column.
Definition at line 192 of file kaeventloop.h.
int KaEventLoop::mTrig [private] |
Trigger sample time.
Definition at line 264 of file kaeventloop.h.
unsigned long KaEventLoop::nAdcErrors [private] |
Number of errors in ADC data.
Definition at line 249 of file kaeventloop.h.
statistics KaEventLoop::pulse [private] |
Statistic parameter of the pulse (including the base line shift)
Definition at line 246 of file kaeventloop.h.
KaSubrack* KaEventLoop::s [private] |
Reference to access the electronic.
Definition at line 186 of file kaeventloop.h.
bool KaEventLoop::scanMem [private] |
Flag to enable memory scan.
Definition at line 204 of file kaeventloop.h.
int KaEventLoop::simRise [private] |
Simulated rising value.
Definition at line 255 of file kaeventloop.h.
bool KaEventLoop::stopAfterEvent [private] |
Flag to stop after the next event.
Definition at line 198 of file kaeventloop.h.
int KaEventLoop::T2 [private] |
Time constant of the exponential decay.
Definition at line 261 of file kaeventloop.h.
int KaEventLoop::trigMode[20][4] [private] |
Trigger mode (debug = 0, run = 1)
Definition at line 195 of file kaeventloop.h.