STDPro
Scanning Table Data Processiong (STDPro)#
Download and Installation#
See the STD2ADF installation section
Introduction#
The STDPro software is used to convert data taken from the Strasbourg scanning table and convert it to adf format.
The processing needs to follwow few steps:
- Configuration file setting
- A first single run processing
- Baseline and thresholds estimation
- TNT2 to ADF conversion
- ADF calibration (preprocessing filter)
Preparing Configuration files:#
The first thing to do is to preprare the configuration files.
The first one is the look up table used to link each board to the correct segment ids. This file is named TNT2_LUT.conf. It content should be like this:
# segid(36=core) card channel baseline ThrLow
0 1202 1 0 0
1 1202 2 0 0
2 1202 3 0 0
3 1202 4 0 0
4 1203 1 0 0
5 1203 2 0 0
6 1203 3 0 0
7 1203 4 0 0
8 1204 1 0 0
9 1204 2 0 0
10 1204 3 0 0
11 1204 4 0 0
12 1205 1 0 0
13 1205 2 0 0
14 1205 3 0 0
15 1205 4 0 0
16 14 1 0 0
17 14 2 0 0
18 14 3 0 0
19 14 4 0 0
20 15 1 0 0
21 15 2 0 0
22 15 3 0 0
23 15 4 0 0
24 17 1 0 0
25 17 2 0 0
26 17 3 0 0
27 17 4 0 0
28 19 1 0 0
29 19 2 0 0
30 19 3 0 0
31 19 4 0 0
32 20 1 0 0
33 20 2 0 0
34 20 3 0 0
35 20 4 0 0
36 1201 1 0 0
In this file, the card numbers needs to be adapted to each segment id. The two last columns are for the baseline and thresholds values. It will be adjusted in the following.
The second configuration file is named TNT2_to_ADF.conf and is like:
########################################
#### TNT2 to ADF configuration file ####
########################################
# OutputFolder
Out ./TNT2Producer
# Source
Source "137Cs"
# Comment (limited to 1024 caracters, in " ", ex: "this is a comment"), can be given more than once
Comment "Vertical scan of S001"
# Translation to crystal frame (Offset Gain)
VertAbsolutePosCenterX -196.9 1
VertAbsolutePosCenterY 170.6 1
LatAbsolutePosFrontX -154.6 -1
LatAbsolutePosCenterY 172. 1
#Source direction in the crystal frame
SourceDir 0 0 1
# Option to remove corrupted traces from dataflow
IgnoreCorrupted 1
It should be filled as follows:
- Out: Output folder to store the adf files
- Source: string (in "quotes"), representig the type of source data
- Comment: string (in "quotes"), to add any comment to the measurement. Can be given more than once
- VertAbsolutePosCenterX: values to be in the X crystal frame for vertical position (center of the detector in the X scanning table frame)
- VertAbsolutePosCenterY: values to be in the Y crystal frame for vertical position (center of the detector in the Y scanning table frame)
- LatAbsolutePosFrontX: values to be in the Z crystal frame for horizontal position (front of the detector in the X scanning table frame)
- LatAbsolutePosCenterY: values to be in the X crystal frame for horizontal position (front of the detector in the Y scanning table frame)
- SourceDir: direction of the source in the crystal frame
- IgnoreCorrupted: if set to 1, remove some corrupted traces with random values (can be checked in the processed ROOT files)
First run processing#
A first processing is necessary to determine the baseline and treshold values (be sure the environment is correcly loaded (see the installation section)
Let's assume there is a TNT2 run named: Data/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60
The following output should be printed:
-- INFO : TNT2_to_CDAT configuration:
-- input run folder : Data/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60
-- LUT file : TNT2_LUT.conf
-- Configuration file : TNT2_to_ADF.conf
-- Source name : 137Cs
-- Corrupted traces will be ignored in the output data flow
-- General comment :
Vertical scan of S001
Scanning position in the table frame (1000: unknown axis): -160.9 160.6 1000
Scanning position in the crystal frame (1000: unknown axis): 36 -10 1000
Scan in vertical mode
Source direction in the crystal frame: 0 0 1
Output file name: ./TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60_Pos_X_36_Y_-10_Z_Undef_
-- INFO : Starting the adf conversion:
[[info]] CentralLog::ChangeCollector() ] [ cout is now the current collector ]
-- INFO : The run: TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60 contains:
card 14: 1 .evt files, (427776 entries) 1 .osc files (104038400 bytes)
card 15: 1 .evt files, (427776 entries) 1 .osc files (104038400 bytes)
card 17: 1 .evt files, (427776 entries) 1 .osc files (104038400 bytes)
card 19: 1 .evt files, (427776 entries) 1 .osc files (104038400 bytes)
card 20: 1 .evt files, (427776 entries) 1 .osc files (104038400 bytes)
card 1201: 1 .evt files, (106752 entries) 1 .osc files (27765248 bytes)
card 1202: 1 .evt files, (427520 entries) 1 .osc files (104038400 bytes)
card 1203: 1 .evt files, (427520 entries) 1 .osc files (104038400 bytes)
card 1204: 1 .evt files, (427520 entries) 1 .osc files (104038400 bytes)
card 1205: 1 .evt files, (427520 entries) 1 .osc files (103973376 bytes)
*********** EMULATOR MAIN LOOP : START ...
Total 106752 evts |===================>| 97.95% [ 8.69e+03 evts/s, time left: 0h00min00s ]NarvalInterface::process_stop called
NarvalInterface::process_stop called
*********** EMULATOR MAIN LOOP : ... STOP after 308 loops (error 0)
-- INFO : Folder: Data/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60
-- INFO : ==> Treated events : 104807 (98.178% )
-- INFO : ==> Pileup events : 425 (0.398119% )
-- INFO : ==> Overshoot events: 831 (0.77844% )
-- INFO : ==> Bad Evt events : 0 (0% )
-- INFO : ==> Bad Osc events : 193 (0.180793% )
-- INFO : Output ROOT file: ./TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60_Pos_X_36_Y_-10_Z_Undef.root
The following files have been created:
ls -lrth TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/*
-rw-r--r-- 1 dudouet staff 905K 25 avr 14:03 TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60_Pos_X_36_Y_-10_Z_Undef.root
-rw-r--r-- 1 dudouet staff 308M 25 avr 14:03 TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60_Pos_X_36_Y_-10_Z_Undef_0000.adf
The root file contains some histograms, as the baseline of energy maps:


Baseline and thresholds determination#
To be processed by the standard agata analysis, the baseline needs to be set at around 4000. For this, use the program EvalBaseline on the processed file:
EvalBaseline -f ./TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60_Pos_X_36_Y_-10_Z_Undef.root
The result should be like:
-- INFO : EvalBaseline configuration:
-- input root file: ./TNT2Producer/S001_2019_09_09_V_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-160,90_160,60_Pos_X_36_Y_-10_Z_Undef.root
-- INFO : 0 -928
-- INFO : 1 -839
-- INFO : 2 -929
-- INFO : 3 -1042
-- INFO : 4 -1008
-- INFO : 5 -1055
-- INFO : 6 -769
-- INFO : 7 -913
-- INFO : 8 -714
-- INFO : 9 -658
-- INFO : 10 -642
-- INFO : 11 -639
-- INFO : 12 -717
-- INFO : 13 -970
-- INFO : 14 -952
-- INFO : 15 -671
-- INFO : 16 -865
-- INFO : 17 -848
-- INFO : 18 -710
-- INFO : 19 -1082
-- INFO : 20 -983
-- INFO : 21 -910
-- INFO : 22 -840
-- INFO : 23 -943
-- INFO : 24 -624
-- INFO : 25 -760
-- INFO : 26 -734
-- INFO : 27 -638
-- INFO : 28 -651
-- INFO : 29 -725
-- INFO : 30 -915
-- INFO : 31 -953
-- INFO : 32 -795
-- INFO : 33 -918
-- INFO : 34 -1035
-- INFO : 35 -1168
-- INFO : 36 -920
Replace the baseline values in TNT2_LUT.conf by the one obtained here and determine the thresholds in the segment energy spectra the remove the piedestals.
TNT2 to ADF conversion#
The TNT2 runs can now be processed to be converted in adf.
It can be either done run by run using the same command than above, or by batch of runs using the multi threaded script MultiTNT2_to_ADF.py located in the stdpro/scripts folder:
./MultiTNT2_to_ADF.py -t 8 -f "../../strasbourg/S001_Full_Database/Cs_Rawdata/S001_2019_10_11_H_M_Cs_TOTAL_AREA_2x2mm_C1mm/Run_-*"
This example will process all the runs for the horizontal position, using 8 threads.
Once all files of a scan have been produced (or at least a part), a global overwiew can be made using the CheckRawData program:``
This will produce a root file named CheckRawData.root containing a plot of the scanned position and the segment and core energy spectra