Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations

Presentation on theme: "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."— Presentation transcript:

1 An approach for the S-curve fit I.Tsurin CERN 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

2 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 of modules with more than 0.2% of pixels failing the online (DSP) fits (often mentioned)

3 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: signal gain, noise, time response are measured using the threshold scan techniques:

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

5 S-curve parameterisation Page 5 S-curve (bin statistics): cumulative distribution function (binomial Mean) Gaussian probability density function, could also be Laplace or t-Student distribution

6 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 1 st or the 3 rd 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 :-(

7 An alternative method Page 7 Derivative of the S-curve gives a Gaussian amplitude spectrum: Online computation: Skip negative F values and wait for the next good Count reading ! Provides the minimum (analytically proven) when the parameterization is correct (no 1/ F noise) (see page 5)

8 Pixel Calibration Data Readout parameters: Page 8 Offline computation: Mean, RMS – characterize strips / pixels; Chi2, NDF – statistical significance of the measurement results Data reduction: 16 bytes / pixel – good trade off between saving the raw data (S-curves) and making DSP histograms which dont characterize individual pixels

9 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-curveGaussian 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

10 Page 10 Fit to the S-curve: Fit to the Gaussian (S-curve derivative): Chi-2 Test Chi-2 statistics: Be very careful with the approximation: (Pearsons method) The Poisson approximation to the Binomial distribution works for pi - cumulative distribution function pi - probability density function

11 G-Test Page 11 Neyman-Pearson lemma allows for an algebraic manipulation of the LR to 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... k simultaneously; To get the same bin counts with the true (estimated) probabilities: pi - probability in a single trial in the i-th bin.

12 Likelihood Ratio ( ) Test in General Form Mean = NDF, / NDF -> 1 Always show and NDF separately as their ratio 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 of logarithm is less dependent on the Ntrig Scale since there is no Nobs(i) multiplier for each component of the sum

13 Page 13 Chi2 computation requires a temporary data storage for each pixel; this memory could be shared between different scans (pipeline) Use data from the previous scan to calculate the Chi2-statistics (it has to run faster than acquiring the new frontend reading) Receive the frontend reading and overwrite the memory cell; increment the RMS and Mean variables Towards the Hardware Mean and StD results are instantaneous (ready with the 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

14 What is the DSP ? Page 14 The second after the MCC intelligent device that processes the data TMS320C6713B No operating system (program is a loop with interrupt services) L1 cache: 4 kb program memory, 2x2kB (2-way) data memory, L2 cache: 256 kb program and data memory (re-configurable) 200 MHz maximum clock freq. 50 MHz maximum RAM access frequency Strip & Pixel ROD (Readout Driver) The DSP fit alone is ~50 kB of code + include files with the lookup data

15 DSP DOs and DONTs Page 15 RecommendedAllowedProcessor-Specific Arithmetical: +, -, * Logical: and, or, not Relations: >,<, = 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 through libraries 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

16 Quick-and-Dirty Logarithm Page 16 Real number: N – shift > 22 and mask 0xFF Y – mask 0x7FFFFF

17 Some useful Formulas: Page 17...and just for fun: Gaussian Spectrum in the logarithmic scale is a parabola !

18 qdl2(X), pwr2(X) uncertainties Page 18 Error cancellation: qdl2(X) ~2% error pwr2(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% error pwr2(X) ~4% error The latter has to be taken into account and corrected for Maximum deviation 4e-7

19 Page 19 Statistical error : 1% Systematic error : 0.01% Range: Range, Sample size, Class intervals Class intervals: From the critical values of for the 5% significance level: to prevent Type-I errors Bin statistics:> 5 Gaussian approximation to the binomial distribution (Central Limit Theorem)

20 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 mask stages) -> 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)

21 Page 21 Algorithm test with the SCT data Mean amplitude and signal dispersion were obtained from the SCT scans using the new fit techniques. Long and short strips with different noise 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 position is OK but statistics is poor

22 Page 22 SCT data analysis ––––– original S-curve..... derivative function fit curve (+) accept fit (-) reject fit Type - I errors : Type - II errors: Rejecting good strips / pixels Accepting bad Strips / pixels ? How good is good and how bad is bad

23 Summary Recommended for scans of the silicon pixel, strip and pad detectors and any 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

24 float qdp2(float Dat){ int IQ; float Res; IQ = (int) ceil(Dat); Res = 1. + Dat - IQ; Res *= 1<>23) & 0x7F); Arg.Tmp &= 0x7FFFFF; Arg.Tmp += 0x3F800000; Res += Arg.Val; return Res; } Base-2 Logarithm functionPower of 2 function Code primitives

Download ppt "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."

Similar presentations

Ads by Google