AMS Geneva Memo

The calib program

Produit Nicolas

27 march 1997

The program calib.exe is the program to qualify an AMS ladder. It works on different hardware configurations (Geneva PC card, CAMAC TDR, VME TDRS and TDRK, files ...)

You need to have a correct default.set file (look at AMS Geneva Memo The default.set file )

The purpose of the program is to determine which channels are good or bad and to give for all channels the characteritic values that the clustering program will need to perform its job (look at AMS Geneva Memo: Algorithm for AMS clustering). Those numbers are for each strip: pedestal, gain, noise and status.

Definition:

We consider that the ADC value read from a good strip i in VA k in event n is equal to:

ADC(i,n)=ped(i)+CN(k,n)+noi(i,n)+gain(i)*signal(i,n)

Where ped(i) is the pedestal of strip i

CN(k,n) is the common noise of VA k and event n, CN is just one single random number for all good strips belonging to the same VA, gaussian distributed around 0. The width (=SCN(k)) of this distribution depends on the readout system and not on the ladder itself.

noi(i,n) is a gaussian random variable with mean 0 and sigma=noise(i)

signal(i,n) is the signal in MIPS on strip i for event n

gain(i) is the MIP to ADC convertion factor for strip i

status(i) is 0 for good strip. For a bad strip each bit of status encodes a pathology discovered (look at table 1)

Running the program

When you run the calibration program you have to make sure that signal is equal to 0 for all strips and for all events. If you don't have a powerful source near your detector or if you are using a file written off beam this is a very good approximation; in AMS in space or on earth this will also always be a good approximation, especially if we use random triggers.

The calib program will use internal trigger irrespective of the value written in default.set.

Very important remark:

if the common noise of your system is bigger than 20, the numbers calculated by the program can be so badly affected that they can be considered as complete garbage. The program calib is NOT intended to be able to give useful information in all possible situations. This program showed very nice reproductible values when used in reasonable situations and with reasonable ladders.

The program will start and try to read the id of the temperature sensor. If the id is 0 it means that it failed. If you have really a K hybrid with a temperature sensor mounted on it you will have to invistigate.

Algorithm

The biggest problem that calib faces is to find the good and the bad strips: you have to realise that a bad strip can have an ADC value wich is thousands of ADC counts different from his pedestal (we have a 12 bit ADC) and that sometimes its noise does not correlate with the noise of other strips. As we have only 64 strips in a VA, including a single bad strip in the common noise determination can easily change the value of the CN by hundreds of counts. When we know that a typical MIP is around 40 ADC counts you see that this is not acceptable.

I will call mean of quantity a over events <a>n, and mean over good strip in a VA k <a>k

In absence of bad strips it is obvious that if we consider signal(i,n)=0 then ped(i)=<ADC(i,n)>n (by definition CN(k)=<ADC-ped>k so that <CN(k)>n=0, obviously <noi>n=0 and <noi>k=0).

When ped is known noi=ADC-ped-CN. So computing the sigma of this value gives us the noise of each strip.

The idea behind the program is just to repeatedly apply this algorithm on a more ans more refined set of good channels.

The different passes

The number of events for each pass is taken from the file default.set.

As we are doing means over events, 100 events give you an error on the pedestal of noise/sqrt(100) which is around 0.2 for good strips. This error of 0.2 on the pedestal seems to be acceptable according to our experience. This means also that noise values have an error of 0.1 to 0.2 counts. It is then meaningless consider as significative differences of 0.1 ADC counts in the noise unless, we go to bigger statistics.

pass 0

When the program starts it has no idea what SCN(k) can be. Let's state it clearly again: if the CN vary too wildly due to the fact that your readout system is too noisy, you cannot expect that the calib program will be able to give out numbers that make any sense.

As long as SCN is not known we cannot apply a cut on sigma ADC because the two noises contribute to this value and only one is charaterizing the ladder, the other one just charaterizes your environment. So pass 0 is done assigning all the noise to SCN which, in a good system, is normally correct within a factor of 2 .

This pass is also intended to mark the underflow/overflow strips that can be usefull for signal but they have a tendency to disturb the common noise calculation (their CN distribution is not symmetric around 0)

pass1

Pedestal and noise are calculated. A cut is then applied at cal_sigx ADC count (from default.set)+ 3 SCN as calculated in pass 0. This is a very loose cut to get rid of the most dangerous strips. A cut is also made at the value cal_sign (from default.set) to eliminate strips with not enough noise.

Experience tells us that there are two kinsd of anomalies in the strip noise: strips that show almost no noise (mostly unbonded channels) and very noisy channels (mostly high leakage current strips or capacitor diode protections conducting to the power supply). Tuning of the bias voltage can normally solve problems of conducting protection diodes especially on Va borders.

pass2

In this pass we can assume that the common noise calculated for each event is not ridiculously far from the correct one, and we can compute the first pedestal and noise. The cut is done on sigma noise .

pass3

In this pass we try to see strips that will create cluster.

Our assumption is that there is no signal, so in fact no strips have to create clusters. The cut in this pass is on the frequency that a strip creates a cluster. The dynamical pedestal algorithm is applied during this pass.

Our experience shows us that there exist strips that have resonable noise but are creating clusters more often than gaussian statistics imply. This pass is targetted to those strips. Let me remind you that the bandwith for communication to earth does not allow us to send any wrong clusters (see calculation in AMS Geneva memo The algorithm for AMS data compression)

pass gain

This pass can be accomplished only by some hardware (for the moment, only by Geneva PC card but we can hope that TDR will be able to do it in the future); in this pass we will try to find the gain of each strip and use that information to cut strips with gain around 0.

The number of events for pass 4 is taken from default.set.

This pass is very different from the other ones. The sequence used is completely different from the standard readout sequence.

Calibration sequence:

Each strip is chosen in test mode. A signal is injected using the DAC. The trigger to hold time is waited for and the value of the ADC is stored. Then the next strip is chosen.

As the timing of this sequence is very different from the normal readout sequence, we expect that the value read with 0 injection of charge will not be absolutely equal to the values readout by a normal sequence, even if we consider that with 0 injection they are conceptually equal. Besides an effect due to the different sampling phase and the fact that the VA is internally in a different state, we produce a small glitch in opening the DAC which is by design exactly synchronous to a real signal.

This is why the gain slope determination will use two different injection values (indicated in default.set) even if conceptually we could have used only one injection value and the pedestal value.

We know that the gain curve is not linear but is rather a tanh. At this stage of the processing we are only interested to see if the gain of the strip has a pathology or not. So only a linear fit between the two injection values will be performed and a cut on this distribution used to exclude strips with gain near 0.

We know by experience that some dead strip behave very nicely in all respects of noise and CN and pedestal and dont work. They can only be spotted by the fact that they exhibit a gain near 0. Sometime this is a VA-wide problem and it is not sure that those VA cannot be used. For example if the calibration capacitor is disconnected or if the VA for some reason cannot be put in test mode, it is possible that this VA is perfectely usable for data even if declared bad by this cut. We will have to investigate more this behaviour to correctly use it in the clustering program.

Anyway in the final analysis we will have to use real data to calibrate the gain of each strip (with enough data this is no problem). So consider this pass only for finding anomalies. The numbers quoted in the calibration file for gains will correlate strongly with a real gain determination but they are NOT intended to be taken at face value.

We see that the first strip in each VA shows anomalies in the gain value. We suspect that this is an artefact of the procedure. We are investigating it.

As the polarity is different between S and K, this pass has to be done once for S and once for K, so that in total 4 times the number of events declared in default.set for this pass will be used (2 injections, 2 polarities). So be patient.

End of the program

At the end of the program the most important numbers are displayed. For each VA we can read

the SCN: you have to verify there the performance of your system, again this is not a ladder characteristic

the mean pedestal: we try to have it around 1000 to minimize overflow/underflow, this is a characteristic of both the hybrid and the readout system, a value very different from 1000 here indicates that the ladder can be useful in the condition that we change the response of the corresponding TDR for this very channel, this is conceptually possible but perhaps logically hard to manage.

the pedestal sigma: this is a characteristic from the VA chip. As we didn't put any acceptation criteria on this value for VA qualification this can be surprisingly big but we will have to live with it.

mean noise of good channels: for good ladder must be around 2 ADC count. This is the single most important number to qualify a ladder.

sigma of noise of good channel: expect some reasonable small number

mean gain: the value there must be always positive. The exact number depends on many parameters. Our experience is a number around 10 has to be expected. Anyway bad strips look always very different from good ones in this distribution so the exact value is irrelevant.

sigma gain: not very informative.

number of dead strips: to be implemented.

The file calib.cal will be written to the directory declared in defaut.set

Format of calib.cal

this file is a line oriented ASCII file.

First line: number of VA (must be 16=5+5+6 for a normal ladder), number of strips per VA, id of the ladder.

The id is not the full id of the sensor but only the 7 least significant decimal digits. The full name will be much to big for PAW. The program scope is able to give you the full hexadecimal name and the reduced decimal number used in calib. We use decimals because in paw hexadecimal values are not really easy to treat. (sorry but we are not leaving in a perfect world)

Then we have SCN value, one per line. This is just to see in which condition the test where made not primarly useful.

Then for all the strips (for Geneva PC system the order is S1 S2 K), one line per strip:

strip number, pedestal, noise, gain, status

KUMAC

A standard kumac (showcal.kumac) makesthe standard calibration plots.

Status bit signification

0 1 2 3 4 5 6 7 8
low noise high noise high occupancy underflow overflow no gain