Content
2018-12-04
On 2018-12-04 we was working with Gabriel to fix fit issue from potentially lost events/frames.
Code was committed to https://github.com/lcls-psana/Detector/blob/master/src/UtilsEpix10kaCalib.py
on the top of the release ana-1.3.82.
However, test of the offset etc. evaluation procedure like
bsub -o log04 -q psanaq epix10ka_offset_calibration -e xcsx35617 -d XcsEndstation.0:Epix10ka2M.0 -r544 --idx=4 --nspace=5 -p
shows that offsets, gains, and evaluated pedestals have some problem:
img-epix10ka_0006_20181129124822_xcsx35617_r0544_offset_AHL.png Previous version of the fit did not show this issue img-epix10ka_0007_20181129124822_xcsx35617_r0544_offset_AHL-old.png
![](/download/attachments/242294549/img-epix10ka_0006_20181129124822_xcsx35617_r0544_offset_AHL.png?version=1&modificationDate=1544059349000&api=v2)
![](/download/attachments/242294549/img-epix10ka_0007_20181129124822_xcsx35617_r0544_offset_AHL-old.png?version=2&modificationDate=1544117954000&api=v2)
img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AHL-H.png
![](/download/attachments/242294549/img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AHL-H.png?version=1&modificationDate=1544059345000&api=v2)
img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AHL-L.png
![](/download/attachments/242294549/img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AHL-L.png?version=1&modificationDate=1544059342000&api=v2)
Although AML shows normal results:
img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AML-M.png
![](/download/attachments/242294549/img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AML-M.png?version=1&modificationDate=1544059338000&api=v2)
img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AML-L.png
![](/download/attachments/242294549/img-epix10ka_0006_20181129124822_xcsx35617_r0544_gainci_AML-L.png?version=1&modificationDate=1544059335000&api=v2)
2020-06-10
Directories
/reg/d/psdm/det/detdaq18/xtc
/reg/d/psdm/det/detdaq18/calib/Epix10ka2M::CalibV1/DetLab.0:Epix10ka2M.0/pedestals/
/reg/g/psdm/detector/gains/epix10k/panels/
exp=detdaq18:run=20 - 103 calibcycles, last dark calibcycle does not have configuration for AHL-L and can't be used. All 2x7x7charge injectionb cc should be good.
event_keys -d exp=detdaq18:run=20 -m3
DetLab.0:Epix10ka2M.0
Issue
epix10ka_offset_calibration -e detdaq18 -d DetLab.0:Epix10ka2M.0 -r40 --idx=0 -P --nspace=7 -o ./work
fit does not work for all injection points...
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-img-charge.png?version=1&modificationDate=1591825219000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix12-iy37.png?version=1&modificationDate=1591825214000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix12-iy37.png?version=1&modificationDate=1591825219000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix14-iy23.png?version=1&modificationDate=1591825215000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix14-iy23.png?version=1&modificationDate=1591825219000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix16-iy09.png?version=1&modificationDate=1591825215000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix16-iy09.png?version=1&modificationDate=1591825220000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix29-iy46.png?version=1&modificationDate=1591825216000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix29-iy46.png?version=1&modificationDate=1591825220000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix31-iy32.png?version=1&modificationDate=1591825216000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix31-iy32.png?version=1&modificationDate=1591825220000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix33-iy18.png?version=1&modificationDate=1591825216000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix33-iy18.png?version=1&modificationDate=1591825220000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix35-iy04.png?version=1&modificationDate=1591825217000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix35-iy04.png?version=1&modificationDate=1591825221000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix48-iy41.png?version=1&modificationDate=1591825218000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix48-iy41.png?version=1&modificationDate=1591825221000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix50-iy27.png?version=1&modificationDate=1591825218000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix50-iy27.png?version=1&modificationDate=1591825221000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix52-iy13.png?version=1&modificationDate=1591825218000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0040-DetLab-0-Epix10ka2M-0-seg00-cc005-ix52-iy13.png?version=1&modificationDate=1591825221000&api=v2)
Dubrovin, Mikhail Thu 6/11/2020 9:28 AM
To: Kwiatkowski, Maciej; Blaj, Gabriel
Hi Maciej,
I hope you are the right person to ask this question about epix10ka calibration.
I am trying to fix Gabriel's fitter which defines offsets between switching gain modes of epix10ka.
For some reason it does not work well for all pixels.
A few plots for new 2M detector recent run 40 are posted on
https://confluence.slac.stanford.edu/display/PSDM/EPIX10KA2M+Charge+injection+fit+issue#EPIX10KA2MChargeinjectionfitissue-2020-06-10.1
Left plots blue line is raw pixel intensity vs event number, red line - gain bit 14 status.
Right plots - associated fits. When fitted lines go close to dots it is ok, and vice versa.
It looks like gain factor for pixels might have spread x2 or so.
There is a few questions:
is it possible that in the same gain range pixel-channels have x2 different gain or something wrong with config or readout?
I do not quite understand algorithm how saw pulse generator works. Could you explain me please,
- when it starts cycle,
- when it resets,
- how long it does not inject charge in the beginning of cycle,
- (bonus question) how to find charge/voltage increment?
Mikhail
===============
Kwiatkowski, Maciej Thu 6/11/2020 10:00 AM
To: Dubrovin, Mikhail; Blaj, Gabriel
Hi Mikhail,
I think I have an answer for your question 1. It looks like the upper plot was taken without the ghost effect correction. Was it recorded in the past with the old firmware and the lower plots with the new one? To explain why this happens I will have to answer partially to your question 2. I'm sure the gain is the same in both cases.
The ASIC's test charge injection circuit uses a built in DAC that is incremented every frame until it rolls over and starts from 0V. The DAC is 10 bit so there is 1024 steps. This matches the upper plot.
The ghost correction algorithm was added to the firmware. It is to clear any remaining charge that leaks to the following frame. The firmware is just taking a dummy frame in between standard frames that you read out. The dummy frames are dropped and they never reach the DAQ. It has an effect on the ASIC's test circuit as also the dummy frame increments the built in DAC. Therefore with the latest firmware there is 512 DAC steps with doubled voltage increase and this matches to the lower plots that you sent. You will have to fix the fitter for the new firmware.
There is an ASIC register to reset the DAC if you want to always start from 0. Otherwise the cycle will start from where it was left last time. This is one bit register called PulserR that you should toggle True->False. I'm not sure if this was renamed in the DAQ so might not be exactly the same name.
Unfortunately I don't know what is the DAC voltage range and what is the cap value to convert this to charge. Either Angelo or Gabriel may know the answer.
Don't hesitate to ask if something of the above length email is not clear.
Best,
Maciej
2020-06-18 Calibration procedure for pedestals using charge injection
Current we accumulate data and evaluate pedestals for five dark gain modes:
- 5 calib-cycles: FH, FM, FL, AHL-H, AML-M,
and 2x49 charge injection samples: - 7X7 calib-cycles: AHL
- 7X7 calib-cycles: AML
In charge injection samples each pixel has data and fit results as shown on plots.
Assuming that each gain mode intensity sample is parametrized as
<intensity> = offset + <charge-index> * <gain>
each pixel has constants like
- offset_AHL-L, offset_AHL-H, and evaluate their difference offset_ahl = H-L
- offset_AML-L, offset_AML-M, and evaluate their difference offset_aml = M-L
Then, in current calibration procedure we evaluate pedestals for two leftover gain modes as
- pedestal_AHL-L = pedestal_AHL-H - offset_ahl
- pedestal_AML-L = pedestal_AML-H - offset_aml
![](/download/attachments/242294549/fig-detdaq18-r0051-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix16-iy09.png?version=1&modificationDate=1592614377000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0051-DetLab-0-Epix10ka2M-0-seg00-cc005-ix16-iy09.png?version=1&modificationDate=1592614399000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0051-DetLab-0-Epix10ka2M-0-seg00-cc005-dat-ix29-iy46.png?version=1&modificationDate=1592614377000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0051-DetLab-0-Epix10ka2M-0-seg00-cc005-ix29-iy46.png?version=1&modificationDate=1592614399000&api=v2)
![](/download/attachments/242294549/fig-detdaq18-r0051-DetLab-0-Epix10ka2M-0-seg00-cc005-img-charge.png?version=1&modificationDate=1592614422000&api=v2)
Reconstruction of data in analysis
intensity = (<raw-data> - pedestal) * <gain-factor>
where pedestal and <gain-factor> are per-pixel map combined from 7 gain mode maps.
Questions
- is current procedure correct?
- if not, what is correct procedure?
- or what could we calibrate with charge injection?
References