ATLAS Offline Software
ConditionDefaults.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.Logging import logging
4 from AthenaCommon.Constants import DEBUG
5 
6 logger = logging.getLogger( __name__)
7 logger.setLevel(DEBUG)
8 
9 import math
10 from copy import deepcopy
11 
13  def __init__(self):
14 
15  # we have neta, ceta and p eta. Each is a key for
16  # TrigJetConditionConfig_signed_eta. We need a way to
17  # interprete the scenario, atking into account minus signs
18  # cannot appear in the chain name.
19  self.defaults = {
20  'et': {'min': '0', 'max': 'inf'},
21  'pt': {'min': '0', 'max': 'inf'},
22  'eta': {'min': '0', 'max': 'inf'},
23  'neta': {'min': '-inf', 'max': '0'}, # scenario etas: -eta -eta
24  'ceta': {'min': '-inf', 'max': 'inf'}, # scenario etas: -eta, +eta
25  'peta': {'min': '0', 'max': 'inf'}, # scenario etas: +eta +eta
26  'nphi': {'min': '-inf', 'max': '0'}, # scenario phis: -phi -phi
27  'cphi': {'min': '-inf', 'max': 'inf'}, # scenario phis: -phi, +phi
28  'pphi': {'min': '0', 'max': 'inf'}, # scenario phis: +phi +phi
29  'djmass': {'min': '0', 'max': 'inf'},
30  'djdeta': {'min': '0', 'max': 'inf'},
31  'djdphi': {'min': '0', 'max': str(math.pi)},
32  'ht': {'min': '0', 'max': 'inf'},
33  'dipz_mlpl': {'min': '-inf', 'max': 'inf'},
34  'dipz_njet': {'min': '2', 'max': 'inf'},
35  'smc': {'min': '0', 'max': 'inf'},
36  'jvt': {'min': '0', 'max': 'inf'},
37  'bsel': {'min': '-inf', 'max': 'inf'},
38  'tausel': {'min': '-inf', 'max': 'inf'},
39  'clrsel': {'min': '-inf', 'max': 'inf'},
40  'pileuprm': {'min': '-inf', 'max': 'inf'},
41  'momCuts': {'min': '-inf', 'max': 'inf'},
42  'timing': {'min': '0', 'max': 'inf'},
43  'timeSig': {'min': '0', 'max': 'inf'},
44  }
45 
46  self.scale_factor = {
47  'et': 1000.,
48  'pt': 1000.,
49  'eta': 0.01,
50  'neta': 0.01,
51  'ceta': 0.01,
52  'peta': 0.01,
53  'nphi': 0.01,
54  'cphi': 0.01,
55  'pphi': 0.01,
56  'djmass': 1000.,
57  'djdeta': 0.01,
58  'djdphi': 0.01,
59  'ht': 1000.,
60  'dipz_mlpl': -0.1,
61  'dipz_njet': 1.0,
62  'smc': 1000.,
63  'jvt': 0.01,
64  'clrsel': 0.01,
65  'pileuprm': 0.01,
66  'momCuts': 0.01,
67  'timing': 1.0,
68  'timeSig': 1.0,
69  }
70 
71  def __call__(self, key, lo='', hi=''):
72  vals = deepcopy(self.defaults[key])
73  if lo: vals['min'] = self.scale(key, lo)
74  if hi: vals['max'] = self.scale(key, hi)
75  return vals
76 
77  def scale(self, key, val):
78  return str(float(val) * self.scale_factor[key])
79 
80 defaults = ConditionDefaults()
81 
python.ConditionDefaults.ConditionDefaults.defaults
defaults
Definition: ConditionDefaults.py:19
python.ConditionDefaults.ConditionDefaults.__call__
def __call__(self, key, lo='', hi='')
Definition: ConditionDefaults.py:71
Constants
some useful constants -------------------------------------------------—
python.ConditionDefaults.ConditionDefaults.scale
def scale(self, key, val)
Definition: ConditionDefaults.py:77
python.ConditionDefaults.ConditionDefaults
Definition: ConditionDefaults.py:12
str
Definition: BTagTrackIpAccessor.cxx:11
python.ConditionDefaults.ConditionDefaults.__init__
def __init__(self)
Definition: ConditionDefaults.py:13
python.ConditionDefaults.ConditionDefaults.scale_factor
scale_factor
Definition: ConditionDefaults.py:46
readCCLHist.float
float
Definition: readCCLHist.py:83