Top Banner
TNT2 Digital Pulse Processor Functionalities & TUC control software Marc Richer <mailto:[email protected]> Christian Bonnin <mailto:[email protected]> Cayetano Santos March 28, 2013
206

TNT Functionalities

Jul 20, 2016

Download

Documents

Gica Joe

TNT User manual, digital gamma-ray spectroscopy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: TNT Functionalities

TNT2 Digital Pulse ProcessorFunctionalities

&TUC control software

Marc Richer<mailto:[email protected]>

Christian Bonnin<mailto:[email protected]>

Cayetano Santos

March 28, 2013

Page 2: TNT Functionalities

Abstract

Working around the Tracking gamma AGATA and the Grace-NTOF projectsthe development of a new digital acquisition card has been started at IPHC(old IReS) IN2P3 at the end of the year 2001. The TNT card (Treatmentfor Numerical Tracking or Treatment for NTOF) cames out of developmentphase during 2003. This card is controlled from a PC through USB2 (Uni-versal Serial Bus, version 2). The TNT card has 2 channel sampled at 65Mhz and a FPGA in order to process sampled data and accomplish commu-nication tasks.During 2004 a second card version has been designed (TNT2) whith someimprovements: 4 channels sampled up to 100 Mhz and 2 FPGA’s on board.The aim of this document is to present the functionalities of a TNT cardand how they are accessible through some dedicated software, TUC (TntUsb Control), that has been taylored for Tnt needs. This guide is the mainpart of the TNT Documentation.

Page 3: TNT Functionalities

Contents

I Overview 8

1 Overview 91.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

II Functionalities 17

2 Card functionalities 182.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.2 Acquisition modes . . . . . . . . . . . . . . . . . . . . . . . . 20

2.2.1 Oscilloscope mode . . . . . . . . . . . . . . . . . . . . 202.2.1.1 Several boards together . . . . . . . . . . . . 21

2.2.2 Energy mode . . . . . . . . . . . . . . . . . . . . . . . 242.2.3 Advanced topic: mix mode: oscilloscope AND energies

within . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.2.4 Advanced topic: test counter mode . . . . . . . . . . . 352.2.5 Advanced topic: ADC histogram mode . . . . . . . . . 35

2.3 Triggering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372.3.1 Simple and digital trigger . . . . . . . . . . . . . . . . 382.3.2 CFD trigger . . . . . . . . . . . . . . . . . . . . . . . . 412.3.3 Extern trigger . . . . . . . . . . . . . . . . . . . . . . . 412.3.4 Local and global trigger: local trigger readout . . . . . 432.3.5 Remarks about triggering . . . . . . . . . . . . . . . . 43

2.4 Data and Operation Inspection . . . . . . . . . . . . . . . . . 452.5 NIM / VETO interface . . . . . . . . . . . . . . . . . . . . . . 49

2.5.1 Handling NIM input logic . . . . . . . . . . . . . . . . 502.5.1.1 Gate and Delay: retriggerable concept . . . . 50

2.5.2 Coincidence data acquisition using NIM inputs . . . . 522.5.3 TNT2-D only : VETO input interface for anti-coincidence

acquisition . . . . . . . . . . . . . . . . . . . . . . . . 542.5.4 Synchronization top generation and clock output at

NIM’s out . . . . . . . . . . . . . . . . . . . . . . . . . 552.6 Special channel numbers . . . . . . . . . . . . . . . . . . . . . 56

1

Page 4: TNT Functionalities

CONTENTS

2.6.1 Logical Synchronization Events-LSE: channels five toeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

2.6.2 Low counting rate: channel zero . . . . . . . . . . . . 592.6.3 Pile-up data acquisition . . . . . . . . . . . . . . . . . 602.6.4 External validation window using NIM input for coin-

cidence data acquisition . . . . . . . . . . . . . . . . . 612.6.5 TNT2-D only : veto data acquisition using VETO input 622.6.6 ADC out of range event tagging . . . . . . . . . . . . 622.6.7 Full data readout acquisition . . . . . . . . . . . . . . 63

2.7 Time and synchronization . . . . . . . . . . . . . . . . . . . . 652.7.1 Time and accurate timing informations . . . . . . . . 652.7.2 Synchronization . . . . . . . . . . . . . . . . . . . . . 66

2.8 Data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 692.8.1 Format of oscillograms . . . . . . . . . . . . . . . . . . 692.8.2 ADC histogram mode . . . . . . . . . . . . . . . . . . 712.8.3 Format of energy mode . . . . . . . . . . . . . . . . . 71

2.9 Parameter sets . . . . . . . . . . . . . . . . . . . . . . . . . . 742.9.1 DT5 parameter set . . . . . . . . . . . . . . . . . . . . 742.9.2 GLIB parameter set . . . . . . . . . . . . . . . . . . . 78

2.10 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . 852.10.1 Some reflexions about dead times . . . . . . . . . . . . 85

2.10.1.1 Data treatment dead time . . . . . . . . . . 852.10.1.2 Data collection dead time . . . . . . . . . . . 862.10.1.3 Conclusion . . . . . . . . . . . . . . . . . . . 88

2.10.2 Time decay constant really used . . . . . . . . . . . . 902.10.3 Energy with Reset amplifiers . . . . . . . . . . . . . . 902.10.4 TFA triggering : rectify hidden coefficient . . . . . . . 902.10.5 TFA and Rapid signal shaping . . . . . . . . . . . . . 902.10.6 TNT and Fast Signals . . . . . . . . . . . . . . . . . . 912.10.7 Card types . . . . . . . . . . . . . . . . . . . . . . . . 91

III The control software : ’TUC’ Tnt USB Control 92

3 TUC software 933.1 Main screens . . . . . . . . . . . . . . . . . . . . . . . . . . . 933.2 Acquisitions overview . . . . . . . . . . . . . . . . . . . . . . 973.3 ”TntCards” tab . . . . . . . . . . . . . . . . . . . . . . . . . . 101

3.3.1 Parameters of selected card 1/3 tab . . . . . . . . . . 1103.3.2 Parameters 2/3 tab . . . . . . . . . . . . . . . . . . . 1243.3.3 Parameters 3/3 tab . . . . . . . . . . . . . . . . . . . 132

3.4 ”Oscillograms of card n” tab . . . . . . . . . . . . . . . . . . 1413.4.1 Interlace . . . . . . . . . . . . . . . . . . . . . . . . . . 147

3.5 ”Histograms” tab . . . . . . . . . . . . . . . . . . . . . . . . . 147

TNT Digital Pulse Processor - Functionalities and control software 2

Page 5: TNT Functionalities

CONTENTS

3.5.1 Integration from oscillograms . . . . . . . . . . . . . . 1543.5.2 Bidimensional histograms . . . . . . . . . . . . . . . . 1563.5.3 Slice of a bidimensional histogram . . . . . . . . . . . 156

3.6 ”Options” tab . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573.6.1 On board VHDL . . . . . . . . . . . . . . . . . . . . . 1653.6.2 Polezero search parameters - Ref-4-6 . . . . . . . . . . 1693.6.3 Channel calibration . . . . . . . . . . . . . . . . . . . 1733.6.4 Sending data over network - only energy datas . . . . 174

3.7 Performances . . . . . . . . . . . . . . . . . . . . . . . . . . . 1753.8 Multicard operating . . . . . . . . . . . . . . . . . . . . . . . 1793.9 Configuration files . . . . . . . . . . . . . . . . . . . . . . . . 1823.10 Tricks and tips . . . . . . . . . . . . . . . . . . . . . . . . . . 1853.11 Future . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

4 Working with card(s) 1924.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . 1924.2 Known problems and tips . . . . . . . . . . . . . . . . . . . . 195

4.2.1 Virtex doesn’t boot . . . . . . . . . . . . . . . . . . . 1954.2.2 Pile up through noisy Triggering . . . . . . . . . . . . 1964.2.3 TNT2D with LSE : events missing . . . . . . . . . . . 1984.2.4 Linux:’Card doesn’t seems to trigg...?’ . . . . . . . . . 1984.2.5 VHDL flash upload hangs . . . . . . . . . . . . . . . . 1994.2.6 How to apply some Gate/Delay on external trigger

over NIM in’s . . . . . . . . . . . . . . . . . . . . . . . 201

TNT Digital Pulse Processor - Functionalities and control software 3

Page 6: TNT Functionalities

List of Figures

1.1 Layout of TNT . . . . . . . . . . . . . . . . . . . . . . . . . . 101.2 One GUI example for TNT, TUC (Tnt USB Control) . . . . 111.3 TUC, Oscillogram’s tab . . . . . . . . . . . . . . . . . . . . . 111.4 TUC, Histogram’s tab . . . . . . . . . . . . . . . . . . . . . . 121.5 analog part . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.1 Offset Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.2 Synchronisation of several boards in oscilloscope mode. Up-

per panel shows the back plane and lower panel shows thefront face of three TNT boards. . . . . . . . . . . . . . . . . . 23

2.3 Deconvolution . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.4 Pole Zero Calculation . . . . . . . . . . . . . . . . . . . . . . 262.5 Trapezoid Overshoot . . . . . . . . . . . . . . . . . . . . . . . 262.6 Base line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.7 Histogram mode . . . . . . . . . . . . . . . . . . . . . . . . . 362.8 Analog and sampling stages. Main FPGA with memory blocks

containing the samples of the oscilloscope mode. . . . . . . . 372.9 Oscillocope capture from a coincidence acquisiton . . . . . . . 372.10 TUC screen capture in oscilloscope mode . . . . . . . . . . . 382.11 Preamplifier Output (blue) and difference signal (red) . . . . 392.12 Trigger difference overshoot: four different difference con-

stants, N and detail of the baseline . . . . . . . . . . . . . . . 392.13 Trigger Difference Overshoot Compensated . . . . . . . . . . 392.14 Trigger Integral . . . . . . . . . . . . . . . . . . . . . . . . . . 402.15 Digital CFD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.16 CFD triggering: differenciation, CFD window, CFD signal

and trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422.17 Card 126 should be the ’Clock’ master and ’Acquisition start’

master . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682.18 OscilloFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . 692.19 OscilloFormat3 . . . . . . . . . . . . . . . . . . . . . . . . . . 692.20 OscilloFormat4 . . . . . . . . . . . . . . . . . . . . . . . . . . 71

4

Page 7: TNT Functionalities

LIST OF FIGURES

2.21 Typical binary acquisition file. Each line represents a full 14bytes event . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

2.22 Filling Out Buffer . . . . . . . . . . . . . . . . . . . . . . . . 882.23 Filling Out Buffer2 . . . . . . . . . . . . . . . . . . . . . . . . 88

3.1 Main screen bottom part . . . . . . . . . . . . . . . . . . . . . 1033.2 Acquisition stopped because of disk space missing . . . . . . 1063.3 Start & Stop acquisition . . . . . . . . . . . . . . . . . . . . . 1063.4 First parameters tab . . . . . . . . . . . . . . . . . . . . . . . 1103.5 Card inputs parameters . . . . . . . . . . . . . . . . . . . . . 1113.6 Triggering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1133.7 Additional parameters . . . . . . . . . . . . . . . . . . . . . . 1193.8 2nd parameters tab . . . . . . . . . . . . . . . . . . . . . . . . 1253.9 3rd Parameters tab . . . . . . . . . . . . . . . . . . . . . . . . 1333.10 Oscillogram tab . . . . . . . . . . . . . . . . . . . . . . . . . . 1413.11 Triggered point of an oscillogram . . . . . . . . . . . . . . . . 1443.12 Zooming in an oscillogram . . . . . . . . . . . . . . . . . . . . 1453.13 Interlacing the TNT-2 channels . . . . . . . . . . . . . . . . . 1473.14 Choose channels to be interlaced and tune gains and offsets . 1483.15 Labelled histogram tab screenshot . . . . . . . . . . . . . . . 1493.16 Energy histogram with contextial menu . . . . . . . . . . . . 1503.17 Histogram plot properties . . . . . . . . . . . . . . . . . . . . 1503.18 Event detection rates . . . . . . . . . . . . . . . . . . . . . . . 1523.19 Event detection statistics . . . . . . . . . . . . . . . . . . . . 1523.20 Event detection bitmask . . . . . . . . . . . . . . . . . . . . . 1533.21 Histogram visualization parameters . . . . . . . . . . . . . . . 1543.22 Integration parameters . . . . . . . . . . . . . . . . . . . . . . 1553.23 Integration Area . . . . . . . . . . . . . . . . . . . . . . . . . 1563.24 Bidimensional histogram . . . . . . . . . . . . . . . . . . . . . 1573.25 Slice of a bidimensional histogram . . . . . . . . . . . . . . . 1583.26 Bidimensional histogram with a displayed slope . . . . . . . . 1583.27 Options tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1593.28 Versions history . . . . . . . . . . . . . . . . . . . . . . . . . . 1633.29 Pulse theorical curve . . . . . . . . . . . . . . . . . . . . . . . 1703.30 Channel calibration . . . . . . . . . . . . . . . . . . . . . . . . 173

4.1 Flash upload process freeze during file upload! . . . . . . . . . 199

TNT Digital Pulse Processor - Functionalities and control software 5

Page 8: TNT Functionalities

List of Tables

3.1 Files generated when saving data . . . . . . . . . . . . . . . . 1063.2 Readout frequency of energy data . . . . . . . . . . . . . . . . 138

6

Page 9: TNT Functionalities

LIST OF TABLES

Libraries

This software uses the following libraries:

• JAIDA a graphical component to display histograms (http://java.freehep.org/freehep1.x/jaida/v3.2.4/ReleaseNotes.html). It isa Java implementation of AIDA (http://aida.freehep.org) and isdistributed under the terms of LGPL (http://www.gnu.org/copyleft/lesser.html)

• SurfacePlotter a zoomable 3D surface plotter in Java/Swing (http://code.google.com/p/surfaceplotter) distributed under the termsof LGPL (http://www.gnu.org/copyleft/lesser.html)

TNT Digital Pulse Processor - Functionalities and control software 7

Page 10: TNT Functionalities

Part I

Overview

8

Page 11: TNT Functionalities

Chapter 1

Overview

1.1 Overview

This section resumes the remaining of the fonctionalities chapter, and canbe considered as an introductory overview to most important features. Thisis a good starting point and provides a global insight on main concepts to bedeveloped afterwards. TNT main concern is on line pulse processing offeringadvanced high-resolution spectroscopy capabilities.It features four channels operating in parallel. Each channel combines afourth order anti-aliasing Nyquist filter (cut-off frequency of 40 MHz), upto 105 MHz of sampling speed and 14 bits resolution. On-board processingprovides real time operation. A Xilinx Virtex II FPGA ( [1, Virtex II])implements pulse processing and hardware control. An additional SpartanII FPGA provides system reconfiguration.PC communication (control & acquisition data readout) goes through someUSB2 chip (FX2) that allows very high transfer rates (up to 25MB/s percard).

Following, some of the most important characteristics:

USB An 8051 compatible micro controller (Cypress Semiconductors’ FX2,2) is responsible for data readout and slow control. It implementsUSB communication and deals with the low level protocol. Readoutperformance can reach up to 40 MBytes/s. The software from thePC side allows the user to benefit from some graphical user interfacesoftware (TNT USB Control: TUC, see figure 1.2) in order to

• inspect\update some of the parameters defined at the card

• start\stop some acquisition

• visualize\save some acquisition data

In detail description of USB details and TUC’s low level operationsare considered in the corresponding guide of the TNT documentation

9

Page 12: TNT Functionalities

Figure 1.1: Layout of TNT

15 ’CardUSBCommunication.doc’.

Four analog input channels Four differential / common mode in-put channels sampled by a Flash Analog to Digital Converter(FADC) from (Analog Devices’ AD6645, [5, AD6645]) at up to105 Mhz. with an input voltage ranging from -0.3 V. to +0.3 V.(or -1.2/+1.2Volt if other gain is chosen). The following featuresare available for each channel

• Enable/disable the analog common/differential input

• Enable/disable FADC operation

• Selectable analog gain(range between around 0-2MeV to 0-5MeV)

• Variable offset to cover the full scale and benefit of the fullsampling dynamic range

• Any channel can be delayed of up to 1024 sampling periodsimmediately after the sampling stage

Triggering Refer to section 2.3, Triggering on page 37 for furtherinformation

• Four local triggers can be set-up (one for each card input). Inoscilloscope modes, the logical OR of the four and an externtrigger to be chosen between one of the four NIM inputs givesrise to the global trigger (2.3.4 section). In energy acquisitionmodes, each channel follows its own seperate trigger setup(which include some external triggering on a NIM input).The following features are available for each channel (local)trigger

TNT Digital Pulse Processor - Functionalities and control software 10

Page 13: TNT Functionalities

Figure 1.2: One GUI example for TNT, TUC (Tnt USB Control)

Figure 1.3: TUC, Oscillogram’s tab

TNT Digital Pulse Processor - Functionalities and control software 11

Page 14: TNT Functionalities

Figure 1.4: TUC, Histogram’s tab

– Enable or not

– Select between ’simple’ and ’digital’, leading edge trig-gers. The ’simple’ trigger compares the input signal witha threshold value comprised between -8192 and +8191 inFADC channel units. The ’digital’ trigger compares witha differentiated, averaged version of the input

– Sensible to positive / negative polarity (slope trigger)

– Integration / differentiation length up to 32 samplingperiods

– Global trigger can be forced high (’Force trigger’)

– Any of the local and global trigger can be taken out ofthe TNT at the local trigger outputs

• For accurate timing, a digital implementation of a classic,analog Constant Fraction Discriminator (CFD) has been im-plemented. Several parameters will determine its quality asa valid time reference

– Definition of the CFD delay : between 1 and 8 samplingperiods

– Definition of the CFD gain : 1/1, 1/2, 1/4 or 1/8

TNT Digital Pulse Processor - Functionalities and control software 12

Page 15: TNT Functionalities

Figure 1.5: analog part

– Definition of the CFD shift for the validation window

Counters The TNT handles several special counters, which can bere initialized each time the card register bank is updated (de-fault), each an acquisition starts or not, when something is de-tected at NIM input 2 or when some specific number of minutes isreached after an acquisition starts. These counters will composethe header information in oscilloscope mode, and will be part ofthe 14 bytes full event information in energy mode. A parameterin the register bank contains time before reset of those counters.

• Time stamp counter. Common to all working modes andindependent of them. Implemented as an up counter syn-chronous to the system clock (see section 2.7, ’Time andsynchronization’ on page 65 for details). This counter is en-coded using 6 bytes (50 days if working at sampling intervalsof 15.38 ns or 32 days if data sampled at 100Mhz)

• Four channel event counters, one by card channel. Syn-chronous to the system main clock domain, these countersincrease by one unit at each local trigger (internal or exter-nal) occurrence. The counters are encoded using 4 bytes.

• Four LSE event counters, one for each considered NIM in-put (TNT accept up to four external logical synchronizationevent channels, see section 2.6, Special channel numbers onpage 56). Synchronous to the system main clock domain,these counters increase by one unit at each NIM signal re-ceived. The counters are encoded using 4 bytes.

Oscilloscope acquisition mode (see section 2.2.1, Oscilloscope modeon page 20 for details). When a global trigger occurs, the cardwill memorize a given number of sampled point and will readout

TNT Digital Pulse Processor - Functionalities and control software 13

Page 16: TNT Functionalities

the corresponding data to the PC via the USB. In this mode, itis possible to

• Define an acquisition window size, the number of points be-fore trigger and the total number of points in the trace (=’oscillogram’).

• select the data to be readout. Several possibilities are offeredto the user (preamplifier signal, trapezoidal shape, etc.). Thisis valid for each channel.

Energy and mix acquisition modes Some trapezoidal shaper iscontinuously calculated with each new sampled point. Thus, somepulse will produce a trapezoid shape whose height is related tothe gamma ray energy deposit (in case of a Ge detector use). Thecard calculates the energy (some flat top averaging) containedin the pre amplifier signal and reads out this value along witha time stample, channel number and counter event informations.Several parameters are required for the correct determination ofthe energy. For more details about thess features, see 2.2.2, En-ergy mode on page 24 and 2.2.3, Mix mode on page 34. In themix mode, each time an oscillogram is catched by the card, thesedatas will be readouted:

• Whole oscillogram triggered

• All energy events detected within this oscillogram (at leastone) and only these.

Direct Digital Synthesis (DDS, [6, AD9852]) component is used tosynthesize a proper clock signal for driving the FADC’s (see sec-tion 2.7, Time and synchronization on page 65 for details). Thiscomponent facilitates the generation of a clean clock source, withan arbitrary frequency and shift. Several possible sources can feedthe component

• internal with some FPGA’s internal clok at 24 Mhz

• external source from a special dedicated LVTTL input

• internal with a 20 Mhz quartz

• external 50 Mhz from a special dedicated LVDS input (LVDSinput number 1)

The system clock is routed out to the LVDS output 1.

NIM interface Four inputs and four outputs (see section 2.5, NIM/VETO Interface on page 49 for more details).

TNT Digital Pulse Processor - Functionalities and control software 14

Page 17: TNT Functionalities

• Ability to apply a gate and delay (up to 65535 samplingperiods) on any of the four NIM inputs and any of the fourNIM outputs

• For each of the four NIM inputs:

– 50 Ohms termination (NIM) or 1MOhm (TTL)

– Consider falling (default) or raising edge of the originalNIM signals received for each of the four NIM inputs.

– original NIM signal inversion (for veto features) or not.

– enable or disable the NIM input.

Any of the NIM input can be used as an external validation sig-nal, thus allowing to take only events which are in coincidencewith a given pattern. In energy and mix acquisition modes andfor synchronization purposes, the card can take an extern eventinjected in any nim inputs. These logical synchronization events(LSE) will appear in the event data flow and can be considered asa extern channel with cahnnel 5 to 8, so all information regardingtime and frequency of occurrence will be available (see section2.6, Special channel numbers on page 56) The TNT2D card hasalso some additional veto input for each input channel.

Data and Operation Inspection. See section 2.4, Data and Opera-tion Inspection on page 45 of this guide for details

• Four inspections like signals (oscillogram data signals) areprovided when using oscilloscope mode. One out of 4 possible(FPGA) signals can be displayed within TUC as oscillogramdata (original sampled data, trapezoid data, CFD data,...);

• Two analog inspection lines : one out of 16 possible (FPGA)signals can be routed out to an oscilloscope.

• Four logical inspection lines : one out of 64 possible (FPGA)signals can be routed out to an oscilloscope.

• Both last features can be disabled (by setting up the outputDAC on sleep mode to avoid PCB noise, for example)

LVDS See section 2.7.2, Synchronization on page 66 for further infor-mation

• The user has access to four input/four output general pur-pose LVDS interfaces

• This feature is currently used for synchronization purposesand can be disabled by software

TNT Digital Pulse Processor - Functionalities and control software 15

Page 18: TNT Functionalities

System reconfiguration. TNT firmware running on the Virtex IIFPGA is default loaded from 3 EEPROM’s. But some additionnalnon volatile flash memory can be also used for storing some newVirtex VHDL program. This additionnal Virtex configurationcan be easily accessed using the USB port and TUC. The userhas the possibility to add new features by uploading some newconfiguration file to the flash EEPROM or to download (backup)the flash EEPROM content. Then it is possible to let the Virtexreboot over his 3 EEPROM’s default configuration or over thisnon volatile flash memory.

TNT Digital Pulse Processor - Functionalities and control software 16

Page 19: TNT Functionalities

Part II

Functionalities

17

Page 20: TNT Functionalities

Chapter 2

Card functionalities

2.1 Introduction

This guide intends to be an in depth introduction on advanced use of TNT2from the user point of view. It can be considered as global overview of allpossibilities offered by the embedded firmware which benefits of the hard-ware present around the main Virtex II FPGA ( [1, Virtex II]) and can beaccessed throught the software TUC (see figure 1.2). It aims at providing avalid starting point for a deep understanding on more advanced features. Itcan be seen as a reference on more advanced characteristics too.

The user will be faced to several common features when working withthe TNT, as well as to some particular aspects of digital processing. It isin his own interest to master these concepts, as long as performances willdepend on them. It is important to consider all the following with relationto the physics, not just as abstract concepts: how high or low countingrates, detector efficacy and pre amplifier stage characteristics will influencethe right setting up is something the user has to learn to deal with.

Basically, the aim of one TNT module is to digitise the input signal atthe sampling frequency (up to 100 MHz, 14 bits, see [5, AD6645] for de-tails). Then, data processing is applied to the data flow. Well know digitalprocessing algorithms are implemented in the FPGA part ( [1, Virtex II]).Additional external memory ressources are used to use the unit as an ac-curate digital oscilloscope. The communication with a card is implementedvia an Universal Serial Bus (USB).

The simplest operating mode, the oscilloscope mode, takes a givenamount of sampled points for each input channel (the oscillogram trace)and reads it out to the PC. Several triggering shemes can be set up in orderto define different event selection criteria. Section 2.2.1 Oscilloscope modeexplains this in detail.

The context of the main operating mode, the energy mode, is to pro-cess the detector output from the preamplifier stage used in nuclear physics

18

Page 21: TNT Functionalities

experiments. This is useful mainly with HPGe detectors, due to the longtime scale compared to the sampling period. This is not a restriction, asTNT can be easily coupled to fast signals comming from scintillators, pho-tomultiplicators, etc. See section 2.10.6 TNT and Fast Signals and 2.10.5for more details.

When a physical event occurs, a gamma-ray interacts with the detec-tor. The result of this interaction is the induction of a voltage impulse.The height of these impulses is proportional to the amount of the gamma-ray energy released during the interaction with the detector. The accuratemeasure of the interaction energy is the key in order to start some analy-sis (constitution of energy spectra) about what occurred during the physicexperiment which is part of physicist research work.

At any time, when an impulse is detected, the card considers the asso-ciated trapezoidal shape whose flat top height is proportional to the initialimpulse height. The flat top height value is a magnitude proportional tothe energy. Each time a trigger occurs on a channel, the card will build upthe so called energy event or multiparametric event or information tuple,consisting on the channel number, trigger counter, timestamp and energyvalue (flat top height value) along with additional information. The succes-sive energy events are sent to the PC in order to save them to file and/or toconstruct the corresponding energy histogram. Section 2.2.2 Energy Modeexplains this in detail.

Several other operating modes (histogram of sampled data, section 2.2.5ADC histogram mode, mix mode, Section 2.2.3 Mix mode) are available.Interfacing the unit to external equipement can be useful too. For this, NIMsignals can be injected to and/or taken from the board for implementingcoincidence data acquisition, online data filtering, pile up selection, etc.(section 2.5, NIM Interface). Any of these can be managed independentlyand its use will be explained furtherly.

TNT Digital Pulse Processor - Functionalities and control software 19

Page 22: TNT Functionalities

2.2 Acquisition modes

2.2.1 Oscilloscope mode

TNT module can continuously acquire waveforms with 14-bit precision. Atthe same time the data flow is sent into the digital pulse shaper, it is alsostored into a circular buffer. This FIFO (First Input First Output) has adepth of 1024K entries corresponding to 10.4 ms worth of event waveformdata (if working at sampling intervals of 10 ns.). When an event trigger hasbeen received, the module can incorporate waveforms of arbitrary lengthinto its output data stream. As in a digital oscilloscope, it is possible torecord pre-trigger waveform data. This mode is useful for off line analysisto visualize and / or to apply data processing.

The card can be used as an accurate digital oscilloscope, continuouslysampling data from the FADC’s and storing it into memory. When a triggeroccurs (internal or external), the card waits until the specified size of data(Ref-10-33.2)is reached and then starts to read out the data to the USB2.At this point, no more data is written to memory and the card enters intothe readout phase. The VII writes data to the FX2 buffers. As long as thisreadout phase is not completely finished, any further trigger signal detectedby the card will be ignored.

In oscilloscope acquisition mode when a global trigger occurs, the cardwill memorize a given number of sampled points for each input channel andreads out the corresponding data to the USB. In this mode, it is possible to

• Define an acquisition window size

– Number of points before trigger

– Total number of points in the trace (the same for all channels)

• Select the data to readout

– For each channel, it is possible to readout several different databuses out of the VII. For example, the pre amplifier (FADC)falling tail, the deconvolution filter’s output (trapezoid), differ-ence or integration from the trigger algorithm, etc.

This data can be graphically displayed in TUC, the way an oscilloscopewould do, and/or saved in a data file. The values of five counters (timestample + four channels event counter) are readout along with the datastream. This is a header information added in front of each frame. Withthese counter values, it is possible to determine:

• Time or occurrence

• The event counting rate by channel

TNT Digital Pulse Processor - Functionalities and control software 20

Page 23: TNT Functionalities

Oscilloscope mode

• The number of ’lost’ events due the USB readout phase (readout deadtime)

For both main acquisition modes (oscilloscope and energy), the referenceis the number of events seen by the board over each channel, which impliesa correct trigger set up (refer to 2.3, Triggering for a discussion on thistopic). For example, a high threshold will miss low energies and for lowenergy sources the counting rate and dead time are under estimated. Fordetailed description of the oscilloscope file format, refer to 2.8, Data ReadoutFormats.

Additional features As shown in figure 2.1, the offset of the input datacan be changed to accomodate high amplitudes. This variable offsetserves to cover the full scale and benefit of the full sampling dynamicrange. In addition, the user can select between two different analoggains (range between around 0-2MeV to 0-5MeV) and enable or disablethe analog common/differential input to prevent noise in the analog,pre sampling stage.

Finally, each channel can be delayed of up to 1024 sampling periodsimmediately after the sampling stage to compensate for any otherlatency present in the acquisition signals.

Figure 2.1: Offset Control

2.2.1.1 Several boards together

Using several boards in oscilloscope mode is of course possible : eachcard is USB plugged on same PC host, each one will receive the acqui-sition start order in a serial communication sheme (first one on USBbus, second one,etc...). Each card has own triggering setup and willtry to readout an oscillogram when it want/can. Each card lives hisown way but is of course conditionned of the PC USB capabilities anddepends of readout needs of all other cards sharing the same USB bus.But there is no particular synchronization between these cards as they

TNT Digital Pulse Processor - Functionalities and control software 21

Page 24: TNT Functionalities

Oscilloscope mode

have their own clock and readout oscillograms when it want/can.To understands what follows, the user can refer to section 2.7 Timeand synchronization on page 65 for details on using several TNT mod-ules. This implies using a common clock, as well as understanding theconcepts of master and slave cards. How the modules will behave whenthey are used in this mode is also explained.The motivation to using several TNT modules in oscilloscope modewould be, for example, to store traces from several (more than four)segments of the same detector. The traces are stored when an event isdetected on only one of the channels, and all traces in different TNTmodules must correspond to identical time frames.The main idea is

• let all cards share the same clock. For example, one will use itsown one but all others will get this clock as it is daisy chainedfrom LVDS IN/OUT at the back panel. The second card will getan external clock from the first and will also output the clock onits own LVDS outputs.

• get better control over the acquisition start phase latency, bydefining some unique master and all other as slave cards. Slavecards will be armed when they receive their acquisition start orderthrough the USB bus but they don’t really start to acquire data(timestamp clock isn’t yet running and local triggering also). Realstart signal is generated by the master one which should be thelast plugged on the USB bus (last order in TUC’s lists) on theLVDS bus. With a correct daisy chain of the LVDS In/Out thereal start signal is transmitted to each slave card.

• get better control over successive USB readout phases: when acard finishes to readout an oscillogram, it should wait until allother cards also complete their readout. Then they are all to-gether ready to trigg and catch some new oscillogram datas again.

See 3.3.1 and 3.8 for detailled explications.

Figure 2.2 shows the correct setup for the case of three cards.

Once the boards are synchronous, one of them is declared to be themaster. A ’master signal’ has to be plugged to the master board. Thiswould be, for example, the signal comming from a common segment(core in a coaxial detector, non segmented anode in a planar detector,etc.). The local trigger from this signal should trigger the oscilloscopemode. This, when using a single card, is not an issue. The globaltrigger can be identified to this local trigger by just disabling anyother local trigger (remember that the global trigger is just the logicalOR ring of all local triggers in the same card).

TNT Digital Pulse Processor - Functionalities and control software 22

Page 25: TNT Functionalities

Oscilloscope mode

Figure 2.2: Synchronisation of several boards in oscilloscope mode. Upperpanel shows the back plane and lower panel shows the front face of threeTNT boards.

TNT Digital Pulse Processor - Functionalities and control software 23

Page 26: TNT Functionalities

Energy mode

In the case that several boards must be opperated in the same con-ditions (one master signal triggers all), the local trigger have to beextracted and injected to all the slave cards. Due to possible mist-matching, the simplest option is to use a fan in - fan out additionalmodule to replicate the local trigger before putting it to nim inputone, for example. Now, as long as the TNT has the capability of usingextern signals as triggers, any of the slave cards has to use nim inputone (for example) as the local trigger of one of the channels, disablingall the rest. This makes the global trigger (wich triggers the oscillo-scope) of any of the slaves to be identical to any other global trigger ofany other slave board, and identical (neglecting the cable delay) to thelocal trigger of the master signal, which triggers the master card. Theuser is invited to refer to section 2.3.4 Local and global trigger for de-tails on the function of global and local triggers. For a full explanationon triggering, refer to 2.3 Triggering.

Once the previous has been set up correctly, there is a possible source ofdata mismatch in the sense of equivalent data traces not correspondingto the same time frame. Simply put, USB readout doesn’t happenin parallel for all modules, so that when one of the modules hasn’tfinished reading out its own data, another module is ready to accepta new trigger, and in fact it does, which makes that the data storedto a file is difficult if not impossible to correlate.

There is a simple way to avoid that. Refering to figure 2.2, Ren OUT(back plane) is kind of ’busy’ signal, in NIM format. OR-ing all thethree and looping back the result to the Ren IN makes the local triggerof channel one in board 126 disappear: when one of the boards readsout its trace to the pc, its corresponding ’busy’ is active, and no newtrigger is present, so all remaining boards will wait until all readoutare finished. This makes that all traces in a data file correspondsto identical time windows, which makes that the behaviour of usingseveral modules is identical to using only one of them. To check thateverything works fine, the user can observe how the size of each filecorresponding to different modules is the same.

2.2.2 Energy mode

The information related to the deposited energy in an event is contained inthe pulse. More exactly, the principle of linearity is accepted, meaning thatthis energy is proportional to the pulse amplitude. This is not completelytrue, due to the not instantaneous charge collection time, which implies thatsome information is lost during the pre amplifier stage. One other part ofthis information implies some integration time too long. In addition, noise(white electronic and sampling noise) must be considered as a source of non

TNT Digital Pulse Processor - Functionalities and control software 24

Page 27: TNT Functionalities

Energy mode

linearity.

Deconvolution. In order to determine the energy level (or equivalentlythe pulse amplitude) of a detected impulse, a well-known techniquehas been implemented on-line in the FPGA fabric. This is based onthe deconvolution of the pre-amplifier signal, which filters the signalto a trapezoidal shape, whose amplitude is proportional to the energy.For additional information, refer to [9, Geor] and [8, Jord].

The basic principle is to build a trapezoidal shape from the original im-pulsion, being the height of both proportional, and thus proportionalto the energy deposited. The algorithm can be easily implemented inan FPGA. The recursive algorithm allows to construct a trapezoidalshape, s(n), from the sampled points of the input signal v(n):

sn = sn−1 + pn + dk,j,n ×M (2.1)

with

pn = pn−1 + dk,j,n (2.2)

dk,j,n = vn − vn−k − vn−j + vn−j−k (2.3)

with M the decay time constant.

In the following screen capture, the original impulse can be appreciated(blue), along with its correspondent trapezoid (red), in different scales.

Figure 2.3: Deconvolution

Note how the Virtex II synthesizes the trapezoidal shape in real time,so there is no need for any storage and further post processing. Twosuccessive shapes can be resolved in function of two parameters:

• the rise time, k

• the flat top time, m

TNT Digital Pulse Processor - Functionalities and control software 25

Page 28: TNT Functionalities

Energy mode

Pole zero cancellation The deconvolution algorithm takes into accountthe decay time constant of the impulsion, M (up to 650µs). A correctfalling tail value estimation is crucial to correctly flatten the trapezoidand then to have a good energy measure. This involves measuring thisfalling tail taking samples from the several falling tails to get a bestvalue, best meaning here the value which is obtained most times. TUCprovides a tool for doing that automatically, building up an histogramof M values (figure 2.4).

Figure 2.4: Pole Zero Calculation

It is important to realize here how a bad approximation of the rightM value will modify the shape of the trapezoid. Figure 2.5 shows thisclearly. Over and under stimation will change energy resolution ac-cordingly by the equivalent over or under measure of the right trape-zoid height. This can be recognized when looking at the resultingspectra by appreciating a tail to the right or to the left of the energypeaks.

Figure 2.5: Trapezoid Overshoot

A digital gain is used as a rescale factor. Depending on set up, the trape-zoidal shape (signed) bus can take up to 32 bits. Energy is consideredto be the 16 leftmost hand (most significant) bits, which means thatthe original value is divided by 216 = 65536. Depending on its ampli-tude, the calculated spectra will be more or less contracted. In orderto expand the spectra (which is equivalent to improve the details), theuser has the possibility to apply some kind of gain to the calculated

TNT Digital Pulse Processor - Functionalities and control software 26

Page 29: TNT Functionalities

Energy mode

energy. This way, a digital gain concept has been defined. Simply put,it comes to add some shift to the right when taking the 16 bits fromthe original 32 bit value. For example, discard the first most signifi-cant bit (after the sign bit) and take the following 15 bits. This hasthe effect of a applying a gain to the original trapezoid. In this way,giving an arbitrary parameter ’value’,

• value 1 ⇒ card take the 16 most significant bits

• value 2 ⇒ card discard the most significant bit and take thefollowing 16 bits

• value 3 ⇒ card discard the 2 most significant bits and take thefollowing 16 bits, etc.

Note that the noise to signal ratio (NSR) is modified by the digitalgain, so resolution is expected to be inversely affected.

Energy calculation. At this point, the important question is what mustbe considered as the (more accurate, true or more stable) energy value?The answer to this question comes from the physics involved in thedetecting process. If the deconvolution is thought as an integration (ofcharges drifting towards the contacts), then the longer the integrationtime, the more accurate will be the measure at the end of the trape-zoid. This is because the flat top is not so flat, and depends on theintegration. Once this is finished, the slope at the flat top disappears.In this case, the true energy value should be the one at the end of theflat top.

There are several parameters to deal with this. In general, energy willbe an average of the samples in a defined window. A given numberof samples are taken on the flat top of the trapezoid to calculate anaverage. This provides what is called the energy. For determining theaverage the following expression is used as long as the VII FPGA logicis not well suited for a division by an arbitrary integer, a classic alter-native has been chosen here. Division by a power of two is equivalentto a bit right shift of 1 position, so in order to facilitate arithmeticcalculations, the division has been changed to a multiplication:

Average =∑n

k=1 vk

n(2.4)

Average× 214 =∑n

k=1 vk

n× 214 (2.5)

Average =n∑

k=1

vk ×214

n× 1

214(2.6)

TNT Digital Pulse Processor - Functionalities and control software 27

Page 30: TNT Functionalities

Energy mode

The term 214/n (χ factor) is calculated by software and send to theVII FPGA as a parameter. Thus, the multiplication can be done quitefast thanks to the embedded multipliers coming within the FPGA aspart of several dedicated fast resources intended for DSP implemen-tation. As a consequence, several additional parameters needs to becommunicated to the FPGA for energy determination:

• average width, number of samples from the flat top to be usedfor the average

• χ factor, this is the integer part of the term 214/n and is auto-matically calculated by TUC

• average shift, this parameter indicates where the averaging win-dow must be placed, starting from the first point of the trape-zoidal flat top (trigger point + k = first point of the flat top).

More in concrete, averaging is implemented in the form of a movingwindow, which continuously calculates the energy from n samples pre-ceding the actual. Energy is stored following the local trigger. Becauseof this, a precise, stable local trigger is necessary to avoid incorrect en-ergy measurements. Refer to section 2.3 Triggering for information ona correct trigger set up. The next figure ’Normal events’shows an os-cilloscope capture where the trigger is shown (pink) along with thetime where energy is taken from the trapezoid’s flat top (green). Notethat second one is a shifted versions of the first one, being the shift aparameter equal to k + average width + average shift.

Pile up rejection For a proper energy measurement, the whole flat topmust be free from any influence coming from next events or saturation.This means that, at least k+m samples are necessary to correctly mea-sure the energy average. In the case a new event occurs before k+msamples, pileup pattern is recognized by the card. In all 4 followingimages:

• Yellow: Analogical input signal (use ’Insp. ana.1=0-Data ch1’ ona TNT2 card)

• Blue: Trapezoid costructed by the card using user’s energy pa-rameter settings(use ’Insp. ana.2=4-Trapezoid ch1’ on a TNT2card)

• Pink: Trigger signal generated by th card (use ’Log. insp.1=23-Ch1 trigger’ on a TNT2 card)

• Yellow: Signal generated by the card when it take the energy (use’Log. inps.2=34-Wr en ch1’ on a TNT2 card)

TNT Digital Pulse Processor - Functionalities and control software 28

Page 31: TNT Functionalities

Energy mode

At this first image, both triggers are far away from each other, thesecond occurs long time after the end of the first trapezoid. No pileupare here.

In the second case, only the first event produces a valid energy, asthe second one is corrupted by the previous (asymmetric, not flat toptrapezoid). ’Pileup reject?’ set to ’yes’ will cause the second one tobe ignored by the card (rejected). ’Pileup reject?’ set to ’no’ will

TNT Digital Pulse Processor - Functionalities and control software 29

Page 32: TNT Functionalities

Energy mode

cause the second one to be taken by the card but with a special bitb4 raised in the channel number less significant byte. The energy ofthe second event will not be taken by TUC in the energy histogram(default behaviour).

In this third case, the 2nd event occurs (pink) before energy of firstevent has been taken. Both energy are corrupted, so both events willbe seen as pileups by the card. ’Pileup reject?’ set to ’yes’ will causenone of the two events to be considered by the card (all rejected).’Pileup reject?’ set to ’no’ will cause both events to be taken bythe card but with a special bit b4 raised in the channel number lesssignificant byte. Bothe energy values will not be taken by TUC in theenergy histogram (default behaviour).

TNT Digital Pulse Processor - Functionalities and control software 30

Page 33: TNT Functionalities

Energy mode

In this last case the energy is corrupted because of the analog signalamplitude which is out of the ADC range. It is also some card optionsto reject events when the analog pulse goes out of the ADC range(default behaviour) or to keep them but with some special bit raisedin the channel number less significant byte (bit b7). Here, defaultbehaviour is rejection if analog data is out of range of the ADC : afterthe 3th trigger, the filtered shape needs some time to become stable,and TNT card does’nt consider this last event (no energy is taken atgreen curve).Setting ’Pileup reject?’ to ’no’ is useful in the case the user prefersto store all events independently of any rejection condition. This way,the user can reproduce offline all the sequence, and may remove anyfalse energy information or even try to get the right energy value fromthe wrong one.

Base line restoration The baseline of the charge signal is not stable. Itdepends on leakage currents in the reverse diode. This fact is reflectedon the trapezoid’s baseline, which inherits its instability. In addition,the offset level where no deposition of energy occurs is rarely equal tozero (remember that in general, the energy should be the differencebetween base line offset and trapezoid height, but here we supposeda null zero level). This implies that some base line correction is nec-essary. The simplest way to do this is to calculate the base line level-when no trapezoid is present- and to substract it. Here, this calcula-tion is implemented as a continuous average on a variable number ofsamples. This implies an accurate trigger providing a valid reference

TNT Digital Pulse Processor - Functionalities and control software 31

Page 34: TNT Functionalities

Energy mode

on the presence or not of a flat base line. Figure 2.6.

Advanced topic: energy readout optimization It is important to un-derstand that the host PC is responsible for the final histogram con-struction, displaying it and/or saving data to disk. The TNT moduleonly reads out full events at the maximum rate allowed by the USBbus. This means that if any other tasks runs in parallel to TUC, itwill degrade performances. As a consequence, and depending on thedata readout rate, not all the information will be considered and someevents can be lost. From the USB point of view, the TNT module fillsa data buller somewhere between the board and the PC, this PC emp-ties this buffer at a rate wich depends on all tasks being executed inparallel. By default, each time a packet is complete, TUC will displaydata and save it to disk. If the filling rate is higher that the emptingrate, then data lose happens (it is also possible to inspect that usinganalog inspection lines, see Data and Operation Inspection for details).There are several simple ways to avoid or minimize data losses:

• Setting the priority of TUC to ’MAX’ improves highly the per-formance of TNT in terms of low dead time (data or full eventslose). This is equivalent to asking to the operating system to givea maximum priority to TUC as a processus running on the hostPC. It is possible to graduate this priority from a minimum to amaximum at discrete values. See sec:OptionsTab ’Options tab’within TUC.

• Reduce the work done by TUC:– Select data visualization only if absolutely necessary.– It is possible to decrease the refresh rate of the histogram

(and for oscillogram too) being plotted. By default, whenan USB packet is full, TUC plots the cumulative histogram.This default behaviour can be modified to one out of x USBpackets. Refreshing the histogram once out of 10 or 1000USB packet can be more than enought at high counting rates.

– It is also possible to decrease the USB packet rate for his-togram calculation. By default, TUC consider all USB datareceived, but it is possible to consider only a subset of allUSB data received. This default behaviour can be modifiedto one out of x USB packets. Of course TUC’s calculationabout the percent of event in histogram related to all eventstriggered will be corrupted as relative to data really takeninto histogram not to all events really received and may besaved to disk.

– Remark that displaying at the screen is one of the most CPUconsuming tasks. As a consequence, reducing and minimizing

TNT Digital Pulse Processor - Functionalities and control software 32

Page 35: TNT Functionalities

Energy mode

Figure 2.6: Base line.

TNT Digital Pulse Processor - Functionalities and control software 33

Page 36: TNT Functionalities

Advanced topic: mix mode: oscilloscope AND energies within

the TUC window is the best solution when the acquisition isrunning.

• Finally, increasing the size of the USB buffer is a way to reducethe default behaviour of TUC, which means that the number oftimes the display is refreshed (by second) decreases. By default,TUC handle a maximum of some 64512 bytes of USB buffering.Note that for low counting rates (refer to section 2.6.2, Low count-ing rates), all of the previous changes. Refreshment rate must beset to one and the size of the USB data packet reduced to a min-imum. Additionally, ’dummy’ data can be injected to the dataflow in order to fill the USB packets faster. This capability isaccesible to the user which can set the time, in seconds, of thenext displaying.

2.2.3 Advanced topic: mix mode: oscilloscope AND energieswithin

This is a mixture of the oscilloscope and the energy modes. As in oscilloscopemode, a number of samples is readout to the PC. In parallel, the signaltriggering the data capture (global trigger) enables the beginning of a timewindow, which is closed when all the requested samples are in memory. Allthe energy mechanism is enabled during this time window, so all calculatedenergies on this interval will be present. This is useful to have both, thetrace of samples and the full energy events. Note that events belonging tothe pre trigger are not considered in the mix mode. During the readoutof oscillosgrams a dead time is present (no new input data is accepted).Events are readout while the USB is free, that’s to say, while new data isbeing written to memory (or while a new trigger starts this).

Energies are always calculated in parallel to data that has been memo-rized. For example, in the case of a big acquisition window holding severalimpulses, the card will just consider and memorize full event informationsfor impulses contained in the trace. Events between 2 traces will not beconsidered. This kind of dead time represent the time needed by the TNTsystem (card and PC) in order to readout completely the oscillogram datato the USB host PC.

Thus, the card will try to readout 2 data flows: an oscillogram flow andan energy tuples flow. These 2 flows are scheduled in a particular way: assoon as an oscillogram has been completely memorized, the card take first alook in the memory zones which are dedicated for buffering event multipara-metric informations (energy, timestamp, trigger counter, channel number).If this zone is full, the card will try to readout first these datas to the USBbus. Then, and only then it will consider oscillogram data for the USBreadout part. When the last byte of the oscillogram has been transferred,the card write then the energy informations contained / associated to the

TNT Digital Pulse Processor - Functionalities and control software 34

Page 37: TNT Functionalities

Advanced topic: test counter mode

oscillogram data to the dedicated memory zones on the card and then returnin a waiting state, waiting for the next trigger signal. Energy informationswill be readout only if their dedicated buffer zone is full.

This mode has not so good performances than each mode separatelybecause the energy data is not continuously transferred to the USB, butonly when the Virtex II buffers are full: during the readout of these buffers,new events will be ignored by the card.

Events detected during the readout phase of oscillogram data are alsobe ignored by the card. This mode is usually used to get both oscillogramsand on board calculated energy. One can easily take the oscillogram andfeed it to offline custom software which calculates precisely energy and thencompare the results with the energy informations calculated by the card, forexample.

In order to increase readout performances and decrease the deadtimeduring oscillogram readout, it is possible to specify a subset size of theinitial oscillogram to consider only for the readout : this allow to specifyan initial oscillogram size that is longh enough for the shaping time of theenergy calculation process and to readout only the falling edge / rising edgeof the pulse (some very few oscillogram points) that has been triggered bythe card, for pulse shape analysis needs, for example.

2.2.4 Advanced topic: test counter mode

This is a debug mode, and is only useful in order to test and verify thequality and coherence of the USB transfer phase. Indeed, even if the USBtransfer type used (the bulk transfer) has a transfer error detection featurewith some ability to re-send a packet which has not been correctly received,this acquisition mode allow to test the general reliability of the USB transfer.

The card manage some counter which increment from -8192 to +8191and re-start again and again. The counter is initialized with a 0 value.One can easily check if the PC USB host receive correctly all data send bythe card, with no missing part. Thus the USB2 transfer part could not beresponsible of any possible loss of data.

Oscillograms of this mode are completely artificials and doesn’t have anyconnection with any signal that could occurred at the inputs of the card.

2.2.5 Advanced topic: ADC histogram mode

Histogram of samples is possible in this mode. One sample out of four in thesequence of samples is used for this. As the FADC’s operate on 14 bits, theFADC histogram will collect for each possible ADC value ([0, 214-1] = 16383different possible values (channels), the number of times this value has beenencountered since the start of the acquisition or since the last USB readoutof the histogram. This is because once one of the channels in the histogram

TNT Digital Pulse Processor - Functionalities and control software 35

Page 38: TNT Functionalities

Advanced topic: ADC histogram mode

reaches its maximum value (saturates), the full histogram is readout to thePC. Then, all channels are reset to 0 and the count restarts.

Four different histograms can be calculated in parallel, each of then hav-ing several possibilities as its input data. This is similar to the oscilloscopemode.

Each channel counter is implemented as an unsigned up counter andspans over 2 bytes in a big endian order (MSB,LSB). On a regular basis,when the total numbers in the histogram reach some predefined quantity,the card sends 16384 counter values, each one coded on a word (2 bytes),thus giving an amount of 32768 bytes. Histograming is often used for:

• examining TNT performances: effective number of bits, noise charac-terization, differential non linearity, etc.

• base line correction width determination,

Remarks:

1. the process is trigerless, this mode can be considered as particular andquite independent of the rest

2. this mode won’t be present in all versions of the code running in theVII FPGA. This is due to the fact that a huge amount of memoryis necessary to store the histogram counters (channels). This spaceis preferred for an use in the output energy buffer, where events arestored before readout to the PC.

Figure 2.7: Histogram mode

TNT Digital Pulse Processor - Functionalities and control software 36

Page 39: TNT Functionalities

Figure 2.8: Analog and sampling stages. Main FPGA with memory blockscontaining the samples of the oscilloscope mode.

Figure 2.9: Oscillocope capture from a coincidence acquisiton

2.3 Triggering

Triggering is of great importance. It determines the presence of an impul-sion in the data flow. A good trigger must be characterized by low detectionthreshold, low sensitivity to signal dispersion and noise, and low dead time.It has an impact on both pile-up rejection and trapezoid base line restoration(see 2.2.2 ’Base line restoration’) which eventually leads to a good or badenergy resolution. This is crucial not only because a low energy thresholdis easy to reach with digital electronics, but also because a correct pile-up determination (and rejection) will improve energy resolution when falseenergies are correctly rejected. At the same time, trapezoid base line rectifi-cation and energy measure are also improved. Refer to 2.2.2, Energy Mode),for details on how the energy information is extracted from the preamplifier

TNT Digital Pulse Processor - Functionalities and control software 37

Page 40: TNT Functionalities

Simple and digital trigger

Figure 2.10: TUC screen capture in oscilloscope mode

signal.Several different triggering schemes have been implemented within TNT.

The simplest one is a ’leading edge’ trigger, sensible to amplitudes (energies)and characterized by a poor timing (high jitter) (2.3.1 Simple and digitaltrigger). The following are digital versions of their analog counterparts(constant fraction discrimination classic trigger, for example), and are usedto time stamp events occurrences with good accuracy. Refer to the 2.3.2CFD trigger section for a detailed implementation description of the CFDalgorithm. In addition, TNT has the capability to incorporate triggers fromouter modules for improved accuracy (2.3.3, Extern trigger).

All figures shown in this section have been taken using the data in-spection capabilities included with TNT, whether using TUC or using anoscilloscope. See section 2.4, Data and Operation Inspection, for use.

2.3.1 Simple and digital trigger

The first trigger implemented in TNT2 is a leading edge trigger. It is theresult of a comparison between a reference threshold with the pre amplifiersignal (simple trigger), or with a filtered signal (digital trigger) [7, Lauer].

To allow a quick trigger detection (quick meaning here low dead timeand without any dependency on latency), the low frequency component ofthe pre amplifier signal must be suppressed. This comes to removing thelong pre amplifier tail. For this, a first difference stage is implementedwith a DS (difference-substract) unit, whose delay N will be referred fromnow on as the difference constant. This makes the algorithm independentof the input offset (base line is always 0).

Figure 2.11 shows a positive impulse (blue) along with the calculateddifference signal (red curve).

Even if the red curve seems to be always positive, it is slightly negativewhen it returns to the baseline. This overshoot is due to the falling tail ofthe preamplifier output, which must be compensated, as this might havean important effect at high counting rates. In figure 2.12 the effect of fourdifferent difference constants, N. Figure 2.12 shows a zoom of the previous,where the mentioned overshoot can be more clearly appreciated.

TNT Digital Pulse Processor - Functionalities and control software 38

Page 41: TNT Functionalities

Simple and digital trigger

Figure 2.11: Preamplifier Output (blue) and difference signal (red)

Figure 2.12: Trigger difference overshoot: four different difference constants,N and detail of the baseline

In TNT, a correction factor has been introduced to minimize this effect

Kd = −NTs/Td (2.7)

where Ts is the falling tail constant, and Td the sampling period. Thisfactor is introduced in the DS unit in the form

Snew(k) = S(k)−Kd ∗ S(k −N) (2.8)

For more details on this topic, please refer to [11, Lukic], [12, Mihailescu].

Figure 2.13: Trigger Difference Overshoot Compensated

TNT Digital Pulse Processor - Functionalities and control software 39

Page 42: TNT Functionalities

Simple and digital trigger

In figure 2.13, under compensation (blue, red) and over compensation(yellow), along with the correct one (green) are presented. The user must beawared that the correction factor is automatically calculated and taken intoaccount in TNT, so in principle he is not to deal with it. The correctnessor not of the correction will be related only to the accurate measure of thefalling tail constant (see 2.2.2 ’PZ cancellation’)

The second stage is the comparison with a reference level (threshold).Leading edge schemes are quite sensible to noise, so in order to avoid ahigh degree of sensitivity on rising edge uncertainty (and so a high jittertrigger), an average (or integration) of the difference signal is accomplished.This is implemented with the help of a Moving Average Unit (MAU), whichperforms an integration of M samples, where M is the ’integration constant’.This is equivalent to a low pass filter which removes high frequencies (noise),improving trigger jitter. The generated shape can be observed on figure 2.11(green curve).

Figure 2.14: Trigger Integral

To summarize, the ’digital’ trigger calculates a difference based on theoriginal samples: it takes the difference between the current actual point nxand the previous point nx-N. Then, a second signal is calculated by summingthe difference signal over M points. Finally a simple threshold is applied onthe last signal coupled with a slope indicator, which takes into account thepositive or negative polarity of the preamplifier signal. When the resultingcalculated signal crosses the threshold by respecting the specified slope, thenthe card triggers on this channel. Parameters are:

• delay for the DS unit of the differentiator module N, [1, 31] samples

• delay for the DS unit of the integrator (MAU) module M, [1, 31] sam-ples

• minimum time over threshold (de glitch of trigger signal), fixed to sixsampling periods

• trigger threshold value [−8192,+8191], reference value for the com-parator

TNT Digital Pulse Processor - Functionalities and control software 40

Page 43: TNT Functionalities

CFD trigger

• positive or negative slope

2.3.2 CFD trigger

In addition to the previous, a digital Constant Fraction Discriminator (CFD)signal is constructed, equivalent to a classic, analog implementation. Thisis useful for having a more accurate timing by fixing the time stamp value.This type of trigger avoids any leading edge incertitude: the crossing pointin the linear zone is constant!

The input to the CFD module is the averaged signal from previous stage.Several parameters must be adjusted for a correct timing.

• CFD delay : between 1 and 16 sampling periods

• CFD gain: 1/2, 1/4, 1/8 or 1/16

• CFD shift for the validation window :between 1 and 8 sampling periods

Figure 2.15: Digital CFD

It is important to realize that the CFD will be influenced by the differen-tiation and integration constants mentioned in the previous sections. Thisis due to the fact that the input signal to the CFD block will come fromthe output of the differentiation, integration stage. A visual detail on theoperation of the CFD is shown in figure 2.15. Figure 2.16.

2.3.3 Extern trigger

As stated before, TNT has the capability to incorporate triggers from outermodules for improved accuracy. See section 2.10.6 TNT and Fast Signalson page 91 for an example of utilisation of this capability.

TNT Digital Pulse Processor - Functionalities and control software 41

Page 44: TNT Functionalities

Extern trigger

Figure 2.16: CFD triggering: differenciation,CFD window, CFD signal and trigger

TNT Digital Pulse Processor - Functionalities and control software 42

Page 45: TNT Functionalities

Local and global trigger: local trigger readout

For using extern triggers with TNT, the NIM inputs are used (see 2.5NIM/VETO interface on page 49 on how to use the NIM inputs to interfaceTNT with external signals). The correct set up can inspected using thedata inspection capabilities (refer to 2.4, Data and Operation Inspection fora description of each available signal).

When setting up the type of trigger to be used for each channel, fourpossibilities are offered to the user. Simple, digital, CFD and extern. Thislast option needs to select one of the four NIM inputs. The local trig-ger will be copied from this NIM input. To see what’s there, select 1-Nim in gd positive-(1:4) in the logic inspection menu. Then, do the sameusing a second logic inspection and select Ch1 trigger, which shows the localtrigger: both signals should be the same.

Attention has to be paid at this point. The NIM inputs are supposedto be correctly adjusted (50 ohms, potentiometers). If this is not the case,and the nim signal doesn’t see 50 ohms input impedance there might berebounds and several ’copies’ of the trigger can happen. If this is the case,TNT understands that several successive trigger are present, and if the pileup rejection is set to ’yes’, all of them will be rejected.

2.3.4 Local and global trigger: local trigger readout

Each channel has its own local trigger. The user has the possibility to usefor this any of the previous, simple, digital, CFD or extern. Any channelsin a TNT board can use a different type of local trigger. The user candecide to enable a local trigger or not independently for each channel. Thislocal trigger will be used in the energy or mix modes. This implies that, forexample, if no trigger is present for a given channel, no energy calculationwill take place, and this is valid for each one of the channels.

For a precise inspection of local triggers or even for its use with com-plementary instumentation, four local trigger outputs are provided. Eachone will contain the local trigger of its channel after a gate and delay stage.This is useful to delay (up to 127 sampling periods) the local trigger to com-pensate for any other latency or to increase its size up to to 127 samplingperiods (by default, this will be a 10 ns length, active low nim signal, whichmight not be enought for other instruments).

The global trigger signal will be the logical OR of the four local, indi-vidual triggers plus a ’force trigger’ signal (forces the global trigger to ahigh, active state when selected). This global trigger will be used always inoscilloscope mode.

2.3.5 Remarks about triggering

Good energy resolution implies, among others, good event detection. Lowenergies can influence in the sense that pile-up rejection, and so good energy

TNT Digital Pulse Processor - Functionalities and control software 43

Page 46: TNT Functionalities

Remarks about triggering

measurement, assumes detection of the pile-up, even for low pulse levels.This means that a low threshold level (threshold meaning here the lowestenergy detectable) is a good practice for accurate spectrometry.

To reach low thresholds and then, to be able to observe low energies anattain good resolutions, there are two possibilities:

• a. decrease the threshold value to be compared to the deconvolvedsignal

• b. increase difference and / or integration constants, which increasesthe gain.

The user must bewared that the second option increases trigger deadtime (higher gain implies also a larger occupancy time), which means thatthe trigger is less sensible to pile-up. The system is blind to two consecutiveevents too close to each other, so the results is the inverse that the one theuser can expect.

TNT Digital Pulse Processor - Functionalities and control software 44

Page 47: TNT Functionalities

2.4 Data and Operation Inspection

Six inspections signals can be used as ’spy’ signals and routed to the oscil-loscope. This is useful whether for debugging purposes, whether for visualinspection of the desired behaviour and further set up. It helps to improvethe understanding of the implemented functionalities too. In addition, it ispossible to use TUC as an advanced digital oscilloscope to visualize data.Follows the full list of available signals. Each of them represents a differentinformation to inspect the set up.

• Inspect with TUC by selecting type of data for oscillogramacquisition mode. For each input channel it is possible to selectthese kind of data to readout:

1. input data: select ’0-Card input 1-4’

2. derivative: select ’1-TFA 1-4(Digital&CFD trigg)’. It is the dif-ferenciation signal used by the digital and the CFD triggers(see2.3’Triggering’).

3. CFD : select ’2-CFD trigg 1-4’ to see the final CFD signal used.in conjunction with

4. Trapezoid : select ’3-Jordanov:trapezoid 1-4’ in order to see thetrapezoidal shape that is calculated with every new sampled point.This trapezoid is used for energy calculation in the ’energy’ ac-quisition modes.

• Two analog inspections The most relevant data buses in the VIIFPGA are routed to a dual port 12 bits, 100 MHz parallel DAC. Oneof 16 possible signals can be selected with TUC (only 13 are actuallyused). In addition, the user can enable or disable this functionality toprevent any noise impact on the data from the preamplifier. Finally,the DAC used can be put in ’sleep’ mode to reduce electric consom-mation.

1. 0-3,-Data Ch1-4 : input data

2. 4-7,-Trapezoid ch1-4 : trapezoidal shape continuously calculatedby the card and used for energy calculation

3. 8-11,-CFD ch1-4 : constant fraction discriminator shape used fortimestamp determination

4. 12-Ebuff fill rate: filling rate of the card energy output buffer.In energy acquisition modes, this buffer is continously emptiedto the USB part of the card. When the USB (FX2 chip) ownbuffers are full (2*512 bytes = 1024 = 73 time 14 bytes-events),any new event will be lost as there is no more space. It is thePC task to often ask some data to the FX2 in order to empty

TNT Digital Pulse Processor - Functionalities and control software 45

Page 48: TNT Functionalities

its buffers. By monitoring this signal, it is possible to see if theenergy buffers fullfills or how they fills, at which rate. At highcounting rates, it is easily possible to verify that the acquisitionsystem card+PC doesn’t loose any event (i.e all triggered eventshas been safely readouted to the PC) due to unsufficient bufferspace / too slow PC programming USB data requests.

• Four logical inspections (only 2 for TNT2D cards) For each ofthe logical inspections, one of 64 possible signals can be selected, withthe possibility to enable or disable each output.

1. ’0:Select Data ...’: No signal (default)

– G/D - Monostable ——————————————–

2. 1-Nim in gd positive-1): output of the gate-delay stage, nim 1

3. 2-Nim in gd positive-2 : output of the gate-delay stage, nim 2

4. 3-Nim in gd positive-3 : output of the gate-delay stage, nim 3

5. 4-Nim in gd positive-4 : output of the gate-delay stage, nim 4

6. 5-Nim in positive-1 : original nim input 1 before the gate-delaystage

7. 6-Nim in positive-2 : nim input 2 before the gate-delay stage

8. 7-Nim in positive-3 : nim input 3 before the gate-delay stage

9. 8-Nim in positive-4 : nim input 4 before the gate-delay stage

10. 9-Nim in enabled-1 : nim input 1 before the gate-delay stage withenable

11. 10-Nim in enabled-2 : nim input 2 before the gate-delay stagewith enable

12. 11-Nim in enabled-3 : nim input 3 before the gate-delay stagewith enable

13. 12-Nim in enabled-4 : nim input 4 before the gate-delay stagewith enable

– Triggering ————————————————-

14. 13-Extern trigger : external global trigger used in oscilloscopemode over some NIM input

15. 14-GlobalTrigger : logic OR of all 4 local and extern triggers

16. 15-Ch1 trigger valid : local trigger (channel 1) validated (coinci-dence/veto)

17. 16-Ch2 trigger valid : local trigger (channel 2) validated (coinci-dence/veto)

TNT Digital Pulse Processor - Functionalities and control software 46

Page 49: TNT Functionalities

18. 17-Ch3 trigger valid : local trigger (channel 3) validated (coinci-dence/veto)

19. 18-Ch4 trigger valid : local trigger (channel 4) validated (coinci-dence/veto)

20. 19-Ch1 cfd window : validation window of channel 1 used forCFD triggering. The zero crossing of the CFD signal is searchedwithin this window, so it’s necessary to check with oscilloscopeif the validation window is in time with CFD zero crossing point(use ’Shift’ CFD parameter to adjust)

21. 20-Ch2 cfd window : validation window of channel 2 CFD. Seebelow.

22. 21-Ch3 cfd window : validation window of channel 3 CFD. Seebelow.

23. 22-Ch4 cfd window : validation window of channel 4 CFD. Seebelow.

24. 23-Ch1 trigger : local trigger (channel 1) before any coincidence/vetoapplication

25. 24-Ch2 trigger : local trigger (channel 2) before any coincidence/vetoapplication

26. 25-Ch3 trigger : local trigger (channel 3) before any coincidence/vetoapplication

27. 26-Ch4 trigger : local trigger (channel 4) before any coincidence/vetoapplication

–Oscilloscope mode running————————————

28. 27-Enable rd : reading of memory in oscilloscope mode

29. 28-End reading : end reading of memory in oscilloscope mode

30. 29-Enable wr : writting of memory in oscilloscope mode

31. 30-End writting : end writting of memory in oscilloscope mode

–DDS clock —————————————————

32. 31-Locked 100 : goes high when the 100 Mhz DCM locks

33. 32-Locked 24 : goes high when the 48 Mhz DCM locks

34. 33-Global clear : goes high while registers are updated (TUC ’Up-date’ button)

– Energy mode running——————————————

35. 34-Wr en ch1 : writes an event in energy mode for channel 1

36. 35-Wr en ch2 : writes an event in energy mode for channel 2

TNT Digital Pulse Processor - Functionalities and control software 47

Page 50: TNT Functionalities

37. 36-Wr en ch3 : writes an event in energy mode for channel 338. 37-Wr en ch4 : writes an event in energy mode for channel 439. 38-Wr en ch5 : writes a LSE event with channel 5 in energy mode

(some signal over NIM input 1). See 2.5.1.40. 39-Wr en ch6 : writes a LSE event with channel 6 in energy mode

(some signal over NIM input 2)41. 40-Wr en ch7 : writes a LSE event with channel 7 in energy mode

(some signal over NIM input 3)42. 41-Wr en ch8 : writes a LSE event with channel 8 in energy mode

(some signal over NIM input 4)43. 42-R energie bigbuffer : reads a full event from output buffer, en-

ergy mode44. 43-W energie bigbuffer : writes a full event from output buffer,

energy mode45. 44-Pileup reject marker ch1 : pile up state46. 45-Pileup reject marker ch2 : pile up state47. 46-Pileup reject marker ch3 : pile up state48. 47-Pileup reject marker ch4 : pile up state

– Veto input (TNT2D only) ————————————-49. 48-Veto in gd 1 : veto signal after gate and delay application over

dedicated veto input of channel 1.50. 49-Veto in gd 2 : veto signal after gate and delay application51. 50-Veto in gd 3 : veto signal after gate and delay application52. 51-Veto in gd 4 : veto signal after gate and delay application53. 52-Veto in 1 : original signal received over dedicated veto input

of channel 1 positive converted.54. 53-Veto in 255. 54-Veto in 356. 55-Veto in 457. 56-Bigbuf rdt ovflw58. 57-Bigbuf rdt valid59. 58-Bigbuf rdt undflw60. 59-Bigbuf rdt wr ack61. 60-’0’62. 61-Renin x :used when operating several cards together in oscil-

loscope mode (see 2.2.1.1’Several boards together’).63. 62-’0’64. 63-Dds update clk : comming from the DDS

TNT Digital Pulse Processor - Functionalities and control software 48

Page 51: TNT Functionalities

2.5 NIM / VETO interface

Most part of the advanced features included in TNT benefit of the possibil-ity to interface with the outer world. This way, different acquisition modescan be implemented. This includes elaborated coincidence or rejection dataacquisition patterns, as well as more sophisticated triggering schemes.This interface takes the form of four input and four output connectors placedin the front plane, directly connected to VII pins. This facilitates accessibil-ity and synthesis of custom functionality. More in concrete, the four inputnim signals get into dedicated clock pins of the VII, which improves perfor-mance by using dedicated routing ressources. Remark that any of the fourNIM input interfaces can be modified to accept TTL voltage level signals.For this, the user can adapt the hardware by accessing to a jumper and apotentiometer placed near the connectors. Refer to the hardware documen-tation for more details. In addition, each of the 4 NIM input can be setupwith TUC (see 3.3.3Parameters 3/3 tab):

• 50 Ohms termination can be enabled /disabled

• keep the original NIM signal as it is or invert it (for some veto featurefor example)

• consider only the raising (default) or falling edge of the original NIMinput signal.

• enable or disable the considered NIM input (for energy saving modes)

Actually, these feature are implemented in a TNT card using the NIM/VETO interfaces :

• NIM IN’s: coincidence data acquisition by constructing some externalvalidation windows

• NIM IN’s: LSE (logical synchronization events) event generation. See2.6.1 Logical Synchronization Events-LSE: channels five to eight, andRef-11-3 at 3.3.2)

• NIM IN’s: external triggering. See 2.3.3 Extern trigger) and 2.5.1.1Gate and Delay: retriggerable concept

• Veto IN’s(TNT2-D only, also NIM format): anti-coincidence (veto)data acquisition by constructing some veto rejection windows.

• NIM OUT’s: synchronization top generation and clock output

It is always possible to design some custom additional feature for somespecific experience/needs.

TNT Digital Pulse Processor - Functionalities and control software 49

Page 52: TNT Functionalities

Handling NIM input logic

2.5.1 Handling NIM input logic

The logic in the FPGA fabric transforms, first, an edge sensible event to aone period length, level sensible event synchronous to the system clock. Thisevent will be referred to as 5:8-Nim in positive-1:4 in the logical inspectionsignal list, and will be used:

• as a local trigger for one of the TNT channels

• as external validation windows generator (coincidence acquisition)

• as LSE generator

This NIM event can provide some valid reference to a physical event(for example, time of occurrence). The algorithm is sensible to the risingor the falling edge of the incoming nim pulse (TUC selectable). In parallel,this logic signal can be enabled or not (9:12-Nim in enabled-1:4 ), whichallows to have a software selectable logic event as well as another one alwayspresent. This multiplies the number of possibilities, for example, as it allowsusing 5-Nim in positive-1 from nim input 1 as the local trigger of channel2. Independently, 9-Nim in enabled-1 can be present or no in the data flowas some LSE event with channel number 8.

2.5.1.1 Gate and Delay: retriggerable concept

Following this, a second stage performs a shift and a delay on the levelsensible event. This operation gives rise to a shifted version of the originalone, including a custom length window, useful for coincidence / rejectiondata acquisition. This can be inspected using the logic inspection linesand selecting 5:8-Nim in positive-1:4 and 1:4-Nim in gd positive-1:4. Firstoscilloscope screen shows how this works in the case of two successive events:

TNT Digital Pulse Processor - Functionalities and control software 50

Page 53: TNT Functionalities

Handling NIM input logic

Second oscilloscope screen points out an important fact. Here, the resultingtrain of windows is the logical or (addition) of the individual ones, evenin the case of a second event coming immediately after the first one (thirdoscilloscope screen). This is important at high counting rates and used allalong the implemented functionality in TNT. This way, up to four windowscan be declared, and used to declare concrete acquisition intervals. Anyinput nim can be used with any of the four TNT channels.

TNT Digital Pulse Processor - Functionalities and control software 51

Page 54: TNT Functionalities

Coincidence data acquisition using NIM inputs

2.5.2 Coincidence data acquisition using NIM inputs

Coincidence data acquisition is possible with TNT. Several patterns canbe defined with the help of the input NIM interface to the board and bymonitoring the gate and delay which follows the original NIM signal received.The aim is to construct some ’External validation window’ using NIM inputsignals for coincidence data acquisition.

For explanation on how this works refer to the section 2.5.1.1, Gate

TNT Digital Pulse Processor - Functionalities and control software 52

Page 55: TNT Functionalities

Coincidence data acquisition using NIM inputs

and delay. Once the user has defined a custom window, he can decide tolimit the events to be considered to those comprised inside (coincidence) oroutside this time interval (rejection) by just inverting the window. He caneven prefer to store all useful information on disk for further analysis of allevents. In this case, some extra information in order to differentiate betweencoincidence and rejection events is necessarily added in the channel numberfield of the multi parametric information tuple formed and readouted by thecard.

Three different possibilities are available to the user:

• standard acquisition, no coincidence is selected, all events are con-sidered. Four channel numbers are possible here (1 to 4).

• half coincidence acquisition, only the events inside the window(pink gate) give rise to an energy in the data flow (outside in the caseof NIM inversion). Events occuring outside such external validationwindows are rejected. Four channel numbers are possible here (1 to4).

• full coincidence acquisition, in this case, all events are considered.Those comprised outside the window will be ticked with the sixth lowerweight bit b5 raised in the event channel number less significant bytehigh, thus giving a channel numbering of 1+32 to 4+32. Those beinginside a validation windows will appears as ’normal’ channels (1 to 4).

The same is valid in the case of rejection (reversed window interval)data acquisition. Remark that only in the third mode non standard channelnumbers should be present in the data.

TNT Digital Pulse Processor - Functionalities and control software 53

Page 56: TNT Functionalities

TNT2-D only: VETO input interface for anti-coincidence acquisition

2.5.3 TNT2-D only : VETO input interface for anti-coincidenceacquisition

This interface is only available for type TNT2-D(Dubna) TNT cards.Its behaviour is similar to the four nim inputs. Each of the veto inputs

goes throught a gate and delay mechanism that allows to generate a windows(the sum of the ’Gate’ and ’Delay’ values for an input can’t exceed 127sampling periods). Each of these windows declares a time interval and canact or not on its corresponding analog input. This can be inspected withlogic inspection lines and selecting

• 52− V eto in 1: original positive veto signal

• 48−V eto in gd 1: positive veto windows constructed by applying userdefined gate and delay values. Events occuring within this windowscan be rejected or marked with some special bit raised.

The purpose of the veto inputs is to avoid considering events during giventime intervals. Veto can be seen as the opposite of coincidence data ac-quisition (see 2.5.2, coincidence data acquisition). In this case, the sameprinciples stands: veto data acquisition is possible with TNT, where severalpatterns can be defined with the help of the input veto interface to the boardand by monitoring the gate and delay which follows. Once the user has de-fined a custom window, he can decide to limit the events to be consideredto those comprised outside this time interval. He can even prefer to storeall useful information on disk for further analysis of all events. In this case,some extra information is needed in order to be able to differentiate betweencoincidence and rejection events. In the practice, this means that a markeris needed to differentiate data. Following the several possible set-ups, theseventh lower weight bit b6 in the full event will be positioned high (+64in channel number) in the case of an event detected within a veto window.Tree differents possibilities are available to the user:

• standard acquisition, no veto is selected. Four channels numbersare possible here: 1 to 4.

• half veto acquisition, veto is selected with rejection option. Onlythe events outside the veto window give rise to an energy in the dataflow (outside in the case of NIM inversion). Events occuring withinsuch external veto windows are rejected. Four channel numbers arepossible here: 1 to 4.

• full acquisition, veto feature is selected but with ’mark all’ option.Events inside the veto window will be ticked with the seventh lowerweight bit b6 in the full event positioned high: channel number 1+64to 4+64. ’Normal’ events that occurs out of any veto gate are normallynumbered : channels 1 to 4.

TNT Digital Pulse Processor - Functionalities and control software 54

Page 57: TNT Functionalities

Synchronization top generation and clock output at NIM’s out

Of course, it is possible to activate and use BOTH feature : some exter-nal validation using one of the 4 NIM inputs and some veto window usingthe dedicated veto input signal.

CAUTION :

If the veto input is used but not the NIM input (the veto feature withdedicated veto input is activated but not the external validation one with aNIM input, see TUC: ’Use NIM in’:None and ’Use Veto in’:true) THEN thebit related to the External validation feature with NIM input is ALWAYSraised (sixth bit b5 of the channel number less significant byte) wheneverthe pulse/trigger occurs in /out the veto window.

If both features, NIM input and veto input, are used, the bit relatedto the external validation feature with NIM input is raised whenever itshould be in regards of the trigger position related to the external validationwindows.

2.5.4 Synchronization top generation and clock output atNIM’s out

In what concerns the four output nim, a different principle applies and noarbitrary gate and delay can be applied to the signals to be extracted outof the board.

• Nim output 1 provides a periodic signal, whose frequency can be ad-justed by software. This image displays the periodicity of of NIMoutput 1:

TNT Digital Pulse Processor - Functionalities and control software 55

Page 58: TNT Functionalities

• Nim output 2 outputs a signal which oscillates whith respect to thefirst at a fixed frequency. This is more clearly shown here:

• Nim output 3 and 4 reflects the system clock with the help of a digitaloscilloscope:

See 3.3.3 Synchronization tops generation, Ref-12-3.

2.6 Special channel numbers

TNT is a four channels digitizer.But in energy acquisitions, it does not mean that only four channels can bepresent in the event flow : some other informations are also encoded in the2-bytes size ’Channel number’ field used. As the original channel numbering(1 to 4) use only few bits (3), a lot of un-used bits has been used for otherspecific features :

TNT Digital Pulse Processor - Functionalities and control software 56

Page 59: TNT Functionalities

• Logical synchronization events - LSE

• Accurate timing down to 1/4 sampling period unit

• Dummy events for very low counting rates: channel 0

• Coincidence data acquisition: external validation with NIM input

• Coincidence data acquisition: veto feature with dedicated VETO input

• Pile up marquing

• ADC Out of range marquing

Map of the channel number LSB:

Following table summarize all features encoded in the channel numberinformation field:

TNT Digital Pulse Processor - Functionalities and control software 57

Page 60: TNT Functionalities

Thus, when decoding in a decimal way the LSB (less significant byte) of thechannels number field, these numbering can be encountered:

• 0, [1 to 4], [5 to 8], [17 to 20], [33 to 36], [49 to 52], [65 to 68], [81 to84], [97 to 100], [113 to 116]

• [129to132] ([-127 to -124]) , [145 to 148] ([-111 to -108]), [161 to 164]([-95 to -92]), [177 to 180]([-79 to -76]), [193 to 196]([-63 to -60]), [209-212]([-47 to -44]), [225-228]([-31 to -28]), [241-244]([-15 to -12])

TNT Digital Pulse Processor - Functionalities and control software 58

Page 61: TNT Functionalities

Logical Synchronization Events-LSE: channels five to eight

2.6.1 Logical Synchronization Events-LSE: channels five toeight

In energy acquisition modes, for synchronization purposes, extern event tag-ging, etc..., the user has the ability to inject some kind of particular eventsin the main event flow generated by the card : by using the NIM input 1to 4, each time some logic signal is detected on these inputs, the card addsome LSE with channel number 5 to 8.Refer to section 2.5.1, Handling NIM input logic, for an explanation on howthis works. Each time a falling/rising edge (TUC selectable) is detected anew event will appear in the event flow. This default behaviour can be cus-tomized with TUC (see 3.3.2): the LSE will always be present in the flowof events or only when a physical event happens (physical events are eventsproduced in channels 1 to 4) over a particular channel. In this last case,each successive LSE over same NIM input will overwrite the precedent untilone ’normal’ event occurs : card will output only the very last LSE receivedon this NIM input. The information contained in a LSE full event is thefollowing:

• channel number 5, 6, 7 or 8 (NIM input 1 => channel 5, NIM input2 => channel 6,...)

• 48 bits time stamp value containing the time of occurrence over theconsidered NIM input when

• a 32 bits event counter value, which increments each time an event isdetected on this NIM input

• The energy value is arbitrary fixed over the 12 lowest bits (0xFFF)and the upper four bits contains the fine time of occurence:

– 0x0FFF

– 0x1FFF

– 0x2FFF

– 0x3FFF

Multiply the upper 4 bit value with 1/4 of sampling period and sub-stract it from the original timestamp value to get the fine time ofoccurence.

2.6.2 Low counting rate: channel zero

TNT is able to deal with the case where only a few events by second,minute,hours,etc.. are detected. But as USB data is not continuously received by thePC, the general USB communication transaction sheme implies some general’Request / Answer ’ transaction : the PC always ask for some amount of

TNT Digital Pulse Processor - Functionalities and control software 59

Page 62: TNT Functionalities

Pile-up data acquisition

raw USB data from the card. As single events are 14 bytes long each, itcan be some long waiting time before the PC get the data chunk askedwhich is between 3584 (256 events) and 64512 (4608 events) bytes! In orderto avoid particular long waiting time, the idea is to generate some artificial’dummy’ data labelled as channel zero. For visualization purposes, this datais suppressed at the PC side, so this can be considered as a ’transparent’feature to the user. Saving events to binary format files will not discardthese dummy events. Refer to 2.2.2 energy readout optimization for correctset up of the energy mode at low counting rates.

To understand this, it is important to realize that data transfer to thePC takes place in bulk, non continuous mode. This means that a minimumamount of data must be presented to the USB request made before the pcexecutes any task on it (storage in disk, update of histogram, etc.). Due tothis fact, low counting rates demand great amount of time before something’happens’. This can be avoided by first, reducing the size of the packet totransfer to the pc, and then by reproducing the behaviour of an artificial(null) channel, whose counting rate can be monitored and fixed. The userhas access to the packet size, as well as to the refreshment frequency (inseconds) with TUC (see 3.3.2).

2.6.3 Pile-up data acquisition

In some circumstances, the user might need to recover all possible infor-mation for each detected occurence. This can happen independently of thecorrectness in the energy measure that can be achieved by the deconvolutionmethod. For example, the user can be interested on the time of occurence ofevents, without any regard to the measured energy. This means that evenat high counting rates, events too close in time (pile-up events) can be of amain importance, regardless of their amplitude. Default card operation is toreject events that has been seen as ’Pile up’ with a first one, but it is possibleto change this behaviour (3.3.2), to keep all events detected as pile-ups. Inthis case, as in the case of coincidence data acquisition, a marker is neededto distinguish this ’pile up’ data from ’normal’ data.In this case, the fifth bit b4 of the less significant byte of the channel number(2 bytes) will be raised (+16 to the original channel number value). Thiswill allow to handle events differently depending on their inaccuracy in whatconcerns energy measure.

Pile-up situation = if a second trigger is detected shortly after a first oneand before the end of flat top of the trapezoid related to first trigger hasbeen reached. Refer to 2.2.2 for further information on pile-up concept andrejection.

TNT Digital Pulse Processor - Functionalities and control software 60

Page 63: TNT Functionalities

External validation window using NIM input for coincidence dataacquisition

2.6.4 External validation window using NIM input for coin-cidence data acquisition

Coincidence data acquisition is possible with TNT using some NIM inputsignal : the user can adjust some gate and delay in order to construct someproper external validation window. Once the user has defined a customwindow, he can decide to limit the events to be considered to those comprisedinside (coincidence) or outside this time interval (rejection) by just invertingthe window. Using this user defined window, it is possible to take

• only events that occur within such external validation window anddiscard others

• all events but use some special bit marking in the channel number lesssignificant byte in order to be able to retrieve offline the events thatoccurs out of a external validation window.

For explanation on how this works refer to the section 2.5.1.1, Gate anddelay and see 3.3.2 ”External validation with NIM input Ref-11-4” in orderto see how TUC handle this.In the practice, this means that a marker is needed to differentiate data.Following the several possible set-ups, the sixth lower weight bit (b5) inthe full event will be positioned high (+32 in channel number) in the caseof a event detected out of an external validation window constructed usinga NIM input. Of course, it is possible to activate and use BOTH feature: some external validation using one of the 4 NIM inputs and some vetowindow using the dedicated veto input signal.

CAUTION : if the veto input is used but not the NIM input (theveto feature with dedicated veto input is activated but not the externalvalidation one with a NIM input, see TUC: ’Use NIM in’:None and ’UseVeto in’:true) THENthe bit related to the External validation feature with NIM input is ALWAYSraised (sixth bit b5 of the channel number less significant byte) wheneverthe pulse/trigger occurs in /out the veto window

If both features / NIM input and veto input are used, the bit relatedto the external validation feature with NIM input is raised whenever itshould be in regards of the trigger position related to the external validationwindows:

TNT Digital Pulse Processor - Functionalities and control software 61

Page 64: TNT Functionalities

TNT2-D only: veto data acquisition using VETO input

2.6.5 TNT2-D only : veto data acquisition using VETO in-put

The TNT2-D Dubna cards has some special dedicated veto input that canbe used also to construct some veto window. The purpose of veto featureis to reject events that occurs within a veto window (it can be seen asthe opposite of coincidence data acquisition with some external validationwindow). Once the user has defined a custom window, he can decide to limitthe events to be considered to those comprised outside this time interval orhe can even prefer to store all useful information on disk for further analysisof all events. In this case, some extra information is needed to differentiatebetween events occuring within a veto window and those ’normal’ eventsthat occurs outside such windows : the seventh lower weight bit (b6 bit) inthe full event will be positioned high (+64 in channel number) in the caseof an event detected in a veto window.

For explanation on how this works refer to the section 2.5.3, Veto inputinterface and see 3.3.2 ”External validation with NIM input Ref-11-4” inorder to see how TUC handle this.

2.6.6 ADC out of range event tagging

Each card’s input channel has an associated ADC device which has somenormal voltage range from -1.1V up to +1.1V. Some preliminary basic cardsetup should be the gain and offset tuning : aim is to be sure that main’normal’ pulses ranges fits within the ADC operating voltage range. Butin case of pileups or unusual perturbations (ex:cosmic rays), it can happen

TNT Digital Pulse Processor - Functionalities and control software 62

Page 65: TNT Functionalities

Full data readout acquisition

that the top (bottom if negative pulse) of a pulse goes over the 1.1 V limits.The card can monitor this state and propose

• to reject these events because it assume that the energy is corruptedbecause of the analog signal amplitude which is out of the ADC range(default behaviour). See below

The top of the pulse is flat because it goes over 1.1V, the ADC deliversome constant fixed value. The trapezoid is affected but one can con-sider that it is relevant for statistics purposes or for time informationextraction : the card will take this event as the green signal show this.

• to keep these events but with some special bit raised in the channelnumber less significant byte (bit b7).

This late option permits some offline treatment for specific needs (ex: forgetting some timing informations).

2.6.7 Full data readout acquisition

TNT support full event readout. This means that all events can be readoutindependently of

• their pile-up state

• their external NIM validation state (event within or without someexternal validation constructed windows)

TNT Digital Pulse Processor - Functionalities and control software 63

Page 66: TNT Functionalities

Full data readout acquisition

• their external veto condition state (event without or within some vetoconstructed windows)

• their in/out of ADC range state

In practice, each time a local trigger is present in one channel (one to four),an event should appear in the event data flow. In addition, it is importantto realize that all the previous (pile-up, coincidence, veto and ADC out ofrange) can be combined together to give full information.

TNT Digital Pulse Processor - Functionalities and control software 64

Page 67: TNT Functionalities

2.7 Time and synchronization

2.7.1 Time and accurate timing informations

A TNT card handle some precise internal clock that has a tick unit equalto the actual samping period (default is 10 nanos, i.e 100Mhz samplingfrequenz). This clock counter is resetted and started again each time anacquisition starts (defaut behaviour) or after particular minutes number isover (default=65535 minutes=45 days) and can also be re-initialized whensome signal is found at NIM input 4 (see ’Parameters of selected card 1/3’tab 3.3.1).

The current value of this clock is taken and put in the ’timestamp’ fieldof

• oscillogram headers ⇒ when any of the card channel (2 or 4 in regardsof different card types) triggers

• energy events, channel 1 to 4 ⇒ when the given channel triggers

• LSE events, channel 5 to 8 (Logical Synchronization Events, see 2.6.1)⇒when a NIM signal is received over NIM in 1,2,3 or 4

For more accurate timing needs, the card supply also time informationthat goes under the timestamp unit, down to 1/4 of the timestamp unit:

• energy events, channel 1 to 4 ⇒ in the 2 upper bits of the most sig-nificant byte of the ’channel number’ field which spawn over 2 bytes.The value of these 2 upper bits is to multiply with 1/4 of the times-tamp unit and must be removed from the timestamp value to extractaccurate time of occurrence information. These values can be foundfor the MSB byte of the channel number field:

– 0x00⇒ original timestamp value can be taken

– 0x40⇒ ’01’ for 2 upper bits ⇒ substract 1/4 sampling period tothe original timestamp value

– 0x80⇒ ’10’ for 2 upper bits ⇒ substract 2/4 sampling period tothe original timestamp value

– 0xC0⇒ ’11’ for 2 upper bits ⇒ substract 3/4 sampling period tothe original timestamp value

• LSE events, channel 5 to 8 ⇒ in the 2 upper bits of the most significantbyte of the ’Energy’ field which spawn over 2 bytes. The value ofthese 2 upper bits is to multiply with 1/4 of the timestamp unit andmust be removed from the timestamp value to extract accurate timeof occurrence information. These values can be found for the MSBbyte of the ’Energy’ field:

TNT Digital Pulse Processor - Functionalities and control software 65

Page 68: TNT Functionalities

Synchronization

– 0x0F⇒ original timestamp value can be taken

– 0x1F⇒ ’01’ for 2 upper bits ⇒ substract 1/4 sampling period tothe original timestamp value

– 0x2F⇒ ’10’ for 2 upper bits ⇒ substract 2/4 sampling period tothe original timestamp value

– 0x3F⇒ ’11’ for 2 upper bits ⇒ substract 3/4 sampling period tothe original timestamp value

2.7.2 Synchronization

When using TNT, it is possible to modify the main clock parameters to getmore flexibility when interfacing with additional hardware or using severalTNT modules.

Case of one only card A Direct Digital Synthesis (DDS) component isused in TNT for constructing a clean (in the sense of low jitter) clocksignal for driving the four FADC’s. The following clock characteristicscan be adjusted with the help of the DDS:

• input clock frequency

• sampling frequency (default is 100 Mhz)

• phase of clock

For this, an input clock must be fed to the component. It is possibleto select one of these clock sources for this purpose.

• internal FPGA 48 Mhz, this is the clock coming from the FX2and used to implement a synchronous communication; routedthrought the VII FPGA

• external source from a special dedicated NIM input

• internal 20 Mhz quartz

• external source from a special dedicated LVDS input (LVDS inputn1)

The ADC clock used (internal or external) can always be found onLVDS output 1.

Each data bus coming from the FADC should be synchronous to itsown DRY clock signal. This is in general not possible as the full hard-ware design has to run synchronous to a only clock reference (thereis no sense on ’ORing’ four trigger asynchronous signals, for exam-ple). In addition, the shift between the clock to the FADC and it’sresponse in terms of sampled bus and DRY is well known, and can be

TNT Digital Pulse Processor - Functionalities and control software 66

Page 69: TNT Functionalities

Synchronization

considered, with an acceptable degree of certitude, independent of thechannel. This means that the differences between the four chXDRYclock signals can be neglected and so, we accept that the four are thesame (same phase, same jitter quality -that of the input clock to theFADC, etc.). In conclusion, the sampling of the four data buses willbe done at relative different times, but as long as the stability of thedata is accepted, this is not a problem. The AD6645 data sheet canbe consulted for more details.

The signal ch1DRY is chosen to synchronise the full design. The databuses are latched at the input blocks of the VII FPGA. This is, ingeneral, a good design practice, as it improves timing at the expensesof an increase on latency, which is not important in this case.

Case of several cards It is possible to run several TNT boards synchronously,or even to synchronize them to an outern reference (for example, toa complementary hardware using its own clock). The several aspectsthat have to be respected to achieve that are explained here.

The extention of TNT to more than one module allows to run morethat four channels in any of the possible acquisition modes. To runsynchronously, a way to share a common clock is necessary. This canbe done thanks to the LVDS port present at the back face of all TNTcards. This way, one of the modules will run using its own innerclock, as explained previously, and will be called the master card. Theremaining modules will be referred to as the slave, and will receive theclock from the master one in a daisy chain configuration. For this,appropriate cables and connectors are necessary. Figure 2.2 depictsan example of three boards, one master and two slaves. LVDS out ofthe master card is connected to LVDS input of the first slave. Thisscheme is to be reproduced for any number of modules.

It is possible to inspect the actual clock running on each module takingthe output nim 4 of each one to the oscilloscope. Then, it will bepossible to to phase align the clocks using the dephasing capabilitiesof the DDS (see previous section). This allows to sample data at thesame time, so that all the channels run synchronous and phase aligned.

More in detail, the master card uses it’s own clock @ 100 MHz. Itsends out a 50 MHz clock using the LVDS port. The first slave in thechain doesn’t uses its own 100 Mhz clock, but the one it receives inthe LVDS in port (this is why LVDS out, master, goes to LVDS in,slave). Then the slave multiplies this frequency to work at 100 Mhz.This repeats for the rest of the slaves in the chain. Why not just sendthe 100 MHz instead of reducing the frequency?, the answer is in TNTthere is a digital frequency synthesizer which doesn’t accept somethinghigher that 75 MHz.

TNT Digital Pulse Processor - Functionalities and control software 67

Page 70: TNT Functionalities

Synchronization

A second possibility would be using the connector present in the frontface on each module. Here a LVTTL formated clock running between15 and 75 MHz can be injected to the master card, which allows to syn-chronize TNT to an extern frequency reference. Then, all the previousdiscussion applies again.

There are several other issues to be respected when synchronizing sev-eral modules. First, the clock master card must also be declared as’Acquisition start master’. See 2.2.1.1 Several boards together and 3.8Multicard operating. So it must appear the last in the list of TNTmodules detected by the USB bus, as shown in figure 2.17. Followingthis example, card 126 is the master, so the others are the slaves andthis has to be set up in TUC accordingly. Board 126 reads out itsown clock to the slaves (in the back plane, 126 lvds out to 127 lvds in,etc.) Parameters in TUC must be coherent with this (board 126 usesits own clock, 127 and 129 out LVDS clock). Once all three boardsare synchronous, board 126 must be plugged to the usb bus after 127and 129. This makes it appear in the last place in TUC. Master mustbe always the last in order to the clock to propagate correctly to theslaves. Finally, master and slaves must be declared as such in TUC asreciprocally, ’Acquisition start master’ and ’Acquisition start slave’.

Figure 2.17: Card 126 should be the ’Clock’ master and ’Acquisition start’master

TNT Digital Pulse Processor - Functionalities and control software 68

Page 71: TNT Functionalities

2.8 Data formats

2.8.1 Format of oscillograms

Successive data files are structured in this manner:

Figure 2.18: OscilloFormat

The content of an oscillogram has 15 possibles configurations dependingof which channels the user has asked (channels are arranged in ascendingorder)

An oscillogram starts always with the header informations. A headercontains always the four trigger counter even if only one channel has beenasked for readout. The header is 22 bytes long and contains 5 countersvalues:

Figure 2.19: OscilloFormat3

• Number of internal triggering for channel 1 (even if this channel hasnot been chosen for data readout). This counter is encoded using 4bytes which gives a range from 0 to 4 294 967295 (0xFFFF FFFF) on10 digits

• Number of internal triggering for channel 2 (same as for channel 1)

• Number of internal triggering for channel 3 (same as for channel 1)

• Number of internal triggering for channel 4 (same as for channel 1)

TNT Digital Pulse Processor - Functionalities and control software 69

Page 72: TNT Functionalities

Format of oscillograms

• Number of ADC clock ticks since start of acquisition or since lastreset (see parameters above). This counter is encoded using 6 bytes(48 bits) which give a range from 0 to 281 474 976 710655 (0x FFFFFFFF FFFF) on 15 digits. Having a sampling period of 10 nanos, thisgives some maximal duration about 50 days before it will reset.

During an acquisition, the four trigger counters can be easily be com-pared with the number of events which have been really readout duringthe same duration. It is then possible to get informations about how muchevents has been lost because of the dead time needed for reading out theprevious events or because of pileups or ADC out of range. The ADC’ssample data on 14 bits, but a sample point is readouted over 16 bits (oneword) by respecting these ranges of values :

• The bit b0 b13 contains he ADC value (between 0 and 16383) in atwo-complement representation: positive value are from 0x0000 = 0to 0x1FFF = 8191, negative from 0x2000 = 8192 = −8192(in signed14 bits notation) to 0x3FFF = 16383 = −1(signed 14 bits notation)

• When the input signal is not in the normal ADC range [-1.1 V, +1.1V], the card delivers some constant value over 14 bits plus the bit n◦15,b14, that will be set in order to notify this overflow state :

1. If the ADC is in positive overflow, the sampled point has themaximum 14 bit positive value with the 15th bit (bit b14) set to1 : 0x5FFF = 24575

2. If the ADC is in negative overflow, the sampled point has thesmallest 14 bit negative value with the 15th bit (bit b14) set to1 : 0x6000 = 24576

• The bytes ordering type within a word is a Big endian type: MSB,LSB

• The trigger point has his original value with the 16th bit (bit b15)set to one. Decoding whole 16 bits together, in a two’s complementnotation, the trigger point would have a negative value.

• The first and last point of a channel have special mark values :

1. For channel 1 : 0xFFFF=65535 = -1 (in signed notation over 16bits).

2. For channel 2 : 0xFFFE=65534 = -2.

3. For channel 3 : 0xFFFD=65533 = -3.

4. For channel 4 : 0xFFFC=65532 = -4.

TNT Digital Pulse Processor - Functionalities and control software 70

Page 73: TNT Functionalities

ADC histogram mode

Figure 2.20: OscilloFormat4

By resuming, decoding point values in a signed way over 16 bits, givesrange as follows:

• 0 to 16383 : normal values

• 24575 : positive overflow

• 24576 : negative overflow

• -1 : first and last point of channel 1

• -2 : first and last point of channel 2

• -3 : first and last point of channel 3

• -4 : first and last point of channel 4

Any other negative point (only one per channel and per event) shouldbe the trigger point

2.8.2 ADC histogram mode

A normal sampled point is between 0 and 16383, so the card manage ahistogram wich store the number of time each value has been encounteredsince the last readout or since the start of the acquisition. On a regular basis(when the total numbers in the histogram reach some predefined quantity),the card send 16384 counter values, each one coded on a word (2 bytes),thus giving an amount of 32768 bytes.

2.8.3 Format of energy mode

In energy acquisition mode (see 2.2.2 section), each time a energy deposit isdetected (a channel’s trigger fire), a full 14 bytes event is constructed andstored in a temporary memory zone. If the cards buffers (Virtex and FX2)are not full, the event is saved and then readout by next data request fromthe PC. Data construct and readout are independent processes, which allows

TNT Digital Pulse Processor - Functionalities and control software 71

Page 74: TNT Functionalities

Format of energy mode

low data lose. This is possible as long as the Virtex temporary memory canaccomodate up to 16384 events during readout stand by, while FX2 canstore up to 73 events.

As a result, event data is formatted following the the big endian orderwhich is used for arranging byte order. These fields can be found within afull event (see figure 2.21)

• 6 (unsigned) bytes for the timestamp value of trigger occurrence. Thisis the number of clock periods since the counter starts (default: acqui-sition start).

• 4 (unsigned) bytes for the trigger counter value which increments eachtime a trigger occurs

• 2 signed bytes for the energy value [-32768,+32767]

• 2 bytes containing additional informations

– Channel number 0, (1 to 4) in rightmost bits

– Pile-up event bit

– Bit for coincidence/veto using NIM input

– Bit for coincidence/veto using VETO input

– ADC out of range bit

In the case some LSE is present, the previous informations are modified(see section 2.6)

• 6 (unsigned) bytes with time of occurence (sensible to level and preciseto the clock period)

• 4 (unsigned) bytes, containing the value of an up counter which in-creases (+1) when an edge is detected in the corresponding NIM input

• 2 bytes of data containing not the energy value (no sense here), but thechain ”0x0FFF”, ”0x1FFF”, ”0x2FFF” or ”0x3FFF”. Useful informa-tion about accurate time is contained in the 2 upper bits bits. To beprecise, 2, 5 ns times the decimal value of these 2 upper bits must beremoved from the time stamp to extract accurate time of occurrenceinformation

• 2 bytes containing channel number information, as before

– LSE with channel number 5 to 8

– No pile-up, coincidence, veto nor ADC out of range informationwill be found here

TNT Digital Pulse Processor - Functionalities and control software 72

Page 75: TNT Functionalities

Format of energy mode

All the previous can be observed in figure 2.21. Channel numbers cycli-cally follow the sequence 5,4,3,2,1, whereas event counters increase simul-taneously (this file was generated using a synchronous pulse generator onthe four inputs). Having a look to the time stamp bytes, we appreciate afixed delay between channel 5 and all remaining channels. Energy valuescorresponds to the previous explanation.

Figure 2.21: Typical binary acquisition file. Each line represents a full 14bytes event

TNT Digital Pulse Processor - Functionalities and control software 73

Page 76: TNT Functionalities

2.9 Parameter sets

2.9.1 DT5 parameter set

TNT Digital Pulse Processor - Functionalities and control software 74

Page 77: TNT Functionalities

DT

5param

eterset

DT5 Register BANKMSB Byte LSB Byte

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 01

Common registers to all channels2 NIM input delay3 NIM input gate4 NIM input delay 25 NIM input gate 26 NIM input delay 37 NIM input gate 38 NIM input delay 49 NIM input gate 410 NIM output delay11 NIM output gate12 NIM output delay 213 NIM output gate 214 NIM output delay 315 NIM output gate 316 NIM output delay 417 NIM output gate 418 # Sample Points Before Trigger (15:0) : [10, 65535]19 # Sample Points After Trigger continuation (LSB 15:0) :20 Copy of acq mode AcqStart

TS Rst# Sample Points After trigger

21 VLCR Very low counting rates : number of bytes toask to the card when readout E data acquisition

Ana Insp Select(2:0) 2 Ana Insp Select(2:0) LSETrigg1En

LogInspEN* 2

LogInspEN*

AnaInspEN* 2

AnaInspEN*

22 Nim In50 4

Nim In50 3

Nim In50 2

Nim In50

Nim InEn 4

Nim InEn 3

Nim InEn 2

Nim InEn

LSENimRd-OutAll4

LSENimRd-OutAll3

LSENimRd-OutAll2

LSENimRd-OutAll

LSENimEn 4

LSENimEn 3

LSENimEn 2

LSENimEn

23 NIMRetrig

Energytypgain

TStampReinitNIM4

Acqmaster

Forcetrigger

AnaInspSleep

LVDSOUTEN

LVDSINEN

LSENIM4IF CH2

LSENIM4IF CH

LSENIM3IF CH2

LSENIM3IF CH

LSENIM2IF CH2

LSENIM2IF CH

LSENIM1IF CH2

LSENIM1IF CH

24 NimFront 4

NimFront 3

NimFront 2

NimFront

NIMInvert4

NIMInvert3

NIMInvert2

NIMInvert

25 TS Reset Minutes(15:0)26 # Mix mode only: oscillogram points to

readout - After triggerSyncTopPeriod VLCR Readout frequency of dummy

events channel 0

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are75

Page 78: TNT Functionalities

DT

5param

eterset

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

27 # Mix mode only: oscillogram points to readout - After trigger continuation [0,65335]28 Trigger Channel 1 WalkThreshold(15:0)29 Trigger Channel 1 TFAThreshold(15:0)30 RESET

AMPLIEN-ABLE

LT OUT GATE LT OUT DELAY

31 LT OUT GATE 2 LT OUT DELAY 232

AD951733 M Divider 0 low cycles ADCs (7:4) N Divider 0 high cycles ADCs (3:0)34 M Divider 2.1 low cycles DDR2 (7:4) N Divider 2.1 high cycles DDR2 (3:0)35 M Divider 3.1 low cycles CLKout&Virtex5

IO (7:4)N Divider 3.1 high cycles CLK-out&Virtex5 IO(3:0)

36

Channel 137 ExtValidation NIM Sel(1:0) O Data Type(1:0) ExtValidation

EnableExtValAll-Mark

Trapez Gain (8:0)

38 Log Insp Select(4:0) Kirk phaser (9:0)39 CH

GAIN5 50

Digital Trig Int Width Digital CFD Trig-ger Gain(1:0)

Trigger type Digital Trig Diff Width(4:0)

40 Trigger Threshold(15:0)41 Digital trigger Kd correction factor42 Pile up

rejectAdcOvflwAccept

Trigger EXTNIM Trapez m(9:0)

43 Digital CFD Trigger Delay(3:0) Trapez k(10:0)44 Trapez Grand M(15:0)45 Digital CFD Trigger Shift Trapez Average Shift(9:0)46 Trigger

enableTriggerslope

Trapez Baseline Size(1:0) Trapez Average Width(9:0)

47 O Selchan

E Selchan

Trapez X factor(13:0)

48 Offset (15:0)

Channel 249 ExtValidation NIM Sel(1:0) O Data Type(1:0) ExtValidation

EnableExtValAll-Mark

Trapez Gain (8:0)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are76

Page 79: TNT Functionalities

DT

5param

eterset

Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

50 Log Insp Select(4:0) Kirk phaser (9:0)51 Digital Trig Int Width Digital CFD Trig-

ger Gain(1:0)Trigger type Digital Trig Diff Width(4:0)

52 Trigger Threshold(15:0)53 Digital trigger Kd correction factor54 Pile up

rejectAdcOvflwAccept

Trigger EXTNIM Trapez m(9:0)

55 Digital CFD Trigger Delay(3:0) Trapez k(10:0)56 Trapez Grand M(15:0)57 Digital CFD Trigger Shift Trapez Average Shift(9:0)58 Trigger

enableTriggerslope

Trapez Baseline Size(1:0) Trapez Average Width(9:0)

59 O Selchan

E Selchan

Trapez X factor(13:0)

60 Offset (15:0)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are77

Page 80: TNT Functionalities

GLIB parameter set

2.9.2 GLIB parameter set

TNT Digital Pulse Processor - Functionalities and control software 78

Page 81: TNT Functionalities

GLIB

para

meter

setGLIB Register BANK

MSB Byte LSB ByteBit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

PLL AD95101 CP CURRENT FOR VCO FMC

POWERDOWN

CLKADCEN 7

CLKADCEN 5

CLKADCEN 3

CLKADCEN(gh)

CLK ADC FREQ FMCCLKCHAIN

CLK MODE

2 CONFIGSTART

DCMPHASE

CLKADCDE-PHASEALL

SYNCDATA

STATUS CTRLSEL

CLK OUT FREQ CLK IN FREQ

3 CLK TO FPGA DEPHASE CLK OUT DEPHASE CLK TO FPGA FREQ4 CLK ADC DEPHASE(ab)5 CLK TO FPGA DELAY CLK ADC DEPHASE 36 CLK OUT DELAY CLK ADC DEPHASE 57 CLK OUT FINE DELAY CLK ADC DEPHASE 78 CLK TO FPGA FINE DELAY

ADC ADS62P49 x 49 VCM

ADC 7VCMADC 5

VCMADC 3

VCMADC(gh)

ADCEN 8

ADCEN 7

ADCEN 6

ADCEN 5

ADCEN 4

ADCEN 3

ADCEN 2

ADCEN(h)

10 CLKFROMADCDE-LAYALL

CLK FROM ADCDELAY 7

CLK FROM ADCDELAY 5

CLK FROM ADCDELAY 3

CLK FROM ADCDELAY(gh)

11 ADC GAIN CH 4 ADC GAIN CH 3 ADC GAIN CH 2 ADC GAIN CH(d)12 ADC GAIN CH 8 ADC GAIN CH 7 ADC GAIN CH 6 ADC GAIN CH 513 ADC DATA CH 4 ADC DATA CH 3 ADC DATA CH 2 ADC DATA CH(d)14 ADC DATA CH 8 ADC DATA CH 7 ADC DATA CH 6 ADC DATA CH 5

OSCILLO ACQ15 Samples After Trigger(15:0)16 O Channel Sel SRAM2 O Channel Sel SRAM1 Oscillo

EndRead-out

OscilloStart

ForceTrigger

Samples After Trigger(31:16)

17 Samples Before Trigger(15:0)

ENERGY ACQ18 VLCR Readout frequency of dummy

events channel 0:[0,11]TrapezGainType

TrapezResetAmpliEn

E ForceRead-out

E Acq Mode E Acq Mem Sel

19 E PACKET NUMBER(15:0)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are79

Page 82: TNT Functionalities

GLIB

para

meter

setBit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

20 E PACKET NUMBER(31:16)21

TRIGGER IN - ELS or G&D22 ELS

TriggerIn IFCH 8

ELSTriggerIn IFCH 7

ELSTriggerIn IFCH 6

ELSTriggerIn IFCH 5

ELSTriggerIn IFCH 4

ELSTriggerIn IFCH 3

ELSTriggerIn IFCH 2

ELSTriggerIn IFCH(h)

ELSTriggerIn Rd-OutAll

ELSTriggerIn En

GDRetrig-ger-ability

GDTrig-ger InEdge

FLAG STATUS / READ ONLY23 E Mem1 Write Addr(15:0)24 E Acq

Mem2Full

E AcqMem1Full

O Os-cilloReady

PLLSTA-TUS

E Mem1 Write Addr(31:16)

25 E Mem2 Write Addr(15:0)26 E Mem2 Write Addr(31:16)27 O Trigger Counter Channel Sel SRAM1(15:0)28 O Trigger Counter Channel Sel SRAM1(31:16)29 O Trigger Counter Channel Sel SRAM2(15:0)30 O Trigger Counter Channel Sel SRAM2(31:16)31 O Mem Reading Addr(15:0)32 O Mem Reading Addr(31:16)33 O Timestamp Counter(15:0)34 O Timestamp Counter(31:16)35 O Timestamp Counter(47:32)36 ASCII CHAIN(LEFT)37 ASCII CHAIN 238 ASCII CHAIN 339 ASCII CHAIN 440 ASCII CHAIN 541 ASCII CHAIN 642 ASCII CHAIN 743 ASCII CHAIN 844 ASCII CHAIN 945 ASCII CHAIN 1046 ASCII CHAIN 1147 ASCII CHAIN 1248 ASCII CHAIN 13

CHANNEL 149 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are80

Page 83: TNT Functionalities

GLIB

para

meter

setBit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

50 Kirk Phaser(a)51 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

52 Trigger Integ Constant(a) Trigger Diff Constant(a)53 Trigger Correct Factor(a)54 Trigger Threshold(a)[-32768,32767]55 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

56 Trapez k(a)57 Trapez m(a)58 Trapez Decay M(a)59 Trapez Average Shift(a)60 Trapez Average Width(a)61 Trapez X factor(a)62 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 263 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

64 Kirk Phaser(a)65 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

66 Trigger Integ Constant(a) Trigger Diff Constant(a)67 Trigger Correct Factor(a)68 Trigger Threshold(a)[-32768,32767]69 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

70 Trapez k(a)71 Trapez m(a)72 Trapez Decay M(a)73 Trapez Average Shift(a)74 Trapez Average Width(a)75 Trapez X factor(a)76 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 377 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are81

Page 84: TNT Functionalities

GLIB

para

meter

setBit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

78 Kirk Phaser(a)79 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

80 Trigger Integ Constant(a) Trigger Diff Constant(a)81 Trigger Correct Factor(a)82 Trigger Threshold(a)[-32768,32767]83 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

84 Trapez k(a)85 Trapez m(a)86 Trapez Decay M(a)87 Trapez Average Shift(a)88 Trapez Average Width(a)89 Trapez X factor(a)90 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 491 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

92 Kirk Phaser(a)93 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

94 Trigger Integ Constant(a) Trigger Diff Constant(a)95 Trigger Correct Factor(a)96 Trigger Threshold(a)[-32768,32767]97 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

98 Trapez k(a)99 Trapez m(a)100 Trapez Decay M(a)101 Trapez Average Shift(a)102 Trapez Average Width(a)103 Trapez X factor(a)104 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 5105 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are82

Page 85: TNT Functionalities

GLIB

para

meter

setBit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

106 Kirk Phaser(a)107 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

108 Trigger Integ Constant(a) Trigger Diff Constant(a)109 Trigger Correct Factor(a)110 Trigger Threshold(a)[-32768,32767]111 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

112 Trapez k(a)113 Trapez m(a)114 Trapez Decay M(a)115 Trapez Average Shift(a)116 Trapez Average Width(a)117 Trapez X factor(a)118 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 6119 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

120 Kirk Phaser(a)121 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

122 Trigger Integ Constant(a) Trigger Diff Constant(a)123 Trigger Correct Factor(a)124 Trigger Threshold(a)[-32768,32767]125 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

126 Trapez k(a)127 Trapez m(a)128 Trapez Decay M(a)129 Trapez Average Shift(a)130 Trapez Average Width(a)131 Trapez X factor(a)132 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 7133 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are83

Page 86: TNT Functionalities

GLIB

para

meter

setBit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

134 Kirk Phaser(a)135 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

136 Trigger Integ Constant(a) Trigger Diff Constant(a)137 Trigger Correct Factor(a)138 Trigger Threshold(a)[-32768,32767]139 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

140 Trapez k(a)141 Trapez m(a)142 Trapez Decay M(a)143 Trapez Average Shift(a)144 Trapez Average Width(a)145 Trapez X factor(a)146 Trapez Baseline Size(a) Trapez Gain(a)

CHANNEL 8147 O Data To Scope(a) E Ext Val Sel(a) E Ext

ValEn(a)

ECoinci-denceMarkEn(a)

EPileupRe-ject(a)

E ADCOVRRe-ject(a)

E AcqEn(a)

148 Kirk Phaser(a)149 Trigger Type(a) Trigger

En-able(a)

TriggerSlope(a)

150 Trigger Integ Constant(a) Trigger Diff Constant(a)151 Trigger Correct Factor(a)152 Trigger Threshold(a)[-32768,32767]153 Trigger CFD Delay(a) Trigger CFD

Gain(a)Trigger CFD Shift(a)

154 Trapez k(a)155 Trapez m(a)156 Trapez Decay M(a)157 Trapez Average Shift(a)158 Trapez Average Width(a)159 Trapez X factor(a)160 Trapez Baseline Size(a) Trapez Gain(a)

TN

TD

igitalP

ulseP

rocessor-

Functionalitiesand

controlsoftw

are84

Page 87: TNT Functionalities

2.10 Miscellaneous

2.10.1 Some reflexions about dead times

The philosophy in TNT2 was to implement all what’s necessary for a fast,accurate and low dead time energy determination on-line. For this, digital,short shaping times are a main issue. This point of view benefits from thecapabilities offered in an FPGA, well suited for the implementation of anarchitecture able to deal with very high counting rates.

The way the TNT2 deals with events is explained here, as well as how thehistograms are constructed. Some key aspects of spectrometry with TNT2are explained in some depth. In energy mode, the acquisition data is placedin the USB endpoint n◦8 configured for Bulk transfers in a IN direction,pipe n◦2.

2.10.1.1 Data treatment dead time

First discussion should turn around an important point, where dead timescomes from. Classically, a trace of samples containing the impulsion to anal-yse is stored in memory. This includes some base line for determining thezero level, as well as the full rising edge. In addition, for a more preciseanalysis, a number of samples of the falling tail must be stored too. As aresult, some micro seconds of data are put in memory. Then, on-line algo-rithms (energy extraction, etc.) are applied on this data. In consequence,there will be a fixed dead time, because the time this data is being analysedno other data can be accepted. This approach can be improved by usingtwo (several!) buffers, a main buffer for the last impulsion and a secondbuffer for a new event arriving while the first one is being analysed. In anycase, a first source of dead time is encountered here. This can be referredas time of treatment dead time. See the interesting reference [Carniol] for adiscussion.

This solution comes from the fact that, classically or even at very high-1 GHz. or above- sampling rates, a sequential treatment of data was notpossible. Nowadays components (VII FPGA, for example) are adapted toon-line implementation of fast DSP algorithms, thanks to their structureof pre-routed logic along with dedicated resources (huge amount of fastmemory, embedded multipliers, powerful clock managers, dedicated routingresources, etc.).

This second approach allows the use of parallelism (which removes theneed for buffers) and pipelining (to optimize speed at the expenses of higherlatency). This is possible thanks to a enhanced architecture, rich on storageelements (flip-flops) and flexible resources (LUT’s, SRL16, etc.). As a result,full on-line calculations can be executed at the FADC’s sampling speed (100Mhz. here), provided there are enough logic resources available. Refer to[Garcia] for a brief introduction to this kind of FPGA.

TNT Digital Pulse Processor - Functionalities and control software 85

Page 88: TNT Functionalities

Some reflexions about dead times

To avoid having any treatment dead time, one possible solution would beto take advantage of the previous to parallel the data treatment flow. Thisway, once the algorithms to implement can be describe in recursive form(actual samples depend on the previous), the deconvolution filter can takethe form of a hardware block characterized by some latency (= pipelining).At each clock event, a sample is processed sequentially, so the maximumspeed will depend on the slowest task to be executed (18 bits multiplication,for example). The more the design is pipelined, the higher the speed and thelatency, and the more logic resources are needed. Globally, this can be seenas a ’serial chain’, where each ’link’ (sequential element) deals with somepart of the full ’task’.

The advantage of this view, is the fact that many of those blocks canbe put to work in parallel. Since they are all characterized by the samelatency, one can think on them as ’black boxes’. Providing a known inputis furnished, the output will take a concrete form: the deconvolved signal,a trigger response, etc., the only issue is latency. There is no limit to thenumber of tasks which can be executed in parallel (in fact, the limit is theresources available and the required speed). For example, a hardware blockcould take the deconvolved signal (and some information on where it starts)as an input to average some of its samples. The output might be the energy,time of occurrence or even the full event. In this case, one should be awareof the deconvolution latency plus the average latency.

In conclusion, provided some basic design concepts are respected, treat-ment dead time can be suppressed by using this technique. A parallel ar-chitecture allows to obtain all event’s information at the same time theinformation is available (modulo some latency), which removes any need fora post event treatment, which was the origin of this kind of dead time. Re-mark how the only requisite for a correct function is a performing trigger.This provides a valid (an only!) reference for knowing where events happensand so where to calculate energy, where to restore base line, etc.

2.10.1.2 Data collection dead time

The second possible source of dead time is the one appearing when sendingdata to the processing unit. Dedicated modules are usually developed todeal with this tasks (event collectors). Those modules are intended for afast event transfer and further treatment. Depending on the amount ofdata to be transferred, and on the nature of the event collector, a collectiondead time might appear. The percentage of data lose is variable.

TNT2 modules use the fast USB2 bus to communicate any information to/ from the card (slow control), as well as to readout any data. In particular,in energy mode the calculated events must be sent to the PC via the USB,which acts as event collector. Once at the PC side, events can be storedfor off-line analysis. An on-line processing on this data could be performed

TNT Digital Pulse Processor - Functionalities and control software 86

Page 89: TNT Functionalities

Some reflexions about dead times

too (as in ’ADC histogram’ acquisition mode where some online histogramcalculation is done).

There are 9 possible channels in TNT2 events. Four ’energy’ channelsplus 4 additional ’reference’ channels (= logical synchronization events) plusthe 0 dummy one (for very low counting rates). The size of the events isthe same, 14 bytes. This means that, depending on the counting rate, maybe some Mega byte by second (MB/s) worth of data must circulate throughan 40 MB/s (observed) bus. Note that if several cards are connected to thesame bus, the pass band is shared among them. Exemple:

• At 10 000 counts by second, 4 channels, no LSE’s: 10 000 x 4 x 14 =560 000 bytes per seconds.

• At 80 000 counts by second, 4 channels, 4 LSE’s at 100 cps: 80 000 x4 x 14 + (100*4*14) = 4 480 000 + 5600 = 4 485 600 =4.2MB/s

This means that, even at high speed, the collection of data to the PCshouldn’t present any (major) loose of data. Laboratory tests were per-formed at 60 and 100 kcps, and no data loose was observed. For this, thesame signal was injected to the four channels, and a dedicated Pentium 4PC, with a native USB2 chipset on the mother board was used and datawas stored in raw format.

At this point, there are several factors which could negatively affect thecollection process. They are mentioned here :

• On line treatment of collected data. This includes storage in asciiformat instead of raw data, calculation of the histogram of energies,or any other type of data processing. Note that several of them can bepresent (the user would need the raw -ascii- data as well as some kindof spying of what’s happening). To workaround this, several trickshave been considered in TUC. As long as the collection software isrunning on a PC, any tasks running in parallel and using CPU timewill degrade acquisition performances: a PC is not dedicated to oneonly task. It is up to the user to avoid having this kind of inconvenientby setting up correctly the acquisition host. See 3.7 Performances inthe TUC part of this documentation.

• USB low level. Transfer of data is not continuous, but a ’packet’ trans-fer mode. A low level buffer must be filled before being transferred,which means that some bus occupancy dead time must be accepted.

This is something TNT2 has to manage. No data transfer request will besystematically accepted by the event collector, due to any of the previousreasons. The way to workaround this is adding some buffering logic whenreading out events. The way TNT2 deals with any dead time coming fromthe event collector side (in the sense of not being possible to transfer any

TNT Digital Pulse Processor - Functionalities and control software 87

Page 90: TNT Functionalities

Some reflexions about dead times

Figure 2.22: Filling Out Buffer

data) is explained here. The architecture shown in the figure optimizesthe available resources in terms of memory (if a particular channel is notpresent, its corresponding memory is not wasted but used by the rest offound channels). Filling rate can be inspected on line (and so to know ifsome data loss happens) by monitoring an analogue inspection spy signal(one of the logical inspection flag activates when some data is lost). Routingthis to an oscilloscope, something similar to this should be observed.

Here, a typical data transfer caption in shown. Arrows indicates outputbuffer filling level. Note how slope is dependent on counting (filling) rate.Output buffer accommodates the periods of time when event collector is toable to store more data. When PC remains blocked for a long time, data islost. Note that thanks to the true double port available in the VII FPGA,events can be readout at the same time new ones arrives: both processesare not exclusive. An oscilloscope caption is also shown.

Figure 2.23: Filling Out Buffer2

2.10.1.3 Conclusion

Previous discussion intends to be a summary on how TNT2 manages cal-culated events. With the aim of reducing the several possible dead timesas much as possible, an architecture beneficing from the capabilities offered

TNT Digital Pulse Processor - Functionalities and control software 88

Page 91: TNT Functionalities

Some reflexions about dead times

by an FPGA has been chosen. Possible sources of data lose have been pre-sented, along with the way to workaround them. Some understanding ofwhat has been presented here is important for the user looking for goodresults in terms of resolution and low dead time at high counting rates.

To end up with this discussion, an obvious fact must be pointed out.Digital peaking time (time between the event is detected and its energy iscalculated) is an important concern here. A minimum separation of k +m samples between consecutive events is necessary in order to distinguishthem. This imposes a limit to the maximum counting rate. For example,with some 10µs of peaking time, no more than 100 kcps would make sense.

Some other strategies would be possible to manage events. For example,if the user is interested just on having an histogram of energies, it could havebeen constructed in hardware within the card, using the memory availableinside the FPGA. This would eliminate any event transfer problem, as longas no event transfer takes place. For inspection, this information could beread out under request or on a given condition basis (once by second, whenthe hardware histogram is full, etc.).

This strategy has the disadvantage of producing a minimum dead timewhich must be accepted, no workaround is possible. Time of readout is timenot useful for acquisition. Again, this can be optimised by increasing theneed for extra (and out to the FPGA) memory, and implementing moreelaborate strategies which would, of course, decrease dead time.

The difference between this point of view and the one on TNT2 is, inthe first case, a fixed amount of dead time is present (as a bulk transfer ofdata will take place from time to time, whereas no transfer happens for along time). In the last case, notice how peaking time is also the maximumtime the board is allowed to read out events. As previously stated, 14 bytesof data * 6 (average number of channels) equals 84 bytes of events to beread out in the case all channels trigger at the same time (worst case). If wesuppose approx. 100 ns to readout 2 bytes (worst case again), this gives some4 10µs necessary to transfer all this data flow (remember that 100 kcps isequivalent to 10 10µs). So in this case, instead of transferring huge amountsof data at precise times, smaller packets are transferred while waiting for anew event to come (which is wasted time, anyway).

TNT Digital Pulse Processor - Functionalities and control software 89

Page 92: TNT Functionalities

Time decay constant really used

2.10.2 Time decay constant really used

In ’energy’ acquisition modes, even if within TUC, the user key directly thedifferent ’Time decay constant’ values, in fact, the card expect and use somedifferent values in order to avoid some arithmetic rounding errors in VHDL:

M ′ = M × (Digital gain)

As M’ is coded over 16 bits, this give a new constraints over keyed Mand Digital gain values :

M in sampling periods× (Digital gain) ≤ 65535

See 3.6.2 Polezero search parameters and 2.2.2 Energy acquisition mode formore informations

2.10.3 Energy with Reset amplifiers

TNT and TUC has been designed in the context of germanium gamma-spectroscopy. In particular, the energy calculation suppose that the pre-amplifier signal had some exponential time decay constant (around 50000nanos)

In the case of using some reset amplifier, the pulse signal generated bythese amplifiers doesn’t have any exponential time decay. M should be keyedin TUC with some infinite value which is not possible until 65535 Samplingperiods = 655 350 nanos when operating at 100Mhz.

Some new VHDL algorythm has been implemented in order to be ableto construct some trapezoidal shape in this particular case

In order to be able to activate this feature, you must use/set digital gain=0 !

2.10.4 TFA triggering : rectify hidden coefficient

In order to improve the return to zero of the TFA signal (used by the digitaland CFD trigger), some Kd ’rectify’ coefficient is used:

Kd = exp(−[Diff.constant keyed+5]×Sampling periodM )

M: Time decay constant of the channel of the considered Ge detector. ThisKd ’rectify’ coefficient is automatically calculated by TUC and sent to thecard among all other parameters from the GUI.

2.10.5 TFA and Rapid signal shaping

If the checkbox ’Rapid signal shaping’ is selected, then the ’Rectify or Kd’hidden parameter calculated by TUC is fixed to 65535, thus minimizing baseline restoration side effect for this kind of signal which is some offset addedon the TFA signal.

TNT Digital Pulse Processor - Functionalities and control software 90

Page 93: TNT Functionalities

TNT and Fast Signals

2.10.6 TNT and Fast Signals

TNT has the possibility to deal with fast signals where only a few samplesare available, considering a nominal sampling frequency of 100MHz. Thisinvolves using analog electronics for determining the occurrence of an event.This information can be injected to TNT using its NIM input interface (see2.5.1 section, ReferencesLogic event generation). This way, calculation oftrigger in TNT is bypassed, and the information coming from any of theNIM inputs is used to detect the presence of some useful information in thesampled data (see 2.3.3 section, ReferencesExtern trigger).

For example, a classic CFD analog module would be used to trigger ona plastic scintillator fast signal. The output of the module is to be enteredinto TNT, along with the scintillator signal itself. This provides a simpleway to deal with fast signals at the expense of additional extern modules.

2.10.7 Card types

TNT Digital Pulse Processor - Functionalities and control software 91

Page 94: TNT Functionalities

Part III

The control software : ’TUC’Tnt USB Control

92

Page 95: TNT Functionalities

Chapter 3

TUC software

3.1 Main screens

The 6 TUC’s main screens are listed below :

Main screen 1/6 : parameters 1/3

93

Page 96: TNT Functionalities

Main screen 2/6 : parameters 2/3

Main screen 3/6 : parameters 3/3

TNT Digital Pulse Processor - Functionalities and control software 94

Page 97: TNT Functionalities

Main screen 4/6 : oscillogram tab

TNT Digital Pulse Processor - Functionalities and control software 95

Page 98: TNT Functionalities

Main screen 5/6 : histogram tab

TNT Digital Pulse Processor - Functionalities and control software 96

Page 99: TNT Functionalities

Main screen 6/6 : option tab

3.2 Acquisitions overview

Adapting for some new user needs or some particular experience configu-ration, it is always possible to develop and to add some new functionalityor acquisition mode to the card, but the defaults versions supports actuallyonly these modes:

• Oscilloscope mode

• ADC histogramer mode

• Energy mode

• Mix mode

• Test counter mode

• Oscilloscope mode : this mode is chosen in order to vizualise and / orto save sampled points to the USB host (for some offline processing,for example). The card simply works as an oscilloscope, sampled datafrom ADC’s is continuously stored in memory. When some triggersignal occurs (internal or external), the card wait until the ’Acquisition

TNT Digital Pulse Processor - Functionalities and control software 97

Page 100: TNT Functionalities

windows’ size specified by the user (Ref-10-3) has been reached andstarted to send the data to the USB host. As long as this readoutphase is not completely finished, any further trigger signal received /detected by the card will not engage some new memory writing phase(these events will not be catched and readouted by the card). By usingsome visualization of the oscillogram data (Ref-18) TUC will plot theoscillogram data received from the card : each channel data, that hasbeen selected for readout by the user (Ref-10-1), will be drawed with adifferent color on the ’Oscillograms’ tab (Ref-2). By using some ’savedata to file’ feature (Ref-18), TUC will write the raw data to some fileon a disk, allowing to view all the oscillogram data received later andoffline.

The main disadvantage of this mode is that the quantity of data toreadout for a trigger signal can be relatively consequent, thus mayinduce some dead time, even with the high USB2 transfer output. Athigh counting rate, some events could not be taken into account bythe card to PC readout process and will be missing in the oscillogramfiles. The quantity of data to readout for a trigger depends of :

– The oscillogram size : Ref-10-3 (Avoid some big size about tensor hundreds of thousands of points if not absolutely necessary).

– The number of selected inputs for data readout (1,2,3 or 4) :Ref-10-1

• ADC histogramer mode (available through a preliminary specific VHDLupload) : an histogram of the sampled data values over one card inputwill be calculated in this mode. On a regular basis the card sends16384 counter values, each one coded on a word (2 bytes), thus givingan amount of 32768 bytes. A new ADC histogram is then started bythe card. On it’s side, the PC will collect and sums these successiveshistograms. Depending of the user’s choise, TUC will then draw thesummed histogram at the ’Histogram’ tab (Ref-3) or /and save thishistogram to disk by using a specific format (WinTMCA, ASCII : Ref-18). It will be then possible to re-visualize this file later by using theRef-3-7 button. The final histogram file will be created when the userpress the ’Stop’ button (Ref-19) (Note that for security reasons, ona regular basis during an acquisition, TUC will also save the currenthistogram into some temporary file that will be overwritten when stop-ping the acquisition : CardXXXX histo VY.spc.tmp for ASCII formatand CardXXXX histo VY.asc.tmp for WinTMCA format).

• Energy mode : each time a trigger occurs over some input selected bythe user (Ref-10-1), the card will readout the associated energy (signed16 bits value), trigger counter, channel number and timestamp val-ues. From this flow, for visualization purposes, TUC will extract the

TNT Digital Pulse Processor - Functionalities and control software 98

Page 101: TNT Functionalities

channel number and the absolute energy value, construct an energyhistogram and will draw it on the ’histogram’ tab (Ref-3). If desired,these histograms (one for each input) will be written to file in ASCIIformat or WinTMCA format (Ref-18). These histogram files can beused by other software tools for further analysis and calibration. His-togram file will be created when stopping the acquisition. Note that forsecurity reasons, on a regular basis during an acquisition, TUC will alsosave the current histogram into some temporary file that will be over-written when stopping the acquisition : CardXXXX histo Y.spc.tmpfor ASCII format and CardXXXX histo VY.asc.tmp for WinTMCAformat) A Snapshot feature (Ref-3-8) enable some copy of the his-tograms during an acquisition. A histogram file can be reviewed laterwith TUC : Ref-3-7. If events backup has been selected (Ref-18), theywill be written to some file in binary format (as the card send thedata) or in some ASCII format (one event per line).

• Mix mode (Oscilloscope and energy) : this one combine both the ’Os-cilloscope’ and the ’Energy’ modes. Energy is calculated only withinthe catched oscillogram data : trigger signals that occurs while anoscillogram is being readouted are ignored by the energy events deter-mination feature.Trapezoid parameters must be coherent with the defined oscillogramsize : there must be enough oscillogram points for the energy calcula-tion process. It should be at least ’k’ + ’shift’ + ’width’ points fromthe trigger point in the oscillogram. This mode is mainly for testspurposes and is not so effective as the ”Energy mode” but havingoscillogram data, it is possible to use it offline for some other energycalculation and then compare results with the associated energy eventsthat has been generated by the card. Only in this acquisition mode,in regards of oscillogram datat, it is possible to specify the number ofpoints to readout starting from the first point of an oscillogram. Thusit is possible to readout only small traces ( rising or falling edge) ofbigger oscillogram size defined in regards of shaping time constraintsfor the energy calculation.

• Test counter mode : the card readout some incremental counter valuethat goes infinitely from -8192 to +8191, starting at 0. This mode isonly for checking the coherence and behaviour of the USB2 transfer.

See 2.2 for more informations about acquisition modes.When launching TUC this screen will appear (each particular screen

zone is labelled with some ’Ref-XX’ in order to be able to simply referenceit when explaining some specific feature):

TNT Digital Pulse Processor - Functionalities and control software 99

Page 102: TNT Functionalities

Main screen 1/6 : parameters 1/3

The software is made of some tabs in the main part of the screen :

• the TNT cards tab allow the visualization of the parameter set of theactual selected card. Parameter values can be changed, modified andupdated to the card (Ref-16 or Ref-17). The whole parameter setcan be saved into a file or loaded from a previously saved file. Asthe user changes the selected card (Ref-6), TUC will ask the currentparameters values of the new selected card in order to update the GUI.As the amount of parameter is important, this screen is divided into3 sub-tabs :

– Parameters of selected card 1/3

– Parameters 2/3

– Parameters 3/3

• the Oscillograms tab is used in two different ways :

– ”On-line” =⇒ when starting some acquisition that includes os-cillogram readout, these will be drawed from time to time byTUC

TNT Digital Pulse Processor - Functionalities and control software 100

Page 103: TNT Functionalities

– ”Off-line” =⇒ it is always possible (except during an acquisition)to view the content of an oscillogram file. The actual selectedoscillogram of the file (Ref-2-14 and Ref-2-16) will be drawed onthis tab.

• The Histograms tab is also used in two different ways :

– ”On-line” =⇒ when starting some acquisition which includes en-ergy events calculation and readout, TUC will extract the energyvalues from the events received, construct some histogram foreach channel and draw them on this tab at the defined refreshrate (Ref-3-4). In the ”ADC histogramer” mode, the sum of thehistograms received is drawed also on this tab.

– ”Off-line” =⇒ it is always possible (except during an acquisition)to view the content of a histogram file previously saved (ASCIIfile, WinTMCA file or plotml-XML file).

• The Options tab gives access to some minor TUC parameters (Color,language, ...), to polezero search parameters, to some advanced fea-tures (VHDL reboot, VHDL upload,..) or to some experimental fea-tures of TUC. The GUI of this tab may slightly change from TUC’sversion to another TUC’s version.

The lower part of the main screen (Ref-18 to 23) is mainly dedicatedto the acquisition process : start and stop of some acquisition, acquisitionoptions (visualization, save data to file, data format, directory..), or su-pervision of some ongoing acquisition (quantity of data received since thestart, transfer rates) At the right bottom (Ref-22 and Ref-23), a button willlaunch the online help (this document) while another button will quit theTUC application.

Basically, the user navigates from one card to another (Ref-6), sees andadjusts the different parameters values that every card has and then startssome acquisition with all cards found over the USB bus by TUC. For eachcard, some raw data is received and stored into files and / or shown at theOscillogram tab or at the Energy tab. The data shown is always related tothe actual selected card, identified by its 4-digits number (Ref-6, Ref-2-15and Ref-3-3). The acquisition process will stop when the user presses thestart/stop button again Ref-19.

3.3 ”TntCards” tab

When launching TUC or when pressing the Detect button (Ref-5), TUC willsearch for TNT cards plugged on the USB bus and will ask for each card toreturn its 4 digits identification number : the lisboxes Ref-6, Ref-2-15 andRef-3-3 will be filled with these numbers. The card numbers appear with

TNT Digital Pulse Processor - Functionalities and control software 101

Page 104: TNT Functionalities

the USB plugged order in the list : the first plugged, the second pluggedand so on. Note that in some particular case (multicard acquisition 3.8) thisorder is very important.

Then for the first card found, TUC will ask the card to return the pa-rameter set it has in memory : if all parameter values are zero values, it’sassumed that the card has not yet some parameter values (it has just started,for example) : the red text (Ref-8) Card has no valid parameters appearsat the upper right corner of the screen. Some default values will be shownby TUC in this case.

Screen upper part : card informations

If at least one parameter has non zero value, TUC will try to decodeall the parameter set and display them over the 3 parameters tabs Ref-10,Ref-11 and Ref-12. As different card version exists (TNT1, TNT1N, TNT2,TNT2D, ..), this information is also shown at Ref-9. Some other descriptorsare also asked to the selected card and shown :

• a descriptive stored in the FX2 chip is shown at the first line of Ref-7zone. The USB bus type is also shown at the end of this line : ’USB2’in blue or ’USB1’ in red (a PC can have different USB busses whichcan operate at different speed).

• Some descriptive text from the Spartan FPGA (if applicable for cur-rent card type) is shown at the 2nd line of Ref-7 zone.

• Some descriptive text from the Virtex II FPGA is shown at the 3rdline of zone Ref-7

For all other cards found, at this moment, only their identification num-ber is asked in order to fill the Ref-6 list. If no TNT card is found over theUSB busses, the Ref-6 will stay empty and buttons firing USB communica-tion will stay disabled (Ref-15, Ref-16, Ref-17, Ref-19). When no acquisitionis running, at every moment, the user can force a new card detection (if somenew card has been plugged or unplugged) by pressing the Ref-5 button.

The aim of this screen is to present all parameters values of a selectedcard in order to adjust them if necessary. Due to the important numberof possible parameters, a whole parameter set of a card cannot fit into onesingle screen : three different sub-tabs of the TNT cards tabs will collectthese values. By changing the selected card (Ref-6, Ref-2-17, Ref-3-3), TUCwill update all parameters values and descriptive text shown on the GUIwith information supported by the new selected card.

TNT Digital Pulse Processor - Functionalities and control software 102

Page 105: TNT Functionalities

The TNT cards tab contains in its middle part 3 sub-tabs which presentthe whole parameter set related to the actual selected card (see 3.3.1 , 3.3.2,3.3.3)

But what ever which tab or sub-tab has been selected, some acquisitionelements will always be presented to the user at the bottom of the screen :

Figure 3.1: Main screen bottom part

• Management of acquisition data (Ref-18): before starting anacquisition, the user indicates here how the acquisition data will behandled by TUC. Possible choices are ’Visualize’, ’Save to file’, bothor none. If visualization is wanted, depending of the acquisition modethat has been chosen, TUC will try to interpret and plot the readouteddata :

– As oscillograms on the ” Oscillograms ” tab if ”Oscilloscope”,”Oscillo+energy histogramer” or ”Test counter” has been se-lected

– As histograms on the ” Histogram ” tab if ”ADC histogramer”,”Oscillo+energy histogramer” or ”Energy histogramer” has beenselected

If some ” Save to file ” feature has been selected, it can be necessaryto indicate the kind of data to save and the format to use :

– Oscillograms: this kind of data will be stored on disk in a rawbinary format, as they will be received from TNT cards. Oscillo-gram files have ’osc’ extension and can be easily later compressedfurther (about 50 percent ratio). TUC manages this file genera-tion model :

{Directory given in Ref-21}\CardXXXX YYYY.osc

With XXXX = 4 digits card number and YYYY= 4 digits fileorder number

– Histograms: if this kind of data has been selected, 2 specificcheckboxes appear in order to collect the user’s choice

∗ ASCII format : histogram data is written with ISO-646 ASCIIcharacter encoding and with a single bin value on a line· First bin

TNT Digital Pulse Processor - Functionalities and control software 103

Page 106: TNT Functionalities

· Second bin· .....· Last bin

A file will contain 16384 lines (ADC histograms) or 32769(energy histograms) lines. ASCII histogram names will havethis kind of names

{Directory given in Ref-21}\CardXXXX histo VY.ascWith XXXX = 4 digits card number and Y= card channelnumber

∗ WinTMCA format : the WinTMCA software is a compan-ion software of some other acquisition card that has beenalso used by our teams some time ago. This software canalso be used for viewing some spectras offline and for cal-ibrating them in order to obtain resolution and statisticalinformations about the histogram. A WinTMCA histogramuses also the ASCII character set but presents some morecomplex information organisation structure. WinTMCA his-togram names will have this kind of names

{Directory given in Ref-21}\CardXXXX histo VY.spcWith XXXX = 4 digit card number and Y= card channelnumber

– Events: in acquisition modes that include energy calculation(”Energy histogramer” and ”Oscillo+energy histogramer” the cardwill readout some information tuple for each trigger on each se-lected channel : (TimeStamp=sampling period clock ticks, trig-ger number, energy value, channel number) The time stamp andthe trigger counters values are initialized each time a new acqui-sition is started (the time stamp value is also reinitalized whenthe ”Re-init” minutes values, Ref-10-4, is reached). The triggercounter is related to each card channel. The data flow catchedby TUC from a card contains events related to each channel thathas been selected for readout(Ref-10-1):

∗ In the ”Binary” event format, TUC will save the events dataas it has been received from a card. Such data is not directlyviewable by some basic editor but minimize the time TUCneeds to write data to disk and the disk space used. Binaryevent files will have this kind of names

{Directory given in Ref-21}\CardXXXX YYYY.evtWith XXXX = 4 digit card number and YYYY= 4 digits filenumber.

∗ In the ”ASCII” event format, TUC will decode any field inevery event tuple and write it down to disk by using the

TNT Digital Pulse Processor - Functionalities and control software 104

Page 107: TNT Functionalities

ASCII character set. Each event is written on a separateline and some special character is used (by default a SPACEcharacter) as field separator. When reaching a specified fieldsize, TUC will start a new event file. The field separatorcharacter used and the average event (or oscillogram) file sizeevent can be changed in the ”tuc.properties” configurationfile. See 3.9 for detailed informations about these features.ASCII event files will have this kind of names:{Directory given in Ref-21}\CardXXXX YYYY events.txtWith XXXX = 4 digit card number and YYYY= 4 digits filenumber..

Each time an acquisition is started with some ”Save to file” feature,TUC creates automatically for each card 2 files that contain all pa-rameter values used for this acquisition :

– one file with parameter values in some human readable ASCIIform, {Directory given in Ref-21}\CardXXXX log.txt

– one file with parameter values in some format that can be laterloaded again in a TNT card of the same model (TNT1, TNT2,TNT2D,...), {Directory given in Ref-21}\CardXXXX.TNTParam

Having several cards, TUC will use the directory given in Ref-21 inorder to manage these files for storing acquisition data (Ref-21 = ”C:\”in this example):

TNT Digital Pulse Processor - Functionalities and control software 105

Page 108: TNT Functionalities

Card # Ref-6 Card Oscillograms Histograms Events Logs1 0002 Card0002 0001.osc ASCII format: ASCII format:

Card0002 0002.osc Card0002 histo V1234.asc Card0002 0001 events.txt Card0002.TNTParamCard0002 0003.osc Card0002 0002 events.txt Card0002 log.txt.... WinTMCA format : ....

Card0002 histo V1234.spc OR (binary format)Card0002 0001.evtCard0002 0002.evt....

2 0001 Card0001 0001.osc ASCII format: ASCII format:Card0001 0002.osc Card0001 histo V1234.asc Card0001 0001 events.txt Card0001.TNTParamCard0001 0003.osc Card0001 0002 events.txt Card0001 log.txt.... WinTMCA format : ....

Card0001 histo V1234.spc OR (binary format)Card0001 0001.evtCard0001 0002.evt....

Table 3.1: Files generated when saving data

TUC has some free disk space detection feature : on a regular basis,the actual free disk space left is asked to the operating system. If thereis not enough space for a full new data file (oscillogram or events file), the acquisition is properly ended by showing this message:

Figure 3.2: Acquisition stopped because of disk space missing

• Acquisition Start/Stop: When each card parameter has been cor-rectly setup for a specific purpose, in order to start an acquisition withall TNT cards that has been plugged into the USB bus of the PC (thuswhose card number appears in Ref-6 listbox), it is necessary to use theRef-19 ’Start all cards’ button. TUC will check the coherence of allparameter values over the different parameter tabs in regards of the

Figure 3.3: Start & Stop acquisition

TNT Digital Pulse Processor - Functionalities and control software 106

Page 109: TNT Functionalities

card type of the actual selected card and if everything is correct then:

– the whole parameter set is send to the actual selected card

– the acquisition start order is send to all cards present in the Ref-6listbox. TUC will proceed cards in the same order as they appearin Ref-6

– start some data collecting processes in order to handle the acqui-sition datas sent by each card to the PC. A different process isused for each card and for each type of data (oscillogram and/orenergy events). Each process will ask his attached card for somepredefined quantity (see 3.9 Configuration files) of raw acquisi-tion data. As some data is received from a card, and dependingof the user’s choices in Ref-18, it will be written to disk and / orprocessed for visualization tasks. The visualization operates onlyfor the actual selected card.

If some backup of acquisition data is wanted (Ref-18), TUC will alsocheck if some file already exists (depending of the type of data expectedin specified format wanted) and ask the user for some confirmation ifnecessary :

As soon, as Ref-19 has been actionned for a new acquisition start,this button changes it’s appearance in order to suggest that any otheraction on this button will try to break the acquisition that has beenjust started. When an acquisition stop has been asked, TUC will try towait until the current oscillogram or event end has been received beforetruly trying to stop. As the trigger counting rate can be relativelyslow (ex: bad trigger setting), some timeout feature is used by TUC: while waiting up to 3 seconds for getting the oscillogram end, somewaiting screen is shown. After, this delay, some rough USB breakis made in order to respond to the initial user stop request. In this

TNT Digital Pulse Processor - Functionalities and control software 107

Page 110: TNT Functionalities

case, the integrity of the last oscillogram/event data could not be fullyguaranteed.

In fact, after an acquisition stop, TNT cards don’t really stop, but asTUC has stopped every readout process, nothing will empty the FX2(USB2 chip on the card) USB buffer : they will fullfill and the cardwill be blocked in a USB readout phase waiting for some lowerage ofthese buffers. Cards will really get out of an acquisition process whena new acquisition is started, if TUC is launched again, or if any ofthe ”Load parameters...”, ”Ask card”, ”Update card” or ”Update allcards” button is used.

• Selected card, on USB bus, Ref-20: this helps for the supervisionof an ongoing acquisition by managing some bytes counter and transferrates informations.

This area is usefull for getting readout information of the actual se-lected card (Ref-20) and of the overall datas received through all cards:

– Selected card informations∗ Ref-20-a: Raw bytes counter counter of oscillogram, test

counter and ADC histogramer data: as soon as some ac-quisition data of these types has been received through theUSB, this counter is updated. From time to time (every 100readout collecting packet whose size is indicated in the TUCconfiguration file), an approximated transfer rate is also cal-culated by TUC. This transfer rate can be expressed in bytesper seconds or in events/oscillograms per seconds (see Ref-4-3 on the option tab)

∗ Ref-20-b: Raw bytes counter of energy events data : assoon as some acquisition data of this type has been receivedthrough the USB, this counter is updated. When a readoutcollecting packet (whose size is indicated in the TUC config-uration file or at Ref-12-2), an approximated transfer rate isalso calculated by TUC. This transfer rate can be expressedin bytes per seconds or in events/oscillograms per seconds(see Ref-4-3 on the option tab).

TNT Digital Pulse Processor - Functionalities and control software 108

Page 111: TNT Functionalities

The actual selected card informations are updated as soon as theRef-6 listbox is actionned in order to change the current card andas soon as new data from the new selected card is received. Whenstarting an acquisition, some kind of a chronometer is started inorder to measure an approximative time lap since the last re-freshment of these 2 counters values. Be aware that these count-ing rates reflect detected events by the card, and succesfullyreadouted/collected by the PC. For example, in an oscilloscopemode, the Ref-2-9 fields on the ”oscillogram” tab will present the’real’ card counting rate by analysing the trigger counter valuesand timestamp values of the oscillogram header. But as oscil-logram often will last over some Kbytes or Mbytes (dependingof the number of channels and the oscillogram size in Ref-10-3),the readout precess will never be fast enough to received all os-cillograms. In case of the ’Energy bytes’ counting rate, TUC willconsider all events types together and channels together givenonly some global trigger and readout counting rate. The count-ing detected by the card is shown at Ref-3-2 by using timestampand triggercounter informations received.

– Ref-20-c: Overall readout information : this counter presentsthe sum of all data types being received from all cards. If theactual selected card doesn’t trig for any reason, the two countersmentioned above will be still but if this one changes, it meansthat at least one other card trigs and reads out to the PC theacquisition data. When having several cards, it is easy to changefrom one card to another in order to survey if every card presentmore or less similar trigger policies.

• Backup directory, Ref-21: By clicking the button, a directory se-lection window appears in order to select the desired directory to usefor storing acquisition datas received from all cards. For mnemotech-nics purposes, the full pathname of the directory is displayed at theleft of the button and can be fully seen in the tooltip of this field.

• TUC stops / quit Ref-23: Using this button will stop immediatelyTUC and every acquisition process launched without saving data tofile. If some acquisition is running with storing data, some confirma-tion screen will appear:

TNT Digital Pulse Processor - Functionalities and control software 109

Page 112: TNT Functionalities

Parameters of selected card 1/3 tab

Figure 3.4: First parameters tab

By pressing ’Ok’, TUC will try to close the oscillogram / events filesin a clean way and only then try to quit the application.

• Online help Ref-22: This button will open the TUC online help file.Note that pressing F1 key while being anywhere on some field or GUIitem will have the same effect and open the help at some page wherethe field / GUI item is explained.

3.3.1 Parameters of selected card 1/3 tab

Following card parameters are accessible on this tab:

• Cards inputs parameters - Ref-10-1: these array present some generalparameters related to each of the card inputs. Each input can beadjusted separately from the others.

– Common mode: a given input can be activated in commonmode (the associated connector at the front panel must be usedin this case) or disabled

– Differential mode: an input can be activated in differentialmode (the associated connector at the front panel must be used

TNT Digital Pulse Processor - Functionalities and control software 110

Page 113: TNT Functionalities

Parameters of selected card 1/3 tab

Figure 3.5: Card inputs parameters

in this case) or disabled Note that both modes (common anddifferential) cannot be activated at the same time, TUC shouldprevent the user to select both for the same input. The inputmode can also be hardwired on the card : user’s choices will beignored in this case.

– ADC bus: if an input channel isn’t needed, it’s possible to switchoff the associated ADC bus in order to gain less power consump-tion.

– Analog gain: the electronic analog part on the card has twopossible gain selectable here. The first is suitable for some ’en-ergy’ range of [0-2MeV], the second for a [0-5MeV] range. (Line39 in DT5 parameter set 2.9.1)

– Offset: Input signals that will be sampled by the card should bebetween [-0.3,+0.3]V or [-1.1, +1.1]V if Analog gain is [0-5MeV]range. Outside this range, an ADC will deliver some ’OverFlow’sampled values (0x5FFF for positive overflow and 0x6000 for neg-ative overflow). In order to adjust an input signal into the codingrange, some offset can be added. This offset is encoded over 16bits, thus giving some possible values between [-32768, +32767].This range correspond to some [-1 V,+1V] potential.(Line 48 inDT5 parameter set 2.9.1)

– Kirks’ phaser: the sampled signal can be delayed by [0,1023]sampling periods. This delay is applied before eventual energycalculation processing. (Line 38 in DT5 parameter set 2.9.1)

– Activate E calculation: some particular acquisition modes(Ref-10-3) implies an energy calculation processing on board. Inthis case, this column will be enabled and is suitable for select-ing which input channel energy events will be readouted by thecard. At least one channel should be selected. (Line 47 in DT5parameter set 2.9.1)

– Readout oscillogram: some acquisition modes (Ref-10-3) im-plies some oscillogram readout. In this case, this colomn will beenabled and is suitable for selecting for which input channel oscil-logram data will be readouted by the card. At least one channelshould be selected. By selecting a channel, the associated listbox

TNT Digital Pulse Processor - Functionalities and control software 111

Page 114: TNT Functionalities

Parameters of selected card 1/3 tab

’Output:’ at the left side is enabled (Ref-14). (Line 47 in DT5parameter set 2.9.1)

∗ Output signal: in oscillogram modes, for an input signalthe user often want to have the original sampled data onscreen or saved to file. The TNT card is also able to readoutas oscillogram data for one input some other calculated orprocessed data based on the original sampled data. The list-box may contain up to 8 different signal choices the user canselect for data readout as oscillogram. Actually for example· ’0-Card input X’ : original sampled data· ’1-TFA X(Digital and CFD trigg)’: the TFA signal calcu-

lated by using the ’Diff.’ and ’Integ.’ values in the triggerfeature for this channel n◦X (Ref-10-2). This TFA sig-nal is used for the ’Digital trigger’ (which applies somethreshold and slope condition on the TFA) and by the’CFD trigger’ which used the TFA signal as intermediatesignal for constructing the final CFD signal (that can bealso used for readout as mentionned up)

· ’1-CFD trigg X’: the CFD trigger signal calculated byusing the TFA signal (see below) and the ’Delay’, ’Gain’and ’Shift’ values in the trigger feature for this channelnX (Ref-10-2)

· ’3-Jordanov:trapezoid X’: the ’Jordanov’ trapezoid usedby the energy calculation process and constructed by us-ing the actual energy parameters at Ref-11 for this chan-nel n◦X

· Rest of item in list are non -used(Line 37 in DT5 parameter set 2.9.1) This feature is oftenused for tests or fine parameter tuning. If the actual acqui-sition mode doesn’t imply oscillograms or if the associatedinput isn’t selected, this listbox will be disabled.

• Triggering - Ref-10-2: For each of the card inputs, it is possible to setup some specific triggering feature :

– Input n◦X triggering activation : on / off. (Line 46 in DT5parameter set 2.9.1)

– The type of trigger to activate : simple, digital, CFD or external(to be taken over a particular NIM input).In parallel to the digitaltrigger, a digital Constant Fraction Discriminator (CFD) signalis constructed, equivalent to a classic, analog implementation.This is useful for having a more accurate timing by fixing thetime stamp value. The input to the CFD module is the averaged

TNT Digital Pulse Processor - Functionalities and control software 112

Page 115: TNT Functionalities

Parameters of selected card 1/3 tab

Figure 3.6: Triggering

signal from previous stage. Several parameters must be adjustedfor a correct timing. (Line 39 in DT5 parameter set 2.9.1)

– Some threshold value between [-8192,+8191] (codified over 14bits) used for simple, digital and CFD trigger types. (Line 40 inDT5 parameter set 2.9.1)

– Some differenciation constant value between [1-31]. Used onlyfor digital and CFD triggering. The card constructs some in-termediary signals by calculating current sampled point value -sampled point value [1-31] sampling periods before. (Line 39 inDT5 parameter set 2.9.1)

– Some integration constant : between [1-31] points to sum. Asa difference between two points could theorically span over [-16383,+16383], a sum over 32 points could then span over 32*[-16383,+16383]. But the authorized threshold values still remainsbetween [-8192,+8191], 14 bits encoded (it should be sufficient formost needs).Used only for digital and CFD triggering. The cardconstructs some intermediary signals by summing [1-31] points ofthe ’Differenciation signals’ calculated with the ’Differenciationconstant’. (Line 39 in DT5 parameter set 2.9.1) This signal isalso called ’TFA’ can be monitored at TUC screen by startingsome oscilloscope acquisition and selecting ’2-Digital and CFDtrigg: TFA vX’ as kind of data to readout in the ’Output’ lisboxRef-10-1.

TNT Digital Pulse Processor - Functionalities and control software 113

Page 116: TNT Functionalities

Parameters of selected card 1/3 tab

– The kind of slope wanted for the trigger condition : increasing ordecreasing slope of the pulse. Used for simple, digital and CFD.See 2.3.1. (Line 46 in DT5 parameter set 2.9.1)

– Only for CFD trigger: Delay value between [1, 16 sampling peri-ods]. See 2.3.1. (Line 43 in DT5 parameter set 2.9.1)

– Only for CFD trigger: Gain Delay value to select between {1/2,1/4,1/8,1/16}values. See 2.3.1. (Line 39 in DT5 parameter set 2.9.1)

– Only for CFD trigger: Shift value between [1, 8 sampling periods].See 2.3.1. (Line 45 in DT5 parameter set 2.9.1)

– Only for external trigger: NIM input selection. The card willlisten for some trigger signal coming over this NIM input. Notethat some gate and delay can be specified over each of the NIMinput’s (Ref-12-1). (Line 42 in DT5 parameter set 2.9.1)

The constructed CFD signal can be monitored at the analogical in-spection Ref-10-2 at positions:

– 8-CFD Ch1

– 9-CFD Ch1

– 10-CFD Ch1

– 11-CFD Ch1

and also at TUC screen by starting some oscilloscope acquisition andselecting the second item in the Ref-10-1 listbox (select kind of datato readout) ’1-CFD trigger vX’

Oscilloscope mode and triggersBy specifying 2 or more triggers over different channels, a logical ORwill be applied by the card for oscilloscope acquisition modes. Anoscillogram containing all selected channels (Ref-10-1) will be catchedand readouted, even if only one of the activated channel’s trigger hasfired.For facilitating initial trigger adjustment, it is possible to force trig-gering by select ’Force trigger’. In this case, the card will immediatelystart to take an oscillogramm as soon as the precedent is sent to thePC : some data will always be continuously received from the card,allowing to view the general signal form applied to the card inputs.In addition to the external triggering which can be selected over eachchannel, it is also possible to activate some global external trigger,to be chosen over some NIM input. In this case, the card will alsoconsider a logical ’OR’ between each of the individual channel triggerthat has been activated and the global external trigger: if a triggersignal is detected for one of the selected channel or over the NIM

TNT Digital Pulse Processor - Functionalities and control software 114

Page 117: TNT Functionalities

Parameters of selected card 1/3 tab

input used for the global external trigger, then an oscillogram will betaken. The external global triggering and the force trigger feature areenabled only for ’oscilloscope’ acquisition modes.Energy mode and triggersEach card channel can be managed independently from each other : ifa particular channel fires some triggers (internal or external), then thecard increments the associated trigger counter, constructs the multi-parametric event (Time stamp, trigger counter, Energy, Channel) andgives it to the readout process.For a particular channel, even if it has been activated for ’E calculationand readout’ (Ref-10-1), no datas will ever come out for this card ifno trigger has been activated for this channel.Simple triggerA simple comparison is made between sampled data and a specifiedthreshold value, by respecting some slope condition (increasing / de-creasing). If the threshold value is reached, the card will trigger andcatch the specified number of points (Ref-10-3).

Digital triggerCard calculates some differenciation signal by taking the differencebetween the current actual point nx and the previous point nx-N.(the number of points N is called ’Differenciation constant’). Then, asecond signal is calculated by summing the differenciation signal overM points. This second calculated signal is called ’integration signal’.When the resulting calculated signal crosses a threshold by respectinga specific slope, then the card triggers on this channel.

Some particular card types, TNT2 and TNT2D, has the ability tooutput the trigger signal of a channel to some dedicated NIM output.In this case, some ’Gate’ and ’Delay’ can be applied to the originalsignal before it goes out of the card : [0, 127 sampling periods]. (Line30 in DT5 parameter set 2.9.1)

• Acquisition mode of the tnt cards plugged, Ref-10-3

TNT Digital Pulse Processor - Functionalities and control software 115

Page 118: TNT Functionalities

Parameters of selected card 1/3 tab

This is one of the most important parameter : it will determine theacquisition behaviour of all TNT cards plugged (and whose Id numberappears in the list Ref-6) when the ”Start all” button Ref-19 is ac-tionned. This parameter is common to all cards seen by TUC at thismoment : TUC will dispatch the same acquisition mode everywhere.If a different acquisition is wanted on a specific card, simply disconnectit and plugg it to another PC running another TUC instance and usethe ’Ignore cards’ feature for dispatching cards to the 2 TUC instances(see 3.10). The list propose these 5 possible acquisition modes :

– Oscilloscope mode

– ADC Histogramer mode

– Energy mode

– Oscillo+ energy mode or ’Mix mode’

– Test Counter mode

(Line 20 in DT5 parameter set 2.9.1) See 2.2 ’Acquisition Modes’ aboutacquisition modes. In some acquisition mode (oscilloscope and mixt),it is possible to specify 2 main oscillogram characteristics:

– Oscillogram size : The number of sampled points to catch andreadout for each selected card input (Ref-10-1) as soon as anytrigger fires. This number should be [20-1048575]. (Line 19 inDT5 parameter set 2.9.1)

– Before trigger size : The number of sampled points to considerbefore the trigger point. These ’pre-trigger’ points are includedin the specified oscillogram size and their number must at least10 and maximum 65535 and cannot exceed (oscillogram size -10).(Line 18 in DT5 parameter set 2.9.1)

– In ’Mix mode’ only : the oscillogram readout size (which shouldbe less or equal than the oscillogram size). This allows to definesome oscillogram size in regards with shaping time constraints

TNT Digital Pulse Processor - Functionalities and control software 116

Page 119: TNT Functionalities

Parameters of selected card 1/3 tab

and trapezoid setup (ex: k+m=4000 nanos) but to readout onlythe leading /falling edge of the pulses (ex: 150 nanos), thus havingmuch less oscillogram data to readout. Default value= Oscillo-gram size. (Line 27 in DT5 parameter set 2.9.1)As soon as the focus leave ones of these two fields, TUC calculatesthe corresponding duration based on the actual sampling periodspecified in Ref-10-5 and show the results in nanoseconds at theright side of these 2 input fields.

• ADC clock - DDS - Ref-10-5 : For experiences who need accurateperformances, especially for timing calculations or when several cardsshould operate together in some synchronized way, then the quality ofthe clock used by the ADC’s comes into play.

One of the TNT2 enhancements is the ability to construct some stableclock signal of high quality for the ADC with a DDS component whichuses some given clock source. While with the TNT1 card version (seeimage below)

the only option was to use an internal clock signal or to use someexternal signal over LVDS input 4, the TNT2 allows to tune:

– Clock source selection : To choose between 4 different sources.In order to deliver the final ADC clock signal, the DDS will takesome input clock signal which can have different origin and fre-quencies:

TNT Digital Pulse Processor - Functionalities and control software 117

Page 120: TNT Functionalities

Parameters of selected card 1/3 tab

∗ Internal clock source with FPGA 24Mhz: the DDS will usea 24 Mhz FPGA clock signal. By choosing this option, TUCwill disable the ’Input’ frequency field and put automatically24Mhz inside.

∗ External clock source over LVTTL input. By choosing thisoption, the clock source is supposed to be found at the ’CLKEXT’ front panel connector and TUC will enable the ’Inputfrequency’ field : the user has to key the frequency (between15 and 75Mhz) of the signal he has connected over the frontpanel connector.

∗ Internal clock source with 20Mhz quartz : the DDS will usea 20 Mhz clock source generated by some onboard quartz.By choosing this option, TUC will disable the ’Input fre-quency’ field and put automatically 20Mhz inside. This in-ternal source is quiet better than the other internal one.

∗ External clock source on LVDS Input 1 : the DDS will tryto use a clock signal which is supposed to be found on theLVDS input n1 (rear face of card). By choosing this option,TUC will enable the ’Input frequency’ field and put a default50Mhz value. As each TNT2 card will output a 50 Mhz clocksignal on the LVDS output 1, this signal can be used againby another TNT2 card : both cards will use the same clocksource signal, data will be sampled in a synchronized way. Asthe default sampling frequency of a TNT2 card is 100Mhz,the default frequency of the signal found on LVDS output n1will be 50 Mhz. See 2.7 and 3.8

– ADC frequency: the ADC’s normal sampling period is 100Mhzbut it is possible to sample data at some other frequency up to105Mhz. (Line 33 in DT5 parameter set 2.9.1) The content ofthis field is very important for TUC because it is used for someduration calculations :∗ Oscillogram size and number of points before trigger : Ref-

10-3∗ Durations and delays on NIM input and outputs : Ref-12-1∗ Energy parameters (Ref-11-1) : conversion of ”k”, ”m”, ”shift”,

”width” and ”M” parameters keyed in nanoseconds. TUCcalculate the corresponding number of sampling periods andsend it to the card when the whole parameter set is updated(ex: ”Update card” Ref-16 button).

∗ CFD’s delay and shift values lists : Ref-10-2∗ Local trigger output’s Gate and Delay : Ref-10-2∗ (TNT2-D only) Local trigger output’s Gate and Delay : Ref-

10-4

TNT Digital Pulse Processor - Functionalities and control software 118

Page 121: TNT Functionalities

Parameters of selected card 1/3 tab

Figure 3.7: Additional parameters

∗ Oscillogram plotting feature Ref-2– Clock Dephasing: a value between [0,360] degrees will set some

phase adjustment between the DDS source clock signal and theADC clock generated with the source clock signal. This could beusefull when trying to synchronize several TNT2 cards together.

– DDS register inspection: this feature is only for advanced users.By choosing a specific DDS register address in the ’Register’ list,the register value will be shown in the ’Value’ field when sendingthe whole parameter set to a card and then while asking theparameter again.

The ADC clock signal finally used is always redirected to the dedicatedNIM output and the LVDS 1 output. In case of a TNT1 card, it’sredirected to the LVDS output n4.

• Other parameters Ref-10-4

– Enable/disable LVDS inputs and outputs (default enabled). Theuse of these checkboxes is required if some LVDS I//O is wanted(output of ADC clock over output LVDS1, ADC clock sourcetaken from LVDS input n◦1, synchronisation start signals overLVDS3 I//O). (Line 23 in DT5 parameter set 2.9.1)

– The ”Re-init counters” value specifies the number of minutes thecard will consider before resetting the timestamp counter valueand the trigger counter values (for each channel) used in oscillo-scope & energy modes. (Line 25 in DT5 parameter set 2.9.1)

– Acquisition start synchronisation status : ’Master’/’Slave’. Use-full only in a multicard context when time synchronisation is im-portant and a time correlation between each timestamp counteris required, or if you want that all cards starts together the ac-quisition. (Line 23 in DT5 parameter set 2.9.1)

TNT Digital Pulse Processor - Functionalities and control software 119

Page 122: TNT Functionalities

Parameters of selected card 1/3 tab

∗ During an acquisition start, TUC will send the ”Start acq”in a serial communication process : one card after one in thesame order as they appear in the card listbox. So havingseveral cards, it is highly probable that the first will starteffectively and readout some oscillogram or energy eventsBEFORE all cards even receive the order to start.

∗ As each card handles its timestamp counter separately fromeach other, the goal is to have a precise idea of the time gapbetween the real start of the first one and the last one. Usethis feature ’Master/Slave’ together with same clock sharingin order to be able to measure precisely the time gap betweencards and to re-synchronize offline the datafiles.

∗ With the acquisition start ’Master/Slave’ feature : one card isacquisition master and all others are acquisition start slaves.

∗ When starting an acquisition, slave cards will be ’armed’ butwill they not really start to trig and acquire data. As soonas a signal arrives on LVDS input n◦4, a slave card starts toacquire data and immediately output the signal to the LVDSoutput n◦4, may be for other acquisition start slave cards...

∗ When the master card receive the ”start acq” order, it im-mediately starts the acquisition and output a signal to theLVDS output n◦4. There should be only one master cardand it should be at the last position order in the card list(Ref-6). If this is not the case, deplugg it, replugg it on theUSB bus and ask a new card detection with Ref-5 button”Detect TNT cards on bus”.

See 2.7 and 3.8 for complementary informations.

– Timestamp re-initialization feature : the timestamp counter isnormally resetted when the counter itself goes over the 48 bitsmax value : 281 474 976 710 656 * sampling period (10 nanos)= 2814 749 s = 32,5 days. But for particular needs, it is also possibleto activate or not 2 other timestamp re initialization items :

∗ each time some signal is received over NIM input 4. (Line 23in DT5 parameter set 2.9.1)

∗ each time some acquisition is started. (Line 20 in DT5 pa-rameter set 2.9.1)

At the bottom of the ”TNT cards” tab, some buttons are available inorder to handle the current parameter set of the actual selected card :

TNT Digital Pulse Processor - Functionalities and control software 120

Page 123: TNT Functionalities

Parameters of selected card 1/3 tab

• ”Save parameters...”-Ref-14 button : Every parameter value that ap-pears through the 3 parameter sub-tabs (”Parameters of selected card1/3”, ”Parameters 2/3” and ”Parameters 3/3”) will be saved into afile in a binary form (not directly readable as a text file but as it issent to a TNT card) with a ”TNTparam” suffix file name. By pressingRef-14 button a small file selection windows appears allowing the userto easy navigate through the file system of the PC and to enter somefile name. The generated ’Tntparam’ file can be easily re-loaded laterinto any card of same type (Tnt1, TNT2, TNT2d or TNT2R) by usingthe Ref-13 button ”Load parameters”.

• ”Load parameters...”-Ref-13 button : Some parameter set previouslysaved on disk (see previous paragraph) can be loaded again into theactual selected card and on the GUI. By pressing Ref-13 button a smallfile selection windows appears allowing the user to select a parameterfile. The content of this file will be immediately shown on screen andsent to the actual selected card.

And after selecting ’Ok’ button, if the sending of parameters succeeds:

TNT Digital Pulse Processor - Functionalities and control software 121

Page 124: TNT Functionalities

Parameters of selected card 1/3 tab

TUC will immediately ask the current card to return his parametersin order to control and verify that the returned values are similarto the file content sent. If not, some message will be written in theoutput windows and directly to the user (see below) by mentioning atwhich words differences appears. If no card is actually plugged, thenonly the GUI will be updated consequently. Note that only the actualselected card in Ref-6 is concerned by the ”Load...”, ”Save...”, and”Ask” buttons.

• ”Ask card” Ref-15 button : TUC will ask the actual selected card toreturn his current parameter set. It will be then compared to thoseactually shown on TUC’s screens and the result will be communicatedin this :

or if some difference is detected :

By detecting some difference, the user will have the possibility to up-date the GUI screen with the card parameters.

TNT Digital Pulse Processor - Functionalities and control software 122

Page 125: TNT Functionalities

Parameters of selected card 1/3 tab

This feature can be used for example if the user has some doubt abouthaving pressed the ”Update card” Ref-16 button after having modifiedsome fields on screen. If the actual selected card is empty of any pa-rameter value (it has reboot recently), it will have for every parametersome zero values, thus this button will not be enabled.

• ”Update card”-Ref-16 button : by activating this button TUC willcollect all parameter values over the 3 ”Parameters x/3” sub-tabs, en-code them in some adequate way and send them to the actual selectedcard through the USB. Note that this action is also automatically donefor the actual selected card when user pressed ’Start acquisition’.

• ”Update cards”-Ref-17 button : by activating this button TUC willcollect all parameter values over the 3 ”Parameters x/3” sub-tabs,encode them in some adequate way and send them to all TNT cardsactually plugged on the USB, detected by TUC (whose ID number isin the Ref-6 card listbox) and that is of same card type than the actualone (Tnt1, TNT2, TNT2d or TNT2R). TUC will proceed in the cardorder shown in the Ref-6 listbox : first card, second one and so on.When finished, the list of all updated cards is shown :

The benefit of this feature grows proportionally witth the number ofTNT cards used. As with this feature it is very easy to modify thewhole parameter set of all cards, TUC will needs some confirmationbefore processing.

Basically, there are four different ways the parameter set of a TNTcard can be modified :

TNT Digital Pulse Processor - Functionalities and control software 123

Page 126: TNT Functionalities

Parameters 2/3 tab

– by using ”Update card” Ref-16 button. This button is mainlyused in a multicard context : as each card has to be updated,this button will be used before switching to another card withthe Ref-6 listbox.

– by using ”Update cards” Ref-17 button. This button is mainlyused as some help for positioning parameters values into thecards. If the main part of the parameters is similar from cardto another, it will be easier to check the values for the first card,apply these values to all card by using this button and then toswitch to the other cards for simply just change the single pa-rameters which are specific to each card.

– By using ”Load parameters...” Ref-13 button if some parameterfile has been previously created by using TUC’s Ref-14 feature.

– By starting an acquisition with ”Start All” Ref-19 button : thevery first thing TUC will manage to do is to update systemati-cally the actual selected card with the whole parameter set valuesactually shown on screen. This is the most common way used inorder to update a TNT card if only one card is on the USB bus.

Changing a field value or some GUI elementdoesn’t update really the actual selected card :changes are commited only when using one ofthe four ways to update a card which has beenpresented just above!It is the user’s responsability to ensure an effective commit updateshas been made. During an acquisition, it is not possible to changesome parameter value on a card : every GUI element used to adjusta parameter value is disabled. It’s necessary to stop first the acquisi-tion, to adjust some parameter in the GUI, and to start again (thuscommitting the updates only for the actual selected card.

3.3.2 Parameters 2/3 tab

On this sub-tab, these parameters can be visualized and modified :

• ”On-line energy calculation parameters” Ref-11-1. If the acquisitionmode chosen (Ref-10-3) implies an on-board energy calculation, thenit’s necessary to supply some specific parameter values to the card inorder to let the VHDL algorithms function properly.These algorithms works continuously in parallel of the sampling fea-ture. With every new sampled point, they will calculate some recursiveshaping that constructs some trapezoidal shape for each impulse com-ing.

TNT Digital Pulse Processor - Functionalities and control software 124

Page 127: TNT Functionalities

Parameters 2/3 tab

Figure 3.8: 2nd parameters tab

Each time a trigger occurs over a channel (asuming the triggering hasbeen correctly setup) the card calculates some averaging at the flat topof the trapezoid which is supposed be found at k+m points after thetrigger point. The height of the trapezoid reflects (is proportional) theenergy level associated to the pulse. All these parameters are neededin order to determine the height of the trapezoids and are presentedat this GUI array for each input channel of the card :

– k: trapezoid rise time, expressed in sampling period (default is10 ns with 100Mhz sampling period, see Ref-42) multiples andshould be between [ 1 sp , 2047 sp]. If the keyed number is notprecisely a sampling period multiple, TUC will substitute thisvalue with the most closest multiple.(Line 43 in DT5 parameterset 2.9.1).

– m: trapezoid flat top, expressed in sampling period multiples andshould be between [1 sp , 1023 sp]. If the keyed number is notprecisely a sampling period multiple, TUC will substitute thisvalue with the most closest multiple.(Line 42 in DT5 parameterset 2.9.1).

– Digital gain: integer value between [0,511]. By giving a greatervalue than 1, the flat top height will increase more or less pro-portionaly to this value. It’s another way to increase trapezoidheight, more efficient than increasing the ’m’ parameter. See Jor-danov’s publications 8. (Line 37 in DT5 parameter set 2.9.1).

– Average shift: this nanoseconds expressed duration indicates howmany sampling points must be counted from the flat top begin-ning before to start to take value into an average calculation of

TNT Digital Pulse Processor - Functionalities and control software 125

Page 128: TNT Functionalities

Parameters 2/3 tab

flat top points values for the energy calculation. Possible valuesdepends of ’Average width’ and ’m’ in this way :

Shift + width flat top m - 5 sampling periods.

If the keyed number is not precisely a sampling period multiple,TUC will substitute this value with the most closest multiple.(Line 45 in DT5 parameter set 2.9.1).

– Average width: this nanoseconds expressed duration indicateshow many sampling points on the trapezoid flat top the card willconsider for the energy determination. The average of these pointwill gives the energy value. Possible values depends of ’Averageshift’ and ’m’ in this way :

Shift + width flat top m - 5 sampling periods.

If the keyed number is not precisely a sampling period multiple,TUC will substitute this value with the most closest multiple.(Line 46 in DT5 parameter set 2.9.1).

– X factor: some information relate to the average width but ex-pressed in a more efficient way for the Virtex 2 in order to oper-ate arithmetic division smoother and rapidly. The average widthkeyed before is converted in a number of sampling points, i. A16384 value is divided by ’i’ and the main part found gives thedefault ’X factor’ value. As soon as the average width is modi-fied, TUC will immediatly calculate the corresponding X factorand overwrite the old field content. This parameter can also beused like a second type of a digital gain : by keying a greatervalue than the default calculated value E(16384/i), all energyvalues will be slightly greater, the corresponding histogram willbe right-shifted. The inverse effect will occur by keying a smallerX-factor value. This acts as some ’micro’ gain as digital gain ismuch like a ’macro’ gain. (Line 47 in DT5 parameter set 2.9.1).

– Pileup reject ?: after a trigger, while the card constructs thetrapezoid, if another trigger is detected before the end of the flattop has been reached, then

∗ both events will be considered as pileups if the second triggeris also before energy related to first trigger has been taken

∗ only the second event will be considered as pileup if it occursafter the energy related to first trigger has been taken

This can be monitored by watching these logical inspection lines: ’23-Ch1 trigger’ and ’34-Wr en ch1’.

TNT Digital Pulse Processor - Functionalities and control software 126

Page 129: TNT Functionalities

Parameters 2/3 tab

If pileup rejection is chosen (’Pileup reject?=yes’), events recog-nized as pileup will not be considered by the card, they will notbe send to the PC.(Line 42 in DT5 parameter set 2.9.1).If pileup rejection is disabled (’Pileup reject?=no’), events recog-nized as pileup will be considered by the card as ’normal’ events,they will send to the PC with a special bit marking within theirchannel number less significant byte (see 2.6.3).

– BL correction w/ avge: the card will permanently calculate abaseline average value by taking sampling points outside trape-zoid shapes. By zooming on a trapezoidal shape, one can see thatin fact, the base line isn’t strictly equal to zero and is very smallin regards to the flat top height values. For the final energy value,making the difference between flat top height and baseline valuegives better resolusion results. For this average calculation, thecard can take ” 0, 128, 256 or 512” points on a TNT1 card ”0,64,128, 256,512,1024,2048,4096,8192” points on a TNT2 card

– M: time decay constant of the impulses detected by the card.This is normally a characteristic of a Ge detector preamplifierand should be keyed here precisely as possible around 50 mi-cros. It is expressed in a multiple of the sampling period used innanoseconds between : [0 et 50000]. If the keyed number is notprecisely a sampling period multiple, TUC will substitute thisvalue with the most closest multiple.

See 2.2.2 for more detailled informations about the energy calculationfeature of the TNT cards.

• ”M auto search”

This button located just under the ’M’ column of the energy calcula-tion parameters array can give some help when trying to adjust thetime decay constant. TUC will try to start an acquisition in oscillo-scope mode only for the actual selected card by : 1. Selecting ’Os-cilloscope’ mode in the acquisition mode listbox 2. Selecting all card

TNT Digital Pulse Processor - Functionalities and control software 127

Page 130: TNT Functionalities

Parameters 2/3 tab

inputs rows in the ’Readout oscillogram’ column of the ’Card inputs’parameter array on the ’Parameters of selected card 1/3’ tab. Basedon the Ref-4-6 ’Polezero’ parameters on the ’Options’ tab, TUC willtake 2 sampling points for each oscillogram received for each channeland calculate the resulting time decay constant value. Every 100 oscil-lograms, the M values of each card channel are filled into an histogramwhich is plotted at the ’Histogram’ tab, Ref-3. When the given num-ber of oscillogram has been reached (default=1000), TUC will stop theacquisition and update the ’M’ column values in the energy parametersarray Ref-11-1 for each input channel of the card. If something goeswrong during the automatic launched acquisition (histograms are notconvincing), the acquisition process can be stopped simply by usingthe start /stop button Ref-19. It is assumed that the user has be-forehand tuned the trigger over each separate input channel and thatoriginal sampled data (’0-Card input X’) has been chosen as kind ofoscillogram data to readout. This feature is often called ’Automaticpolezero search’ feature. See 3.6.2 for more information.

• ”Logical and analogical inspection lines” Ref-11-2

For parameter tuning, test or debugging purposes, the TNT2 cardhas some inspection lines that are dedicated to output some internalinspection signals :

– 2 analogical inspection signals : by choosing one of 16 predefinedsignals in the listbox, the card will output the selected informa-tion. Each analogical inspection line can be enabled /disabled(checkbox). If the analogical inspection feature is not used, itis possible to put the DAC used by the card for both lines in a’sleep’ mode that have less power consumption. Example of pos-sible signals are ’Data seen at input X’, Jordanov trapezoid forchannel X,... (Line 21 in DT5 parameter set 2.9.1).

– 4 logical inspection lines : by choosing one of 64 predefined sig-nals in the listbox, the card will output the selected information.Example of possible signals are ’Signal received over input nx af-ter delay & duration’ or ’Channel X trigger’ or ’CFD validation

TNT Digital Pulse Processor - Functionalities and control software 128

Page 131: TNT Functionalities

Parameters 2/3 tab

windows of channel X’. (Enabling : Line 21 in DT5 parameterset 2.9.1)(Selection : Line 38 in DT5 parameter set 2.9.1)

See 2.4 for more detailed signal list. Each inspection line can be en-abled /disabled (checkbox).If necessary the power needs of a card can be lowered by putting thecommon DAC electronic component used for the 2 analog inspectionlines in some ’sleep’ state (’DAC sleep’ checkbox).The inspection lines are in the middle of the TNT2 front face (TNT1back face). The content of the GUI listbox is loaded from the ’tuc.properties’file within the main jar file TUC Vx.jar, thus it can be different fromone TUC program /TNT version to another. The ability to enable /disable each of the inspection line gives some interessant feature in amulticard context : by chaining ’Log1’ output of each card togetherand at the end into an oscilloscope, it is possible to inspect the ’Log1’signal of a precise card by simply disabling this output over all othercards.

• ”External synchronisation LSE” Ref-11-3. LSE means ’Logical Syn-chronisation Events’.

For the ’Energy’ and ’Mix’ acquisition modes, a logical synchronisa-tion event (LSE) will be added in the event flow everytime a signal isdetected over NIM 1/2/3/4 (channel 5/6/7/8) input.Each TNT card has his own time reference which is the internal times-tamp counter. This counter has a zero value everytime when an ac-quisition starts (default behaviour that can be changed at Ref-10-4)and is incremented by each sampling period tick. When TNT cardsare used in correlation with other acquisition systems in a same globalacquisition experiment, then it could be usefull to adjust and correlate

TNT Digital Pulse Processor - Functionalities and control software 129

Page 132: TNT Functionalities

Parameters 2/3 tab

offline the internal time reference of a TNT with some global clock ortime signal.The Logical Synchronisation Events - LSE feature can be of some helpfor this need : some global time tick signal can be injected into a TNTcard by using any of the 4 NIM inputs. When this happens and if ithas been activated, the card will add in the event flow some ’logical’event which can be used to re-synchronise offline all saved events. Foreach of the 4 card NIM inputs, it is possible to

– activate or not the LSE feature.

– to select between two readout policy for these LSE’s :

∗ Allways readout LSE even if no ’normal’ event is detectedbetween two successives LSE’s

∗ Readout a LSE only it’s followed by some ’normal’ events.In this case, the user can select which channel(s) is(are) toconsider.

Every time a signal (raising edge) is detected by the card overthe declared NIM input’s, the card increment a specific counterrelated to this NIM input, take the timestamp counter value andreadout a specific ’logical ’ event which has a channel numberequal to 5,6,7 or 8 (for NIM1 to NIM4) and an arbitary fixed Evalue of 4095.

Caution : the gate and delay values applied in the NIM I/O featureRef-12-1 are ignored by the LSE feature.

• ”External validation with NIM input” Ref-11-4 - ’Energy’ modes only

When events detection and may be readout should be conditioned bysome external logic / condition (example : anti-compton shield), someexternal validation feature can be used. For each input channel it ispossible to

– Disable the external validation / veto feature

TNT Digital Pulse Processor - Functionalities and control software 130

Page 133: TNT Functionalities

Parameters 2/3 tab

– Enable the external validation / veto feature and choose to read-out all events by applying some special marquing (bit raising)of the channel number field that will give hints if an event is /was in coincidence or not.The bit b5 (sixth) bit of the ’channel number’ field in the energyevent tuple (which is made also of timestamp, trigger counter andenergy informations) will be raised in this case if a NIM input hasbeen used. Channel 1,2,3,4 comes out as 33,34,35,36 if it triggersout of the external validation window constructed using a signalcoming over the considered NIM input.

– Enable the external validation / veto feature and choose to read-out to readout only the events which are in coincidence with theexternal validation signal.

– Select which NIM entry is to consider : None, 1,2,3 or 4.

– For Tnt2-D cards only: this kind of cards has for each cardinput some dedicated VETO specific input that can also be usedfor validation / veto feature. Some gate and delay can also beapplied on to these input signals : [0,127] sampling periods, butfor a given input, the sum of both gate and delay cannot exceed127 sampling periods. The ’Use Veto In’, ’Use In gate’ and ’Use InDelay’ column will be disabled if the actual card is not a TNT-Dtype.For a given card input, it is then possible to use 2 different exter-nal signals : one that goes into a NIM input and the other intothe VETO input.The bit b6 (seventh) bit of the ’channel number’ field in the en-ergy event tuple will be raised if the VETO input is used to con-truct a VETO window and the trigger occurs within this VETOwindow : channel 1,2,3,4 comes out as 65,66,67,68.CAUTION: If the dedicated VETO input is used to constructsome external validation window with a ’Mark all’ readout policy,but none of the NIM inputs (column ’Use NIM In’ is ’None’),the b5 (sixth) bit of the ’channel number’ field will ALWAYS beraised. Channel numbering will be : 97,98,99,100 if trigger occurswithin a VETO gate or 33,34,35,36 if trigger occurs outside aVETO gate.

(Line 37 in DT5 parameter set 2.9.1) Tips : Select ”Inversion” Ref-12-1 for the desired NIM input in order to have some anti-coincidence orveto feature using one of the NIM inputs. This next figure summarizethe external validation /veto feature using a NIM input:

TNT Digital Pulse Processor - Functionalities and control software 131

Page 134: TNT Functionalities

Parameters 3/3 tab

This next figure summarize the external validation/veto feature usinga veto input:

Note that the external validation signal that comes into these NIMinputs can be gated and delayed by using the NIM Delay / Durationfeature Ref-12-1.

3.3.3 Parameters 3/3 tab

On this third sub-tab of the ’TNT Cards’ tab, these parameters can bevisualized and modified :

• NIM I/O signals, Ref-12-1:

TNT Digital Pulse Processor - Functionalities and control software 132

Page 135: TNT Functionalities

Parameters 3/3 tab

Figure 3.9: 3rd Parameters tab

• Very low couting rates, Ref-12-2:

• Synchronization tops generation, Ref-12-3:

• Card dummy field, Ref-12-4:

• Fast signals (TFA), Ref-12-5:

• NIM I/O signals, Ref-12-1 :

For each of the four NIM inputs and outputs, it is possible to applyon the input/output signal :

– a delay between 0 et 65535 samping periods value (see Ref-10-5in the ADC clock - DDS area), expressed in nanoseconds. If thekeyed number is not precisely a sampling period multiple, TUCwill substitute this value with the most closest multiple. (Line 2in DT5 parameter set 2.9.1).

TNT Digital Pulse Processor - Functionalities and control software 133

Page 136: TNT Functionalities

Parameters 3/3 tab

– a duration between 0 et 65535 samping periods value (see Ref-42in the ADC clock - DDS area), expressed in nanoseconds. If thekeyed number is not precisely a sampling period multiple, TUCwill substitute this value with the most closest multiple. (Line 3in DT5 parameter set 2.9.1).

Input of these values can be done directly in the input fields or byadjusting the slider knob at the right of each input field. Additionally,each NIM input can be,

– enabled or disabled (less power consumption of the card). (Line22 in DT5 parameter set 2.9.1).

– terminated with a 50 ohm resistance or not. If a NIM input isused, it is necessary to terminate physically the line with a 50ohm resistance. Such a resistance is also supplied on the cardand can be used for this purpose by selecting the checkbox.

– inverted (the NIM signal will be inverted). This can be usefullin case of using some external validation signal as a veto or anti-coincidence.

– configured for raising edges or falling edges. The FPGA willconsidere the falling / raising edge of the NIM signal for furtherprocessing. (Line 24 in DT5 parameter set 2.9.1).

Note that the external validation signal that comes into these NIMinputs (Ref-11-4) can be gated and delayed by using this NIM Delay/ Duration feature. It is also possible to enable / disable some retrig-gerability feature. When a second NIM signal is detected before theconstructed one gated and delayed by the card is finished, it is possibleto:

– ignore the second NIM signal

TNT Digital Pulse Processor - Functionalities and control software 134

Page 137: TNT Functionalities

Parameters 3/3 tab

– make some logical OR of the 2 gated/delayed signals conctructedby the card.

The following pictures illustrate this feature:

NIM signal gated at 60 micros

NIM signal gated at 80 micros

TNT Digital Pulse Processor - Functionalities and control software 135

Page 138: TNT Functionalities

Parameters 3/3 tab

NIM signal gated at 100 micros without any re-trigger ability

NIM signal gated at 100 micros with some re-trigger ability

TNT Digital Pulse Processor - Functionalities and control software 136

Page 139: TNT Functionalities

Parameters 3/3 tab

• Very low couting rates, Ref-12-2 - ’Energy’ modes only:

When working with very low counting rates (one trigger per minutes,),it can last a long time before TUC obtain a USB data packet, processit and save it to file or visualize it! With the default USB quantityasked to the USB driver (64512 bytes), as long as this quantity isn’tcompletely received by the PC, TUC will not be able to process any-thing.In order to adapt TUC’s behaviour to such cases where it is necessaryto process an event as it is readouted by the card and not to relay onsome buffering by the USB driver of the card (which is necessary forhigh readout performance), these two parameters can be used :

– EP8 readout packet size ⇒ Quantity of bytes TUC will alwaysask to the operating system / driver to receive from TNT cardsif they are running an acquisition with energy mode. Size ofbuffering used by TUC in the global readout processes : onlywhen this amount of data has been received from a TNT card,TUC will start to process these data. Example: with the defaultvalue (64512) and an approximative counting rate of 1 trigger /channel / seconds and a 4-channel TNT2 card:

∗ One trigger /event = 14 bytes of raw data to readout fromthe card

∗ Every seconds : 14*4 = 56 bytes to readout∗ ⇒ TUC will wait 1152 seconds before 64512 bytes are re-

ceived = 19,2 minutes.

The minimal choosable quantity in the lisbox is 3584. Chang-ing to something else than the default value will be memo-rized by TUC in order to use the same value the next timeTUC is launched. Note that this parameter doesn’t reallybelong to a TNT card (it is not sent to a TNT card) but isa only pure TUC parameter. If, even by choosing this mini-mal quantity, the TUC waiting time is too long, then the useof ’Readout frequency of energy data’ (see below) parametercould be of some help.

TNT Digital Pulse Processor - Functionalities and control software 137

Page 140: TNT Functionalities

Parameters 3/3 tab

(Line 21 in DT5 parameter set 2.9.1).– Readout frequency of energy data : when having very low

counting rates, the data flow is very small, thus it’s necessary towait some until a pre-defined quantity of events has been receivedon the PC (see parameter just above) before starting to processthem. By activating this feature on a TNT card (TNT2 cardsonly), it will start to readout some dummy energy events on aregular periodic basis in order to grow artificially the readout dataflow. When ’real’ events occurred, they will be then processedearlier by the PC as the ”EP8 readout packet size” will be reachedearlier.By selecting a specific value in the listbox (different than ”—-”),the card will start to use a 24-bits counter in order to determinea readout period of a dummy energy event in this manner :

Listbox value Feature1st value Disabled2nd Value One dummy event will be readouted when the timestamp bit b23 is set

⇒every 2ˆ 23 sampling periods3rd Value One dummy event will be readouted when the timestamp bit b22 is set

⇒ every 2ˆ 22 sampling periods...... ......12th Value One dummy event will be readouted when the timestamp bit b11 is set

⇒ every 2ˆ 13 = 8192 sampling periods

Table 3.2: Readout frequency of energy data

Knowing the ”EP8 readout packet size” (see above) and consider-ing ’real’ events as so rare that are unaware in belong to dummyevents, TUC will calculate how many seconds will last before itwill process some USB data packet, update the bytes counters atRef-20 and update the histogram if some ’real events’ are foundin the USB data packets.Thus, the listbox content is automatically updated everytime theuser changes the ”EP8 readout packet size”.Dummy event are easily recognizable : they have a zero (0) chan-nel number. When choosing the ’Ascii’ format, TUC will discarddummy events from datafiles but not if the binary format is used!

(Line 26 in DT5 parameter set 2.9.1).

• Synchronization tops generation, Ref-12-3 :

TNT Digital Pulse Processor - Functionalities and control software 138

Page 141: TNT Functionalities

Parameters 3/3 tab

A card will always output a periodic NIM signal at the NIM output1 and another one over NIM output 2 that is cyclic and periodic gen-erated based on the NIM 1 signal. (Line 26 in DT5 parameter set2.9.1).

In some multicards / multidevices context and using this feature, itis possible to consider a given TNT2 card as time reference, to dis-tribute NIM output 1 / 2 to all other cards / devices in some startopology (using may be some FAN IN/OUT module), even into theinitial transmitter card. These NIM signal can be injected again inTNT2 cards over NIM inputs where the ’External synchronization’feature (Ref-11-4) has been enabled, thus it will generate some LSEevents in the energy data flow.NIM output n◦1 top generation period can be adjusted through some4 bits values, it will gives 16 possibles values but only 11 are used inthis way:

0 = 5,27 ms 1 = 2,638 ms 2 = 1, 318 ms 3 = 659,24 = 329,6 5 = 164,8 6 = 82,4 7 = 41,28 = 20,6 9 = 10,3 10 = 5,16

NIM output n◦2 top generation will follow the last one generated atNIM output n◦1 :

Considering some 7 bits fixed delaying = 0111 1111 = 127 sampling periodsFirst top will be generated 127 sp after the initial NIM output n◦1 topSecond top comes at 127 + 2*1 sp after the initial NIM1 topThird top comes at 127 + 2*2 sp after the initial NIM1 top.......Top comes at 127 + 2*127= 381 sp after the initial NIM1 topTop comes again 127 sp afterTop comes again 129 sp after

TNT Digital Pulse Processor - Functionalities and control software 139

Page 142: TNT Functionalities

Parameters 3/3 tab

• Card dummy field, Ref-12-4 - ’Energy’ modes only:

The content of this GUI field will be memorized by the actual card:this 6 bits information will be readouted within any kind of event(energy acq mode) in the most significant byte of the channel numberword which is byte n◦13 of the 14 bytes of an event. It can be usedas some card level information field. Example in multicards and datamerging feature : put in some serial number [0,63] that can identifyeach card so it will be possible to know where (from which card) aparticular event is coming ...

• Fast signals (TFA), Ref-12-5: When using TNT with very fast signals,this feature disable the Kd / rectify hidden coefficient (Kd is fixed at65535) in order to avoid some offset on TFA signal. Thus having thischeckbox selected while updating a card (or while starting an acqui-sition and for the actual selected card), TUC will ignore the ’normal’Kd coefficient calculation (see 2.10.4 TFA triggering : rectify hiddencoefficient). For each channel, the KD will be fixed to 65535 indepen-dently of the ’trigger differenciation constant’, the sampling periodused and the time decay M for the considered channel.

TNT Digital Pulse Processor - Functionalities and control software 140

Page 143: TNT Functionalities

3.4 ”Oscillograms of card n” tab

Figure 3.10: Oscillogram tab

The ’Oscillogram’ tab is used for two purposes :

• ’Online’: when starting some acquisition which implies oscilloscopedata readout and if ’visualization’ feature has been selected (Ref-18),TUC will use this screen for plotting oscillogram data received from theactual selected card (Ref-2-15). In a multicard context, by changingthe actual selected card in Ref-2-15, TUC will try to draw the nextoscillogram received from the new selected card by respecting the plotfrequency given in the Ref-2-7 listbox.

• ’Offline’: when no acquisition is running (even if no TNT card has beenplugged) it is possible to view and navigate through some previouslycreated oscillogram data file (some CardXXXX YYYY.osc file):

TNT Digital Pulse Processor - Functionalities and control software 141

Page 144: TNT Functionalities

TNT’s ADC samples points spans over 14 bits giving 16384 differentsigned values : [-8192,+8191]. The plotting area is about 870 pixel widthand 416 pixel height : a maximum of 870 sampled points can be drawedwith a 416 level Y axis, thus giving a default zoom factor of 16384/416 =39,4 levels per pixel on the Y axis.

Each channel will be plot with a different color (see Ref-4-1 at ’Options’tab) by respecting the desired plot parameters :

• Part of oscillogram to visualize ⇒ Ref-2-2

• Ratio of points to plot ⇒ Ref-2-6

• Y -zooming by keying values (Ref-2-11) or by some mouse left-click/drag/release

If the oscillogram size (number of sampled points for each desired channel)is greater than the drawable number of pixel over the X axis, then TUC willmanage some navigation through the whole oscillogram points by respectingthe maximum number of points that can be drawed (870). This navigationis done by using the horizontal scrollbar Ref-2-2.

When plotting some oscillogram data, these features are proposed on the’Oscillograms’ tab :

• Plotting of oscillogram points and visualization of oscillogram headerinformation and other counters based information. The plotting isdone for each channel that has been selected for readout Ref-10-1.As the oscillogram size Ref-10-3 can exceed the maximum showablenumber of point (870) some kind of scrolling and zooming effects aresupported :

– Horizontal scrolling with the Ref-2-2 scrollbar. By using thisscrollbar, it is possible to navigate through the whole oscillogramdepending of the X zoom effect Ref-2-6 wanted.

– X-zooming : the Ref-2-6 listbox propose to different options :vizualise 1 /1 points (all points), or one every 2, 10, 20, 100 or1000 points. For example, with an oscillogram size of 5000 points,and- no X-zooming (’1/1’ selected) : there will be 5000/870= 5,7which gives 5 full ’scrolling windows’ or ’slices’ of 870 points eachand a 6th with only 650 points- a X-zooming of ’1/2’ : there will be 5000/(2*870)= 2,8 whichgives 2 full ’slice’ of 870 points each and a third one with 760points

Regardless of the oscillogram part being visualized there are alwayssome informations shown which helps when navigating through anoscillogram :

TNT Digital Pulse Processor - Functionalities and control software 142

Page 145: TNT Functionalities

– Ref-2-5 : the number of samples per channel which is taken fromRef-10-3 on the ’TNT cards’ tab

– Ref-2-1 : under the left/right lower corner of the graph, the pointnumber (counted from the beginning of the oscilllogram) actuallyshown at the very left/right of the screen and the correspondingtime duration based on the actual sampling frequency used (Ref-10-5)

– Ref-2-3 and Ref-2-4 : the actual ’scrolling windows’ or ’slice’number actually shown within the osciilogram and the actualtotal number of showed point number for this ’slice’. It shouldbe generally 870 except for the last ’slice’ / ’scrolling windows’ ifthe oscillogram size is not a multiple of 870.

Within each oscillogram, the card send first some header informationsthat contain always a timestamp information (number of samplingperiod since the acquisition start) and a trigger counter number foreach card channel, regardless if a channel has been selected for readoutor not (Ref-10-1). These 3 or 5 informations (2-channel or 4-channelcard type) will always be decoded and shown at Ref-2-9.Additionnaly, for each channel, the actual counting rate is calculatedfor each separate card channel by using memorized trigger countersand timestamp values of the precedent oscillogram shown and these ofthe actual oscillogram shown :

Hit/s = trigger counter difference / timestamp difference

• First and last oscillogram points specific plot : for control needs, TNTcards always mark the first and last point of an oscillogram by givingthem some precise and fixed value which last over 16 bits:

– 0xFFFF = first and last point of channel 1 = -1 if signed 16 bitsdecoding

– 0xFFFE = first and last point of channel 2 = -2 if signed 16 bitsdecoding

– 0xFFFD = first and last point of channel 3 = -3 if signed 16 bitsdecoding

– 0xFFFC = first and last point of channel 4 = -4 if signed 16 bitsdecoding

This kind of values cannot be given by the ADC which have a 14 bitsrange [0,16383] = [0, 3FFF]. Thus TUC will draw these points with aparticular vertical bar that allows immediate visual detection of firstand last points of an oscillogram (and is also usefull for checking thedata coherence):

TNT Digital Pulse Processor - Functionalities and control software 143

Page 146: TNT Functionalities

Figure 3.11: Triggered point of an oscillogram

• Trigger point specific plot: as for the first and last point of each channelwithin an oscillogram, a TNT card mark the trigger point by raisingit 16th bit to 1. Thus, the original 14 bits value is still preserved butin term of plotting task, this point will also appears with a verticalbar on the screen.

• Exact values visualization of mouse overflown points Ref-2-8: by usingthe mouse position on the X-axis of the oscillogram plot, TUC willshow the exact values of each channel point in the oscillogram thathave the same X position. This area will present the 14 bits signedvalues of up to four possible channels (depending of actual selectedcard type). In order to get the values of a precise point of each channel,simply move the mouse cursor over this point.

• Y zooming-Ref-2-11. The 2 fields below the plotting area gives the user

the possibility to key:

– A new amplitude for the Y axis : when keying a new half range’ymax’ for the Y axis (value between [1, 8192]) and when usingthe ENTER key or when leaving one of these 2 fields, TUC willadjust the plot in order to show data that have a value between [-ymax, +ymax-1]. By default, TUC consider a Y axis that coversall possible data range ,i.e 14 bits 2-complement signed values[-8192, +8191].

TNT Digital Pulse Processor - Functionalities and control software 144

Page 147: TNT Functionalities

– A new origin for the Y axis : by default, all the 14 bits ADC rangeis covered [-8191, +8191], thus the origine is zero. By keying somenew value within this range and when leaving this field or usingthe ENTER key, show only sampling points which are aroundthis new value by calculating and using the maximum possibleamplitude which is then put in the first field.

– In order to cancel at any moment a Y zooming effect, the ’Def’button can be used which take the 2 default values for Y plotting: origin at 0 and 8191 half-amplitude.

• Global X /Y zooming : with a ’click-drag-release’ mouse operationby using the left mouse button a white rectangle representing a selectedarea is draw over the oscillogram. As the mouse button is released, theoscillogram is plotted again in regards of these new given parameters:

– Y axis center = middle of a vertical rectangle border

– Y axis amplitude = vertical dimension of rectangle

– X axis origin = point number of first point in the rectangle

– Coefficient for X zooming = the point numbers difference betweenthe last selected and the first selected point will give the amountof point that TUC will try to plot. If this quantity is greater thanthe 870 available pixels, then a x-zooming coefficient is calculated.

Figure 3.12: Zooming in an oscillogram

When some mouse zooming has been done, Ref-2-6 (X-zooming list-box) and Ref-2-11 (Manual zoom) are disabled.A simple right mouse click will restore initial plot parameters. Notethat it is not possible to X-zoom more than 1:1 because all points areplotted in this case...

TNT Digital Pulse Processor - Functionalities and control software 145

Page 148: TNT Functionalities

• Offline - Memory dump of the oscillogram shown Ref-2-12.When stopping some oscilloscope acquisition with vizualization orwhen viewing some oscillogram file, this button will take the oscil-logram raw data actually shown on the screen and write it to diskwhich enables further visualization. Some file selection window willappears in order to let the user select the location and filename for theoscillogram file.This feature is usefull when some acquisition with only visualizationhas been started. When stopping the acquisition, if the last oscillogramreceived from the card and shown on screen has some interest, it ispossible to save it into a file for further examination.When starting an acquisition with both visualization and saving datato file and seing something particular on screen, this feature can beused for extracting only the particular oscillogram from a whole oscil-logram file : use first the ’View file’ Ref-2-13 feature and then Ref-2-14file navigation for searching the particular oscillogram.

• Offline - Oscillogram file visualization Ref-2-13 :

A file selection windowswill ask for the oscillogram file to visualize. TUC will open the fileanalyse it and make some format verification. Under the ” View File ”button, a small horizontal scrollbar for file navigation will appears andat the right of the button, a red text label containing the total numberof oscillograms and the number of the actual oscillogram shown in thefile will also be there.The Ref-2-14 horizontal scrollbar allow forward and backward naviga-tion through the file.TUC will also calculate these oscillogram charac-teristics and update consequently the GUI fields :

– which data channel is in an oscillogram : Ref-10-1 last columnof the card input parameter array on the first ’Parameters ofselected card’ tab

– the number of point before trigger (Ref-10-3)

– the whole oscillogram size (Ref-10-3) and the Ref-2-5 label on the

TNT Digital Pulse Processor - Functionalities and control software 146

Page 149: TNT Functionalities

Interlace

’Oscillogram’ tab

– the acquisition mode ’Oscilloscope mode’ will be selected in theRef-10-3 listbox

3.4.1 Interlace

The four channels of a TNT-2 card (or the 2 channels of a DT5) can beinterlaced to virtually multiply the sampling frequency of the card. To dothis, the same input signal is plugged into all input channels and the wiresbetween channels must have the right lengths so that the propagation timeis equals to the fourth (half for DT5) of the sampling period. See figure 3.13.Because the same signal applied to all channels does not give exactly the

Figure 3.13: Interlacing the TNT-2 channels

same sampled value, a gain and an offset have to be applied to all channelsexcept the first before performing interlace. These gain and offset valuescan be determined by calibrating the channels (see 3.6.3). By clicking theRef-2-17 button, the user may choose to interlace 2, 3 or 4 channels. Thegain and offset values (stored in the InterlaceParamXXXX.csv file whereXXXX is the card number) can be tuned by using the corresponding sliders.A check box allows to apply the gain and offset also when the channels arenot interlaced. The interlace tuning dialog box can be resized to increasethe sliders precision.

When interlacing, the user may choose to save oscillograms into a filewhere channels are interlaced by checking the ”Interlaced” check box (afterchecking ”Save to file”). He can also save them the usual way and interlacethe channels when viewing (see 3.4) the file.

3.5 ”Histograms” tab

This screen is mainly used for plotting histogram :

TNT Digital Pulse Processor - Functionalities and control software 147

Page 150: TNT Functionalities

Figure 3.14: Choose channels to be interlaced and tune gains and offsets

• On line when some acquisition with ’Energy histogramer’ is running.While multiparametric events are collected on the PC, TUC will ex-tract the energy value of an event and construct histogram for eachchannel that has been selected by the user (Ref-13-7).For data readout needs, a TNT card will readout the signed 16 highestbits of the calculated energy values, giving a range of [-32768,+32767].As the original energy values are stored in files, for plotting needs,TUC will convert all negative to positive values which gives a totalnumber of 32769 histogram bins for [0,32768] possible values (negativeenergy values are found in case of negative signal impulses).

• On line when some acquisition with ’ADC histogramer’ mode is run-ning. While TUC collects ADC histograms, it will sum them andplot them on the screen. In this acquisition mode, an ADC histogramcontains 16384 bins on the x axis (16384 different ADC values).

• Offline (no acquisition is running) : by using the REF-3-6 ” Showa spectra ” button, a file selection window appears asking for somehistogram file to load. This feature allows to load from disk up to3 differents histogram files : ASCII, WinTMCA, XML (’asc’, ’spc’or ’plotml’ file extension). Multiple file selection is allowed : up to4 different files of same type can be loaded and plotted at the sametime.

TUC handle 3 different histogram formats : ASCII (’asc’ file extension) andWinTMCA ( ’spc’ file extension) for storing histogram during an acquisition(Ref-18) and a XML format (plotml file extension, see later) when the useruses the ’save as’ over an plotted histogram. For detailed information aboutthe different format, see Data readout formats.

The user can zoom in and out by using the mouse wheel over the his-togram. Zoom can also be obtained by pressing the left mouse button at the

TNT Digital Pulse Processor - Functionalities and control software 148

Page 151: TNT Functionalities

Figure 3.15: Labelled histogram tab screenshot

new wanted minimum X value, moving the mouse pointer, and releasing themouse button at the wanted maximum X value. The X axis can be trans-lated by dragging it with the mouse pointer or by using the mouse wheelwhile pressing the Shift key. To cancel X-zooming, simply use the Ref-3-1’Cancel Zoom’ button.

The graphical histogram plot component ’jas plotter’ from the ” JAS ”Java Analysis Studio HEP java framework is used by TUC (http://java.freehep.org/).Thus, all functionalities shipped with this component are accessible, espe-cially those appearing with a right-click over a plot : Within this contextualmenu, amongst other things, it is possible to :

• Modify the appearance of the graph : color, border, title,...

• Modify some graph properties by selecting the menu ’Plot properties’:One particular functionality concern the ’X Axis’ tab : some zoomeffect is possible by changing the ’Min’ and ’Max’ range values and byusing the ’Apply’ button.

• Save the plot in a XML format (’plotml’ file extension) where the data

TNT Digital Pulse Processor - Functionalities and control software 149

Page 152: TNT Functionalities

Figure 3.16: Energy histogram with contextial menu

Figure 3.17: Histogram plot properties

TNT Digital Pulse Processor - Functionalities and control software 150

Page 153: TNT Functionalities

itself will be saved or in a ’Gif’ format where only the image will besaved but not the raw histogram data.

• Print the graphics

If some acquisition is started with ’Save to file’ and histogram saving (Ref-18), TUC will generate the histogram file when the user asks to stop theacquisition. TUC will wait for the last data from the card, update thehistograms and save them to file. In order to avoid some possible data lossif TUC is brutally aborted, some temporary backup of the histogram is madeon a regular basis. These temporary files are deleted when the acquisitionnormally stops. TUC will write the histogram data, one file for each selectedchannel and for each format wanted by the user on the ’format’ checkboxes.

The ’Snapshot’ button Ref-3-8, appears when an acquisition starts anddisappears when it stops. Using this ’Snapshot’ button during an acquisi-tion will take all current histograms and save them to file in every formatinitially wanted. If only visualization has been selected, then the defaultASCII format is used. The filename used by TUC for snapshot file is ex-plicit enough and contains some number which increments each time the’Snapshot’ button is used. For example if the backup directory (Ref-20) is’D:

data’, then successives snapshot data files could be:

• For the ASCII format : CardXXXX SnapYYYY histo VZZZZ.asc withXXXX=card number, YYYY=snapshot number and ZZZZ=channelnumber. Ex : Card0015 Snap1 histo V2.asc, Card0015 Snap8 histo V4.asc

• For the WinTMCA format: CardXXXX SnapYYYY histo VZZZZ.spc

A log file is also created by each time the ’Snapshot’ feature is used :

’CardXXXX SnapYYYY histo VZZZZ log.txt’.

This file contain in particular the current date and time, the number of sec-onds since acquisition starts and the number of hits/events for each channel.When some acquisition is running some, TUC will calculate some monitoring

informations :

• Event detection rate for each channel, expressed in ’Hits/s’ Ref-3-2:Everytime a USB data packet is received from a TNT card (see theincrement value on the ’Energy bytes received’ counter Ref-20 which is64512 bytes by default), TUC picks up a single event for each channeland consider the trigger number and the timestamp of this event. Bymaking the difference of these values with those of a previous eventreceived and memorized, some instantaneous counting rate value is

TNT Digital Pulse Processor - Functionalities and control software 151

Page 154: TNT Functionalities

Figure 3.18: Event detection rates

calculated. Note that these values reflect only what the TNT cardis currently detecting with the trigger characteristics tuned by theuser (Ref-10-2). It doesn’t reflect the overall capability of the TNTsystem which combine detection, online processing and readout pro-cesses. Dead time and event loss are still possible depending of thecounting rate, pile up effects (in regards with Energy calculation pa-rameters ’k’, ’shift’ and ’width’), PC USB capability and other PCactivity which can be present within (visualization tasks, save datatasks, ...) and in parallel of the TUC software.

• Total event number which are taken for histograming, for each chan-nel and approximative quantity (percent) of events which has beendetected but are not in the histograms on screen Ref-3-9:

Figure 3.19: Event detection statistics

After the processing of an event packet, the last event received foreach channel gives a hint about the number of events detected bythe card (’trigger number’ field) which can be compared to the totalnumber of counts actually received on the PC and used to constructthe histograms. Note that the amount of events used for histogramingcan be less than the amount of events received by the PC if the Ref-3-5’Construct with 1 USB packet every’ field is bigger than ’1’. If all USBpackets are taken into account (’1’ field value) and a non-zero percentvalue is seen at the upper right graph corner, then it means that someevents has been detected but the TNT/TUC system was not able toreadout them safely due to possible PC deadtime and / or pileup’seffect.

CAUTION: for the histograming, TUC will only consider channel

TNT Digital Pulse Processor - Functionalities and control software 152

Page 155: TNT Functionalities

Figure 3.20: Event detection bitmask

numbers of [1,4] without any special bit raised in the channel numberless significant byte of the channel number word within any Tnt eventreadouted by a card. It means, that

– Pile up and/or

– ADC out of range and/or

– Events outside any ’external validation window’

– Events inside any TNT2-D ’Veto’ window

will not be taken into account into the visualized histogram data. Thussome high loss event ratio (ex:15% or 40%) can be due do any of these4 features.

Before starting or during an acquisition, and only for the visualizationfeature (not the binary save to data feature!), it is possible to let TUCignore (or consider only) some special bits within the less significantbyte of the channel number fields and for all events readouted:Selecting for example ’ADC overflow bit b7’ and ’Pile up bit b4’ willcause TUC to apply some bitmask over this byte that will delete theconsidered bit positions. During an ongoing acquisition, TUC will im-mediately delete prior calculated histogram datas and start some newones where for each channel, ’normal’ events, ’pileup’ events and ’ADCout of range’ events are put together in the new histogram calculationprocess. Of course, all deleted data will not be considered when calcu-lating the approximative quantity (percent) of events which has beendetected but are not in the histograms on screen Ref-3-9, thus it willraise these percent values.

In order to adjust histograming visualization needs in regards to de-sired readout performance level, it is possible to change:

– The histogram graph update frequency. The ’Show at xx th USBpacket’ Ref-3-4 field contains a ’5’ default value which is the best

TNT Digital Pulse Processor - Functionalities and control software 153

Page 156: TNT Functionalities

Integration from oscillograms

Figure 3.21: Histogram visualization parameters

possible refresh rate of the histogram plot : at the end of theprocessing of every USB data packet received, the histogramsplot will be updated. By keying some bigger value (10, 20, 50,100, ...) it is possible to do this less often. By high counting rates,as USB data flow grows, it can be usefull not have a refreshmentonly from time to time and thus to have more CPU time and PCressources available for USB readout and data processing.

– The proportion of USB packet to consider for histograming. The’1’ default value in the ’Construct with 1 USB packet every’ Ref-3-5 field indicates that every USB packet received will be processedin order to update the histograms on screen.

– By changing this value to something bigger, the histogram plot-ted will reflect only a part (some samples) of the whole eventsquantity received and saved to disk. Note that in this case, thepercent of events which are not taken for histograming (betweenparentheses in the upper right border of the graph) can be con-fusing as it will probably have high values. In order to determinethe effective percent of events lost, it is necessary to process thewhole events data fileset, to count the total number of events re-ceived and compare it with the ’trigger counter’ value of the verylast event received.

In a multicard context, when an acquisition is started, then it is necessaryto use the Ref-3-3 listbox (or Ref-6 or Ref-2-15) in order to monitor thehistograms data of another card. The graph will not update immediately(look at the graph title which includes the card number) after selectinganother card, but only when the next USB packet of the new selected cardis being received and processed in regards of the ’Show at xx th USB packet’Ref-3-4 and ’Construct with 1 USB packet every’ Ref-3-5 fields.

3.5.1 Integration from oscillograms

TUC software can calculate ”energy” values by integrating oscillogram sam-pled values. This is especially usefull when interlacing (see 3.4.1) channelssince the TNT’s energy mode cannot be used. When integrating, virtual

TNT Digital Pulse Processor - Functionalities and control software 154

Page 157: TNT Functionalities

Integration from oscillograms

energy events are generated and can be saved and stored into energy his-tograms like standard energy events. Integration has to be switched onbefore starting the acquisitions by clicking the Ref-3-11 ”Integrate...” but-ton and the ”Integrate” button in the Integration parameters dialog boxshown in figure 3.22. Only the first channel can be used to perform integra-

Figure 3.22: Integration parameters

tion. Two integration ”windows” can be set: the first is typically before thetrigger and the second is after, but the user can enter a negative value inthe ”Points” edit zones and set them wherever he wants. After computingthe sum of sampled values, the result is divided by a coefficient determinedby a slider. The ”Baseline” window is used to calculate the baseline of eachoscillogram. Its location is determined by entering the number of Pointsfrom the oscillogram beginning or before the trigged point (”Before trigger”check box). Its length is set by using the slider and is necessarily a power of2. An ”Offset” value can be selected to be added to the baseline values andplot them as a histogram too. The three ”windows” can be displayed in theoscillogram view by pressing their corresponding ”Oscillo” button when theintegration button is pressed (see figure ??). The numerical result is alsowritten.

CAUTION: Since the integrated energy values are computed from os-cillograms, those oscillograms have to be ”viewed” by TUC: The ”Visualize”checkbox (figure 3.1) has to be checked and 1 oscillogram / 1 has to be seen(Ref-2-7 combobox in oscillogram tab: figure 3.10).

TNT Digital Pulse Processor - Functionalities and control software 155

Page 158: TNT Functionalities

Bidimensional histograms

Figure 3.23: Integration Area

3.5.2 Bidimensional histograms

The Ref-3-10 button opens the bidimensional histograms window which isused to select the channels on the two axis (radio buttons in the bottom leftcorner) and to display the results. The channels have to be selected beforestarting the acquisition. By default, the picture is displayed in black color.The screenshot shows how to use a color scheme and a logarithmic Z axisscale by entering the contextual submenu (with the right mouse button).The user can zoom in and out by using the mouse wheel. The picture canbe translated by dragging with the left mouse button. After zooming ortranslating, it is often necessary to click the Refresh button to re-fill the 2Dhistogram bins.

The ”Slices” button allows to fill a 1D histogram with points extractedfrom a slice along a given slope in a 2D histogram.

3.5.3 Slice of a bidimensional histogram

In the Slices dialog box, the ”Directions distribution” buttons fills a 1Dhistogram with directions of all points of the 2D histogram. This helps todecide which slope will be used to extract the slice. The ”Show slice” buttonfills the histogram with the points of the slice given by a slope and a percentvalue. The user can also choose which coordinates of the points will be used.A checkbox allows to displayed the chosen slope on the 2D histogram (afterthe Slice dialog has been closed) like in the 3.26 screenshot. Finally, thehistogram can be saved in ASCII format and its parameters in a HTML

TNT Digital Pulse Processor - Functionalities and control software 156

Page 159: TNT Functionalities

Figure 3.24: Bidimensional histogram

table format.

3.6 ”Options” tab

The fourth tab page ”Options” contain some minor parameter elements thatdoesn’t mainly concern directly a TNT card, but are more related to theTUC software :

• Colors used for oscillograms and histograms plotting - Ref-4-1:

– Channel colors

– Backgound color

– Axes & title color

TNT Digital Pulse Processor - Functionalities and control software 157

Page 160: TNT Functionalities

Figure 3.25: Slice of a bidimensional histogram

Figure 3.26: Bidimensional histogram with a displayed slope

When using the small ”...” button at the right of each colorized rect-

angle ,the color chooser windows appears:

TNT Digital Pulse Processor - Functionalities and control software 158

Page 161: TNT Functionalities

Figure 3.27: Options tab

As soon as a new color is chosen, TUC will redraw oscillogram and his-tograms with this new color and memorize this information (user.propertiesin TUC directory) for further TUC’s uses.

• The language used by TUC software - Ref-4-2: the main part of textthat appears over TUC’s screens can use a french language (default)or an english one. It is possible to customize the different labels, andother text elements of the GUI by extracting the ’tuc.properties’ filefrom the ’jar’ file. Modify some file entry that appears after the lines

]]]]]]]]]]]]]]]]]]]Internationalization]]]]]]]]]]]]]]]-]]]]]]]]]]]]]]]]]]]GUItextandlabels]]]]]]]]]]]]]]]

and compress it back into the main TUC jar file, respecting the initialdirectory structure.In order to customize the English version, simply update the ’tuc eng.properties’ file.In order to add a new version, simply create a new ’tuc xx.properties’file by using a copy of an existing file. Translate each line that doesn’tstart with a ’sharp’ character and translate only after the ’=’ : al-ways leave the lines beginnings untouched. Use ASCII and a UNI-CODE character encoding by using \uYYYY for a special charac-ter that doesn’t belong to the ASCII encoding table. Start TUC gointo the Ref-4-2 listbox and key the 2-letter ISO-639 language code

TNT Digital Pulse Processor - Functionalities and control software 159

Page 162: TNT Functionalities

(http://www.loc.gov/standards/iso639-2/englangn.html ) : TUC willupdate all GUI elements by searching the ’tuc xx.properties’ with xx=2 letter language code.

• Transfer rate unit used - Ref-4-3 : instead of the traditional MBytes/sor ’KBytes/s’ units used by default by TUC for showing actual transferrates during an acquisition (lower right screen corner), it is possibleto change to some ’Events / sec’ or ’Oscillogram / sec’. TUC sim-ply divide the received byte counter value by the event readout size(14 bytes) or the oscillogram size (content of ′Numberofpts′ field ∗number of input selected for readout + headersize) Thus the re-sulting transfer rate doesn’t distinguish between channels nor specialevents (see 2.6’Special channel numbers’), it simply calculates someoverall transfer rate which is to compare with those which are relatedto each separate channel (on the histogram tab).

• WinTMCA histogram format, first point extracted Ref-4-4 : this con-cern only acquisition with ’Energy’ and the WinTMCA format usedfor saving histograms. As the WinTMCA software can’t handle his-togram which has more than 15400 values (bins), this feature indicateto TUC the first bin to consider in order to extract 15400 from a 32769bin histogram : the field value indicate the first bin to consider in orderto proceed.

• the GUI look&feel Ref-4-5 : as TUC is written in java, it can be usedon a lot of operating systems, but the overall appearance can slightlychange if it is used on a system that is different than the XP/2000development platform. If some GUI text element doesn’t completelyappear on screen, or if the user wants to customize the general look,it is possible to change :

– The Java Look and feel (depending of JVM and platform, seehttp://www.java.sun.com). Possible values are ’OS’, ’Windows’,’CDE/Motif’,’GTK+’,’Metal’,’Macintosh’ or ’Kunstoff’. If thecurrent OS/JVM doesn’t support the selected L&F, then no changesapplies.

– The font size (default is 11)

– The font to use (default is ’Sans serif’)

In order to apply a new font size, a new font or a new L&F, the firstlistbox must be actionned. TUC will memorize these 3 informations(user.properties file) for further TUC’s uses.

• Thread’s priority Ref-4-8:

TNT Digital Pulse Processor - Functionalities and control software 160

Page 163: TNT Functionalities

In order to obtain maximal readout performances, it is possible to usethis feature that will increase the readout process priority in regardof the PC other softwares that are running at same time. By puttinghigher priorities to oscillogram and/or energy processes that handlethe acquisition data, the maximum PC ressources available will bededicated to these TUC’s processes, thus allowing the possible min-imization of lost data due to PC activity in parallel of TUC. If lessCPU or RAM ressources are available for TUC and for the subpro-cesses which are in charge of collecting card data, then the card willneed more time to readout a given amount of data. If many eventsoccur during a small lap to time, it is possible that some of them willbe lost because all card buffers being full, the card is not able to keepand to readout them.Be aware by increasing these priorities could induce some user un-pleasant side-effects : plotting and system responses to user actionsby mouse / keyboard could operate very slowly and some seconds later.

• (Energy acquisition modes) : ’Boost’ energy readout Ref 4-10 - Ex-perimental Having high counting rates (ex :beyond 30 000 cts/s), thisfeature has been designed in order to try to minimize some dead timerelated to PC USB readout performance. Indeed, in this context, thebottleneck is not always the USB2 part : the readout needs (one eventis triggered on 4 channels a 14 bytes /events == 56 bytes / events== 56 * 30 000 == 1,6MB/s) from a card is far away from maximumUSB2 capability (about 25MB/s per card, 40MB/s for 3 cards).The problem is the time needed by the USB host PC to process afullfilled USB data request of 64512 bytes (which is default value, see3.3.3 ”Very low counting rates, Ref-12-2”) : as TUC isn’t finishedwith this processing, no USB readout activity is going on. Furthernew events will be stored in some card buffers but if some events datacan be lost when these buffers fullfilled. Thus, the main idea, is to setup some mechanism with several USB readout processes dedicated toa single TNT card. When the first process starts to process a full datapacket (64512 bytes) in order to extract energy values for histogramplotting or in order to save data to disk, then a another process takethe continuation of collecting USB data flow from the card. If thesecond process receive a complete USB data request of 64512 bytesand the first process is not ready, then a third process could come intoplay, and so on....This feature is enabled when starting some acquisition with ’energy’mode and the ’Boost energy readout’ checkbox is selected. TUC will

TNT Digital Pulse Processor - Functionalities and control software 161

Page 164: TNT Functionalities

create a number of additional processes for readout and data process-ing that is equal to the content of the field at the right of the checkbox.All readout processes launched by TUC will use the same data file inorder to save their data.CAUTION : Time ordering of the data within files is NOT guaranted!!!

• Change USB order...

In a multicard context, for convenience or for setting up some multi-card acquisition feature (acquisition master /slave: need to have theacquisition start master and clock furnisher at the last USB position),it migth be usefull to change card ordering in the list Ref-6,Ref-3-3 andRef-2-15 without doing any physical unplugg and replugg action. Thisscreen will present all tnt cards actually plugged and found (exceptthose involved in a ’Ignore card’ feature 3.10) on the PC. The orderof the card list is

– the natural one induced from the USB plugging mechanism

– or the result of a prior USB re-ordering made with this screen

Use the ’Up’ and ’Down’ button to change card order, and press ’Ok’button when finished : TUC will start a new card detection phasehaving this new ordering in mind. The 3 listboxes (by Ref-6,Ref-3-3and Ref-2-15) containing the cards founds will be filled consequently.Next time TUC is launched again, the natural order induced from theUSB plugging mechanism will be valid again unless the checkbox ’Keep

TNT Digital Pulse Processor - Functionalities and control software 162

Page 165: TNT Functionalities

ordering for future card detections’ has been selected when pressing’Ok’ button. In this case, the card ordered list will be saved into someascii file in the TUC installation directory

’cardOrdering.properties’

that will be used next times. Deletion of this file is always possi-ble. Cards number found in this file but not actually plugged will beautomatically ordered at the end of the backuped list.

• Release notes...

Figure 3.28: Versions history

This screen will contain the main feature added/corrected/suppressedeach time a new minor/major version is available.

• Test encoding - Advanced use only!

TNT Digital Pulse Processor - Functionalities and control software 163

Page 166: TNT Functionalities

Every parameter of a card feature is encoded into some bits withina word (rarely into a whole word). Putting all of these bits/wordstogether defines some kind of a word array where bits related to aspecific feature are mapped (around 100 words). The whole wordarray which is called ’Parameter set’

– is sent everytime button ’Update card’ or ’Start acquisition’(onlyfor actual selected card) is used

– is received when a card has been asked for whole parameter set

Thus, one of the main job of TUC is to

– decode all parameters and present them correctly to a GUI screen(the 3 ’card parameters tabs’)

– collect all parameters values on GUI screen (the 3 ’card param-eters tabs’) and encode them into a whole word array which ismade of 2 sub arrays : one for the Spartan and then the one forthe Virtex2.

For TUC’s and VHDL development purposes, this screen gives thepossibility to key access a specific word/bit of one of the 2 FPGA’s ofa specific card version (TNT2, TNT2R or TNT2D).

– ’Get word/bit value from GUI’ ⇒ will use TUC actual encodingfunction to extract the given word/bits of the given FPGA ofthe given card type. Individual bits values, whole word value inhexadecimal, decimal and two’s complement (signed) are shown.Non selected bits will appears with a ’-’ sign within the ’Binaryvalue’ field. This functionnality operate even when no card isactually plugged.

– ’Get word/bit value from actual card’ ⇒ will ask directly the ac-tual selected card for his whole parameter set, extract the givenword/bits of the given FPGA for the actual selected card type.Individual bits values, whole word value in hexadecimal, deci-mal and two’s complement (signed) are shown. Non selected bitswill appears with a ’-’ sign within the ’Binary value’ field. Thisfunctionnality will not operate when no card is actually plugged.

– ’Set value from ”Binary” field to GUI & current Card (if any)’ ⇒here it is possible to change /set some bits /word value. Wholeparameter set will be encoded from the GUI values, the givenword will be overwritten by the ”Binary” field content and thenthe GUI and the actual selected card will be updated.

Note that this screen can be used in order to access /set some bit(s)that are not taken into account by TUC’s GUI and code. Initially thisscreen was made for TUC debugging and testing purposes.

TNT Digital Pulse Processor - Functionalities and control software 164

Page 167: TNT Functionalities

On board VHDL

• Waiting scanning orders - IPHC internal needs onlyFor our laboratory’s internal needs, this functionnality has been devel-opped. Aim was the automatization of a detector scanning installation:

– scanning table is directed by some Labview software

– TUC software operate some Tnt cards whose inputs are connectedto the radiation detector

– some third other java software communicate together with the 2first softwares in order to accomplish some long scanning sequencewhich is made of

∗ scanning table moves∗ Tnt cards acquisition starts and stops

Communication between the 3 softwares is done through TCP/IPsocket connections. This button will place TUC in some ’Waiting’state where it start to listen for incoming connection at port 8888.In order to exit this listen/slave state (where TUC is remotelyoperated by some opther software), it can be done by some clean’Stop’ order sent by the other software or directly by leaving TUC.

Other buttons or elements on this tab page serve only for specific testsduring development phases and can be ignored by the user.

3.6.1 On board VHDL

This Ref-4-7 area involve direct communication and actions with the actualselected card:

Starting with TNT2 card types, TNT system provides the ability to re-configure and reprogram dynamically through USB2 and TUC interface theon-board VHDL software of the Virtex II. The TNT2 card support 2 possibledifferent configurations for this FPGA :

• 3 EEPROM’s configuration : by default, at power-on, the card willalways load this configuration into the Virtex. Thus, after power-on,the TUC software can be used to operate the card.

TNT Digital Pulse Processor - Functionalities and control software 165

Page 168: TNT Functionalities

On board VHDL

• Flash EEPROM configuration : for customization needs (ex :for aparticular experience or a specific test) it is always possible to designa new software for the Virtex. In this case, this new alternate con-figuration can be stored into a flash EEPROM at any time throughUSB by using the ”VHDL flash upload” button. At demand, it will bethen possible to make the virtex re-boot by using this flash EEPROMconfiguration or by using the default 3 EEPROM’s configuration.

The ”On board VHDL-Ref-4-7” area gives the opportunity to :

• ⇒ To send a compiled VHDL programfile (bin file) to the flash EEPROM of the actual selected card (throughUSB&SPARTAN). A file selection windows ask the user for the ’bin’file to use. Some format check is performed (first 20 bytes file header)and then a 2-step process is launched :

– Flash erasure : it is necessary to wait approximatively 30 secondswhile the content of the flash EEPROM is deleted.

– Flash write : if the first step complete correctly, then the filecontent is sent through USB to the Spartan FPGA that is incharge of putting it into the flash EEPROM.

When using this button, this sequence begins :

TNT Digital Pulse Processor - Functionalities and control software 166

Page 169: TNT Functionalities

On board VHDL

Upload, 1/4 - Select file to send

Upload, 2/4 - Erasure of flash content

Upload, 3/4 - Sending file content to the card

TNT Digital Pulse Processor - Functionalities and control software 167

Page 170: TNT Functionalities

On board VHDL

Upload, 4/4 - Uploading finishedOnly when ’VHDL uploaded :’ appears on the second line, the

process is completely done. Now it’s time to let the card (the Virtex)boot over this new updated Flash memory : press ’Reboot flash

EEPROM’ button :

Reboot card on new uploaded code

You can start to work with this new VHDL ...

• ⇒ The ”VHDL flash download” button isused to recover the content of the flash EEPROM of the actual se-lected card (through USB&SPARTAN) and write it down to disk.The ’FromFlashEEPROM.bin’ file in the backup directory of the ac-tual card wil be created. CAUTION : overwriting of an existing filewill not be noticed !

TNT Digital Pulse Processor - Functionalities and control software 168

Page 171: TNT Functionalities

Polezero search parameters - Ref-4-6

• ⇒ To let the card reboot by using the3 EEPROM’s configuration. This will make the card return in hisdefault configuration.

• ⇒ To let the card reboot by using theflash configuration. If the flash EEPROM configuration is not TUCcompliant, it could induce malfunction of the TUC software.

3.6.2 Polezero search parameters - Ref-4-6

Among all parameters needed for the energy calculation, TUC offers somefacilities for determining some approaching values of one important param-eter : the time decay constant M (also called ’Polezero’) which can be foundat the ’Parameters 2/3’ sub-tab of the first main tab ’TNT cards’ (Ref-11-1). TUC implements a simple algorithm that calculates within a receivedoscillogram the time decay constant by using the mathematical theoricalgeneral expression of an impulse :

Having a full oscillogram at hand, TUC will calculate the M value byusing two sampling points of this oscillogram with some assumptions :

• The oscillogram contain at least one positive or negative impulse (incase of a negative pulse, the M expression is also the same)

• The trigger is correctly set up : the trigger point is on the rising edgeof the pulse, thus the falling tail begin just after this special point.

• The baseline at the beginning of the oscillogram is at it normal state(no pileup, not at the end of a tail)

TNT Digital Pulse Processor - Functionalities and control software 169

Page 172: TNT Functionalities

Polezero search parameters - Ref-4-6

Figure 3.29: Pulse theorical curve

Working with several oscillograms, the successive M values found are col-lected and then used for filling and plotting an histogram on the ’Histogram’tab. The oscillogram-based M calculation process can be used in three con-text/manner:

• Working with an oscillogram file (file has been opened with the ’Viewfile... Ref-2-13 button on the ’Oscillogram’ tab).

– When navigating through the file, if the Ref-4-6 checkbox ’ cal-culate PZ when viewing oscillogram file’ is checked, TUC willcalculate the M value for the first channel found and store it.When the file navigation has traversed the number of oscillogramsto use (Ref-4-6, ’Number of oscillogram to use=1000(default)’),the resulting histogram is plotted at the ’histogram’ tab and thehistogram average is printed at the output windows.

– When using the Ref-4-6 ”Process a file” button having openedan oscillogram file for visualization : the Ref-4-6 ’Number of os-cillogram to use’ field will be updated with the total number ofoscillogram found in the file. TUC will process th eentire oscillo-gram file and calculate for each oscillogram the corresponding Mbut only for the first channel found. At the end of the file, theresulting histogram containing all successive M values is plottedand the histogram average is printed at the output windows..

• Using the automatic polezero calculation feature (M auto search /Ref-11-1)

with a TNT card correctly set up to read-out well-formed (see above) oscillograms. TUC will try to start an

TNT Digital Pulse Processor - Functionalities and control software 170

Page 173: TNT Functionalities

Polezero search parameters - Ref-4-6

acquisition in oscilloscope mode only for the actual selected card by :

– Selecting ’Oscilloscope’ mode in the acquisition mode listbox

– Selecting all card inputs rows in the ’Readout oscillogram’ col-umn of the ’Card inputs’ parameter array on the ’Parameters ofselected card 1/3’ tab

When a full histogram has been collected from the card, TUC calcu-lates the M value for all card channel. Every 100 oscillograms, the Mvalues of each card channel are filled into an histogram which is plot-ted at the ’Histogram’ tab. When the given number of oscillogramshas been reached, TUC will stop the acquisition and update the ’M’column values in the energy parameters array Ref-11-1 for each inputchannel of the card by using the average of all histogram values. Ifsomething goes wrong during the automatic launched acquisition (his-tograms are not convincing), the acquisition process can be stoppedsimply by using the start /stop button Ref-58. Be sure that the orig-inal card input data has been selected for readout and not some cardcalculated data (see Ref-10-1):

In order to calculate the time decay constant / polezero M value of anoscillogram, some additional parameters are needed :

• ′X1 =′ and′X2 =′⇒ The position of the two sampling points to con-sider. Each point’s position, X1 and X2 is given with a numer relatedto the trigger point. These 2 point addresses should be coherent withthe global oscillogram specified and the number of pre-trigger (pointsRef-10-3). X1 and X2 should be always located clearly on the fallingtail of the impulses and not near the baseline value.

• ′aftertrigger + /− =′⇒ The interval of uncertainty to consider whiththe X1 and X2 adresses at prior items. By keying a L non-zero value,TUC will for each oscillogram randomly adjust the X1 and X2 posi-tions : the point to use is a random point taken from [X1-L, X1+L]and [X2-L, X2+L].

TNT Digital Pulse Processor - Functionalities and control software 171

Page 174: TNT Functionalities

Polezero search parameters - Ref-4-6

• ’Calculate an average of f(X1) and f(X2) with a neighborhood of’ ⇒Neighborhood to consider for calculating an average of some pointsaround the X1 and X2 positions. Possible values are 1,3,5,7,9,11.

• ’Calculate a base line average with sampling points from the begin-ning of an oscillogram until trigger point -’ ⇒ Number of points toconsider for calculating a baseline average. As mentionned above inthe mathematical expression of M, the baseline ’b’ value is needed. Ifthe trigger is correctly set up, then the main part of all ’pre-trigger’point should be at the base line value. Points which are close to thetrigger point has values that goes slightly away from base line value(rising edge of impulse is beginning), thus TUC will consider all pointsstarting from the point n◦2 of the oscillogram until some limit beforethe trigger point which can be keyed here.

• ’Number of oscillogram to use’⇒ when this oscillogram number hasbeen processed, the resulting histograms are plotted and in case of’automatic polezero calculation feature’, the acquisition launched byTUC stops itself and the average values of each channel are put intothe M fields on the ’On-line energy calculation parameters’ area atthe ’Parameters2/3’ sub-tab of the ’TNT cards’ main tab. When thenumber current processed oscillogram is a multiple of 100, then anintermediate histogram plot is also done.

• ’Discard thau values that are not within 50000 nanos more or less:YY%’ ⇒ the method used for calculating the M values gives somevalues that could be far away from the ’normal’ value (in case of pileup,for example, if both points are not on a ’clean’ falling tail af an impulse,or if the pre-trigger points are not at the supposed baseline or if thesampled signal is not a ’normal’ impulse). In order to avoid them forthe final plotting and average calculation of all M values, TUC willdiscard a value if it is not within [50000 nanos - YY %, 50000 nanos +YY %]. As soon as a percent value is keyed, the corresponding intervalis calculated and shown at the right side. This validation is also usedfor the histogram plotting routines.

• ’Discard impulses that doesnt goes over/under:’⇒ in order to avoidsmall impulses which doesn’t have a well-formed tail or if the chan-nel data doesn’t have an impulse (another channel has triggered) itis possible to simply compare the biggest point of an oscillogram tosome threshold value. This threshold feature for discarding oscillogramworks only for positive impulses.

When plotting thaus / Polezero histograms, for each channel, some statis-tics are shown in the legend border : number of oscillogram really used

TNT Digital Pulse Processor - Functionalities and control software 172

Page 175: TNT Functionalities

Channel calibration

(not discarded during calculation) in regards of whole oscillogram numberprocessed and min/max values found for this channel.

3.6.3 Channel calibration

The Ref-4-10 ”Channel calibration” button allows to calculate gain andoffset values used by the channels interlace function (see 3.4.1). To calibrate,

Figure 3.30: Channel calibration

the same DC current voltages have to be sent to all channels. TUC is able toremotely drive through USB the waveform generator Agilent 33220A (under

Windows only):Connect the DC generator on USB, wire it like in figure 3.13 and click

the ”Calibrate” button. TUC will automatically set the generator outputvoltage to values between minimum and maximum and perform the acquisi-tions. If this waveform generator is not connected, the user will have to seteach voltage manually and confirm at each step. The table is filled with theaverages of the oscillograms sampled points. The oscillogram are plotted sothat the user can verify if the acquisition goes well. The number of oscil-lograms and their size can be changed. Once the acquisitions are finished,

TNT Digital Pulse Processor - Functionalities and control software 173

Page 176: TNT Functionalities

Sending data over network - only energy datas

the linear regression lines are plotted (the first is always the identity func-tion). Their parameter are written if a cell in their corresponding column isselected. The user can zoom in and out with the mouse wheel and recenterthe view by clicking with the left mouse button. The interlace parameters(gain and offset values and all averages) are written in the file named ”In-terlaceParamXXXX.csv” where XXXX is the card number. A tooltip overthe param file name shows its location. The ”Save” button only recalculatesthe gain and offset values from averages sampled values and resaves the file(gain and offset values can be changed by tuning the interlace param: seefigure 3.14).

3.6.4 Sending data over network - only energy datas

The aim of this feature is to send to some ethernet destination (IP / port)all energy datas readouted by a TNT card, in addition of the possible localsaving and/or local visualization. If the Ref-4-5 ’Enable socket transfer’checkbox is selected while starting some acquisition then

• TUC will try to open some TCP/IP socket connection to some remotelistening process/program at the IP/hostname found in the ’Host-name/IP’ textfield and at port = 10000 + 4 digit card number. Ifthe ’Hostname/IP’ or if the port number is not correct, then theseerror messages will be shown:

TNT Digital Pulse Processor - Functionalities and control software 174

Page 177: TNT Functionalities

• Having several cards, each card data will be sent to same ’Host-name/IP’ but different unique port number (as a card number is aunique identifier)

• For smoothering the transfers, 2 possible local buffering are possible:

– Socket buffer size within local TCP/IP stack of the operatingsystem: ’SocketBuffer=645120’ bytes which is 10X the defaultUSB readout data chunck

– Internal java buffering ’BBuffer=645120’ bytes which is 10X thedefault USB readout data chunck.

• If the ’Gzip data!’ checkbox is selected, the USB raw data receivedby TUC from a card will be systematically gzip-compressed and thensent through the socket connection. Be aware because this data en-cryption is very costly in regards to the PC ressources and will inducesome slowing down of the USB readout process : check with some os-cilloscope the USB fullfilling level at the analogical inspection signal’12-FillingRate’ !

This feature can be usefull in order to allow some remote data mergingof several cards or in order to do a remote data saving (ex: into somediskarray, SAN, NAS, DLT drive,etc...) over a high bandwidth ethernetnetwork (Gigabit).

3.7 Performances

Keep in mind these facts:

• the theorical USB2 data bandwidth is about 480 Mbit/s = 480/8 =60 MB/s.

• but the theorical USB2 payload data transfer rate (using USB Bulktransfer type), which is the real theorical theorical transfer rate reach-able, is:13 * 512 bytes packets every 0.125 micros ⇒ about 50 MB/s.

With TNT cards and TUC, these real transfer rates has been observed :

• 25 MB/s for a single card

• 40 MB/s shared when several cards plugged and started together

One oscillogram size (in bytes)(be afraid, be very afraid!)

• header = 6 (timestamp) + 4* trigger counter (4 bytes each) = 22 bytes

TNT Digital Pulse Processor - Functionalities and control software 175

Page 178: TNT Functionalities

• for each channel asked for readout : oscillogram size * 2 bytes for eachsampled point

• several impulses can be found in a single oscillogram, depending of theoscillogram size keyed by the user

• example 1: an oscillogram size of 2000 pts with 4 channels gives antotal of 16022 bytes

– With 1000 count/s : 16022*1000 which is about 15 MB/s

– With 10000 count/s : 16022*10000 which is about 150 MB/s

• example 2: an oscillogram size of 1000000 pts with 4 channels givesan total of 8 000 022 bytes

– With 1000 count/s : 8 M *1000 which is about 8 Terra bytes/s

– With 10000 count/s : 8 M*10000 which is about 80 TB/s !

One channel energy event (in bytes) =

• 14 bytes (Timestamp 6, trigger counter 4, Energy 2, channel 2)

• With 4 channels activated, for one card, at 100 000 hit/s this willgenerate around 4*14*100 000 = 5.3 MB/s

In oscilloscope mode the amount of data to readout is grows very rapidlywith the oscillogram size, thus there is very high dead time due to data read-out are expected. While in energy mode only 14 bytes must be readoutedfor a single event. Thus is possible in energy mode, to obtain near to zeroevent loss due to the data readout process even for very high counting ratesabout 100 000 hit/s.

By high counting rates, the PC activity could have also some impact onthe acquisition: if any other activity is going on at the PC, it may take somesystem resources for these, thus being not avalaible for the USB2 readoutprocess. The efficiency of the USB readout process depends of a lot ofparameters, for example :

• From TUC’s on-line data visualization. As this feature needs someconsequent amount of the PC’s hardware ressources (CPU, memory,process time, graphics ressourcestement), it’s better not to select it(Ref-18) or to select a small refresh rate of the oscillogram’s graphics(Ref-2-7). See 3.10.

• From any other program /software which is running at the same timeon the PC

• From the quality of the PC, in particular the USB2 integration on thechipset.

TNT Digital Pulse Processor - Functionalities and control software 176

Page 179: TNT Functionalities

Generally, data visualization features has some costs in term of CPU andPC ressources charge : if too much processing power is needed in order toplot some oscillograms or histograms, then the PC could spend more timefor visualization than for USB2 readout which can induce some dead timeby high counting rates. It is possible to try to reduce the visualization needsby

• adjusting the refresh ratio for oscillograms (Ref-2-7) or for histograms(Ref-3-4)

• reducing general visualization tasks by selecting some parameter tabor by reducing the TUC windows

• increasing readout thread priority for oscillogram and/or energy events(Ref-4-8)

• disabling any on-line visualization (Ref-18)

In energy acquisition modes, the best way to ensure/measure/see thedead time due to the readout chain composed of card buffers (virtex+FX2),PC making data request and data processing at PC is to monitor the analoginspection signal

12-Ebuff fill rate

with some oscilloscope having a very long/big time unit over X scale : greaterthan 0.1 seconds and up to 10s.

At this first oscilloscope screen, we see that most of the time the fullfillinglevel increases but doesn’t reach the full level except at the end.

At his second screen, we see that on some periodical base, the bufferfullfills for some 1-2s : may be some PC visualzation update.

TNT Digital Pulse Processor - Functionalities and control software 177

Page 180: TNT Functionalities

At his third screen,an acquisition starts and then nothing is lost as thebuffers never fullfills:

Running some acquisition, changing some TUC’s parameters and in-specting this energy fullfilling level is very easy to check and see immediatelythe sensitivity (or no, if very low counting rate) of the readout process.

If the fullfill level is never reached (using some oscillocop triggering thatmake some signal capture only when the fullfill level reaches some prede-

TNT Digital Pulse Processor - Functionalities and control software 178

Page 181: TNT Functionalities

fined threshold value that is just below this level, for example), it is thenabsolutely sure that all events triggered by all activated channels (max 4channels + 4 LSE channels) has been readouted, received by the PC andsaved to disk, if this options has been chosen.

See 2.10.1 Some reflexions about dead times for complementary informa-tions on dead time and readout performances.

3.8 Multicard operating

Having several TNT cards plugged into the same USB PC host (theori-cally up to a maximum of 127 USB devices), TUC will manage each cardseparately : only one card can be selected and visualized (parameter setand/or acquisition data) at any time. The actual selected card identity isalways visible in the title of TUC’s window, and at the oscillogram’s tabor ’histogram’ title when some acquisition is running. The listboxes Ref-6,Ref-2-15 or Ref-3-3 can be used at any time in order to change the actualselected card. TUC will immediately show the new selected card parameterset and also show the next oscillogram / histogram data from this card asit become available during an acquisition.

Before starting a multicard acquisition, it will be probably necessary toadjust successively the parameters of all card, except the ’Acquisition mode’that will be the same for all cards when ”Start all cards” is pressed.

By default, there is no direct correlation between differents card ’TimeS-tamp’:

• Each card will function separately : it has its own clock in orderto sample data, acquisition data will be readouted by using its owntimestamp counter values.

• Each card handle his own timestamp counter separately (start/stop).Acquisition data will be saved into separate files on disk and whenlooking into these files, it is not possible to have a fine correlationbetween them : the timestamp counter is started when a card receivethe order to start an acquisition of a specific mode from the USB host.As this order is not sent in a simultaneous way to all cards but in asuccessive order (order of cards as they appear in the card numberlistboxes) the latency between the start of first card and last card isnot precisely known : probably some ms.

In order to handle several cards as a whole coherent acquisition system,to gain more time and logical correlation between all cards it is possible toactivate & use these features:

• common ADC clock

TNT Digital Pulse Processor - Functionalities and control software 179

Page 182: TNT Functionalities

• common time reference (external or internal)

• controled start sequence latency

• common triggering

• controled readout REN-IN/OUT (oscilloscope mode)

• DTUC

• USB card ordering

• Ignore card feature

• Daisy chain of inspection lines

Detailed explication of these features follows:

• common ADC clock ⇒ a given card will output the clock signal to adedicated NIM output and LVDS output n1 at 50 Mhz. This signalcan be used by all other card as source signal for their DDS in orderto construct the clock. This should guarantee that even if all cardsdoesn’t start at the same moments, they will use the same clock andsample data together at the same moments. As there will be always ashift between timestamps of different cards, this shift should be regularand constant. See 2.7, 2.2.1.1 and 3.3.1.

• common time reference ⇒ using the LSE feature Ref-11-3, the idea isto distribute the same synchronisation tops into each running card ina parallel way from each other. Assuming that each card will receiveat his NIM input X the same signal, if this reference is periodical, itshould be possible to correlate each card data flow together. An eventdata file could be similar as

This feature could enable some offline data treatment in order to re-synchronize data file together if :

TNT Digital Pulse Processor - Functionalities and control software 180

Page 183: TNT Functionalities

– Cable connection from NIM signal source to each card is alwaysthe same (cable length and characteristics) and are well known

– LSE events are sent to all cards only when they all have receivetheir acquisition start. This could enable a ’1 to 1’ correspon-dance between data files of different cards : all first occurrenceof event 5 correspond to the same absolute time t1, all secondoccurrence of event 5 correspond to the absolute time t2, etc...

• controled start sequence latency ⇒ all cards are setup in ’acq startslave’ and the last one in the Ref-3 listboxes is ’Acq start master’.’Start order is sent in sequential order of cards in the Ref-3 listboxes.When each card receive the acquisition start order it will be armedbut wait for a signal coming from the ’master’ in order to really startthe timestamp counter, LSE feature and all other acquisition items.See 3.3.1. LVDS cabling is used at cards backpanels.

• common triggering ⇒ often used in detector scanning tasks where theinternal trigger of one card’s channel should triggers oscillogram cap-ture of every other card’s channels which are setup to trigger ’Externalusing NIM input x’.

• controled readout REN-IN/OUT (oscilloscope mode)⇒ in oscilloscopemode, even if a group of card has a common triggering mechanism, ieall cards triggers more or less simultaneously, it is possible that onecard has finished to readout his oscillogram data and is then readyto trigger again while some others are not yet finished/ready !! So ifanother trigger signal occurs yet, the different oscillogram data flowsfrom each cards will not be synchronized (same time window of oscil-logram capture). Some feature is needed in order to make that a cardhaving finished to readout an oscillogram must wait until ALL othercard in same acquisition system are at same point : this is the doneby using the REN-OUT busy signal. See 2.2.1.1.

• USB card ordering ⇒ For personal convenience or in order to respectsome ’Acq start master/slave’ configuration, this feature allow USBre-ordering without any physical unplugg/replugg act.

• Ignore card feature ⇒ For temporary setup facilities, it can be usefullto work only with some sub-part of the cards, while some others shouldbe ignored by TUC : this feature has same effect than a real USBunplugg act but without doing any physical intervention on USb cable.

• Daisy chain of inspection lines ⇒ By cabling the same inspection lineaf all cards together (daisy chain) and then to some oscilloscope deviceit is possible to have access to each cards inspection signal : simplyselect the ’Active’ checkbox at the right of the inspection signal you

TNT Digital Pulse Processor - Functionalities and control software 181

Page 184: TNT Functionalities

want to see and unselect it for all other cards (using some DTUCscreen for example).

• DTUC ⇒ Having several cards to handle (ex 12 cards !) , it can beusefull

– to dispatch the total number of cards over several acquisition PCin order to have better/maximum USB performance (dependingof counting rates expected during experience) or storage space.Of course, having very low readout needs (transfer rates), it isalways possible to plugg all cards into a single PC by addingsome USB2 hubs, if necessary.

∗ it is possible to install TUC on each PC, an operate in thisway each sub-group separately. Through PC remote access(windows RDP, VNC, PC anywhere,...), it is possible to op-erate the whole from some unique console PC. But this wayhas some lack of coherence and coordination..

∗ It is necessary to start/stop the acquisition within each TUC’sinstance

– to have some complementary/other cards view as the one pro-posed by TUC which is one single card at every time. Instead ofviewing whole parameter set of one card, it could be fine to havesome transversal view of a specific feature but for ALL cards.Exemple : have all channel triggering information or all card in-pection lines setup at a single glance. And it would be fine tohave some mechanism for copying one channel/card parameter toall other card/channels.

– to be able to have some overall run control view / informations :transfer rates, byte counters, acquisition status, etc...

– to be able to see several cards acquisition data together (oscillo-gram and/or histograms) and not only one at a time.

– to be able to copy whole parameter set from one card into anotherone (s), to save all cards parameter sets together, to load differentsparameters sets together..

That’s why during the year 2006 the development of DTUC softwarehas started : Distributed TUC !

3.9 Configuration files

Different configuration files are used by TUC:

• tuc.properties, tuc en.properties files, tuc sv.properties, in TUC VX.jar,internal subdirectory < tuc >: contain TUC specific parameters, text

TNT Digital Pulse Processor - Functionalities and control software 182

Page 185: TNT Functionalities

messages and strings used by the GUI. Some of these items can bemodified in order to customize TUC to specific needs.

• api.properties file, in \lib\API TNT.jar, internal subdirectory < usbtnt >:contain some crucial informations related to each manufactured card(card type, number of channels, size of whole parameter set,etc) andlow level USB communication parameters. This file should not bemodified by any user, except for adding/declaring a new card numberthat is missing in this file.

• user.properties files, in same directory as TUC VX.jar : created au-tomatically by TUC when leaving. Contents user preferences (colors,language, data dir,...)

• cardOrdering.properties file, in current directory: used by USB cardordering feature

Caution: when modifying the tuc\tuc.properties in the TUC VX.jaror the usbtnt\api.properties : when you put gain the modified file in theJAR file, note that you must include the relative path indication in order tooverwrite effectively the original file.

Accessible/modifyable options within tuc.properties file are :

• Every parameter is always stored by using some KEY=VALUEsheme: KEY is some string word at the very beginning of a lineand ended when the ’=’ is encountered. Starting after this ’=’character should be the parameter value found. Some featuresimply search if a given key is found or not and ignore any valuekeyed after the equal sign.

• key ’DEBUG=’: if any different value than ’yes’ is found, TUCwill create ’TNT.out’ and ’TNT.err’ files (just at side of TUC’smain ZIP file) where some log’s informations, messages or er-ror values can be found. These files are overwritten each timeTUC is launched. Thus having the debug mode activated (DE-BUG=’yes’), all of these messages are immediatly printed in theconsole/DOS window.

• key ’DATAFILE MAXSIZE=’: acquisition approximative datamaximum filesize (oscillogram and events files), in MegaBytes.Default is 100.

• key ’VIEW TRANSFER RATES=’: if transfer rates unit (at ’op-tion tab’) is ’MB/s’, then having a ’yes’ value enable that thetransfer rate is printed regularly (every 100 driver call) at consolewindow (only for selected card)

TNT Digital Pulse Processor - Functionalities and control software 183

Page 186: TNT Functionalities

• key ’BACKUP HISTO TMP IT NUMBER=’: during an acqui-sition , TUC will make some temporay histogram backup, thusavoiding to loose everything if some PC crash occurs. If this keyis found, TUC will enable this feature. Key value=number ofdrivers calls before making backup. Default is 100 drivers calls.

• key ’EVENT FILE FORMAT SEPARATOR=’: this optional keywill be used when choosing to save events in ascii format whilestarting some acquisition with energy mode. TUC will considerthe very first character found into th evalue of this key.Defaultcharacter used is SPACE one and this key is commented with’@’.

• key ’EVENT FILE FORMAT HEADER=’: this optional key willbe used when choosing to save events in ascii format while start-ing some acquisition with energy mode. TUC use this key valueas very first line of the first event file of every card. If this key isnot found, then default header line isChannel Time@stamp Trigger n◦ Energy(0-32768)

• (CAEN & Diffential mode inputs only) key ’DFLT DIFFERENTIAL MODE=’:this optional key can be used for putting default values by TUCwhen some card is used that has only differential mode inputs. Itis then dumb to let always TUC select ’common mode’ for eachinput. For ’normal’ TNT2 cards that have common mode inputs,this key is commented.

Accessible/modifyable options within api.properties file are :

• (Windows only) key ’MAX NUMBER CARDS=’: when detect-ing TNT cards on the USB bus, TUC will try to find up to this’key value’ number of cards. This number should always exceedthe maximum number of TNT cards which are available to pluggon a single PC. Default is 21.

• (Windows only) key ’VEND AX BC=’: some USB2 controller atthe host/PC side have a slightly behaviour in regards of datarequest made to a TNT card that doesn’t trigger. Main partof PC will cancel such pending requests when receiving a ’short’packet’ from the card. If TUC seem to hang when pressing ’Stop’button with a card that doesn’t trigger, then changing this keyvalue to something else than ’yes’ could help (instead of a ’shortpacket’ TUC will try ’Abort’ and ’Reset’ pipe)

• Having a new card with number XXXX that is not yet referencedinto this file, it is absolutely necessary to add a key ’CARD TYPE XXXX=’

TNT Digital Pulse Processor - Functionalities and control software 184

Page 187: TNT Functionalities

with a value between Tnt2, Tnt2-R, Tnt2-D, Psg, Tnt1, or Tnt1-N. Cards manufactured by CAEN company and that have a cardnumber 0120 ≤ XXXX ≤ 0999 are automatically detected as a’Tnt2’ card type.

3.10 Tricks and tips

A shortlist of these tricks and tips:

• Which USB speed do I have?

• String descriptors stored within a card

• One unique card identifier!

• How much cards?

• When/where do I really communicate with a card?

• Different parameter set backups when starting an acquisition

• Pigs...

• Readout performance & data vizualisation

• Ignore a card

• Multicard, inspection line daisy chain

• Log and error files

• Basics about card communications

• Distinguish a card from other USB devices

• USB VID and PID

• NIM input potentiometers

• LED’s

• Which USB speed do I have on my PC? USB1 or USB2 ? Amongall possible ways to answer this, if a TNT is by hand, plugg itand launch TUC. If it is found by TUC, then the USB type isshown at the upper part of TUC’s screen (also different card’sdescriptors):

TNT Digital Pulse Processor - Functionalities and control software 185

Page 188: TNT Functionalities

• A TNT card contains 4 different string descriptors which areshown within TUC (see picture above)

– In the FX2 USB chip

∗ Some description text for general purpose

∗ Some special 4 digits description text which should beunique: the card number

– In the FPGA’s VHDL code

∗ Some description text stored in the Spartan FPGA

∗ Some description text stored in the Virtex2 FPGA

• TUC use the 4-digits TNT card number in order to retrieve someimportant informations about each card from the ’api.properties’configuration file which is stored in API TNT.jar (Sampling pe-riod, channel number,parameter set informations,...). This uniquecard number is used in order to know the card type of a given one: TNT1, TNT1-N, PSG, TNT2, TNT2-R or TNT2-D.The card number is stored in the FX2 software under the USB’String descriptor’ with language code ’2’.

• The theorical maximum number of TNT cards one can plugg ona single PC is 127.

• TUC initiate real USB communications to the card only whenusing

– ’Detect TNT cards on BUS’ Ref-5 button

– ’Load parameters’ Ref-13 button

– ’Ask card’ Ref-15 button

– ’Update card’ Ref-16 button

– ’Update cards’ Ref-17 button

– ’Start all / stop all’ Ref-19 button

– ’M auto search’ Ref-11-1 button

– special ’On board VHDL’ feature at the ’Options’ tab (’VHDLflash upload’ and ’download’, ’Reboot 3 EEPROMs’ and ’Re-boot flash EEPROM’).

TNT Digital Pulse Processor - Functionalities and control software 186

Page 189: TNT Functionalities

• Automatic backup of parameter set : everytime an acquisitionwith savefile feature is launched 2 backup files are automicallycreated in the backup directory by TUC:

– CardXXXX log.txt : an ascii log file with all parametersvalues used by the acquisition and the start/stop time areadded at the end of the file (it is never overwritten). A sim-ilar file is also created when the ’Snapshot’ feature is used :Card0012 Snap1 log.txt

– CardXXXX.Tntparam : whole parameter set values in binaryform usable for further card or GUI loading (button ’Loadparameters...’).

• Pig’s customization: simply put some other gifs or jpeg files inthe same directory as the main ZIP file

• Data vizualisation is beautiful but it has a cost regarding thetransfer rate ! So use only in order to setup correctly the parame-ters values and desactivate it if you don’t really need it. In orderto maximize the USB2 transfer rates and to minimize data treat-ment time, thus possible event loss periods, there is some thingsthat can be done :

– Oscillogram: choose some bigger value in the Ref-2-7 listbox(ex : show one oscillogram every 1000 ones readouted)

– Close all non used other applications (ex : antivirus soft-wares) , minimize TUC main screen, if no supervision isneeded

– Histogram: if the counting rate of the card is high enough(i.e time between refreshment is not too long), try to keysome ’100’ or ’1000’ values in the Ref-3-4 field ’USB packetsrefresh rate’

– Increase the priority of ’Oscillogram’ readout process and /or the priority of ’Energy’ readout process

– Activate the ’Boost Energy readout feature’ with 2, 3 or 4value.

– Increase the ’Construct with 1 USB packet every’=1 value.CAUTIOUS : this means that the resulting histogram doesn’tcontain ALL data really received by the PC =¿ TUC’s statsand loss event percent calculation will not consider this ’miss-ing’ data thus these numbers will not reflect the real wholedata received and saved.

TNT Digital Pulse Processor - Functionalities and control software 187

Page 190: TNT Functionalities

• Ignore card feature: adding 4 digits cardnumber(s) as argument(s)when launching TUC will activate the ignore card feature. Duringthe USB detection phase (TUC’s startup and each time button’Detect TNT card on bus’ Ref-5 is used) all cards whose card-numbers has been given will be totally ignored by TUC, as ifthey weren’t plugged on the USB bus. Example

java -Xms128m -Xmx256m -jar TUC VX.jar 1005 2056 7412

Cards with number 1005, 2056 or 7412 will not appear in the 3cards lists Ref-6, Ref-3-3 and Ref-2-15 if they are found on theUSB bus.

• The ability to enable / disable each of the inspection line givessome interessant feature in a multicard context : by chaining’Log1’ output of each card together and at the end into an oscil-loscope, it is possible to inspect the ’Log1’ signal of a precise cardby simply disabling this output over all other cards.

• Log and error files: 2 different mechanism are actually in usewithin TUC & associated usbtnt API :

– By keying the key ”DEBUG=anythingElseThan’yes’” withinthe tuc.properties file in the main jar file, everytime TUC islaunched, there will be 2 files automatically generated :TNT.out⇒ contains various debugging informations for soft-ware development teamTNT.err ⇒ contains java error and low level messagesIn case of a problem, don’t forget to immediately secure thesefiles (the next execution of the TUC software will overwritethe files) in order to send them to our technical team...See3.9.

– By using the java Logging feature that is build within javasince 1.4 version. Information level is INFO by default. Inorder to change any properties, please refer to the loggingAPI documentation. In order to change the level of the loggerobject used, edit the file ’logging.properties’ in ’Java runtimeengine installation directory\lib. At the end of the file, adda line:usbtnt.level = XYZwith ’XYZ’=SEVERE, WARNING, INFO, CONFIG, FINE,FINER, FINESTin order to customize the level of the message being showed/ printed within the console/terminal/DOS window.

TNT Digital Pulse Processor - Functionalities and control software 188

Page 191: TNT Functionalities

• Basics about card communications : the general principle aboutcontrolling one card board is : viewing /setting or loading froma file the parameters values AND THEN starting the acquisitionwith or without viewing the readout data on screen. If you wantto modify some parameter after an acquisition start : stop first theongoing process, modify whatever you want, and restart again!Make sure you quit the TUC software before unplugging the TNTboard(s) !

• Distinguish a card from other USB devices: in order to searchand find TNT cards on the USB bus, TUC uses this features :

– Linux/Unix system⇒USB vendor Id and Product Id (VID/PID)

– Windows OS’s ⇒ success or failure of some driver call whenusing this specific string ’ez-usb-n’ with n within [0, X] andX= key value of ’MAX NUMBER CARDS=’ in the ’api.properties’configuration file (See 3.9 Configuration files). The driver isloaded and associated by Windows using the USB VID andPID given by any card.

• USB VID and PID : the USB identifiers Vendor ID & Product IDare USB general identifiers that all USB device should be able todeliver at requests from the USB controler (PC). These identifiersare used in order to recognize which device is plugged and toknow which driver must be used by the PC, if necessary. Theyare hard coded in the TNT card (FX2 chip) and in the windowsTNT driver. They are not registered at the USB organisation. Itmeans that you may encounter some commercial USB peripheral(mouse, camera, scanner,..) carrying the same id’s : in this case,the TNT driver and the other peripheral driver will conflict aboutclaiming the same id’s, thus disabling both peripherals. If thishappens, please contact IPHC TNT team in order to get a newdriver with new id’s. Actual values used are:

– VID : 0x0999

– PID : 0x8888

• NIM input potentiometers : each of the 4 NIM input accept log-ical input signal that can have positive (TTL) or negative (Nim)voltage.

TNT Digital Pulse Processor - Functionalities and control software 189

Page 192: TNT Functionalities

Some jumper must be put in a particular position in order tochange the default setting (NIM : pin 2-3 = 2 lower pins, see greenbracket on image) to TTL settings : connect pin 1-2 together (2upper pins). By putting some NIM (or TTL) test signal intoeach input and by selecting ’5:8-Nim in positive-1:4’ in a logicalinspection line with TUC, the positive card transformed signalshould be seen at oscilloscope screen. If not, adjust the voltagethreshold by using the potentiometer : left (red on image) forNIM, right (yellow on image) for TTL slightly until some is seen.Some potentiometer adjustment must also be done if some re-bounds are detected on a particular NIM input (exmple : doubleor triple triggering when using external trigger over NIM inputs): the voltage threshold is may be too low/high.

• LED’s : 4 LED’s can be be mounted on TNT2 (inside the card)and TNT2-D card (at front panel) depending on manufacturerprocess. These LED’s can be used in 2 cases :

– when powering or resetting a card : if the virtex has cor-rectly booted (complete sequence), then the 4 LED’s shouldblink together a first time and then stay alight until TUC isstarted.

TNT Digital Pulse Processor - Functionalities and control software 190

Page 193: TNT Functionalities

– during an energy acquisition : each time some LED is alight,it means that the energy readout buffer for this channel isfull! Thus there is some high probability that events of thischannel will be/has been lost due to this fullfilling.

3.11 Future

• Distributed TUC acquisition system is under development (0.1Betaversion is available). See 3.8.

• TUC evolution / enhancements

– Channels histos: possibility to visualize any possible channelnumber and not only channels 1 to 4 (have some bitmask forchannel numbers selected to consider and plot)

– Timing: construct & visualize also time histograms. Fora given channel number, calculate time difference betweeneach event received and last LSE or last other given channelnumber

– Fitting and calibrating, histogram in keV,MeV...

– Automatized acquisitions with timeout and/or statistics goal,load other parameters sets and restart again, and again, andagain

TNT Digital Pulse Processor - Functionalities and control software 191

Page 194: TNT Functionalities

Chapter 4

Working with card(s)

4.1 Getting Started

Some kind of checklist in order to avoid dumb situations could be:

• Basic trigger

• Offset & gain

• Look at general signal form

• (Energy)Polezero

• Trigger setup

• Energy specific parameters

These basic steps could be followed when starting some acquisition

• Basic trigger : aim is to get some data out of the card in order tobe able to start basic card setup. Finer trigger setup could/willbe done later. For positive pulses, TUC’s default values shouldbe able to have some trigger fired by the card. If the pulses arenegatives, key a minus sign in the ’Threshold’ field and unselect’+slope’ of the trigger GUI part Ref-10-2.

– Select ’Force trigger’ checkbox if necessary just in order tosee raw signals on TUC’s oscillogram screen

• Offset tuning : purpose is to put the baseline at the top (in case ofnegative impulses) or at the bottom (in case of positive impulses)in order to use maximum ADC range in regards of the maximumpulse height that can be encountered. Check that 99% of thepulses fits in the ADC range (except of very big cosmic pulses...)

192

Page 195: TNT Functionalities

• Verify that signal/pulses goes never out of the ADC range. Usethe [0-5Mev] analogical gain if necesary.

• Look at general signal form. View oscillograms in order to analyse/ search for strange preamplifiers distortions (oscillations) thatcould affect further triggering setup or PZ automatic searches :

– just before the pulse begins or at very beginning of pulse

– at end of rising edge (falling edge)

• Pole zero: proceed automatic PZ searches channel after chan-nel. By clicking ’PZ search’, TUC will select and calculate PZwithin each oscillogram and for every channel. If all channels hasown triggering activated, for a given oscillogram catched by thecard, it is highly probable that the calculation will be wrong /non-applicable for the 3 channels whose triggers was not firing(in ’Oscilloscop’ mode, the card catch all channels when any ofthe selected channel triggers). In order to proceed with betterstatistics, it is recommended to proceed channel after channel:

– Disable all individual triggers except for the considered chan-nel. At the end of the automatic PZ search, note the valuefound as it can be overwritten by the next PZ search

– CAUTIOUS : be sure to readout ’real sampled data’ for theconsidered channel

– Avoid un-necessary huge oscillogram size (more than 50 000pts) if the 2 sampled points taken by TUC for the polezerocalculation are within first 2000 points, for example. Big/hugeoscillogram size means lot more time to readout each oscillo-gram. And default values are : histogram refreshment every100 oscillogram received, 1000 oscillogram to use for the en-tire automatic polezero calculation feature.

– Aware of pre-trigger point overall look. PZ feature needsto calculate for each oscillogram the baseline value by cal-culating some averaging of the sampled point going on fromthe beginning of the oscillogram to the ’Trigger point’ minusX. Check if the base line is stable enough for the averagingwithin the considered oscillogram part : look at TUC’s ’Op-tions tab, ”Calculate a base line average with sampling pointsfrom the beginning of an oscillogram until trigger point - x”and change (increase) if necessary

– Look at overall flat top and trapezoid form:

∗ trapezoid should look like a trapezoid ...

TNT Digital Pulse Processor - Functionalities and control software 193

Page 196: TNT Functionalities

∗ flat top should be flat as possible

∗ return of trapezoid to base line after flat top should notcross it but go /return close as possible to the base line,and quick as possible

Of course these are also small hints, best is to do someexhaustive testing with resolution calculation and changingstep by step values...

– Check if the peak is better when

∗ using some other parameters values. Try to play withadvanced parameters until the PZ histo has correct stats.Example : some peak with majority of values in the 30-70 micros range, or ’Calculate an average of f(X1) andf(X2) with a neighbourhood of X ’ points

∗ Moving away / getting closer the 2 points TUC will takewithin each oscillogram

• Trigger setup

– With oscilloscope mode : aim is to trigger only on ’real’pulses and to get as much as possible the lowest pulses butwithout triggering in noise signals

∗ Proceed to some oscilloscope acquisition by viewing os-cillograms and try to see / verify that cards trigger onlyon ’real’ pulses

∗ Proceed to some oscilloscope acquisition with saving datas.Stop to acquire and browse the generated oscillogram file: how much time the cards triggers on ’false’ / ’wrong’pulses or noise signals ?

– With energy mode

∗ Proceed to some energy acquisition and look at the his-tograms : first datas should be as low as possible

∗ If card triggers badly (often in noise) : lot of ’zero’ orsmall values. If one triggers in the noise: no real pulse isfound, trapezoid is as baseline, very small / zero value/negative values

– Use Inpection lines & ability to view TFA & CFD & Trape-zoid in oscilloscope mode

• E specific parameters

– Digital gain : in order to use ≥ 50 % of the available energycalculation range, try to add some digital gain in order to

TNT Digital Pulse Processor - Functionalities and control software 194

Page 197: TNT Functionalities

cover the maximum range of 32768 channels without loosingtoo much gain/resolution.

– k and m, shift and width

∗ Increasing k & m should be better but has a cost in re-gards of the shaping times : more events will be detectedas pileups.

∗ Need to check by doing some exhaustive testing and en-ergy resolution calculation

∗ Talk with some experienced users and practice TNT

∗ CFD trigger provides theorically better timing

– Use some known source (ex Cobalt60). Take screen or his-togram snapshot in order to have some peak reference. Changeonly one parameter and compare with initial histogram pic-ture: are the 2 cobalt peaks better or not ?

4.2 Known problems and tips

4.2.1 Virtex doesn’t boot

Some times, TUC seems to ’freeze’ / to block when starting it (orhaving pushed some ’Reboot’ button at the option tab and it happenjust after powering on the card. If LED’s are not aligth, it means thatthe Virtex hasn’t succeeded to boot correctly! It will not respond toany command received by the PC. When starting TUC, the PC willalways ask to the actual card to readout all the set of parameters (whichshould be zero as card has just been poweron),but as Virtex doesn’trespond, TUC will stay blocked while waiting response to the orderend through USB.

Solution:

• Windows : use ’Control Panel’ application in order to send some’short packet signal to the FX2 USB chip.

TNT Digital Pulse Processor - Functionalities and control software 195

Page 198: TNT Functionalities

Pile up through noisy Triggering

Key ’BC’ in the ’Req’ field and press ’Vend Req’ button. FX2will then send some ’empty’ USB data packet to the PC which iswaiting for any data packet. As soon as TUC receive this emptypacket plus prior data received from the spartan, it will show someerror message (received less bytes than expected, as only spartanhas sent whole parameter set) and quit properly.

• Linux : try to establish some parallel USB communication to thecard and send a USB control transfer command with Requestcode=0xBC, value=0, Index=0, length=1, Dir=IN, Vendor re-quest type. TUC should then quit properly (it receive less bytesthan expected, as only spartan has sent whole parameter set.

• CTRL+C in shell/dos windows if no other choice....

• Wait some ten minutes or more. Power off and power on immedi-ately again : the LED’s should now aligth, meaning that Virtexhas boot properly (99% of time).

• Once Virtex has booted properly, it should not disfunction againuntil next power off/on...

4.2.2 Pile up through noisy Triggering

Some times, some very bad preamplifier circuit or simply some noisysignal can induce some intempestive double or third triggering justshortly after a first valid and correct trigger over a channel.

TNT Digital Pulse Processor - Functionalities and control software 196

Page 199: TNT Functionalities

Pile up through noisy Triggering

Second picture is a zoom of the first one : the analog pulse (orange) iscorrectly processed by a TNT card which delivers a well-formed trape-zoidal shape (blue), but the card triggers 2 additional times shortlyafter the first valid one (fuschia). In this case, as the threshold trig-ger has been setup at some very low level, some noisy signal at thevery beginning of the pulse tail decrease zone induce the 2th and 3thtriggering.

In order to understand how the trigger operates, it is possible tofirst operate some oscilloscope acquisition by choosing to readout andto see not only the original sampled data but also the TFA signal(second one in the list) which is used by both triggers (digital&CFD).This TFA signal has 2 visible peaks close from each other : the firstwhich is bigger is related to the first valid trigger, the smallest secondone is related to the noisy tail beginning and induces successive noisytriggering.

Main issues of this problem could be:

TNT Digital Pulse Processor - Functionalities and control software 197

Page 200: TNT Functionalities

TNT2D with LSE : events missing

• try to increase the Integration constant (up to 31) : see the effectby running oscilloscope mode and looking at TUC’s screen or se-lect some 8-CFD Ch1 analogical inspection line. The TFA signalwill may be change iin this way : instead of having 2 peaks closetogether, they will get closer and closer as you increase the inte-gration constant and then hopefully they sumup into one singlepeak which should be bigger...

• if it doesn’t help, increase the threshold level

• play with other digital/cfd parameters and look at the TFA os-cillogram form.

Note that if the card detect ’false’ pileup’s because noise let fireagain the trigger, but the trapezoid is well formed (more or less), youcan change default pileup behaviour rejection(parameters tab n2 : Pileup reject: ’No’ instead of ’yes’). Then when 2 triggers appears closelythey will be marqued as ’pileup’ so the online histogram constructed byTUC will take only non pileup events BUT you will get in the eventsbinary file ALL events EVEN pileup’s : these pileups will have somespecial bit raised in the channel number field (less significant byte, fifthbit b4) : channel 1/2/3/4 will ’appears’ as 17,18,19,20.

4.2.3 TNT2D with LSE : events missing

From time to time and only for TNT2D cards, when using the LSE fea-ture Ref-11-3, some of the events are missing in the events files. Theexternal signal has been seen /detected by the card because the ’trig-ger’(ie the trigger field in the multiparametric tuple readouted whichcontain an occurence counter in case of LSE) counter is incrementedas deduced when examining following LSE in event file but the carddoesn’t achieve to readout it correctly. This failure is quiet under in-vestigation at our VHDL experts pool...

4.2.4 Linux:’Card doesn’t seems to trigg...?’

Card operate normally and correctly, then having some acquisitionstarted and stopped, leaving and restarting TUC, it stay blocked inthe startup phase, like in the case of Virtex boot failure but with othermessaging in the console window. The system doesn’t have a determin-istic behaviour : in order to reproduce this basic USB communicationfailure it can be necessary to launch & quit TUC a lot of times (5-20)before it happen at TUC’s starting up. The output message appearsafter 10s (or 100s depending of which libjsub.so has been used):

TNT Digital Pulse Processor - Functionalities and control software 198

Page 201: TNT Functionalities

VHDL flash upload hangs

TntCardLinux—getAcqData—Card XXXX, data type Z, qty wanted:YYYYY bytes, it doesn’t seem’s to trigg...?

Analysis: problem cames from linux USB communication stackSolution : unplugg and replugg the card, that’s all!

4.2.5 VHDL flash upload hangs

When trying to upload some ’bin’ file into the flash EEPROM mem-ory (see ’Options tab’ 3.6 ), sometime TUC hangs during the uploadprocess :

Figure 4.1: Flash upload process freeze during file upload!

In this case, unplugg the card this will cause some error messagefrom TUC. Quit, reboot the card and try again and again. You canalso try to upload while the ’card is empty’ (immediately after a cardreboot) : it seems to works better then. After some try (2-4), youshould normally see something like :

TNT Digital Pulse Processor - Functionalities and control software 199

Page 202: TNT Functionalities

VHDL flash upload hangs

Then, click on ’Reboot flash EEPROM’ and then go to the ’Tnt cards’tab = first TUC screen , you should then see some change in the ’VHDLVersion description text’ on the upper screen part:

TNT Digital Pulse Processor - Functionalities and control software 200

Page 203: TNT Functionalities

How to apply some Gate/Delay on external trigger over NIM in’s

4.2.6 How to apply some Gate/Delay on external triggerover NIM in’s

Tnt cards can consider some external trigger signal for a given channel(1 to 4) : see 2.3.3 Extern trigger for more details.

For each card channel, it is possible to use one of the 4 NIM inputs,but for this specific trigger feature, the card take the original signalBEFORE any gate /delay calculation specified by the user !

For example, if some external trigger is feeded over NIM input 1.Even, if some gate /delay is keyed with TUC for the NIM input 1(3.3.3), only the original NIM signal will be considered.

But one can use the ’Logical inspection lines’ (see 2.4) feature ofa TNT card in order to construct some gated and/or delayed externalNIM signal:

• Connect the original external trigger to consider over NIM input1

• Key some custom gate /delay over NIM input 1

• Select ’1-Nim in gated positive-1’ for the logical inspection ’Log.insp. 1’

• As the logical inspection line output signal are TTL, use some’LEVEL ADAPTER’ NIMTTL conversion module (example : LA8000from ORTEC) in order to convert this signal into normal negativeNIM standart.

• Connect this gated and/or delayed signal again into NIM input2.

• Now this NIM input 2 signal can be used for the ’external trig-gering’ feature

TNT Digital Pulse Processor - Functionalities and control software 201

Page 204: TNT Functionalities

Bibliography

[1] Virtex II FPGA, www.xilinx.com/virtex2

[2] FX2 USB Controller, www.cypress.com

[3] Documentation of the Cypress USB2 development kit CY3681,www.cypress.com

[4] USB in a Nutshell, http://www.beyondlogic.org

[5] AD6645 Flash Analog to Digital Converter, www.analog.com

[6] AD9852 Digital Synthesizer, http://www.analog.com/en/

prod/0,,770_843_AD9852,00.html

[7] Martin Lauer, Digital Signal Processing for segmented HPGe de-tectors. Preprocessing Algorithms and Pulse Shape Analysis, PhDthesis, Heidelberg, 2004

[8] Valentin T. Jordanov and Glenn F. Knoll, Digital synthesisof pulse shapes in real time for high resolution radiation spec-troscopy,Nucl. Instr. Meth. A345 (1994), 337-345

[9] A. Georgiev and W. Gast, Digital pulse processing in high res-olution, high throughput, gamma-ray spectroscopy,IEEE Trans.Nucl. Sci. Vol. NS-40 (1993) 770-779

[10] Benjamin Carniol, Digital ...,PhD thesis, Heidelberg, 200x

[11] Strahinja Lukic, Mesure de sections efficaces de reactions (n,xn)par spectroscopie prompte aupres d’un faisceau a tres haut fluxinstantane,PhD thesis, Strasbourg, 2004

[12] Lucian Mihailescu, Principles and methods for A ray trackingwith large volume germanium detectors,PhD thesis, Bonn, 2000

[13] Garcia, A spcifier

202

Page 205: TNT Functionalities

BIBLIOGRAPHY

[14] P. Medina et al. TNT Digital Pulse Processor IEEE Real TimeConference 2005, Stockholm

[15] IPHC internal TNT documentation CardUSBCommunica-tion.doc

TNT Digital Pulse Processor - Functionalities and control software 203

Page 206: TNT Functionalities

Index

gate-delay, 48

204