Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 49d1b6a

Browse files
AndrewLevinjsturdy
authored andcommitted
handle bad dac fit exceptions (#285)
1 parent 22de70b commit 49d1b6a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

testConnectivity.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def testConnectivity(args):
194194
from gempython.vfatqc.utils.qcutilities import getCardName
195195
if hasattr(args, 'acceptBadDACBiases') is False: # Accept Bad cases where a VFAT DAC cannot reach correct bias voltage/current
196196
args.acceptBadDACBiases = False
197+
if hasattr(args, 'acceptBadDACFits') is False: # Accept Bad cases where a VFAT DAC cannot reach correct bias voltage/current
198+
args.acceptBadDACFits = False
197199
if hasattr(args, 'acceptBadTrigLink') is False: # Accept Bad Trigger Link Status?
198200
args.acceptBadTrigLink = False
199201
if hasattr(args, 'assignXErrors') is False: # For DAC Scan Analysis
@@ -873,8 +875,18 @@ def testConnectivity(args):
873875
# Analyze DAC Scan
874876
from gempython.gemplotting.utils.anautilities import dacAnalysis
875877
from gempython.gemplotting.utils.exceptions import VFATDACBiasCannotBeReached
878+
from gempython.gemplotting.utils.exceptions import VFATDACFitLargeChisquare
876879
try:
877880
dacAnalysis(args, calTree.gemTree, chamber_config, scandate=startTime)
881+
except VFATDACFitLargeChisquare as e:
882+
printRed("One or more VFATs has a bad (large chisquare) DAC vs ADC fit")
883+
printRed(e.message)
884+
if not args.acceptBadDACFits:
885+
printRed("DAC Scan Analysis Failed")
886+
printRed("Conncetivity Testing Failed")
887+
return
888+
else:
889+
printYellow("I've been told to ignore cases of VFATs having bad DAC vs ADC fits; results may not be so good")
878890
except VFATDACBiasCannotBeReached as e:
879891
printRed("One or more VFATs is unable to reach the correct bias voltage/current setpoint")
880892
printRed(e.message)
@@ -1147,6 +1159,7 @@ def testConnectivity(args):
11471159
parser.add_argument("--checkCSCTrigLink",action="store_true",help="Check also the trigger link for the CSC trigger associated to OH in mask")
11481160
parser.add_argument("--deadChanCuts",type=str,help="Comma separated pair of integers specifying in fC the scurve width to consider a channel dead",default="0.1,0.5")
11491161
parser.add_argument("--acceptBadDACBiases",action="store_true",help="Ignore failures where a VFAT DAC cannot reach the correct bias voltage/current")
1162+
parser.add_argument("--acceptBadDACFits",action="store_true",help="Ignore cases where a VFAT DAC vs ADC fit has a large chisquare")
11501163
parser.add_argument("-a","--acceptBadTrigLink",action="store_true",help="Ignore failing trigger link status checks")
11511164
parser.add_argument("-d","--debug",action="store_true",dest="debug",help = "Print additional debugging information")
11521165
parser.add_argument("--detType",type=str,help="Detector type within gemType. If gemType is 'ge11' then this should be from list {0}; if gemType is 'ge21' then this should be from list {1}; and if type is 'me0' then this should be from the list {2}".format(gemVariants['ge11'],gemVariants['ge21'],gemVariants['me0']),default=None)

0 commit comments

Comments
 (0)