2 from DataFormats.FWLite
import Events, Handle
10 def __init__(self, label, type, mayFail=False, fallbackLabel=None):
11 '''Note: label can be a tuple : (module_label, collection_label, process)'''
16 Handle.__init__(self, self.
type)
19 '''Load self from a given event.
21 Call this function, and then just call self.product() to get the collection'''
23 event.getByLabel( self.
label, self)
24 if not self.isValid():
raise RuntimeError
26 Handle.__init__(self, self.
type)
28 Cannot find collection with:
37 if not self.isValid():
raise RuntimeError
41 Handle.__init__(self, self.
type)
43 Cannot find collection with:
45 label = {label} or {lab2}
label
if I succeeded, swap default and fallback assuming that the next event will be like this one ...