Closed AndrewLevin closed 5 years ago
Is this a work in progress or is it ready for review?
@bdorney, it is a work in progress
now, the only thing missing is the use of the correct nominal value for all of the dacSelect options
the tables in the vfat3 manual do not actually have rows for each of the dacSelect values that you wrote in https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/155
to help me with this, can you tell me the nominal value for CFG_BIAS_SH_I_BFCAS?
Commits here don’t seem to reflect your comment. Perhaps some commits where not pushed to your remote? Also rebase on top of develop branch, and when ready remove WIP. I’ll review after WIP is removed.
You’ll need to contact VFAT3 team for question regarding BFCAS.
@bdorney, I rebased it (although given that I only added a new file, I am not sure why that would matter)
Commits here don’t seem to reflect your comment. Perhaps some commits where not pushed to your remote?
Can you be more specific? All commits were pushed to the remote.
You’ll need to contact VFAT3 team for question regarding BFCAS.
I just sent an e-mail to Paul and Henri with you in cc.
When you clean this up please attach screenshots to the PR so we can see what plots have been produced.
@bdorney, two questions:
1) In https://github.com/cms-gem-daq-project/vfatqc-python-scripts/pull/203, CFG_THR_ARM_DAC and CFG_THR_ZCC_DAC are repeated:
14 CFG_THR_ARM_DAC 15 CFG_THR_ZCC_DAC 35 CFG_THR_ARM_DAC 36 CFG_THR_ZCC_DAC
Why?
2) The calibrated ADC values are in what units (e.g. uA or nA)? I guess this depends on the calFile, which I don't have an real example of.
For question 1 this is illustrated in the VFAT3 manual, table 25.
For question 2 the calibration of the ADC is always in volts. In the case of voltage the calibration equation is used, in the case of current you need to convert to volts, e.g. it's the current across a 20kOhm resistor. If a monitoring current is being measured that is not the IREF than the current being monitored is the current of interest plus the IREF. As described in table 25 of the VFAT3 manual.
While you don't need a calibration file for this exercise (e.g. set m=1 and b=0) here are two examples for VFAT3B:
% more vfat3CalInfo/vfat3b/vfat3_0061/calibration_data.dat
Adjusting the global reference current.
- Iref adjusted.
Register value: 28 .
Internal ADCs calibrated. Values:
ADC0: 2.035943 + -325.388101
ADC1: 2.301137 + -450.231461
CAL_DAC conversion completed.
CAL_DAC to fC: 0.215792 + -2.028758
Scan duration: 0.017219 min
And for VFAT3A:
% more vfat3CalInfo/vfat3a/hbrdnp011/calPars.reg
adc0M/D:adc0B/D:adc1M/D:adc1B/D:cal_dac_fcM/D:cal_dac_fcB/D:Iref/I
2.059961 -318.730307 0.823305 334.545018 0.275427 -2.187759 27
Note this is unique to each VFAT and there 5000+ so I don't have each value nor do I have a "characteristic" or "typical" value.
@bdorney, in the example root file that you provided, the dacValYs are between 100.0 and 500.0, so calibrating them using a slope of 1 and an intercept of 0, and then dividing by 20000 gives values between 0.05 and 0.025. The nominal current for CFG_THR_ARM_DAC from the VFAT3 manual is 3.2 uA. Are we sure about the value of the resistance?
@bdorney, in the example root file that you provided, the dacValYs are between 100.0 and 500.0, so calibrating them using a slope of 1 and an intercept of 0, and then dividing by 20000 gives values between 0.05 and 0.025. The nominal current for CFG_THR_ARM_DAC from the VFAT3 manual is 3.2 uA. Are we sure about the value of the resistance?
If you're using a dummy value of slope=1 and intercept of 0 then you're not in volts, but DAC units.
Additionally I'd wager from Fig 29 in VFAT3 manual that the ADC calibration comes out in mV.
ok,
Additionally I'd wager from Fig 29 in VFAT3 manual that the ADC calibration comes out in mV.
I have taken this into account now
@bdorney, for the two registers
CFG_THR_ARM_DAC CFG_THR_ZCC_DAC
isn't it ambiguous if they correspond to a voltage or a current? Possibly the dacSelect number needs to be stored also?
@bdorney, for the two registers CFG_THR_ARM_DAC CFG_THR_ZCC_DAC isn't it ambiguous if they correspond to a voltage or a current? Possibly the dacSelect number needs to be stored also?
Yup that's a good point. For now just consider the voltage case. Maybe this week if you have free time in the camp you can open a GitHub issue for dacScanV3.py to store the dacSelect
in the output TTree
(and even make the PR!).
Once this comment is resolved I'll force merge this PR and build the rpm's for the camp. I understood Henri is coming tomorrow so we should be in time. Otherwise try to reach him by email before 11h00.
Thanks for working through the weekend on this!
Given Henri's recent response we expect mV
or uA
please ensure all output plots are in these units.
@bdorney, Henri only confirmed the units of the voltage calibration constants, should I also ask him about the units of the current calibration constants?
Also, I think I may be doing things in the wrong order:
The correct order for a current register is:
1) calibrate 2) subtract the nominal current 3) use Ohm's law to convert to volts,
right?
@bdorney, Henri only confirmed the units of the voltage calibration constants, should I also ask him about the units of the current calibration constants?
There are no current calibration coefficients, and ADC always reads voltage. A bias current is converted to a voltage by the use of a resistor (e.g. the 20kOhm resistor).
After everything is said and done bias voltage DAC scans should have their physical unit by mV
. Bias current DAC scans should have their physical unit by uA
.
The correct order for a current register is: calibrate subtract the nominal current use Ohm's law to convert to volts, right?
No, the ADC is always in voltage units.
@bdorney, ok, now all of the plots are in mV and uA
The errors on the dacValY variable, which is plotted on the x-axis in the DAC vs ADC plots, have been removed now. ROOT's fitting method does not converge when these errors are used, regardless of what they are set to. I tried a variety of tweaks to the fitting method and the initial values of the polynomial coefficients, but nothing helps at all. In any case, we have such a large number of points and these errors are small enough that their effect would be negligible, at least in the cases I have considered. The fits with the fifth degree polynomial are extremely good when using 0 for the error on the dacValY variable (see the screenshots).
Please add units to access labels where appropriate (e.g. mV
or #muA
).
Additionally there's no labels on the axes of NominalDacValVsVFATX
. Please add them, with units. Additionally restrict this plot's y-axis range to something physical (e.g. negative numbers should not be displayed).
Drawing option APE1
is strongly preferred. Lines should not be drawn between points, only fit curves should be draw.
For DACvsADC
increase the point size (or decrease the TF1
width) so we can see how the points and the fit are matching. Perhaps use a dotted line style for the fit.
Generally the over-arching question when developing a tool for general use is: "can someone with little experience understand what is being plotted?"
We can also resolve the issue about not knowing if CFG_THR_ARM_DAC
is a bias current or voltage by co-resolving: https://github.com/cms-gem-daq-project/vfatqc-python-scripts/issues/206
You need to add doc/man/anaDACScan.rst
and the corresponding line to doc/man-index.rst
in order for your documentation to be built correctly
@lmoureaux, the two files are added now
Issues noticed when installing in a virtualenv
:
man
page is not generated because doc/man/anaDACscan.rst
should be named doc/man/anaDACScan.rst
instead (uppercase S
, the same as in doc/man-index.rst
doc/conf.py
for man
page around line 254 Makefile
around line 56@lmoureaux, fixed
@bdorney, the scaling factors in Table 12 and Table 13 of the VFAT3 manual are now applied
@bdorney, I am now masking vfats that have a constant dacValY that is equal to 0
This script analyzes DAC scans. It reads an input file containing DAC and ADC values, performs calibration, performs a fit, and reports the DAC values which should produce the nominal voltage or current as specified in the VFAT3 manual. 3 by 8 plots of the calibrated data and the fit are also produced.
Description
Pseudo-code, from @bdorney, copied here for convenience from https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/155:
Help output:
calFileList example:
Example execution:
Types of changes
Motivation and Context
This script was requested in https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/155
How Has This Been Tested?
I have tested that the script runs on an input file provided by @bdorney:
dacScanV3.root
Screenshots (if appropriate):
Output root file structure:
DACvsADC:
RawADCvsDAC:
NominalDacValVsVFATX:
Summary plot:
Checklist: