The Charge Correction Method (CCM) corrects the waveform obtained in tct measurements of irradiated samples by considering the integrated charge of the waveform. This function takes tct measurements from a single, irradiated sample and returns the trapping time required to correct for losses in the original signal due to trapping.



How it works

The function consists of 3 main loops:

  1. Loop over sensor bias - after depletion the charge collected by the sensor should be constant. Following irradiation it can be harder to know at what voltage the sensor is fully depleted, so looping over all biases and comparing them helps to evaluate this.
  2. Loop over trapping times - each waveform is multiplied by the exponentiated trapping time to counter the effects of the radiation damage (see theory above). The point of this function is to establish what that trapping time is. To do so it loops over possible values to ascertain which best fits the criteria for a corrected waveform.
  3. Loop over fitting limits - following irradiation the full depletion voltage becomes hard to ascertain, even from a plot of the charge vs. bias. As such it is possible to try different fit ranges to see how it affects the result of the fit and hence which trapping time is deemed to be the most likely.
The optimal trapping time is selected for each fit range. The trapping time returned by the function is then the average of these optimal trapping times.

Function arguments and parameters

CCM takes 3 arguments:

NB:The function expects the text files pointed to by the file paths to be in a specific format, please check your file is in this format. The size of the vector will be the break point for the innermost loop. The number of trapping times and fit limits to test will be the break points to the other two loops.


Imported parameters

The first portion of the function simply imports the trapping times and fit limits from the data files.

Next, using one of the candidate trapping times - each waveform from the data set is multiplied by a correcting factor: exp(t/Tau), where Tau is the candidate trapping time.

twikiPlot modifiedWaveform.png
Comparison of original and modified waveforms

NB To compare the uncorrected waveform with the corrected waveforms in this analysis, set one of the candidate trapping times to 0. In reality a trapping time of zero would mean that all charges in the sample were trapped and no signal produced - this is very unfeasible for the fluences in this irradiation study! A trapping time of infinity is equivalent to none of the charges being trapped in the sample - or how the signal would look if tct measurements were performed on an unirradiated sample. Since infinity is a difficult concept to feed into the program, Tau=0, an unphysical concept is used instead.

Integration and limits

This waveform is then integrated to obtain the charge collected by the sensor, so the next part of the code calls one of two functions to establish limits for this integration. As the waveform is being corrected by a time-dependent exponentiated function, it is not reasonable to deduce the integration limits from it. Instead one of three methods are used:

  • findEdges_inflectionPoints - use the rising and falling edge of the unmodified signal to set the integration limits.
  • findEdges_ToT - set a marker from when the unmodified signal goes over a threshold (nominally double the noise amplitude) and a marker when next it dips below the threshold. These markers bound the time the signal is over the threshold set (Time Over Threshold).
  • Set the limits manually - mostly for debugging purposes if the two automatic methods above fail.
The limits functions set the limits in the dataContainer object so they can easily be passed to the integration function.

twikiPlot waveform w limits.png
Original and modified waveforms with ToT calculated limits visible.

Given that the systematic errors of the tct setup used are practically negligible (William, this could be something you and Christian figure out together! I did it for my Edinburgh setup and the error was too small to be worth considering), the noise floor is set as the error on each data point in the waveform. The error is propagated accordingly for integration and returned along with the integrated charge.


In the next part of the analysis we plot the modified charge vs. bias for one device. Above full depletion the entire charge injected into the bulk should be collected and so the charge vs. bias plot should remain constant after a given bias voltage (see example plot). Unmodified, the charge will be underestimated for sensors that have undergone high fluence irradiation.

To establish the trapping time that results in the flattest straight line, the corrected charge vs. bias graph is fitted, above depletion with a straight line function. The trapping time that returns the fit with the gradient closest to zero is selected as the best fit trapping time. Examples of this process in both Gnuplot and ROOT, using the Chi-squared least squares minimisation, are shown below for corrected, integrated charge data from a 1E14 neq fluence, 70 MeV proton irradiated MCz sensor, using 20 ns correction, over a series of bias voltages.

fit -300 20.png
ROOT fitted data
CCM 20 fitted.png
Gnuplot fitted data

Aside Please note that the Chi-square and Q-factor (or probablilty) differ in the fit results using Gnuplot and ROOT by 0.01. This is probably due to the different ways each software treats the propagated errors from the data points but for all intents and purposes both fits return equal parameters and errors on parameters.

To propagate the result of the fit an in-program fitter is needed. Practically, this is done by saving the charge, error from integration, and bias information to a ROOT TGraphErrors object, so ROOT inline fitting can be utilised ( ). The linear function used to fit the plot contains the following snippet:

      if(x[0] == -470 || x[0] == -425){

In this case the charge data obtained at -470V and -425V was erroneous in some way and we want to exclude those points from the fit. It is up to the user to decide what should be excluded from the fit. Simply comment out the code if not used.

It is worth noting that the fit limits are set eternally because not all sensors are tested over the same voltage range.

Establishing the best trapping time

For each lower limit on the straight line fit, the trapping time which produces a corrected charge vs. bias graph closest to 0 will be selected. All of the best trapping times for each fit lower limit are then averaged, the result is taken to be the optimal trapping time from the list provided.

CCM -100 fitted.png
Fit data, limits of -800:-100 V.
CCM -200 fitted.png
Fit data, limits of -800:-200 V.
CCM -400 fitted.png
Fit data with, of -800:-400 V.
CCM -700 fitted.png
Fit data with, of -800:-700 V.

The plots above are examples of the importance of picking a good limit for the straight line fit.

NB: This function will only return the best trapping time from the gradient of the fit closest to 0. It does not differentiate between a good and bad fit. As such the fit data for each iteration is written to a file: the reduced chi-squared, the chi-squared probability (or Q-value), and the error on the fit parameter (error on gradient).

The plots show information about the straight line fit. ROOT uses a minimum chi-squared, least squares fitting and this information can be plotted to deduce the quality of the fit, along with the deduced parameters. Ideally:

  1. The reduced chi-squared should reach 1, when the correct fit is found.
  2. The Q-value should also be 1.
  3. The function should pick the trapping time which corresponds to the gradient of the fit that is closest to 0.
Dotted lines have been plotted at 0 and 1 to show the ideal values for gradient, Q-value and reduced chi-square, respectively.

  • Fit upper limit of -100V: This is an example of using a fit limit that is too low. The reduced chi-square only reaches 1, for a few trapping times and the Q-value only dips above 0 once. Note that the chi-square is simply 0 after 200 ns.
  • Fit upper limit of -200V: This is an example of a better fit limit. The chi-square is close to 1 after 10ns but the Q-value is mostly 0.
  • Fit upper limit of -400V: In reducing the fit region further the chi-squared drops below 1, possibly indicating that this fit range is a little small as the errors are over-compensating. The Q-value is also, now, all-inclusive above 20 ns.
  • Fit upper limit of -700V: The returned error on the gradient should already be an indication that this fit range is too small. The chi-squared is close to 0 and teh Q-value close to 1, for most data points, implying that the errors over compensate the fit. The CCM function would probably have picked 10 ns as the optimal trapping time from this fit, as it has the resulting gradient closest to 0. However, consider that the Q-value at this point is only ~0.5 whilst the chi-squared is around 1.5.
Interestingly, the fit range changed the trapping time that was returned from the function in each of these cases.

Be sure to look at the equivalent plots for your data set when running the function to check that the fit data seems reasonable.

When setting limits on the fit: it is best to use as large a fit range as possible but, by eye, make sure that the lower limit on this fit range is sufficiently within the full depletion region. The function will then average the trapping times for each fit range.


The function can selectively output data and plots relating to the correction method by setting the compile time variable `SAVE' to 1 or 0.

If SAVE is set to 1, all outputs are saved to a directory, made in the same directory the program is run from. The folder is called `outputs'.

Outputs are saved in 3 types of subdirectory:

  • The tct waveform, modified with the correcting factor. Each waveform is saved in a folder named, e.g. 'correctedWaveforms_4.5/' for a trapping time of 4.5 ns. Inside the folder there are all the modified waveforms at the various bias voltages saved in textfiles, e.g. 'waveform_-570.out' for a dataset taken when the device under test was biased at -570V. These text files are in the same format as the original data file.
         #Timestamp   0
             #DUT         MCz_1E14
             #Bias        -570
             #Xscale      1e-9 
             #Yscale      1e-3
             #Npoints     2000
         Time [ns]    Device response [mV]
              0            -0.423608
              0.05         -0.424668
              0.1          -0.425731
              0.15         -0.426797
              0.2          -0.427865
              0.25         -0.428936
              0.3          -0.43001

  • The integrated charge for a specific bias voltage is saved in the subfolder `CCM'. The propagated error on the charges, from the noise on the signal, is also saved. Filenames are of the format: `CCM_25', for a trapping time of 25 ns.
              #bias    integratedCharge    errorOnCharge
              -100     10376               37.6663
              -105     10451.2             37.1652
              -10      2574.19             32.2102
              -110     10492.6             37.2492
              -115     10497.2             36.7423
              -120     10427.1             36.4863

  • All plots and data related to plots is saved in the `graphs' subfolder. The `fit' folder contains pdf's of the charge vs. bias graph for each trapping time and each fit limit. The fit on each graph is also shown as well as the fit statistics in a legend. Filenames are in the format, e.g.: `fit_-250_25.pdf', for a fit on data collected at a bias of -250V and corrected with a trapping time of 25 ns.
    fit -300 20.png
    ROOT fitted data

  • The `fitData' folder contains two types of document: the parameters from the ROOT fit saved in a text file and a visualisation of that data in eps form. See the "Establishing the best trapping time" section of this twiki for more information. Filenames are in the format, e.g. `fitParsPlot_-100.eps' and `fit_output-100.dat' for charge vs. bias graphs fitted with a lower limit of -100 V.

#tau      fitUpperLimit      gradient      error_on_gradient      reducedChiSquare      Q-value 
0         -200               -0.56066      0.0166714              1.60176               3.38122e-05 
4         -200               5.53956       0.0166714              141.064               0 
6         -200               2.20182       0.0166714              22.5478               0 

fitParsPlot -200.png
Plotted fit parameters

  • The `waveformComparison' folder contains plots, in .eps format, of the original waveform and corrected waveform. The integration limits are also shown. Filenames are of the form, e.g.: `waveformComparison_-155.eps' for data taken with a device under test biased at -155V.
waveformComparison -800.png
Waveform comparison

Major updates:
-- RebeccaCarney - 16-July-2014

%RESPONSIBLE% RebeccaCarney

%REVIEW% Never reviewed

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng CCM_-100_fitted.png r1 manage 115.6 K 2014-07-23 - 10:41 RebeccaCarney Fit limit examples
PNGpng CCM_-200_fitted.png r1 manage 104.3 K 2014-07-23 - 10:41 RebeccaCarney Fit limit examples
PNGpng CCM_-400_fitted.png r1 manage 106.7 K 2014-07-23 - 10:41 RebeccaCarney Fit limit examples
PNGpng CCM_-700_fitted.png r1 manage 111.2 K 2014-07-23 - 10:41 RebeccaCarney Fit limit examples
PNGpng CCM_20_fitted.png r1 manage 129.0 K 2014-07-22 - 11:34 RebeccaCarney CCM_20_fitted_gnuplot.png
PNGpng fitParsPlot_-200.png r1 manage 89.8 K 2014-07-25 - 11:15 RebeccaCarney fitParsPlot_-200.png
PNGpng fit_-300_20.png r1 manage 150.5 K 2014-07-22 - 11:40 RebeccaCarney fit_-300_20.png
PNGpng twikiPlot_fittedCCM.png r1 manage 199.7 K 2014-07-21 - 12:55 RebeccaCarney twikiPlot_fittedCCM.png
PDFpdf twikiPlot_modifiedWaveform.pdf r1 manage 45.5 K 2014-07-17 - 15:33 RebeccaCarney twikiPlot_modifiedWaveform.png
PNGpng twikiPlot_modifiedWaveform.png r1 manage 133.9 K 2014-07-17 - 15:35 RebeccaCarney twikiPlot_modifiedWaveform
Unknown file formateps twikiPlot_waveform_w_limits.eps r1 manage 42.5 K 2014-07-21 - 11:22 RebeccaCarney twikiPlot_waveform_w_limits.eps
PNGpng twikiPlot_waveform_w_limits.png r1 manage 175.6 K 2014-07-21 - 11:22 RebeccaCarney twikiPlot_waveform_w_limits.png
PNGpng waveformComparison_-800.png r1 manage 121.3 K 2014-07-25 - 11:18 RebeccaCarney waveformComparison_-800.png
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r11 - 2020-08-30 - TWikiAdminUser
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox/SandboxArchive All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback