CAEN digitizer: Difference between revisions

From FSU Fox's Lab Wiki
Jump to navigation Jump to search
Line 39: Line 39:


= FSU DAQ =
= FSU DAQ =
[[File:Main Window of the FSUDAQ.png|500px|thumb|right|Main window of the FSUDAQ]]
[[File:Board Control of FSUDAQ.png|500px|thumb|right|Board Control of the FSUDAQ]]


https://fsunuc.physics.fsu.edu/git/rtang/FSUDAQ
https://fsunuc.physics.fsu.edu/git/rtang/FSUDAQ


The FSU DAQ is based on BoxScore. The core is the digitizer class that directly controls and reads out the CAEN digitizer. The GUI of the DAQ uses CERN ROOT GUI elements.  
The (idea of the) FSU DAQ is based on the [https://www.sciencedirect.com/science/article/pii/S0168900222001954 BoxScore]([https://github.com/goluckyryan/BoxScore code] of BoxScore). The core is the digitizer class that directly controls and reads out the CAEN digitizer. The GUI of the DAQ uses CERN ROOT GUI elements.  


The Goals for the DAQ are:
The Goals for the DAQ are:
Line 55: Line 57:
== The Digitizer Classes ==
== The Digitizer Classes ==


The Digitizer classes are based on the ClassDigitizer.h/C. The derivative classes are DigitizerPHA.h/C and DigitizerPSD.h/C. The digitizer classes stores only the connection and board information. It provides an interface to better control the digitizer, for example, manipulate the bits for the control bit.
The Digitizer class is ClassDigitizer.h/C. The class controls the digitizer by manipulating the register. And various types of digitizers are different by the registers. Thus, the class can control different types of digitizers without modification. The digitizer classes stores the connection, and board information, and a copy of the register. It provides an interface to better control the digitizer, for example, manipulate the bits for the control bit.


The digitizer classes directly write/read the registers in the digitizer. The advantage is complete control of the hardware and simplified the program that only 3 pieces are needed:
The digitizer classes directly write/read the registers in the digitizer. The advantage is complete control of the hardware and simplified the program that only 3 pieces are needed:
Line 61: Line 63:
* ReadRegister()
* ReadRegister()
* Register Address
* Register Address
* Load and Save register setting


The drawback is that, the buffer size must be calculated (a lazy man method is assign 100 MB for the buffer?).  
The drawback is that, the buffer size must be calculated (a lazy man method is assign 10 MB for the buffer?).  


== Register Address ==
== Register Address and Setting Binary File==


The registers < 0x8000 are channel settings. For example, 0x1nXX is for channel-n, or 0x80XX is for writing to all channels. The registers >= 0x8000 are board settings.  
The registers < 0x8000 are channel settings. For example, 0x1nXX is for channel-n, or 0x80XX is for writing to all channels. The registers >= 0x8000 are board settings.  


For all types of digitizers, most of the > 0x8000 registers are the same and have the same meaning.  
For all types of digitizers, the register > 0x8000 registers are the same and have the same meaning.  


Because the 2n and 2n+1 channels are paired ( like shared same memory ). There are some registers also paired. for example, the record length is the same for any paired channels, once the record length is set for any one of the paired channels, the record length of the other channel is also set.
Because the 2n and 2n+1 channels are paired ( like shared same memory ). There are some registers also paired. for example, the record length is the same for any paired channels, once the record length is set for any one of the paired channels, the record length of the other channel is also set.
A Setting uses 4 bytes (unsigned int) to store 32 bits of each register value. Using an array of size 2048 can store all register settings. The following table shows the conversion.
{|class='wikitable
! Address Range !! Comment !! Setting Index !! Example
|-
| 0x1000 - 0x1FFF || Channel Setting || 0x1XXX / 4 || 0x1020 -> 1032
|-
| 0x8000 - 0x81FF || Board Setting ||  0x8XXX & 0x0FFF || 0x8080 -> 32
|-
| 0xEF00 - 0xEFFF || Other Board Setting || 0xEXXX & 0x0FFF || 0xEF04 -> 961
|-
| 0xF000 - 0xFFFF || Read only board configuration || (0xFXXX & 0x0FFF) + 0x0200 || 0xF008 -> 520
|}


== Buffer calculation ==
== Buffer calculation ==

Revision as of 17:38, 7 October 2022

Model

Model Energy resolution Sampling rate
V1725 14-bit 250MS/s
V1730 14-bit 500MS/s
V1740 12-bit 62.5 MS/s

DPP firmware

Both V1725 and V1730 can be equipped with the PHA (pulse-height analysis) or PSD (pulse-shape decimation) firmware.

From the programming point of view, the board registers are very different for the two firmware.

required library

On Linux (Ubuntu 18.04+), two CAEN libraries are required to run the digitizers.

  • CAENVMELib
  • CAENComm

that would be enough for running the CAEN CoMPASS.

For custom programs, an additional library is needed

  • CAENDigitizer

Data structure, Read-out, and buffer size

In the CAENDigitizer.h, the CAEN_DGTZ_READDATA() will read the buffer of the digitizer. For a single call of the function, ONE aggregate of data is read from the buffer and clear.

The number of events for an aggregate is set by register 0x1034. When set to zero, the digitizer (mysteriously) auto-set.

The data structure started with 4 words ( 1 word = 32 bits).

FSU DAQ

Main window of the FSUDAQ
Board Control of the FSUDAQ

https://fsunuc.physics.fsu.edu/git/rtang/FSUDAQ

The (idea of the) FSU DAQ is based on the BoxScore(code of BoxScore). The core is the digitizer class that directly controls and reads out the CAEN digitizer. The GUI of the DAQ uses CERN ROOT GUI elements.

The Goals for the DAQ are:

  • support V1725, V1730, V1740 digitizers
  • multi-thread readout and real-time time sorting (possibly events building)
  • extendable to other digitizers and functionalities
  • user-friendly (full GUI, limited terminal output)
  • easy to maintain (avoid abstract coding and entirely objective programming)
  • for Ubuntu 22.04 or equivalent
  • binary output or root tree output

The Digitizer Classes

The Digitizer class is ClassDigitizer.h/C. The class controls the digitizer by manipulating the register. And various types of digitizers are different by the registers. Thus, the class can control different types of digitizers without modification. The digitizer classes stores the connection, and board information, and a copy of the register. It provides an interface to better control the digitizer, for example, manipulate the bits for the control bit.

The digitizer classes directly write/read the registers in the digitizer. The advantage is complete control of the hardware and simplified the program that only 3 pieces are needed:

  • WriteRegister()
  • ReadRegister()
  • Register Address
  • Load and Save register setting

The drawback is that, the buffer size must be calculated (a lazy man method is assign 10 MB for the buffer?).

Register Address and Setting Binary File

The registers < 0x8000 are channel settings. For example, 0x1nXX is for channel-n, or 0x80XX is for writing to all channels. The registers >= 0x8000 are board settings.

For all types of digitizers, the register > 0x8000 registers are the same and have the same meaning.

Because the 2n and 2n+1 channels are paired ( like shared same memory ). There are some registers also paired. for example, the record length is the same for any paired channels, once the record length is set for any one of the paired channels, the record length of the other channel is also set.

A Setting uses 4 bytes (unsigned int) to store 32 bits of each register value. Using an array of size 2048 can store all register settings. The following table shows the conversion.

Address Range Comment Setting Index Example
0x1000 - 0x1FFF Channel Setting 0x1XXX / 4 0x1020 -> 1032
0x8000 - 0x81FF Board Setting 0x8XXX & 0x0FFF 0x8080 -> 32
0xEF00 - 0xEFFF Other Board Setting 0xEXXX & 0x0FFF 0xEF04 -> 961
0xF000 - 0xFFFF Read only board configuration (0xFXXX & 0x0FFF) + 0x0200 0xF008 -> 520

Buffer calculation