cms-gem-daq-project / gem-plotting-tools

Repository for GEM commissioning plotting tools
GNU General Public License v3.0
1 stars 26 forks source link

anaDACScan.py update: handle the case when the OH number is not in the chamber dictionary #174

Closed AndrewLevin closed 5 years ago

AndrewLevin commented 5 years ago

Handles the case when an OH in the input tree is not in the chamber dictionary.

Description

This pull request introduces a dict_chamberNames and sets the chamber name to unknown for OH numbers that are not in the chamber_config dictionary.

Types of changes

Motivation and Context

This pull request resolves https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/173

How Has This Been Tested?

I have tested the script (in a venv) for 3 cases:

1) OH in chamber config

Initializing TObjects
Looping over stored events in dacScanTree
fitting DAC vs. ADC distributions
Determining nominal values for bias voltage and/or current settings
Warning: when fitting DAC CFG_BIAS_PRE_I_BIT the fitted value, 274, is outside range the register can hold: [0,255]. It will be replaced by 255.
Writing output data
Info in <TCanvas::Print>: png file /data/bigdisk/GEM-Data-Taking/GE11_QC8//GE11-X-S-INDIA-0002/dacScans/2018.11.30.21.55/SummaryGE11-X-S-INDIA-0002_DACScan_2018.11.30.21.55.png has been created

Analysis completed. Goodbye

2) OH not in chamber config and no calFile is passed

Warning: OH0 not found in chamber name dictionary. The chamber name associated with this OH will be set to 'unknown'.
Skipping OH0, no calibration file
No OHs with a calFile, exiting.

3) OH not in chamber config and calFile is passed

Warning: OH0 not found in chamber name dictionary. The chamber name associated with this OH will be set to 'unknown'.
Initializing TObjects
Looping over stored events in dacScanTree
fitting DAC vs. ADC distributions
Determining nominal values for bias voltage and/or current settings
Warning: when fitting DAC CFG_BIAS_PRE_I_BIT the fitted value, 274, is outside range the register can hold: [0,255]. It will be replaced by 255.
Writing output data
Info in <TCanvas::Print>: png file /data/bigdisk/GEM-Data-Taking/GE11_QC8//unknown/dacScans/2018.11.30.21.55/Summaryunknown_DACScan_2018.11.30.21.55.png has been created

Analysis completed. Goodbye

Screenshots (if appropriate):

Checklist:

bdorney commented 5 years ago

Please wait for discussion to finalize before implementing a solution. Refer to discussion on bug report for now.