13 Modules required for calculating skim flags. Skim flags track whether an event passes a
14 skim, without the need to directly remove those events from processing.
22 *[Module for skim expert usage]* Create the EventExtraInfo DataStore object, and set
23 all required flag variables to zero.
27 Add this module to the path before adding any skims, so that the skim flags are
28 defined in the datastore for all events.
36 skims (skim.core.BaseSkim): Skim to initialise event flag for.
39 from variables
import variables
as vm
40 from ROOT
import Belle2
43 self.
skimsskims = skims
48 vm.addAlias(skim.flag, f
"eventExtraInfo({skim.flag})")
52 Register EventExtraInfo in datastore if it has not been registered already.
59 Initialise flags to zero.
63 for skim
in self.
skimsskims:
69 *[Module for skim expert usage]* Update the skim flag to be 1 if there is at least
70 one candidate in any of the skim lists.
74 Add this module to the post-skim path of each skim in the combined skim, as the
75 skim lists are only guaranteed to exist on the conditional path (if a
76 conditional path was used).
84 skim (skim.core.BaseSkim): Skim to update event flag for.
87 from ROOT
import Belle2
95 Check EventExtraInfo has been registered previously. This registration should be
96 done by InitialiseSkimFlag.
102 Check if at least one skim list is non-empty; if so, update the skim flag to 1.
105 from ROOT
import Belle2
110 if any([
not ListObj.isValid()
for ListObj
in ListObjects]):
112 f
"Error in UpdateSkimFlag for {self.skim}: particle lists not built. "
113 "Did you add this module to the pre-skim path rather than the post-skim path?"
116 nCandidates = sum(ListObj.getListSize()
for ListObj
in ListObjects)
a (simplified) python wrapper for StoreObjPtr.
def __init__(self, *skims)