CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
example Namespace Reference

Functions

def eventLoop
 

Function Documentation

def example.eventLoop (   filename)

Definition at line 20 of file example.py.

20 
21 def eventLoop(filename):
22  f = ROOT.TFile(filename)
23 
24  treeL1 = f.Get("l1NtupleProducer/L1Tree")
25  treeTow = f.Get("l1CaloTowerTreeProducer/L1CaloTowerTree")
26 # tree_l1ex = f.Get("l1ExtraTreeProducer/L1ExtraTree")
27  treeL1up = f.Get("l1UpgradeTreeProducer/L1UpgradeTree")
28 
29  treeJet = f.Get("l1JetRecoTreeProducer/JetRecoTree")
30 # treeEG = f.Get("l1EGRecoTreeProducer/EGRecoTree")
31 # treeTau = f.Get("l1TauRecoTreeProducer/TauRecoTree")
32 # treeMu = f.Get("l1MuonRecoTreeProducer/MuonRecoTree")
33 
34  treeL1.AddFriend(treeTow)
35 # treeL1.AddFriend(treeL1ex)
36  treeL1.AddFriend(treeL1up)
37  treeL1.AddFriend(treeJet)
38 
39 
40  for jentry, event in enumerate(tree):
41  if jentry >= nevents:
42  break
43 
44  event = treeL1.Event
45  eventSim = treeL1.Simulation
46  eventRCT = treeL1.RCT
47  eventGCT = treeL1.GCT
48  eventDTTF = treeL1.DTTF
49  eventCSCTF = treeL1.CSCTF
50  eventGMT = treeL1.GMT
51  eventGT = treeL1.GT
52 
53  eventCaloTP = treeTow.CaloTP
54  eventTower = treeTow.L1CaloTower
55 
56  eventL1Up = treeL1up.L1Upgrade
57 
58  eventJet = treeJet.Jet
59 
60 # eventEG = treeEG.EG
61 
62 # eventTau = treeTau.Tau
63 
64 # eventMuon = treeMu.Mu
65 
66 
67  # Print hists to file
68  c = ROOT.TCanvas()
69 
70 
71  h.Draw("")
72  h.SetTitleOffset(0.55, 'Z')
73  c.Print("plot.pdf")
74 
75  f.Close() # make sure I go last! otherwise your hists will be NoneType
76 
def eventLoop
Definition: example.py:20