1 from PhysicsTools.Heppy.analyzers.core.Analyzer
import Analyzer
2 from PhysicsTools.HeppyCore.statistics.tree
import Tree
as Tree
6 """Base TreeAnalyzerNumpy, to create flat TTrees.
8 Check out TestTreeAnalyzer for a concrete example.
9 IMPORTANT: FOR NOW, CANNOT RUN SEVERAL TreeAnalyzers AT THE SAME TIME!
10 Anyway, you want only one TTree, don't you?"""
12 def __init__(self, cfg_ana, cfg_comp, looperName):
13 super(TreeAnalyzerNumpy,self).
__init__(cfg_ana, cfg_comp, looperName)
15 if hasattr(cfg_ana,
"outservicename") :
20 super(TreeAnalyzerNumpy, self).
beginLoop(setup)
26 fileName =
'/'.
join([self.dirName,
28 isCompressed = self.cfg_ana.isCompressed
if hasattr(self.cfg_ana,
'isCompressed')
else 1
29 print 'Compression', isCompressed
30 self.
file = TFile( fileName,
'recreate',
'', isCompressed )
31 self.
tree = Tree(
'tree', self.name)
32 self.tree.setDefaultFloatType(getattr(self.cfg_ana,
'defaultFloatType',
'D'));
36 print 'TreeAnalyzerNumpy.declareVariables : overload this function.'
40 super(TreeAnalyzerNumpy, self).
write(setup)
static std::string join(char **cmd)