fdhwlib  2.0.25
KaEventLoop Class Reference

#include <kaeventloop.h>

Inheritance diagram for KaEventLoop:
EventLoop SimpleServer BaseServer

List of all members.

Public Member Functions

Public Attributes

Private Attributes


Detailed Description

Event loop implementation.

Todo:

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

Todo:
Print result to file. The result should contain also other relevant data.

Definition at line 70 of file kaeventloop.h.


Constructor & Destructor Documentation

KaEventLoop::KaEventLoop ( KaSubrack s,
unsigned short  port = 0 
)
KaEventLoop::~KaEventLoop ( )

Member Function Documentation

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.

Parameters:
dataADC trace of 1024 values
lenNumber of samples in the ADC trace
nFilter length
threshThreshold
energyReturn 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).

Parameters:
dataADC trace of 1024 values
lenNumber of samples in the ADC trace
nnumber of samples to calculate the mean values
energyReturn 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.


Member Data Documentation

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.

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.

Fixed bin that is used for display.

Definition at line 231 of file kaeventloop.h.

Definition at line 217 of file kaeventloop.h.

Definition at line 215 of file kaeventloop.h.

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.

Fixed bin that is used for display.

Definition at line 234 of file kaeventloop.h.

Time of last histogram display.

Definition at line 237 of file kaeventloop.h.

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.

Statistic parameter of the pulse (including the base line shift)

Definition at line 246 of file kaeventloop.h.

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.

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.


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