Belle II Software development
EffModule Class Reference
Inheritance diagram for EffModule:

Public Member Functions

def __init__ (self, Belle2Phase)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 Belle2Phase
 Belle2 phase.
 
 Ntot_event
 Total number of events.
 

Static Public Attributes

int Ntot_event = 0
 The total number of events.
 
int Ntrg_event = 0
 The number of events passing L1 trigger.
 
list Nsubtrg_event = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 The number of events passing each L1 trigger line.
 
list prescale_phase2 = [1, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
 prescale factors for phase2
 
list prescale_phase3 = [1, 1, 20, 2, 1, 1, 1, 1, 2, 1, 1, 20, 20, 1, 5, 1, 3, 5, 1, 1, 1, 1, 1]
 prescale factors for phase3
 
list trglog_phase2
 trigger bit log for phase2
 
list trglog_phase3
 trigger bit log for phase3
 

Detailed Description

This module is to calculate and print out the efficiency of each L1 trigger line with
the trigger result from object 'TRGGDLResults'

Definition at line 15 of file effCalculation.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  Belle2Phase 
)
Initialization of EffModule

Definition at line 90 of file effCalculation.py.

90 def __init__(self, Belle2Phase):
91 """Initialization of EffModule"""
92 super().__init__()
93
94 self.Belle2Phase = Belle2Phase
95

Member Function Documentation

◆ event()

def event (   self)
Event function to count the numbers of events passing each trigger line

Definition at line 96 of file effCalculation.py.

96 def event(self):
97 """
98 Event function to count the numbers of events passing each trigger line
99 """
100 self.Ntot_event += 1
101 trgresult = Belle2.PyStoreObj('TRGSummary')
102 summary = trgresult.getPsnmBits(0)
103 if summary >= 1:
104 self.Ntrg_event += 1
105 sum_bin = bin(summary)
106 for i in range(len(sum_bin) - 2):
107 trg = int(sum_bin[len(sum_bin) - 1 - i])
108 if trg == 1:
109 self.Nsubtrg_event[i] += 1
110
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ terminate()

def terminate (   self)
Calculate the efficiency of each trigger line with the statistical values in event function

Definition at line 111 of file effCalculation.py.

111 def terminate(self):
112 """
113 Calculate the efficiency of each trigger line with the statistical values in event function
114 """
115 trglog = []
116 prescale = []
117 if self.Belle2Phase == "Phase2":
118 trglog = self.trglog_phase2
119 prescale = self.prescale_phase2
120 else:
121 trglog = self.trglog_phase3
122 prescale = self.prescale_phase3
123
124
125 if self.Ntot_event == 0:
126 return
127 sp = ' '
128 print('\n')
129 eff_tot = self.Ntrg_event / self.Ntot_event * 100.0
130 print(f'L1 Trigger efficiency(%): {eff_tot:6.2f}')
131 print('Trigger Line', 5 * sp, 'PreScale Factor', 3 * sp, 'Efficiency(%)', 3 * sp, 'Logics')
132 ntrg = len(self.Nsubtrg_event)
133 if self.Ntot_event != 0:
134 for i in range(ntrg):
135 eff = self.Nsubtrg_event[i] / self.Ntot_event * 100.0
136 print(f'T{int(i):3} {int(prescale[i]):4} {eff:6.2f} {trglog[i]} ')
137
138

Member Data Documentation

◆ Belle2Phase

Belle2Phase

Belle2 phase.

Definition at line 94 of file effCalculation.py.

◆ Nsubtrg_event

list Nsubtrg_event = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
static

The number of events passing each L1 trigger line.

Definition at line 25 of file effCalculation.py.

◆ Ntot_event [1/2]

int Ntot_event = 0
static

The total number of events.

Definition at line 21 of file effCalculation.py.

◆ Ntot_event [2/2]

Ntot_event

Total number of events.

Definition at line 125 of file effCalculation.py.

◆ Ntrg_event

int Ntrg_event = 0
static

The number of events passing L1 trigger.

Definition at line 23 of file effCalculation.py.

◆ prescale_phase2

list prescale_phase2 = [1, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
static

prescale factors for phase2

Definition at line 27 of file effCalculation.py.

◆ prescale_phase3

list prescale_phase3 = [1, 1, 20, 2, 1, 1, 1, 1, 2, 1, 1, 20, 20, 1, 5, 1, 3, 5, 1, 1, 1, 1, 1]
static

prescale factors for phase3

Definition at line 29 of file effCalculation.py.

◆ trglog_phase2

list trglog_phase2
static
Initial value:
= ['3 or more 3D tracks',
'2 3D tracks, ≥1 within 25 cm, not a trkBhabha',
'2 3D tracks, not a trkBhabha',
'2 3D tracks, trkBhabha',
'1 track, <25cm, clust same hemi, no 2 GeV clust',
'1 track, <25cm, clust opp hemi, no 2 GeV clust',
'≥3 clusters inc. ≥1 300 MeV, not an eclBhabha',
'2 GeV E* in [4,14], not a trkBhabha',
'2 GeV E* in [4,14], trkBhabha',
'2 GeV E* in 2,3,15 or 16, not a trkBhabha or eclBhabha',
'2 GeV E* in 2,3,15 or 16, trkBhabha or eclBhabha',
'2 GeV E* in 1 or 17, not a trkBhabha or eclBhabha',
'2 GeV E* in 1 or 17, trkBhabha or eclBhabha',
'exactly 1 E*>1 GeV and 1 E>300 MeV, in [4,15]',
'exactly 1 E*>1 GeV and 1 E>300 MeV, in 2,3 or 16',
'clusters back-to-back in phi, both >250 MeV, no 2 GeV',
'clusters back-to-back in phi, 1 <250 MeV, no 2 GeV',
'clusters back-to-back in 3D, no 2 GeV',
'eed: two matched & cluster b2b',
'fed: one track & one matched & cluster b2b',
'fp: one track & track-cluster b2b',
'eeb: two matched & track b2b',
'fep: one track & one matched & track-cluster b2b'
]

trigger bit log for phase2

Definition at line 32 of file effCalculation.py.

◆ trglog_phase3

list trglog_phase3
static
Initial value:
= ['3 or more 3D tracks',
'2 3D tracks, ≥1 within 10 cm, not a trkBhabha',
'2 3D tracks, not a trkBhabha',
'2 3D tracks, trkBhabha',
'1 track, <10cm, clust same hemi, no 2 GeV clust',
'1 track, <10cm, clust opp hemi, no 2 GeV clust',
'≥3 clusters inc. ≥2 300 MeV, not an eclBhabha',
'2 GeV E* in [4,14], not a trkBhabha',
'2 GeV E* in [4,14], trkBhabha',
'2 GeV E* in 2,3,15 or 16, not a trkBhabha or eclBhabha',
'2 GeV E* in 2,3,15 or 16, trkBhabha or eclBhabha',
'2 GeV E* in 1 or 17, not a trkBhabha or eclBhabha',
'2 GeV E* in 1 or 17, trkBhabha or eclBhabha',
'exactly 1 E*>1 GeV and 1 E>300 MeV, in [4,15]',
'exactly 1 E*>1 GeV and 1 E>300 MeV, in 2,3 or 16',
'clusters back-to-back in phi, both >250 MeV, no 2 GeV',
'clusters back-to-back in phi, 1 <250 MeV, no 2 GeV, TrkZ25 is 3D track',
'clusters back-to-back in 3D, no 2 GeV',
'eed: two matched & cluster b2b',
'fed: one track & one matched & cluster b2b',
'fp: one track & track-cluster b2b',
'eeb: two matched & track b2b',
'fep: one track & one matched & track-cluster b2b'
]

trigger bit log for phase3

Definition at line 58 of file effCalculation.py.


The documentation for this class was generated from the following file: