7 @brief Accumulator class to buffer data for a single trigger and export this to JSON or CSV
12 from AthenaCommon.Logging
import logging
13 log = logging.getLogger(
'RatesTrigger')
17 ACTIVE_WEIGHTED_BIN = 2
19 PASS_WEIGHTED_OR_BIN = 4
20 PASS_WEIGHTED_AND_BIN = 5
25 def __init__(self, name, metadata, data, masterGroup):
28 self.
passWeighted = data.GetBinContent(RatesBins.PASS_WEIGHTED_OR_BIN.value)
32 self.
passRaw = data.GetBinContent(RatesBins.PASS_RAW_BIN.value)
46 self.
activeRaw = data.GetBinContent(RatesBins.ACTIVE_RAW_BIN.value)
49 self.
activeWeighted = data.GetBinContent(RatesBins.ACTIVE_WEIGHTED_BIN.value)
55 log.error(
"Normalisation factor not found in the input ntuple! Check if it's not corrupted")
74 prescales = metadata[
'prescales']
75 lowers = metadata[
'lowers']
76 express = metadata[
'express']
103 myDict[
'chain_prescale'] = self.
prescale
104 myDict[
'lower_chain_name'] = self.
lower
105 myDict[
'evts_passed'] = self.
passRaw
109 myDict[
'rate'] = self.
rate
110 myDict[
'rate_err'] = self.
rateErr
113 exportDict[self.
name] = myDict