Closed bdorney closed 7 years ago
Does the helper script correctly handle potential misuse, i.e., failing in the right way? I suppose gemPlotter will check the validity of the things that are passed in? (Or at least fail in a non-destructive way if not)
- anaType is valid
There's a check by gemPlotter.py
to make sure that --anaType
is valid at L185 and it will tell the user what values are supported if an incorrect value is given.
- input file exists
If the argument of --infilename
does not exist gemPlotter.py
will raise an IOError exception, I will add a check in gemPlotterAllChannels.sh
that this file exists before looping.
If a particular scandate given inside of --infilename
does not exist then both arbitraryPlotter()
and arbitraryPlotter2D()
will raise an exception and tell the user they need to check the scandate which is responsible for the exception.
- branchname is valid
root2array()
raises an exception for this but arbitraryPlotter()
and arbitraryPlotter2D()
catch this inside the check that the filename associated with the scandate
exists. I'll optimize.
Added better exception handling.
Handled in gemPlotter.py:
gemPlotter.py -iBadFileName -v10 --anaType=trimAna --branchName=trimDAC --make2D --axisMin=-1 --axisMax=31
BadFileName does not seem to exist
[Errno 2] No such file or directory: 'BadFileName'
Handled in gemPlotterAllChannels.py:
gemPlotterAllChannels.sh BadInputFile trimAna trimRange
Input file: BadInputFile not found
Please cross-check, exiting
Note, exits after one exception and does not spam 128 bad messages
Handled in gemPlotter.py:
gemPlotter.py -ilistOfScanDates_Trim.txt -v10 --anaType=fail --branchName=trimDAC --make2D --axisMin=-1 --axisMax=31
Invalid analysis specificed, please select only from the list:
['trim', 'latency', 'scurveAna', 'threshold', 'trimAna', 'scurve']
Handled in gemPlotterAllChannels.py:
gemPlotterAllChannels.sh listOfScanDates_Trim.txt fail trimRange
gemPlotter.py -ilistOfScanDates_Trim.txt -s0 -a --anaType=fail --branchName=trimRange --rootOpt=RECREATE
Invalid analysis specificed, please select only from the list:
['trim', 'latency', 'scurveAna', 'threshold', 'trimAna', 'scurve']
Note, exits after one exception and does not spam 128 bad messages
Handled in gemPlotter.py:
gemPlotter.py -ilistOfScanDates_Trim.txt -v10 --anaType=trimAna --branchName=fail --make2D --axisMin=-1 --axisMax=31
Branch fail not in TTree scurveFitTree of file /data/bigdisk/GEM-Data-Taking/GE11_QC8//GE11-VI-L-CERN-0002/trim/z4.000000//2017.09.04.20.12/SCurveData_Trimmed/SCurveFitData.root
Existing Branches are:
<ROOT.TBranch object ("vfatN") at 0x2fe02c0>
<ROOT.TBranch object ("vfatCH") at 0x2fefde0>
<ROOT.TBranch object ("ROBstr") at 0x2ff0300>
<ROOT.TBranch object ("mask") at 0x2ff0840>
<ROOT.TBranch object ("maskReason") at 0x2ff0d80>
<ROOT.TBranch object ("panPin") at 0x2ff12c0>
<ROOT.TBranch object ("trimRange") at 0x2ff1800>
<ROOT.TBranch object ("vthr") at 0x2ff1d40>
<ROOT.TBranch object ("trimDAC") at 0x2ff2280>
<ROOT.TBranch object ("threshold") at 0x2ff27c0>
<ROOT.TBranch object ("noise") at 0x2ff3e80>
<ROOT.TBranch object ("pedestal") at 0x2ff43a0>
<ROOT.TBranch object ("ped_eff") at 0x2ff48e0>
<ROOT.TBranchElement object ("scurve_h") at 0x2ff4e20>
<ROOT.TBranch object ("chi2") at 0x3029220>
<ROOT.TBranch object ("ndf") at 0x3029710>
<ROOT.TBranch object ("Nhigh") at 0x3029c30>
Please try again using one of the existing branches
Handled in gemPlotterAllChannels.py:
gemPlotterAllChannels.sh listOfScanDates_Trim.txt trimAna fail
gemPlotter.py -ilistOfScanDates_Trim.txt -s0 -a --anaType=trimAna --branchName=fail --rootOpt=RECREATE
Branch fail not in TTree scurveFitTree of file /data/bigdisk/GEM-Data-Taking/GE11_QC8//GE11-VI-L-CERN-0002/trim/z4.000000//2017.09.04.20.12/SCurveData_Trimmed/SCurveFitData.root
Existing Branches are:
<ROOT.TBranch object ("vfatN") at 0x3e644d0>
<ROOT.TBranch object ("vfatCH") at 0x3e73ff0>
<ROOT.TBranch object ("ROBstr") at 0x3e74510>
<ROOT.TBranch object ("mask") at 0x3e74a50>
<ROOT.TBranch object ("maskReason") at 0x3e74f90>
<ROOT.TBranch object ("panPin") at 0x3e754d0>
<ROOT.TBranch object ("trimRange") at 0x3e75a10>
<ROOT.TBranch object ("vthr") at 0x3e75f50>
<ROOT.TBranch object ("trimDAC") at 0x3e76490>
<ROOT.TBranch object ("threshold") at 0x3e769d0>
<ROOT.TBranch object ("noise") at 0x3e78090>
<ROOT.TBranch object ("pedestal") at 0x3e785b0>
<ROOT.TBranch object ("ped_eff") at 0x3e78af0>
<ROOT.TBranchElement object ("scurve_h") at 0x3e79030>
<ROOT.TBranch object ("chi2") at 0x3ead430>
<ROOT.TBranch object ("ndf") at 0x3ead920>
<ROOT.TBranch object ("Nhigh") at 0x3eade40>
Please try again using one of the existing branches
Note, exits after one exception and does not spam 128 bad messages
Handled in gemPlotter.py:
gemPlotter.py -ilistOfScanDates_Trim.txt -s0 -a --anaType=trimAna --branchName=trimRange --rootOpt=RECREATE
Filepath /data/bigdisk/GEM-Data-Taking/GE11_QC8//GE11-VI-L-CERN-0002/trim/z4.000000//9999.99.99.99.99 does not exist!
Please cross-check, exiting!
Handled in gemPlotterAllChannels.py:
gemPlotterAllChannels.sh listOfScanDates_Trim.txt trimAna trimRange
gemPlotter.py -ilistOfScanDates_Trim.txt -s0 -a --anaType=trimAna --branchName=trimRange --rootOpt=RECREATE
Filepath /data/bigdisk/GEM-Data-Taking/GE11_QC8//GE11-VI-L-CERN-0002/trim/z4.000000//9999.99.99.99.99 does not exist!
Please cross-check, exiting!
Note, exits after one exception and does not spam 128 bad messages
Handled in gemPlotter.py:
gemPlotter.py -ilistOfScanDates_Trim.txt -s0 -a --anaType=trimAna --branchName=trimRange --rootOpt=RECREATE
Filepath /data/bigdisk/GEM-Data-Taking/GE11_QC8//FakeDetector/trim/z4.000000//2017.09.04.20.12 does not exist!
Please cross-check, exiting!
Handled in gemPlotterAllChannels.py:
gemPlotterAllChannels.sh listOfScanDates_Trim.txt trimAna trimRange
gemPlotter.py -ilistOfScanDates_Trim.txt -s0 -a --anaType=trimAna --branchName=trimRange --rootOpt=RECREATE
Filepath /data/bigdisk/GEM-Data-Taking/GE11_QC8//FakeDetector/trim/z4.000000//2017.09.04.20.12 does not exist!
Please cross-check, exiting!
Note, exits after one exception and does not spam 128 bad messages
Regenerated above screen shots of working plots using commands shown above.
Looks good.
Error codes are now positive and follow pythonic example given above.
Performed same set of tests as shown, both to generate exceptions, and also plots. Worked out in the end.
Description
Starting to address: https://github.com/cms-gem-daq-project/gem-plotting-tools/issues/33
Types of changes
Motivation and Context
Right now if a particular plot of interest is desired a user has to make it by hand. This feature seeks to address that. The user provides a
tab
delimited text filelistOfScanDates.txt
of the form:And calls:
Then a plot of
branchName
vsIndepVarName
from the scan dates specified, for each of the VFATs specified will be created. Please note thatcName
need not be the same for each row (however then one would imagine thatIndepVar
is some expression derived from Layer & Slot...)!How Has This Been Tested?
By producing plots below.
Screenshots (if appropriate):
Calling:
Calling:
Calling:
Calling:
Checklist: