def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker._check_coverage |
( |
|
self, |
|
|
|
op, |
|
|
|
syst, |
|
|
|
flav |
|
) |
| |
|
private |
Definition at line 186 of file checkBTagCalibrationConsistency.py.
References checkBTagCalibrationConsistency._eta_pt_discr_entries_generator(), and edm.print().
Referenced by checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_coverage().
187 region =
"op=%d, %s, flav=%d" % (op, syst, flav)
189 print(
"Checking coverage for", region)
195 e.params.operatingPoint == op
and 196 e.params.sysType == syst
and 197 e.params.jetFlavor == flav,
203 (
"Region not covered: %s eta=%f, pt=%f " 205 + ((
", discr=%f" % discr)
if discr
else "")
209 (
"Region covered %d times: %s eta=%f, pt=%f" 210 % (size, region, eta, pt))
211 + ((
", discr=%f" % discr)
if discr
else "")
def _check_coverage(self, op, syst, flav)
S & print(S &os, JobReport::InputFile const &f)
def _eta_pt_discr_entries_generator(filter_keyfunc, op)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker._check_sys_side |
( |
|
self, |
|
|
|
op, |
|
|
|
flav |
|
) |
| |
|
private |
Definition at line 119 of file checkBTagCalibrationConsistency.py.
References checkBTagCalibrationConsistency._eta_pt_discr_entries_generator(), cmsPerfStripChart.dict, and edm.print().
Referenced by checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_values_vs_centrals().
120 region =
"op=%d, flav=%d" % (op, flav)
122 print(
"Checking sys side correctness for", region)
127 e.params.operatingPoint == op
and 128 e.params.jetFlavor == flav,
135 if not hasattr(e,
'tf1_func'):
136 e.tf1_func = ROOT.TF1(
"", e.formula)
138 sys_dict =
dict((e.params.sysType, e)
for e
in entries)
139 assert len(sys_dict) == len(entries)
140 sys_cent = sys_dict.pop(
'central',
None)
141 x = discr
if op == 3
else pt
142 for syst, e
in six.iteritems(sys_dict):
143 sys_val = e.tf1_func.Eval(x)
144 cent_val = sys_cent.tf1_func.Eval(x)
145 if syst.startswith(
'up')
and not sys_val > cent_val:
147 (
"Up variation '%s' not larger than 'central': %s " 148 "eta=%f, pt=%f " % (syst, region, eta, pt))
149 + ((
", discr=%f" % discr)
if discr
else "")
151 elif syst.startswith(
'down')
and not sys_val < cent_val:
153 (
"Down variation '%s' not smaller than 'central': %s " 154 "eta=%f, pt=%f " % (syst, region, eta, pt))
155 + ((
", discr=%f" % discr)
if discr
else "")
S & print(S &os, JobReport::InputFile const &f)
def _eta_pt_discr_entries_generator(filter_keyfunc, op)
def _check_sys_side(self, op, flav)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_coverage |
( |
|
self | ) |
|
Definition at line 177 of file checkBTagCalibrationConsistency.py.
References checkBTagCalibrationConsistency.BtagCalibConsistencyChecker._check_coverage(), electrons_cff.bool, join(), and list().
178 res =
list(itertools.chain.from_iterable(
180 for flav
in data.flavs
181 for syst
in data.syss
184 self.assertFalse(
bool(res),
"\n"+
"\n".
join(res))
def _check_coverage(self, op, syst, flav)
static std::string join(char **cmd)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_discr_ranges |
( |
|
self | ) |
|
Definition at line 171 of file checkBTagCalibrationConsistency.py.
172 for a, b
in data.discrs:
173 self.assertLess(a, b)
174 self.assertGreater(a, data.DISCR_MIN - 1e-7)
175 self.assertLess(b, data.DISCR_MAX + 1e-7)
def test_discr_ranges(self)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_eta_ranges |
( |
|
self | ) |
|
Definition at line 159 of file checkBTagCalibrationConsistency.py.
160 for a, b
in data.etas:
161 self.assertLess(a, b)
162 self.assertGreater(a, data.ETA_MIN - 1e-7)
163 self.assertLess(b, data.ETA_MAX + 1e-7)
def test_eta_ranges(self)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_flavs_b |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_flavs_c |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_flavs_udsg |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_lowercase |
( |
|
self | ) |
|
Definition at line 43 of file checkBTagCalibrationConsistency.py.
References list().
44 for item
in [data.meas_type] +
list(data.syss):
47 "Item is not lowercase: %s" % item
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_ops_loose |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_ops_medium |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_ops_tight |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_pt_ranges |
( |
|
self | ) |
|
Definition at line 165 of file checkBTagCalibrationConsistency.py.
166 for a, b
in data.pts:
167 self.assertLess(a, b)
168 self.assertGreater(a, data.PT_MIN - 1e-7)
169 self.assertLess(b, data.PT_MAX + 1e-7)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_central |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_doublesidedness |
( |
|
self | ) |
|
Definition at line 98 of file checkBTagCalibrationConsistency.py.
100 for syst
in data.syss:
102 other = syst.replace(
"up",
"down")
103 self.assertIn(other, data.syss,
104 "'%s' sys. uncert. is missing" % other)
106 other = syst.replace(
"down",
"up")
107 self.assertIn(other, data.syss,
108 "'%s' sys. uncert. is missing" % other)
def test_systematics_doublesidedness(self)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_down |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_name |
( |
|
self | ) |
|
Definition at line 87 of file checkBTagCalibrationConsistency.py.
89 for syst
in data.syss:
93 syst.startswith(
"up")
or syst.startswith(
"down"),
94 "sys. uncert name must start with 'up' or 'down' : %s" def test_systematics_name(self)
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_up |
( |
|
self | ) |
|
def checkBTagCalibrationConsistency.BtagCalibConsistencyChecker.test_systematics_values_vs_centrals |
( |
|
self | ) |
|
Definition at line 110 of file checkBTagCalibrationConsistency.py.
References checkBTagCalibrationConsistency.BtagCalibConsistencyChecker._check_sys_side(), electrons_cff.bool, join(), and list().
112 res =
list(itertools.chain.from_iterable(
114 for flav
in data.flavs
117 self.assertFalse(
bool(res),
"\n"+
"\n".
join(res))
def test_systematics_values_vs_centrals(self)
static std::string join(char **cmd)
def _check_sys_side(self, op, flav)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run