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] Fixes Errors with Inflection point finder #259

Closed bregnery closed 4 years ago

bregnery commented 4 years ago

This Bug Fix addresses two main bugs: errors in handling very noisy sbits and errors when analyzing chambers with missing vfats.

Description

Previously, if an SBitThresh scan had no region of negative slope this would cause the code to crash. This is now fixed and the inflection point of (0,0) is assigned to this spot.

Also, if an SBitThresh scan was done on a chamber with missing vfats, this would cause the analysis to crash. This is now handled by giving the inflection point of None

Types of changes

Motivation and Context

Previously, if an SBitThresh scan had no region of negative slope this would cause the code to crash. This is now fixed and the inflection point of (0,0) is assigned to this spot.

Also, if an SBitThresh scan was done on a chamber with missing vfats, this would cause the analysis to crash. This is now handled by giving the inflection point of None

How Has This Been Tested?

This was all tested in Bash with a python virtual environment.

#!/usr/bin/env bash

#=========================================================================================
# Testing Suite for the Inflection Point finder ------------------------------------------
#=========================================================================================

echo "Welcome to Brendan's Testing Suite for the Inflection Point Finder"
echo "------------------------------------------------------------------------------------"
echo "This script executes a bunch of files known to cause issues for the inflection"
echo "point finder"
echo "------------------------------------------------------------------------------------"

echo "Did you remember to update??? With make pip and pip install rpm*.tar.gz?"

echo "File 1"
echo "This tests how the code handles a vfat with a bad vfat"
echo "Please make sure (2,5,4) is filled in your system_specfic_constants.py file"

# This file causes issues because of a zero slope issue
anaSBitThresh.py /data/bigdisk/GEM-Data-Taking/GE11_QC8//sbitRate/channelOR/2019.10.25.13.59/SBitRateData.root

echo "File 2"
echo "This tests how the code handles a detector with missing vfats"
echo "Please make sure (1,2,0) is filled in your system_specfic_constants.py file"

# This file is from the coffin where the detector is missing vfats
anaSBitThresh.py /data/bigdisk/GEM-Data-Taking/GE11_Integration//sbitRate/channelOR//2019.10.24.17.45/SBitRateData.root

Screenshots (if appropriate):

Checklist:

bregnery commented 4 years ago

@mexanick, here are the package versions in my venv:

certifi==2019.9.11
chardet==3.0.4
cmsgemos-gempython==1.0.0
codecov==2.0.15
coverage==4.5.4
cx-Oracle==7.2.3
gempython-gemplotting===1.3.1-dev1.dev88
gempython-vfatqc==2.4.3
idna==2.8
numpy==1.14.6
pytz==2019.3
requests==2.22.0
root-numpy==4.8.0
six==1.12.0
SQLAlchemy==1.3.10
tabulate==0.8.5
urllib3==1.25.6