Skip to content

Commit

Permalink
Use different logic to choose when to use the dictionary of sensitive…
Browse files Browse the repository at this point in the history
… types
  • Loading branch information
jmcarcell committed Jul 19, 2024
1 parent 17e5db7 commit 86e370f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions DDG4/python/DDG4.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,15 +678,9 @@ def setupCaloOrTracker(self, name, detType=None, collections=None, isCalo=True):
retType = detType
if detType is None:
retType = self.sensitive_types['calorimeter' if isCalo else 'tracker']
elif detType is not None:
try:
retType = self.sensitive_types[detType]
# KeyError = not found in the dictionary
# TypeError = detType is not a hashable type
except (KeyError, TypeError):
pass
except Exception as X:
raise X
# detType is a tuple when an action with parameters in a dictionary is passed
elif not isinstance(detType, tuple) and detType in self.sensitive_types:
retType = self.sensitive_types[detType]
return self.setupDetector(name, retType, collections)

def setupCalorimeter(self, name, caloType=None, collections=None): # noqa: A002
Expand Down

0 comments on commit 86e370f

Please sign in to comment.