2 from DataFormats.FWLite
import Events, Handle
10 def __init__(self, label, type, mayFail=False, fallbackLabel=None, lazy=True,disableAtFirstFail=True):
11 '''Note: label can be a tuple : (module_label, collection_label, process)''' 20 Handle.__init__(self, self.
type)
25 return super(AutoHandle,self).
product()
33 '''Load self from a given event. 35 Call this function, and then just call self.product() to get the collection''' 39 event.getByLabel( self.
label, self)
40 if not self.isValid():
raise RuntimeError
42 Handle.__init__(self, self.
type)
44 Cannot find collection with: 51 print "Disabling as there is no fallback ",self.
label,self.
type,
"at first failure" 56 if not self.isValid():
raise RuntimeError
60 Handle.__init__(self, self.
type)
62 Cannot find collection with: 64 label = {label} or {lab2} 69 print "Disabling after fallback ",self.
label,self.
type,
"at first failure" 71 if not self.isValid() :
74 print "Disabling ",self.
label,self.
type,
"at first failure" def __init__(self, label, type, mayFail=False, fallbackLabel=None, lazy=True, disableAtFirstFail=True)
label
if I succeeded, swap default and fallback assuming that the next event will be like this one ...
def ReallyLoad(self, event)