Closed bdorney closed 5 years ago
A thorough check for additional key errors should be performed during testing, for example another KeyError
will be created:
Which could be resolved with the same suggestion as shown above.
Here is the pull request: https://github.com/cms-gem-daq-project/gem-plotting-tools/pull/174
I did not try to use a calFile in $DATA_PATH/unknown/
in the case that the OH number is not in the chamber config and the calFile is not passed, since that seemed a little dangerous, but please let me know if that is desired.
OH0
is missing, i.e., missing OH3
doesn't result in some similar fault in some cases?
chamber_config
? Do you put everything in unknown
?chamber_config
is updated?pickle
file and dumped into the output directory, such that all future analysis will have exactly the same conditions, regardless of whether the acquisition time information changes (which I expect it would, in at least some use cases)Just a few questions that I hope will help clarify (at least for me) whether the proposed solution is a good idea long term. For me, the underlying issue is not clear yet (based on the info in this PR), though it likely stems from these tools being designed with an extremely specific directory structure being expected. I fear that what is being proposed as a solution here may fix this issue, with the cost of adding complexity. Now is probably a good time to reevaluate the use cases and see if the assumptions are still valid, or whether improving the UX is in the best interests of the project moving forward.
- Is this only a problem if
OH0
is missing, i.e., missingOH3
doesn't result in some similar fault in some cases?
It's specific to OH0 based on the default assignment of the link entry in the stored TTree at time of acquisition:
gemDacCalTreeStructure
inherits from gemGenericTree
and link
defaults to having a value of 0.
The multi link CTP7 module will fill a DAC word for even masked OH's in the output:
This is unnecessary since the dacWord
includes the ohN, vfatN, adcVal, and dacVal in it:
The reason for the dacWord being written for unmasked OH's is really due to the xhal method for dacScanMultiLink being a DLL and being forced to take a fixed size C-array as an input/return. If this function was boosted to python and dynamic sized containers could be used this would be a moot point.
So the issue is two fold:
link
in the output TTree
is defaulted to 0, andxhal
limitations at the time of acquisition the tree is filled for all OH's, even zero'd cases entries as shown in dacScanV3.py Lines 75-87Boosting to python I think would solve this; and then the ctp7_module
wouldn't need to fill the zero entries.
- What if there are no entries in the
chamber_config
? Do you put everything inunknown
?
I think this unknown
is a stop gap and doesn't treat the underlying problem outlined above.
- Should one expect that
chamber_config
is updated?
Until a full DB system for every test stand is setup and can be moved I think it's safe to say for the short term all dictionaries in chamberInfo.py
should be expected to be up-to-date.
- Can one simply check at the time of acquisition that all necessary information is present? Such info could be exported into a
pickle
file and dumped into the output directory, such that all future analysis will have exactly the same conditions, regardless of whether the acquisition time information changes (which I expect it would, in at least some use cases)Just a few questions that I hope will help clarify (at least for me) whether the proposed solution is a good idea long term. For me, the underlying issue is not clear yet (based on the info in this PR), though it likely stems from these tools being designed with an extremely specific directory structure being expected. I fear that what is being proposed as a solution here may fix this issue, with the cost of adding complexity.
I hope the above clarifies the situation.
Now is probably a good time to reevaluate the use cases and see if the assumptions are still valid, or whether improving the UX is in the best interests of the project moving forward.
I think providing a C++ function in the appropriate HwDevice
in cmsgemos
and exposing this to python will solve the issue. This would also require a PR to ctp7_modules
to update dacScanMultiLink
.
This will be resolved by:
When those PR's are merged this issue will be closed.
Issue is resolved.
Brief summary of issue
anaDACScans.py
throws aKeyError
if0
(OH0) is not in the list of keys forchamber_config
.Types of issue
Expected Behavior
This should not throw.
I can imagine two cases:
chamber_config
was not updated correctly,In case 1 we might want to still analyze this data and place it in some "uncategorised" location. In case 2 perhaps the GEM Tree format should be updated to not set this default link...
Current Behavior
These lines will generate a
KeyError
if0
is not inchamber_config
dictionary ofchamberInfo.py
:https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/390a76897576eb0eba97eb8286c644b418891025/anaDACScan.py#L106-L112
Possible Solution (for bugs)
Set the chamber name as follows:
Then
cName
is passed torunCommand
instead ofchamber_config[oh]
. Not sure if this is the best solution though.Context (for feature requests)
Prevents data analysis of DAC scans.
Your Environment
zsh