PLASTIC - PNapi90/DESPEC-Analysis-Framework GitHub Wiki

PLASTIC DETECTOR SYSTEM

A description of all (important) functions

General remarks

The PLASTIC Detector System read out using the TAMEX module can be calibrated "on-the-fly" using the existing data (e.g. as an .lmd file). This calibration can be switched on using the file Configuration_Files/PLASTIC_CALIB_FILE.txt. Two keywords are used by the file, ONLINE and FORCE (with the possible values of 0 or 1). ONLINE enables the on-the-fly calibration once. After one successful calibration, ONLINE is set back to 0. If FORCE is set to 1, the on-the-fly calibration is always enabled (mainly for debugging).

If you use a "new" PLASTIC setup (e.g. additional channels), please enable ONLINE once. This updates the board ID - channel map.


IF NOT USED, SEGMENTATION FAULTS ARE POSSIBLE (or other unknown behavior)


void Process_MBS(int* pdata)

  • loop over all TAMEX related words in while(!tamex_end) until TAMEX trailer is reached.
  • Calibrate data data (ONLINE or OFFLINE)

void Process_TAMEX()

  • if first word (in total) check for Trigger window and skip possible padding
  • check for TAMEX module header (and get TAMEX ID ...)
  • get amount of words in TAMEX module data stream
  • get coarse and fine trigger time
  • get leading and trailing edge signals. Typically, each leading signal is followed by its corresponding trailing signal. If this is not the case, only the first leading (or trailing) value is used.
  • check for possible errors sent by TAMEX module
  • check trailer

Regarding leading and trailing edges: Each TAMEX module contains 33 channels. Channel 0 is reserved for the trigger signal. All remaining odd channels are reserved for leading, all remaining even channels are reserved for trailing times. Those channels "form" physical channels, where each leading time has a corresponding trailing time. E.g. channel 1 and channel 2 form physical channel 1 (or 0, depending on how you count).

void get_Event_data(Raw_Event* RAW)

send relevant data (e.g. coarse time, fine time, leading and trailing edge time,...) back to Go4 loop

PLASTIC MBS Stream

Here is a small part of the PLASTIC MBS stream


mbs> -X86L-87:transport  : 
-X86L-87:transport  :Event=     31139 Type=   10     1 Words=    96 Trigger=  1
-X86L-87:transport  :  id=  100 con= 9 t/s=   10     1 words=    88 crate= 0
-X86L-87:transport  :      0: 09c409c4 add00200 add00201 00001134 00000038 
-X86L-87:transport  :      5: aa1179a2 62f271eb 80163fae 62f271eb 80582f9e 
-X86L-87:transport  :     10: 62f271eb 8095bfdd 62f271eb 81494f9e 81536fbc 
-X86L-87:transport  :     15: 62f271eb 81986fbc ee000000 bb1179a2 00011134 
-X86L-87:transport  :     20: 00000058 aa1179a2 62c8e173 8017a99a 62c8e173 
-X86L-87:transport  :     25: 8057498c 8043f9a9 805b59b0 62c8e173 808639a9 
-X86L-87:transport  :     30: 809669b0 62c8e173 8146598b 814b39aa 62c8e173 
-X86L-87:transport  :     35: 818609a9 62c8e173 81c5798b 81da59a8 62c8e173 
-X86L-87:transport  :     40: 8202a9a7 ee000000 bb1179a2 

  • 09c409c4 is reserved for the trigger window. The first 16 bits are the pre-trigger window, the last 16 bits are the post-trigger window.
  • all words beginning with add..... are padding words and are skipped.
  • 00001134 is the TAMEX header, where 00 (3rd and 4th 0 from the left) are 8 bits reserved for the TAMEX ID.
  • The last 8 bits of 00000038 are used to get the amount of following words in the respective TAMEX module (divide 38 in decimal by 4). The amount of fired channels can be extracted by dividing 38 in decimal by 4 and subtracting 2.
  • The aa in aa1179a2 marks the begin of data in the respective TAMEX module.
  • 62f271eb is a placeholder. The first 4 bits (6) are the identifier for the placeholder. Each data word is separated by a placeholder (ideally).
  • 80163fae is a data word. Starting from the right, the first 11 bits are the coarse time. The next bit is the identifier for leading or trailing edge. The next 10 bits are the fine time, followed by 6 bits of the channel id. The last 4 bits are the TDC identifier.
  • ee000000 is the error word, where the first 8 bits ee mark the error word identifier and the remaining 24 bits the error code of the TAMEX module. 000000 means no error.
  • bb...... is the trailer of the TAMEX module.

If there are two (or more) consecutive data words without a delimiter, only the first one is used.