An approach for the S-curve fit I.Tsurin CERN 12.06.08 Page 1 ATLAS Pixel Calibration meeting 1.The...
-
Upload
kylie-long -
Category
Documents
-
view
225 -
download
0
Transcript of An approach for the S-curve fit I.Tsurin CERN 12.06.08 Page 1 ATLAS Pixel Calibration meeting 1.The...
An approach for the S-curve fit
I.Tsurin CERN 12.06.08
Page 1
ATLAS Pixel Calibration meeting
1. The new DSP algorithm to fit an error function
2. Goodness-of-fit test based on the likelihood ratio
3. Analysis of statistical and systematic errors
4. Matching precision with the DSP performance
5. Algorithm tests with the SCT threshold scans
A couple of reasons for improvements
Page 2
32 bits for 8-bit integers (unstable fits otherwise):
Unstable offline results:
Commissioning results:shown are the number ofmodules with more than 0.2% of pixels failing theonline (DSP) fits
(often mentioned)
ATLAS Pixel Threshold Scans
Page 3
Aim:
1. Threshold calibration (in terms of C-DAC settings)
2. Signal-to-noise ratio measurement
3. Finding the minimum detectable charge
Pixel parameters: signalgain, noise, time responseare measured using thethreshold scan techniques:
“Conventional” Threshold Scans
Aim:
1. Threshold calibration (in terms of T-DAC settings: Ti = K x Mean)
2. Signal-to-noise ratio measurement (plateau width)
3. Finding the lowest applicable threshold
Page 4
Allows for systematic effect studies: Baseline offset, TDAC non-linearity, etc.
S-curve parameterisation
Page 5
S-curve (bin statistics):
cumulative distribution function
(binomial Mean)
Gaussian probability densityfunction, could also be Laplaceor t-Student distribution
Actual S-curve Fit
Page 6
1. Find 3 points: X1, X2, X3 on the X-axis that correspond to 15%, 50% and 85%
of the number of generated pulses (compare the count readings with three
thresholds and take the nearest points that match this condition) . Drawback:
the 1st or the 3rd points could be missing for noisy / inefficient pixels.
2. Initial guess: Mean = X2, Sigma = (X1+X3) / sqrt(2)
3. Find the Mean with the minimum Chi2 in the range [X2-C ... X2+C] iteratively
4. Find the Sigma with the minimum Chi2 in the range [0.25*S ... 4*S] iteratively
Iterations
a.) keep M=const, take 3 Sigma values: S, 0.99S, 1.01S and return 0.99S
or 1.01S to approach minimum Chi2 for the entire data sample;
b.) keep S=const, take 3 Mean values: M, 0.99M, 1.01M and return 0.99M
or 1.01M to approach minimum Chi2 for the entire data sample;
c.) abort iterations when relative changes to Mean and Sigma are less
than some small value (currently 0.1%) at the same time.
5. Give up when the maximum number of iterations is reached :-(
An alternative method
Page 7
Derivative of the S-curve givesa Gaussian amplitude spectrum: Online
computation:
Skip negative F’ values and waitfor the next “good” Count reading !
Provides the minimum (analytically proven)when the parameterization is correct (no 1/ F noise)
(see page 5)
Pixel Calibration Data
Readout parameters:
Page 8
Offline computation:
Mean, RMS – characterize strips / pixels;Chi2, NDF – statistical significance of the measurement resultsData
reduction:
16 bytes / pixel – good trade off between saving the raw data (S-curves) and making DSP histograms which don’t characterize individual pixels
Goodness-of-fit test
Page 9
1. How confident are the and estimates
2. Find pixels / strips with pathologies
- test
Weighted Sum of residuals
Likelihood ratio test ( )
S-curve
Gaussian
Use -test as a reference method and develop the -test
S-curve
1. Weak against Type-I error
2. Expensive (in terms of DSP)
Binomial(expensive)
Multinomial (G-test)
Bin statistics = parameter
of the Likelihood function
Gaussian
Mean walk =
parameter of
the Likelihood
function
Page 10
Fit to the S-curve:
Fit to the Gaussian(S-curve derivative):
Chi-2 TestChi-2
statistics:
Be very careful with the approximation: (Pearson’s method)The Poisson approximation to the Binomial distribution works for
pi - cumulative distribution function
pi - probability density function
G-Test
Page 11
Neyman-Pearson lemma allows foran algebraic manipulation of the LRto see if there are key statistics in it.
The base of logarithm should provide the variable for the statistics
G-statistics (logarithm of the LR):
Multinomial distribution: consider the entire data sample distributed among k bins
Similarly to the binomial distribution,the probability density function:
to get N1, N2 ... Nk counts in bins 1, 2 ... ksimultaneously;To get the same bin counts
with the“true” (estimated) probabilities:
pi - probability in a singletrial in the i-th bin.
Likelihood Ratio ( ) Test in General Form
Mean = NDF, / NDF -> 1
Always show and NDF separately as theirratio is not enough to calculate the P-value
Probability to find the Mean Threshold on the right place :
Same for the “true” Mean:
Xi – threshold settings
For the S-curve derivative:
Page 12
Advantage over the G-test : the base oflogarithm is less dependent on the Ntrig Scale since there is no Nobs(i) multiplierfor each component of the sum
Page 13
Chi2 computation requiresa temporary data storagefor each pixel; this memorycould be shared betweendifferent scans (pipeline)
Use data from the previous scan tocalculate the Chi2-statistics (it hasto run faster than acquiring the newfrontend reading)
Receive the frontend readingand overwrite the memory cell;increment the RMS and Meanvariables
Towards the Hardware
Mean and StD results areinstantaneous (ready withthe last frontend reading)
Critical issues: 1. the total amount of memory needed for all pixels scanned in parallel; 2. complexity and performance of the new fit algorithm
What is the DSP ?
Page 14
The second after the MCC intelligent device that processes the data
TMS320C6713B
No operating system (programis a loop with interrupt services)
L1 cache: 4 kb program memory,2x2kB (2-way) data memory,
L2 cache: 256 kb program anddata memory (re-configurable)
200 MHz maximum clock freq.
50 MHz maximum RAM accessfrequency
Strip & Pixel ROD (Readout Driver)
The DSP fit alone is ~50 kB of code + include files with the lookup data
DSP DOs and DON’Ts
Page 15
Recommended
Allowed
Processor-Specific
Arithmetical: +, -, *Logical: and, or, notRelations: > ,< , =
Logical: <<, >> (shift)
Arithmetical : 1/X, 1/sqrt(X)
Use integers whenever possible: operations on integers are 5x faster than on floating point values !
Many of the non-elementary functions are available throughlibraries or lookup tables but they are very expensive !
Solution for a serious computing task: use logarithms !
(4% error)
G-test and LR-test have an advantage over the Chi-2 test
“Quick-and-Dirty Logarithm”
Page 16
Real number:
N – shift > 22 and mask 0xFFY – mask 0x7FFFFF
Some useful Formulas:
Page 17
...and just for fun:
Gaussian Spectrum in the logarithmic scale is a parabola !
qdl2(X), pwr2(X) uncertainties
Page 18
Error cancellation:
qdl2(X) ~2% errorpwr2(X) ~6% error
DSP calculus vs. precise values
Chi2-tests: pwr2(qdl2(X))LogLR-tests: qdl2(X1) – qdl2(X2)
For both: the sum of oscillating terms in Chi-2 statistics or G-statistics shows smaller errors (smoothing effect):
qdl2(X) ~1% errorpwr2(X) ~4% errorThe latter has to be
takeninto account and corrected for
Maximum deviation 4e-7
Page 19
Statistical error : 1%Systematic error : 0.01%
Range:
Range, Sample size, Class intervals
7... 20
Class intervals:
From the critical values offor the 5% significance level:
to prevent Type-I errors
Bin statistics:
> 5Gaussian approximation
to the binomial distribution (Central Limit Theorem)
Page 20
Bandwidth and Memory Requirements
1 ROD -> 1 stave: 13 modules x 16 chips x 3000 pixels / 4 DSPs / 32 mask stages -> 5000 pixels
Analogue signal decay time ~3 us -> Maximum frequency of calibration pulses ~100 kHz (10 us intervals) -> 255 pulses for each threshold value -> 2.56 ms
Mean, RMS, G-stat variable increment ~100 clock cycles per pixel -> 500 ns without external RAM access (indeed should be faster due to 8x parallel DSP architecture)
200 e noise -> 200 e step (6 bins) -> 40 steps for 8000 e range -> 1 byte / reading-> 40 bytes / pixel (internal RAM is byte addressable ) -> 4 k-bytes / chip (32 maskstages) -> 64 k-bytes / module -> 800 k-bytes / stave -> 200 k-bytes / DSP
Conclusions: 1. The DSP is fast enough to scan 5000 pixels in parallel 2. The DSP has enough L2-cache memory (256 kb) for data (200 kb) and a small program (64 kb)
Page 21
Algorithm test with the SCT data
Mean amplitude and signal dispersion wereobtained from the SCT scans using the new fittechniques. Long and short strips with differentnoise levels are clearly visible from the plots.
This is due to over-estimated statistical errors(the SCT data could be averaged or smoothed).
The peak positionis OK but statisticsis poor
Page 22
SCT data analysis––––– original S-curve
. . . . . derivative function- - - fit curve
(+) accept fit (-) reject fit
Type - I errors :
Type - II errors:
Rejecting goodstrips / pixels
Accepting badStrips / pixels? How good is
“good”and how bad is “bad”
Summary
Recommended for scans of the silicon pixel, strip and pad detectors andany other systems with a binary readout.
Precise “on-the-fly” calculation of the population Mean and Variance
1. FAST (no iterations, no special functions, no memory access)2. ROBUST (no iterations and convergence requirements)3. Economic (a few DSP commands, no memory consumption)4. Elegant (analytic solution instead of numerical methods)
Fast and precise enough goodness-of-fit test (requires not much memory)
Last page
The algorithm has to be checked with the pixel data
float qdp2(float Dat){ int IQ; float Res; IQ = (int) ceil(Dat); Res = 1. + Dat - IQ; Res *= 1<<IQ; return 0.96 * Res;}
float qdl2(float Dat){ float Res; union{ int Tmp; float Val; } Arg; Arg.Val = Dat; Res = ((Arg.Tmp>>23) & 0x7F); Arg.Tmp &= 0x7FFFFF; Arg.Tmp += 0x3F800000; Res += Arg.Val; return Res;}
Base-2 Logarithm function
Power of 2 function
Code primitives