TracePlayer
TracePlayer package#
The TracePlayer package contains tools to play with AGATA traces. The available tools are:
- PlotADLBases: allow to display AGATA traces written in ADL like format in all the volume of the detector
Download and Installation#
Prerequisite: ROOT
From your favorite software repository:
mkdir traceplayer
cd traceplayer
git clone https://gitlab.in2p3.fr/ip2igamma/tools/dsp/traceplayer.git sources
mkdir build install
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install ../sources
make -jN install
cd ..
source dataset_generator#
PlotADLBases#
Lets assume you have two different basis written in ADL format, like:
dudouet@:$ ll /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A0*.dat
-rw-r--r--@ 1 dudouet staff 848040144 16 jui 2022 /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat
-rw-r--r--@ 1 dudouet staff 848040144 25 mar 2021 /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_B007.dat
Single basis#
The PlotADLBases executable allows to display one or more basis in a dedicated view. Let's start with a single basis:
The basis will be first loaded in memory, and anayzed to map the barycenters of each segment:
Loading file: /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat
Total 808 Mo |====================>| 100.00% [ 856 Mo/s, time left: 0h00min00s ]Real time 0:00:00, CP time 0.960
Segment mapping:
Seg 00: N voxels= 797 -> barycenter: X,Y,Z = [18 , 0 , 8 ] mm
Seg 01: N voxels= 752 -> barycenter: X,Y,Z = [24 , 0 , 18] mm
Seg 02: N voxels= 1140 -> barycenter: X,Y,Z = [24 , 0 , 30] mm
Seg 03: N voxels= 1580 -> barycenter: X,Y,Z = [24 , 0 , 48] mm
Seg 04: N voxels= 1734 -> barycenter: X,Y,Z = [26 , 0 , 64] mm
Seg 05: N voxels= 1809 -> barycenter: X,Y,Z = [28 , 0 , 82] mm
Seg 06: N voxels= 827 -> barycenter: X,Y,Z = [8 , 16 , 8 ] mm
Seg 07: N voxels= 800 -> barycenter: X,Y,Z = [10 , 20 , 18] mm
Seg 08: N voxels= 1231 -> barycenter: X,Y,Z = [10 , 20 , 32] mm
Seg 09: N voxels= 1713 -> barycenter: X,Y,Z = [12 , 22 , 48] mm
Seg 10: N voxels= 1866 -> barycenter: X,Y,Z = [12 , 22 , 66] mm
Seg 11: N voxels= 1943 -> barycenter: X,Y,Z = [12 , 24 , 82] mm
Seg 12: N voxels= 826 -> barycenter: X,Y,Z = [-10, 14 , 8 ] mm
Seg 13: N voxels= 794 -> barycenter: X,Y,Z = [-14, 18 , 18] mm
Seg 14: N voxels= 1213 -> barycenter: X,Y,Z = [-14, 18 , 32] mm
Seg 15: N voxels= 1679 -> barycenter: X,Y,Z = [-14, 20 , 48] mm
Seg 16: N voxels= 1830 -> barycenter: X,Y,Z = [-14, 20 , 64] mm
Seg 17: N voxels= 1922 -> barycenter: X,Y,Z = [-16, 22 , 82] mm
Seg 18: N voxels= 743 -> barycenter: X,Y,Z = [-18, -2 , 8 ] mm
Seg 19: N voxels= 665 -> barycenter: X,Y,Z = [-24, -2 , 18] mm
Seg 20: N voxels= 1004 -> barycenter: X,Y,Z = [-24, -2 , 32] mm
Seg 21: N voxels= 1388 -> barycenter: X,Y,Z = [-26, -2 , 48] mm
Seg 22: N voxels= 1480 -> barycenter: X,Y,Z = [-26, -2 , 64] mm
Seg 23: N voxels= 1524 -> barycenter: X,Y,Z = [-28, -2 , 82] mm
Seg 24: N voxels= 787 -> barycenter: X,Y,Z = [-10, -14, 8 ] mm
Seg 25: N voxels= 725 -> barycenter: X,Y,Z = [-14, -20, 18] mm
Seg 26: N voxels= 1138 -> barycenter: X,Y,Z = [-14, -20, 32] mm
Seg 27: N voxels= 1550 -> barycenter: X,Y,Z = [-14, -20, 48] mm
Seg 28: N voxels= 1677 -> barycenter: X,Y,Z = [-14, -22, 64] mm
Seg 29: N voxels= 1755 -> barycenter: X,Y,Z = [-14, -22, 82] mm
Seg 30: N voxels= 819 -> barycenter: X,Y,Z = [8 , -16, 8 ] mm
Seg 31: N voxels= 795 -> barycenter: X,Y,Z = [10 , -20, 18] mm
Seg 32: N voxels= 1228 -> barycenter: X,Y,Z = [10 , -20, 30] mm
Seg 33: N voxels= 1719 -> barycenter: X,Y,Z = [12 , -20, 48] mm
Seg 34: N voxels= 1873 -> barycenter: X,Y,Z = [12 , -22, 64] mm
Seg 35: N voxels= 1966 -> barycenter: X,Y,Z = [12 , -22, 82] mm

The GUI contains the following:
- A toolbar including:
- Segment ID
- X, Y, Z position (in mm)
- R (in mm)
- Theta (in degree)
- 9 pads showing:
- top left: core signal
- center pad: segment net charge signal
- center left and right: transients signals located on the left and right of the fired segment
- center bottom and top: transients signals located on the bottom and top of the fired segment
- top righ: position in the XY plane
- bottom left: position in the XZ plane
- bottom right: position in the YZ plane
In the above example, the fired segment is, by default, the segment 0. There is by definition no "transient bottom" segment.
The segment can be changed, either on the toolbar, or using the -seg N in the command line. The following example is for segment 4:

We can see that now, both top and bottom transients are represented. The position can be directly changed by clicking on the different position buttons in the toolbar.
Multiple basis#
We can now overimpose the traces at the same position for different basis:
PlotADLBases -file /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat -file /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat
The two basis will be first loaded in memory, and anayzed to map the barycenters of each segment. If some voxels are not existing in both basis, they are removed to avoid side effects:
Loading file: /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat
Loading file: /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_B007.dat
Total 808 Mo |====================>| 100.00% [ 883 Mo/s, time left: 0h00min00s ]Real time 0:00:00, CP time 0.970
Total 823 Mo |====================>| 100.00% [ 605 Mo/s, time left: 0h00min00s ]Real time 0:00:00, CP time 0.950
Basis files renormalization (to remove voxels not common to all basis)
-> File: LibTrap_A007.dat: 891 removed voxels
-> File: LibTrap_B007.dat: 1776 removed voxels
Segment mapping:
Seg 00: N voxels= 782 -> barycenter: X,Y,Z = [18 , 0 , 8 ] mm
Seg 01: N voxels= 725 -> barycenter: X,Y,Z = [24 , 0 , 18] mm
Seg 02: N voxels= 1098 -> barycenter: X,Y,Z = [24 , 0 , 30] mm
Seg 03: N voxels= 1558 -> barycenter: X,Y,Z = [24 , 0 , 46] mm
Seg 04: N voxels= 1742 -> barycenter: X,Y,Z = [26 , 0 , 64] mm
Seg 05: N voxels= 1900 -> barycenter: X,Y,Z = [26 , 0 , 82] mm
Seg 06: N voxels= 775 -> barycenter: X,Y,Z = [8 , 16 , 8 ] mm
Seg 07: N voxels= 731 -> barycenter: X,Y,Z = [10 , 20 , 18] mm
Seg 08: N voxels= 1129 -> barycenter: X,Y,Z = [10 , 20 , 30] mm
Seg 09: N voxels= 1621 -> barycenter: X,Y,Z = [10 , 20 , 46] mm
Seg 10: N voxels= 1814 -> barycenter: X,Y,Z = [12 , 22 , 64] mm
Seg 11: N voxels= 2024 -> barycenter: X,Y,Z = [12 , 22 , 82] mm
Seg 12: N voxels= 812 -> barycenter: X,Y,Z = [-10, 14 , 8 ] mm
Seg 13: N voxels= 766 -> barycenter: X,Y,Z = [-14, 18 , 18] mm
Seg 14: N voxels= 1162 -> barycenter: X,Y,Z = [-14, 18 , 30] mm
Seg 15: N voxels= 1662 -> barycenter: X,Y,Z = [-14, 20 , 46] mm
Seg 16: N voxels= 1822 -> barycenter: X,Y,Z = [-16, 20 , 64] mm
Seg 17: N voxels= 2005 -> barycenter: X,Y,Z = [-16, 20 , 82] mm
Seg 18: N voxels= 699 -> barycenter: X,Y,Z = [-18, 0 , 8 ] mm
Seg 19: N voxels= 603 -> barycenter: X,Y,Z = [-24, 0 , 18] mm
Seg 20: N voxels= 901 -> barycenter: X,Y,Z = [-24, 0 , 30] mm
Seg 21: N voxels= 1296 -> barycenter: X,Y,Z = [-26, 0 , 46] mm
Seg 22: N voxels= 1435 -> barycenter: X,Y,Z = [-26, 0 , 64] mm
Seg 23: N voxels= 1633 -> barycenter: X,Y,Z = [-26, -2 , 82] mm
Seg 24: N voxels= 740 -> barycenter: X,Y,Z = [-10, -14, 8 ] mm
Seg 25: N voxels= 669 -> barycenter: X,Y,Z = [-12, -20, 18] mm
Seg 26: N voxels= 1032 -> barycenter: X,Y,Z = [-12, -20, 30] mm
Seg 27: N voxels= 1476 -> barycenter: X,Y,Z = [-14, -20, 46] mm
Seg 28: N voxels= 1636 -> barycenter: X,Y,Z = [-14, -22, 64] mm
Seg 29: N voxels= 1847 -> barycenter: X,Y,Z = [-14, -22, 82] mm
Seg 30: N voxels= 787 -> barycenter: X,Y,Z = [8 , -16, 8 ] mm
Seg 31: N voxels= 763 -> barycenter: X,Y,Z = [10 , -20, 18] mm
Seg 32: N voxels= 1157 -> barycenter: X,Y,Z = [10 , -20, 30] mm
Seg 33: N voxels= 1674 -> barycenter: X,Y,Z = [12 , -20, 46] mm
Seg 34: N voxels= 1863 -> barycenter: X,Y,Z = [12 , -22, 64] mm
Seg 35: N voxels= 2062 -> barycenter: X,Y,Z = [12 , -22, 82] mm

Apply preamplifier response#
This is possible to ask the code to apply the preamplifier response on the traces as it is done in the AGATA PSA actor. For this use the -preamp option after the basis file:
PlotADLBases -file /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat -file /Volumes/JDev_Data/AGATA/Bases/ADL/Bases/LibTrap_A007.dat -preamp
In this example, we are comparing the same basis, as it is in ADL in blue, and as it is after applying the preamplifier response in red:
