5 from DataFormats.FWLite
import Events, Handle
7 files = [
"patTuple.root"]
8 events = Events (files)
9 handle = Handle (
"std::vector<pat::Muon>")
13 label = (
"cleanPatMuons")
15 f = ROOT.TFile(
"analyzerPython.root",
"RECREATE")
18 muonPt = ROOT.TH1F(
"muonPt",
"pt", 100, 0.,300.)
19 muonEta = ROOT.TH1F(
"muonEta",
"eta", 100, -3., 3.)
20 muonPhi = ROOT.TH1F(
"muonPhi",
"phi", 100, -5., 5.)
28 event.getByLabel (label, handle)
30 muons = handle.product()
33 muonPt.Fill( muon.pt() )
34 muonEta.Fill( muon.eta() )
35 muonPhi.Fill( muon.phi() )