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

Bug Fix: in anaDACScan.py, fix handling of calFiles #172

Closed AndrewLevin closed 5 years ago

AndrewLevin commented 5 years ago

anaDACScan.py did not work when calFiles were not explicitly passed but provided in $DATA_PATH/[chamber name]/.

Description

Currently, when a calFile is found in $DATA_PATH/[chamber name]/, the OH is kept in the list of OHs to calibrate, but the calFile is not parsed, causing the KeyError reported by @bdorney in https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/171. This pull request parses these calFiles and stores the calibration information.

Types of changes

Motivation and Context

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

How Has This Been Tested?

Yes, it has been tested in a virtual environment:

Command executed:

anaDACScan.py /data/bigdisk/GEM-Data-Taking/GE11_QC8/dacScanV3/2018.11.30.21.55/dacScanV3.root

Tail of output:

Loading info from input TTree
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
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

Analysis completed. Goodbye

Screenshots (if appropriate):

Checklist:

AndrewLevin commented 5 years ago

In my test, the calibration file was placed in $DATA_PATH/[chamber name]/ and the script correctly finds it and parses it, so there is no error message. This resolves the issue that @bdorney raised where a calibration file was correctly found but not correctly parsed. I have also tested that when the calibration file is not placed in $DATA_PATH/[chamber name]/ and also not provided through --calFileList the script still correctly reports the error message

Skipping OH0, detector GE11-X-S-INDIA-0002, missing ADC0 calibration file:
        /data/bigdisk/GEM-Data-Taking/GE11_QC8//GE11-X-S-INDIA-0002/calFile_ADC0_GE11-X-S-INDIA-0002.txt
No OHs with a calFile, exiting.

and exits.

jsturdy commented 5 years ago

OK, got it, thanks