1 from __future__
import print_function
3 from DataFormats.FWLite
import Events, Handle
11 def __init__(self, label, type, mayFail=False, fallbackLabel=None, lazy=True,disableAtFirstFail=True):
12 '''Note: label can be a tuple : (module_label, collection_label, process)''' 21 Handle.__init__(self, self.
type)
26 return super(AutoHandle,self).
product()
34 '''Load self from a given event. 36 Call this function, and then just call self.product() to get the collection''' 40 event.getByLabel( self.
label, self)
41 if not self.isValid():
raise RuntimeError
43 Handle.__init__(self, self.
type)
45 Cannot find collection with: 52 print(
"Disabling as there is no fallback ",self.
label,self.
type,
"at first failure")
57 if not self.isValid():
raise RuntimeError
61 Handle.__init__(self, self.
type)
63 Cannot find collection with: 65 label = {label} or {lab2} 70 print(
"Disabling after fallback ",self.
label,self.
type,
"at first failure")
72 if not self.isValid() :
def __init__(self, label, type, mayFail=False, fallbackLabel=None, lazy=True, disableAtFirstFail=True)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
label
if I succeeded, swap default and fallback assuming that the next event will be like this one ...
def ReallyLoad(self, event)