TPC-Test Data Page

Documentation

Altro Simulation

General

The Altro Simulation is a "C++" version of the digital logic of the ALTRO. The purpose of this software is to be able to apply the ALTRO Processing to data which was taken without and to assert the performance of the digital chain. This simulation includes all ALTRO processing steps which are:
  • BSL1 (Baseline Correction 1)
  • TCF (Tail Cancellation Filter)
  • BSL2 (Baseline Correction and Subtraction 2)
  • ZSU (Zero Suppression Unit)

It will give exactly the same result like the hardware on the basis of the stored data, but the ALTRO constantly samples the data inside and outside the triggered event, so the chip knows what happened in between the events, see limitation for details. This limitation can't be resolved. The detailed description of all parameters and their purpose can be found in the "Altro Manual".

Usage

In the end is a table with the ranges of the parameters.

The first step is to create an ALTRO object:

Altro *simAltro = new Altro(int timebins, short* Channel);

The ALTRO Class expects the number of "timebins" and the pointer to the "Channel", the class will change the content in the Channel array.

Then you configure the ALTRO:

simAltro->ConfigAltro(int ONBaselineCorrection1, int ONTailcancellation,
int ONBaselineCorrection2, int ONZerosuppression);

There you can turn on or off (1 or 0) the processing parts of the ALTRO. Be aware every module which is set here to on has to be configured properly that the simulation will run!

So we start to configure the modules starting with the BSL1:

simAltro->ConfigBaselineCorrection_1(int mode, int ValuePeDestal,
int *PedestalMem, int polarity);

For the mode explanation please look in the "Altro Manual" ("4" is the normal mode to correct the data), the "ValuePeDestal" (VPD) is the constant baseline value for a channel (e.g. you can use the pedestal data which is provided on this webpage for the cosmic runs), the "*PedestalMem" is a array with a Pedestal pattern which will be substracted, if you do not use this you have to provide a array with "timebins" 0 inside. If you invert the polarity (1) the values in the provided "Channel" are inverted.

going on to the TCF:

simAltro->ConfigTailCancellationFilter(int K1, int K2, int K3,
int L1, int L2, int L3);

This needs the 6 coefficients as an integer number as the ALTRO in Hardware! You can convert them in "human readable" values if you do:

coeeficient/(2^16-1),

or you can use the PrintParameters() function which is described later.

now the BSL2:

simAltro->ConfigBaselineCorrection_2(int HighThreshold, int LowThreshold,
int Offset, int Presamples, int Postsamples);

Here you have to set the "HighThreshold" and "LowThreshold" in which the BSL2 accepts values for a calculation of the moving average, the "Presamples" and "Postsamples" as the samples which are excluded before and after a cluster and the "Offset".

finally we have ZSU:

simAltro->ConfigZerosuppression(int Threshold, int MinSamplesaboveThreshold,
int Presamples, int Postsamples);

It needs the "Threshold" and the "MinSamplesaboveThreshold" to throw out glitches and the "Presamples" and "Postsamples" to keep samples before and after a cluster. There is no data formater module which produces the ALTRO formated data output, so the ZSU only calculates the pattern which sample is kept for the:

float simAltro->calculatecompression();

function. This function returns the compression compared to the data volume of the raw data.

Now you have configured the complete ALTRO class, to see if everything is ok you can use the:

simAltro->PrintParameters();

function, which will print all configured parameters. (If you call this function without a complete configured ALTRO it only will print the configured part). Every parameter during the configuring phase is range checked and if you set a value out of the boundaries it will be rounded to the nearest border!

Now you can run the emulation which will write the result in the provided channel array with:

simAltro->RunEmulation();

If you have turned on some modules of the class but not configured them you will receive an error and the emulation stops i.e. All modules which are on have to be configured! That's it.

example

The parameters in this example have no physical meaning !!!

#include "Altro.h"
float compression;
Altro *simAltro = new Altro(1003,data);
simAltro->ConfigAltro(0,1,1,1);
simAltro->ConfigBaselineCorrection_1(4, 30, emptyPedestalPattern, 0);
simAltro->ConfigTailCancellationFilter(0xfedf,0xcdcf,0xc1e2,0xfe0b,0xc4d8,0xc3f5);
simAltro->ConfigBaselineCorrection_2(6,6,0,0,0);
simAltro->ConfigBaselineCorrection_2(5,7,0,1,3);
simAltro->ConfigZerosuppression(10,2,2,6);
simAltro->PrintParameters();
compression = simAltro->calculatecompression();
simAltro->RunEmulation();

Limitations

Due to the fact that the real ALTRO constantly samples in between the recorded events, it has the knowledge on what happened in the period. This affects the BSL1, TCF and BSL2 module. In the BSL1 the ALTRO follows slow baseline drifts e.g. temperature change, the TCF has a infinite (IIR Filter) memory of "old samples" i.e. a cluster at the start of a readout cycle will be treated differently, and the BSL2 has a 8 step pipeline. The ALTRO Class can't emulate this behavior because the data is not recorded.

Range table for the Parameters

Module Parameter
minimum
maximum
description
Altro ONBaselineCorrection1
0
1
switch for the BSL1 (0 = off/ 1 = on)
ONTailcancellation
0
1
switch for the TCF (0 = off/ 1 = on)
ONBaselineCorrection2
0
1
switch for the BSL2 (0 = off/ 1 = on)
ONZerosuppression
0
1
switch for the ZSU (0 = off/ 1 = on)
BSL1 mode
0
10
see "Altro Manual"
ValuePeDestal
0
1023
fixed baseline for the channel
PedestalMem
Pointer to Array, no check !!
polarity
0
1
inverts input data (0 = off/ 1 = on)
TCF K1
0
65535
K1 of TCF
K2
0
65535
K2 of TCF
K3
0
65535
K3 of TCF
L1
0
65535
L1 of TCF
L2
0
65535
L2 of TCF
L3
0
65535
L3 of TCF
BSL2 HighThreshold
0
1023
High Theshold
LowThreshold
0
1023
Low Theshold
Offset
0
1023
Offset
Presamples
0
3
Presamples before Cluster
Postsamples
0
15
Postsamples after Cluster
ZSU Threshold
0
1023
Theshold
MinSamplesaboveThreshold
1
3
Minimum number of consecutive samples above Threshold
Presamples
0
3
Keep Presamples before Cluster
Postsamples
0
7
Keep Postsamples after Cluster
Roland.Bramm@cern.ch