Closed bdorney closed 5 years ago
@AndrewLevin
Looking for a volunteer to tackle this by next Monday.
@bdorney, I will do it.
also should probably use the chamber_config
dict of chamberInfo.py to place analysed results in a relevant location of $DATA_PATH
, e.g.:
$DATA_PATH/chamber_config[ohN]/dacScans/scandate/
Where scandal should be the scandate
of the input file, or some suitable different value if none is detected.
I expect dacScan results will be placed in:
$DATA_PATH/dacScansV3/scandate/<out file>
Just a cursory thought.
I wish we had a DB... :(
@AndrewLevin for those monitor (dac) select values that correspond to bias currents (See VFAT3 manual, Table 25 GBL CFG CTR 4 : Monitoring settings) you'll need to convert the ADC readback voltage back to a current. Henri from VFAT3 team writes:
The DACs are linear in the range we typically use them, but they tend to saturate on the higher end of the range. I have used 5th degree polynomial to do the fit, but I think lower order could be used. The currents from the DACs are converted to voltages for the ADCs with an external 20k Ohm resistor.
This also gives some hints as what type of fit functions could be applicable. Recall the goal is to generate an automated routine. So "tweaking" each fit is not an option, the fit should be chosen and design to always converge and give reliable results (like the scurve fit).
@bdorney, I have two questions
1) regarding assign (dacValX, dacValY, dacValY_Err) to the tgraph for a given (vfat,oh) pair
, a TGraph can be filled with errors in both the x and y directions, and I see that both errors are stored in the DAC scan (pending the merge of https://github.com/cms-gem-daq-project/vfatqc-python-scripts/pull/205)
2) regarding Note nameX is the register that was scanned during the DAC scan, but we want plots that are Y=nameX (reg scanned) and X=nameY (ADC value), see below
, I assume that nameX corresponds to dacValX, so then assign (dacValX, dacValY, dacValY_Err) to the tgraph for a given (vfat,oh) pair
would create a TGraph with errors in only the x-direction, can you confirm that is what you intended?
Regarding question 1, see discussion here:
Regarding question 2
# Loop over events in the tree and fill plots
for event in calTree:
assign (dacValX, dacValY, dacValY_Err) to the tgraph for a given (vfat,oh) pair
Here you need to use the ADCX (for X = 0,1) calibration to convert dacValY & dacValY_Err to physical units
You also need to identify if nameX corresponds to a bias voltage DAC or a bias current DAC, see VFAT3 manual Table 25: GBL CFG CTR 4 : Monitoring settings
Note nameX is the register that was scanned during the DAC scan, but we want plots that are Y=nameX (reg scanned) and X=nameY (ADC value), see below
Yes nameX
corresponds to dacValX
, yes this is creating a TGraphErrors
with only the x-direction having errors; the y-value represents the DAC.
e.g. what we want is that if we have a front end bias current that is supposed to be set to 100uA; we want to determine what that DAC value corresponds to, so it should be:
finalDACSetting = int(myFunc->Eval(100uA))
And this is how we use the dac scan information. Is it clear?
@bdorney, the script is written and working, except for these two parts:
# Get ADC0 or ADC1 calibration
# nameY will either be ADC0 or ADC1, you'll need to load calibration for each link
# use parseCalFile(...) from gem-plotting-tools/utils/anautilities.py
# Note this calibration is unique to each (vfat,ohN) pairing
# In future this is where a DB query based on vfatID would take place
# Determine DAC values to achieve recommended bias voltage and current settings
See Table 9, Nominal Current column, and the VFAT3a specific note under table 9
See Table 10, Nominal Voltage column
Here for each (vfat,oh) you should use the fit function to do a look-up on the nominal value to get the DAC value that will achieve this, e.g.
dacVal = myTF1.Eval(nominal voltage)
This then should be printed to terminal as a table, an output file (in either tab-delimited or TTree format) and then as a TGraph object with DAC value vs. VFAT position
Do you have either a calFile or further details about how to implement the calibration-related part?
Currently, I have a script that produces the 3 x 8 plots, but it is just based on the raw uncalibrated ADC and DAC values. Probably adding the calibration will not be difficult and the script should be ready and fully functional by Monday when you requested, but I do need some further information.
Closed by #158
Brief summary of issue
We have a new DAC Scan routine for VFAT3 introduced in https://github.com/cms-gem-daq-project/vfatqc-python-scripts/pull/203.
Now we need a tool to analyze it.
One critical thing to keep in mind is that
dacScanV3.py
can scan multiple optohybrids per call, so the outputTFile
may contain info for multiple detectors.Timescale
Would need this by Monday October 15th for the 904 Camp.
Types of issue
Expected Behavior
Relevant pseudocode below:
You can take inspiration from anaUltraScurve.py.
Referencing the vfat3 manual may be necessary.
Several useful functions in the API:
https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/d7b78cef238894998fc350377c3e4ace1a0b4484/utils/anautilities.py#L341 https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/d7b78cef238894998fc350377c3e4ace1a0b4484/utils/anautilities.py#L438
Context (for feature requests)
Need a tool for analyzing DAC scans.