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.
|