ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.RatesTrigger.RatesTrigger Class Reference
Collaboration diagram for python.RatesTrigger.RatesTrigger:

Public Member Functions

def __init__ (self, name, metadata, data, masterGroup)
 
def export (self, exportDict)
 

Public Attributes

 name
 
 passWeighted
 
 passWeightedErr
 
 passRaw
 
 passExpressWeighted
 
 passExpressWeightedErr
 
 passUniqueWeighted
 
 passUniqueWeightedErr
 
 passMasterWeighted
 
 activeRaw
 
 activeWeighted
 
 activeWeightedErr
 
 rateDenominator
 
 rate
 
 rateErr
 
 efficiency
 
 efficiencyErr
 
 rateExpress
 
 rateExpressErr
 
 prescale
 
 lower
 
 expressPrescale
 
 rateUnique
 
 rateUniqueErr
 
 masterRate
 
 uniqueFraction
 

Detailed Description

Definition at line 24 of file RatesTrigger.py.

Constructor & Destructor Documentation

◆ __init__()

def python.RatesTrigger.RatesTrigger.__init__ (   self,
  name,
  metadata,
  data,
  masterGroup 
)

Definition at line 25 of file RatesTrigger.py.

25  def __init__(self, name, metadata, data, masterGroup):
26  self.name = name
27  # Total weighted events passing the trigger
28  self.passWeighted = data.GetBinContent(RatesBins.PASS_WEIGHTED_OR_BIN.value)
29  self.passWeightedErr = data.GetBinError(RatesBins.PASS_WEIGHTED_OR_BIN.value)
30 
31  # Total un-weighted events passing the trigger
32  self.passRaw = data.GetBinContent(RatesBins.PASS_RAW_BIN.value)
33 
34  # Total weighted events passing the trigger, using the express prescale
35  self.passExpressWeighted = data.GetBinContent(RatesBins.EXPRESS_BIN.value)
36  self.passExpressWeightedErr = data.GetBinError(RatesBins.EXPRESS_BIN.value)
37 
38  # Total weighted events passing a full hypothetical menu which *excluded* this trigger
39  self.passUniqueWeighted = data.GetBinContent(RatesBins.UNIQUE_BIN.value)
40  self.passUniqueWeightedErr = data.GetBinError(RatesBins.UNIQUE_BIN.value)
41 
42  # Total weighted events passing the full menu (full L1 for L1 chains, full HLT for HLT chains)
43  self.passMasterWeighted = masterGroup.GetBinContent(RatesBins.PASS_WEIGHTED_OR_BIN.value)
44 
45  # Total un-weighted number of events in which the trigger was active (always active if L1)
46  self.activeRaw = data.GetBinContent(RatesBins.ACTIVE_RAW_BIN.value)
47 
48  # Total weighted number of events in which the trigger was active
49  self.activeWeighted = data.GetBinContent(RatesBins.ACTIVE_WEIGHTED_BIN.value)
50  self.activeWeightedErr = data.GetBinError(RatesBins.ACTIVE_WEIGHTED_BIN.value)
51 
52  # Wall-time in seconds. No error on this.
53  self.rateDenominator = metadata['normalisation']
54  if not self.rateDenominator:
55  log.error("Normalisation factor not found in the input ntuple! Check if it's not corrupted")
56  raise ValueError
57 
58  # Trigger's rate is total weighted passing events normalised to wall-time
59  self.rate = self.passWeighted / self.rateDenominator
60  self.rateErr = self.passWeightedErr / self.rateDenominator
61 
62  # Trigger's efficiency is the fraction of active events which are passed. Error propagated.
63  self.efficiency = self.passWeighted / self.activeWeighted if self.activeWeighted > 0.0 else 0.0
64  self.efficiencyErr = 0
65  if self.passWeighted != 0 and self.activeWeighted != 0:
66  fracErr = math.sqrt( math.pow(self.passWeightedErr/self.passWeighted,2) + math.pow(self.activeWeightedErr/self.activeWeighted,2) )
67  self.efficiencyErr = self.efficiency * fracErr
68 
69  # Rate using express prescales
70  self.rateExpress = self.passExpressWeighted / self.rateDenominator
71  self.rateExpressErr = self.passExpressWeightedErr / self.rateDenominator
72 
73  # Some menu-derived metadata
74  prescales = metadata['prescales']
75  lowers = metadata['lowers']
76  express = metadata['express']
77  self.prescale = prescales.get(name, 1)
78  self.lower = lowers.get(name)
79  self.expressPrescale = express.get(name)
80 
81  # Unique rate requires the subtraction of the (all minus this trigger) total from the (all triggers) total
82  # The error is taken as a fractional error on the main rate calc
83  # Disabled items should have unique rate = 0
84  if self.prescale != "Multiple" and float(self.prescale) <= 0:
85  self.rateUnique = 0
86  self.rateUniqueErr = 0
87  else:
88  self.rateUnique = (self.passMasterWeighted - self.passUniqueWeighted) / self.rateDenominator
89  self.rateUniqueErr = 0
90  if self.passWeighted != 0:
91  self.rateUniqueErr = (self.passWeightedErr / self.passWeighted) * self.rateUnique
92 
93  # The total rate of all triggers
94  self.masterRate = self.passMasterWeighted / self.rateDenominator
95 
96  # What fraction of the total rate is unique to this trigger
97  self.uniqueFraction = 0 if self.masterRate == 0 else self.rateUnique / self.masterRate
98 
99 

Member Function Documentation

◆ export()

def python.RatesTrigger.RatesTrigger.export (   self,
  exportDict 
)

Definition at line 100 of file RatesTrigger.py.

100  def export(self, exportDict):
101  myDict = {}
102  myDict['express_stream'] = self.rateExpress
103  myDict['chain_prescale'] = self.prescale
104  myDict['lower_chain_name'] = self.lower
105  myDict['evts_passed'] = self.passRaw
106  myDict['evts_passed_weighted'] = self.passWeighted
107  myDict['efficiency'] = self.efficiency
108  myDict['efficiency_err'] = self.efficiencyErr
109  myDict['rate'] = self.rate
110  myDict['rate_err'] = self.rateErr
111  myDict['unique_fraction'] = self.uniqueFraction
112  myDict['unique_rate'] = self.rateUnique
113  exportDict[self.name] = myDict

Member Data Documentation

◆ activeRaw

python.RatesTrigger.RatesTrigger.activeRaw

Definition at line 46 of file RatesTrigger.py.

◆ activeWeighted

python.RatesTrigger.RatesTrigger.activeWeighted

Definition at line 49 of file RatesTrigger.py.

◆ activeWeightedErr

python.RatesTrigger.RatesTrigger.activeWeightedErr

Definition at line 50 of file RatesTrigger.py.

◆ efficiency

python.RatesTrigger.RatesTrigger.efficiency

Definition at line 63 of file RatesTrigger.py.

◆ efficiencyErr

python.RatesTrigger.RatesTrigger.efficiencyErr

Definition at line 64 of file RatesTrigger.py.

◆ expressPrescale

python.RatesTrigger.RatesTrigger.expressPrescale

Definition at line 79 of file RatesTrigger.py.

◆ lower

python.RatesTrigger.RatesTrigger.lower

Definition at line 78 of file RatesTrigger.py.

◆ masterRate

python.RatesTrigger.RatesTrigger.masterRate

Definition at line 94 of file RatesTrigger.py.

◆ name

python.RatesTrigger.RatesTrigger.name

Definition at line 26 of file RatesTrigger.py.

◆ passExpressWeighted

python.RatesTrigger.RatesTrigger.passExpressWeighted

Definition at line 35 of file RatesTrigger.py.

◆ passExpressWeightedErr

python.RatesTrigger.RatesTrigger.passExpressWeightedErr

Definition at line 36 of file RatesTrigger.py.

◆ passMasterWeighted

python.RatesTrigger.RatesTrigger.passMasterWeighted

Definition at line 43 of file RatesTrigger.py.

◆ passRaw

python.RatesTrigger.RatesTrigger.passRaw

Definition at line 32 of file RatesTrigger.py.

◆ passUniqueWeighted

python.RatesTrigger.RatesTrigger.passUniqueWeighted

Definition at line 39 of file RatesTrigger.py.

◆ passUniqueWeightedErr

python.RatesTrigger.RatesTrigger.passUniqueWeightedErr

Definition at line 40 of file RatesTrigger.py.

◆ passWeighted

python.RatesTrigger.RatesTrigger.passWeighted

Definition at line 28 of file RatesTrigger.py.

◆ passWeightedErr

python.RatesTrigger.RatesTrigger.passWeightedErr

Definition at line 29 of file RatesTrigger.py.

◆ prescale

python.RatesTrigger.RatesTrigger.prescale

Definition at line 77 of file RatesTrigger.py.

◆ rate

python.RatesTrigger.RatesTrigger.rate

Definition at line 59 of file RatesTrigger.py.

◆ rateDenominator

python.RatesTrigger.RatesTrigger.rateDenominator

Definition at line 53 of file RatesTrigger.py.

◆ rateErr

python.RatesTrigger.RatesTrigger.rateErr

Definition at line 60 of file RatesTrigger.py.

◆ rateExpress

python.RatesTrigger.RatesTrigger.rateExpress

Definition at line 70 of file RatesTrigger.py.

◆ rateExpressErr

python.RatesTrigger.RatesTrigger.rateExpressErr

Definition at line 71 of file RatesTrigger.py.

◆ rateUnique

python.RatesTrigger.RatesTrigger.rateUnique

Definition at line 85 of file RatesTrigger.py.

◆ rateUniqueErr

python.RatesTrigger.RatesTrigger.rateUniqueErr

Definition at line 86 of file RatesTrigger.py.

◆ uniqueFraction

python.RatesTrigger.RatesTrigger.uniqueFraction

Definition at line 97 of file RatesTrigger.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
readCCLHist.float
float
Definition: readCCLHist.py:83