CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Histogrammer.py
Go to the documentation of this file.
1 from PhysicsTools.HeppyCore.framework.analyzer import Analyzer
2 from ROOT import TH1F
3 
4 class Histogrammer(Analyzer):
5 
6  def beginLoop(self, setup):
7  super(Histogrammer, self).beginLoop(setup)
8  servname = '_'.join(['PhysicsTools.HeppyCore.framework.services.tfile.TFileService',
9  self.cfg_ana.file_label
10  ])
11  tfileservice = setup.services[servname]
12  tfileservice.file.cd()
13  self.hist = TH1F("hist", "an histogram", 200, 0, 200)
14 
15  def process(self, event):
16  self.hist.Fill(event.iEv)
17 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18