1 from __future__
import print_function
2 from DataFormats.FWLite
import Events
as FWLiteEvents
4 from ROOT
import gROOT, gSystem, AutoLibraryLoader
6 print(
"Loading FW Lite")
7 gSystem.Load(
"libFWCoreFWLite");
8 gROOT.ProcessLine(
'FWLiteEnabler::enable();')
10 gSystem.Load(
"libFWCoreFWLite");
11 gSystem.Load(
"libDataFormatsPatCandidates");
13 from ROOT
import gInterpreter
14 gInterpreter.ProcessLine(
"using namespace reco;")
15 gInterpreter.ProcessLine(
"using edm::refhelper::FindUsingAdvance;")
18 def __init__(self, files, tree_name, options=None):
19 if options
is not None :
20 if not hasattr(options,
"inputFiles"):
21 options.inputFiles=files
22 if not hasattr(options,
"maxEvents"):
24 if not hasattr(options,
"secondaryInputFiles"):
25 options.secondaryInputFiles = []
26 self.
events = FWLiteEvents(options=options)
28 self.
events = FWLiteEvents(files)
34 return getattr(self.
events, key)