Author: Wilko
This page was created January 26, 1996, last modified January 26, 1996
- Introduction
- The DSP Data Structure
- Program Flow
- Function Description
- Where to find the code
The structure that contains all the information about a single DSP
card is : dspType.
All programs are build around this structure, a) to created it and
b) to fill the hits for an event. For the analysis it is only this
structure the user has to know about.
Type: dspType
typedef struct
{
int linksUsed; // number of links used for a particular dsp
int linkList[4]; // list of the links that are used
int dspAddr; // the readout address of the dsp (not the physical
LinkType *link[4];
} dspType;
- linksUsed
- number of links used for a particular dsp.
- linkList[4]
- list of the links that are used, e.g: linksUsed = 2 and link 0 and
3 are used than linkList[0] = 0, linkList[1] = 3.
- dspAddr
- the readout address of the dsp (not the physical or DIP switch
address).
- LinkType *link[4]
- type for the four links of a dsp link. When the
dspType is created no memory is allocated for the four
links (i.e: link[i]=NULL), but it has to be explicitly allocated for those links
that are used in the readout. LinkType is described below.
Type: LinkType
LinkType describes one dsp link. The hit information for each channel
is stored in the type LinkHits, for which the needed memory has to be
explicitly allocated (function: memHits ()).
typedef struct
{
int nChan, nChips;
int hitType;
int nHits;
float pitch, offset, angle;
char *detName;
ChanType *chan;
} LinkType;
- nChan, nChips
- number of readout chips and channels (=128 * #channels).
- hitType
- defines the if a 0 or 1 is interpreted as a hit.
- nHits
- number of hits for an event.
- pitch, offset, angle
- for the alignment of the detectors, and track reconstruction the pitch width
parallel offset of the detector and the rotation angle has to be known.
- detName
- name of the detector.
- chan
- pointer to the type that contains information for every readout channel,
i.e.: hits, bad channel bit, hits ored with bad channel bit .. .
Type: ChanType
ChanType information about an individual channel.
typedef struct
{
unsigned short rawHit:1; /* hit && !badChan */
unsigned short hit:1; /* decoded hit */
unsigned short goodChan:1; /* bad Channel bit */
unsigned short addr:10; /* used for hit list mode */
unsigned short empty:3;
} ChanType;
- rawHit
- Bit if a hit was recorded (=1) or not (=0).
- hit
- As rawhit, but bad channels are set to 0 (hit = rawHit && badChan )
- goodChan
- Bit if a channel is considered to be bad. goodChan = 1: good hit,
goodChan = 0: bad channel.
- addr
- 10 bits for channel number. This variable is used to store the hit list.
You have to be careful not to mix the channel number due to addr, and the channel
number for hit. Example:
If we read out 10 channels and channel 2, 4, 7 and 9 are hitted.
chan[0].hit = 0 chan[0].addr = 2
chan[1].hit = 0 chan[1].addr = 4
chan[2].hit = 1 chan[2].addr = 7
chan[3].hit = 0 chan[3].addr = 9
chan[4].hit = 1 chan[4].addr = x
chan[5].hit = 0 chan[5].addr = x
chan[6].hit = 0 chan[6].addr = x
chan[7].hit = 1 chan[7].addr = x
chan[8].hit = 0 chan[8].addr = x
chan[9].hit = 1 chan[9].addr = x
Program Flow
The main program flow for the initialization is:
- readDsp_fromFile
- read the dsp configuration file. The detector name and the dsp and link
it is connected to is stored in an temporary array.
- initDspConfig
- allocate memory for the number of DSP's readout.
- for every used link, read the corresponding detector description
file.
- allocate memory for the link.
- read number of readout chips and the hit type. Calculate the
number of readout channels (128*nChips).
- allocate memory for the hit and dead channel structure (depends on the
number of readout channels).
- initilize bad channel bit to 1 ( = good channel).
- read again the detector description file and extract the bad channel list.
- call the default hbook function (hb_def_hist ()) to book the histogram for
the wire maps, tdc and adc.
- call the user hbook function (hb_user_hist ()) to book user defined histograms
e.g.: correlation
Where to find the code
!!!! no yet installed !!!!
The binary online code is installed on the KEK-DEC station in ~/wilko/monitor.
There are the following directories:
- source
- source files for the binary code.
- include
-
- lib
-
- util
- utility functions used by the binary code. These functions are archived
in libutilBinary.a
- bin
-
- setup
-
Back to SCIPP-Silicon
Back to SCIPP home page