fdhwlib
2.0.25
|
#include <SltPattern.h>
The class sltpattern contains methods to decode the pattern generated by the second level trigger system.
Definition at line 29 of file SltPattern.h.
SltPattern::SltPattern | ( | ) |
SltPattern::~SltPattern | ( | ) |
int SltPattern::checkPixelList | ( | unsigned long * | mem, |
int | n, | ||
int * | colList, | ||
int * | rowList, | ||
int | nList = 4 |
||
) |
Check if all pixel in the list show a valid first level trigger in this image.
void SltPattern::display | ( | unsigned long * | mem, |
int | n, | ||
int | iFirst = 0 , |
||
FILE * | fout = stdout , |
||
int | fLen = 150 |
||
) |
Display the trigger information.
mem | Pointer to the trigger memory. The memory is asumed to start always with data for the first column |
n | Number of lines to be analysed. Every 20 lines a new image starts. |
iFirst | Index of the first trigger line |
fout | Output stream |
fLen | Number of characters in one line |
int SltPattern::findPixelList | ( | unsigned long * | mem, |
int | n, | ||
int | iPattern, | ||
int | patternId, | ||
int | firstRow, | ||
int * | colList, | ||
int * | rowList, | ||
int | nList = 4 |
||
) |
Find the pixel of that are not given by the pattern number of the second level trigger.
double SltPattern::getAlpha | ( | int | y | ) |
Calculate the spherical coordinates.
(GAP 2000-023 Angular direction of pixel in FD camera)
double SltPattern::getAlphaFromSkyCoordinates | ( | double | phi, |
double | delta, | ||
double | beta | ||
) |
Calculate the coresponding coordinate for a given sky coordinate.
(GAP 2000-023 Angular direction of pixel in FD camera)
double SltPattern::getAzimuth | ( | double | alpha, |
double | beta, | ||
double | delta | ||
) |
Calculate the pointing of a pixel in the sky (GAP 2000-023 Angular direction of pixel in FD camera)
alpha | Spherical coordinate of the camera |
beta | Spherical coordinate of the camera |
delta | Elevation |
double SltPattern::getBeta | ( | int | x | ) |
Calculate the spherical coordinates (GAP 2000-023 Angular direction of pixel in FD camera)
double SltPattern::getBetaFromSkyCoordinates | ( | double | phi, |
double | delta | ||
) |
Calculate the coresponding coordinate for a given sky coordinate.
(GAP 2000-023 Angular direction of pixel in FD camera)
int SltPattern::getCircle | ( | int | colRef, |
int | rowRef, | ||
int | col, | ||
int | row | ||
) |
This is a simple algorithm to calculate the length of a vector without multiplication and square root.
Here the pixel are considered as "circles" around the reference pixel. The result is also given in means of the coordinates given by getX and getY.
double SltPattern::getElevation | ( | double | alpha, |
double | beta | ||
) |
Calculate the pointing of a pixel in the sky (GAP 2000-023 Angular direction of pixel in FD camera)
alpha | Spherical coordinate of the camera |
beta | Spherical coordinate of the camera |
int SltPattern::getFirstTrigger | ( | unsigned long * | mem, |
int | n | ||
) |
Get the position of the first second level trigger that occured in this event.
mem | Trigger memory |
n | Lenght of the trigger memory |
void SltPattern::getFltIntervall | ( | unsigned long * | mem, |
int | n, | ||
int | t0[][22], | ||
int | t1[][22] | ||
) |
Return a list of the time intervalls for every pixel with the first level trigger.
mem | Trigger memory |
n | Length of the trigger memory |
t0 | Matrix of the first triggered bin |
t1 | Matrix of the last triggered bin |
int SltPattern::getPatternId | ( | unsigned long | mem | ) |
Return the id of the pattern stored with this column.
mem | One column / word of the trigger memory |
void SltPattern::getPixelList | ( | int | patternId, |
int | col, | ||
int | row, | ||
int * | colList, | ||
int * | rowList, | ||
int | nList = 4 |
||
) |
Return the relative address of the pixel belonging to the pattern.
patternId | The id of the pattern |
col | coordinate of the reference pixel |
row | coordinate of the reference pixel |
colList | array of at least four elements to store the coordinates of the pixel belonging to the track. The reference pixel is always the first entry |
rowList | array of at least four elements to store the coordinates of the pixel belonging to the track. The reference pixel is always the first entry |
nList | Elements available in the rowList parameter |
int SltPattern::getPixelList | ( | unsigned long * | mem, |
int | n, | ||
int * | iTrigger, | ||
int * | colList, | ||
int * | rowList, | ||
int | nList = 4 |
||
) |
Return the relative address of the pixel belonging to the pattern.
mem | Trigger memory as returned by the class SltMemory. The pointer does not necessarily needs to point to the beginning of the data. Every offset coresponding to 1us is allowed. |
n | Length of the given memory data. The length of the memory has to be at least 20 to cover one complete image of the camera. |
iTrigger | Number of the found SLT pattern. Refer to the SLT documentation for the pattern numbers. |
colList | array of at least four elements to store the coordinates of the pixel belonging to the track. The reference pixel is always the first entry |
rowList | array of at least four elements to store the coordinates of the pixel belonging to the track. The reference pixel is always the first entry |
nList | Elements available in the rowList parameter |
float SltPattern::getR | ( | int | colRef, |
int | rowRef, | ||
int | col, | ||
int | row | ||
) |
Calculate the difference between two pixel based of the coordinates introduced by getX and getY.
int SltPattern::getR2 | ( | int | colRef, |
int | rowRef, | ||
int | col, | ||
int | row | ||
) |
Calculate the square of difference between two pixel.
int SltPattern::getScalarProd | ( | int | colRef, |
int | rowRef, | ||
int | col1, | ||
int | row1, | ||
int | col2, | ||
int | row2 | ||
) |
Skalar product between two vectors.
void SltPattern::getSltIntervall | ( | unsigned long * | mem, |
int | n, | ||
int * | t0, | ||
int * | t1 | ||
) |
Return the time intervall with the second level trigger.
mem | Trigger memory |
n | Length of the trigger memory |
t0 | First triggered bin |
t1 | Last triggered bin |
int SltPattern::getTriggered | ( | unsigned long * | mem, |
int | n | ||
) |
Get the number of triggered pixel from the trigger memory.
The number does not necessarily correspond with the number of pixel that show ADC data. To analyse a smaller range of the data, increase the pointer to the memory and decrease the given lenght
mem | Pointer to the trigger memory. The memory is asumed to start always with data for the first column |
n | number of lines to be analysed. Every 20 lines a new image starts. |
int SltPattern::getX | ( | int | col, |
int | row | ||
) |
Calculate the center of the pixel where the axis of the coordinate system lays in the most left pixel of the first column and the first row.
Range [0,39]
double SltPattern::getXFromSphericalCoordinates | ( | double | beta | ) |
Calculate the cartesian coordinates for a given point in the spherical system.
(GAP 2000-023 Angular direction of pixel in FD camera)
int SltPattern::getY | ( | int | col, |
int | row | ||
) |
double SltPattern::getYFromSphericalCoordinates | ( | double | alpha | ) |
Calculate the cartesian coordinates for a given point in the spherical system.
(GAP 2000-023 Angular direction of pixel in FD camera)
int SltPattern::insertByDistance | ( | int | col, |
int | row, | ||
int * | colList, | ||
int * | rowList, | ||
int | nList | ||
) |
Insert a new pixel in a pixel list building a near to linear track.
Use only the distance from the first pixel to order the list.
int SltPattern::insertByProjection | ( | int | col, |
int | row, | ||
int * | colList, | ||
int * | rowList, | ||
int | nList | ||
) |
Insert a new pixel in a pixel list building a near to linear track.
The new pixel has to be added to the list in order to give the best possible track afterwards. (May be more CPU time consuming than other algorithma?!)
int SltPattern::track[128][3] [static, private] |
Pattern as given in the description of the control FPGA at the Slt board.
Definition at line 296 of file SltPattern.h.
int SltPattern::vectorEvenRow[19][2] [static, private] |
Vectors needed to decode the pixel coordinates for a pixel in a even row (0 .
. 18).
Definition at line 301 of file SltPattern.h.
int SltPattern::vectorOddRow[19][2] [static, private] |
Vectors needed to decode the pixel coordinates for a pixel in a odd row (1 .
. 19).
Definition at line 306 of file SltPattern.h.