CMS 3D CMS Logo

SimpleTreeProducer.py
Go to the documentation of this file.
1 from PhysicsTools.HeppyCore.framework.analyzer import Analyzer
2 from PhysicsTools.HeppyCore.statistics.tree import Tree
3 from ROOT import TFile
4 
6 
7  def beginLoop(self, setup):
8  super(SimpleTreeProducer, self).beginLoop(setup)
9  self.rootfile = TFile('/'.join([self.dirName,
10  'simple_tree.root']),
11  'recreate')
12  self.tree = Tree( self.cfg_ana.tree_name,
13  self.cfg_ana.tree_title )
14  self.tree.var('test_variable')
15 
16  def process(self, event):
17  self.tree.fill('test_variable', event.input.var1)
18  self.tree.tree.Fill()
19 
20  def write(self, setup):
21  self.rootfile.Write()
22  self.rootfile.Close()
23 
SimpleTreeProducer.SimpleTreeProducer.write
def write(self, setup)
Definition: SimpleTreeProducer.py:20
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
SimpleTreeProducer.SimpleTreeProducer
Definition: SimpleTreeProducer.py:5
remoteMonitoring_LED_IterMethod_cfg.Analyzer
Analyzer
Definition: remoteMonitoring_LED_IterMethod_cfg.py:32
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
SimpleTreeProducer.SimpleTreeProducer.tree
tree
Definition: SimpleTreeProducer.py:12
SimpleTreeProducer.SimpleTreeProducer.beginLoop
def beginLoop(self, setup)
Definition: SimpleTreeProducer.py:7
SimpleTreeProducer.SimpleTreeProducer.process
def process(self, event)
Definition: SimpleTreeProducer.py:16
SimpleTreeProducer.SimpleTreeProducer.rootfile
rootfile
Definition: SimpleTreeProducer.py:9