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 self.
treename = getattr(cfg_ana,
"treename",
"tree")
19 super(TreeAnalyzerNumpy, self).
beginLoop(setup)
24 fileName =
'/'.
join([self.dirName,
26 isCompressed = self.cfg_ana.isCompressed
if hasattr(self.cfg_ana,
'isCompressed')
else 1
27 print 'Compression', isCompressed
28 self.
file = TFile( fileName,
'recreate',
'', isCompressed )
31 raise RuntimeError(
"You are booking two Trees with the same name in the same file")
33 self.tree.setDefaultFloatType(getattr(self.cfg_ana,
'defaultFloatType',
'D'));
37 print 'TreeAnalyzerNumpy.declareVariables : overload this function.' 41 super(TreeAnalyzerNumpy, self).
write(setup)
def __init__(self, cfg_ana, cfg_comp, looperName)
def beginLoop(self, setup)
static std::string join(char **cmd)
def declareVariables(self, setup)