3 def var( tree, varName, type=float ):
4 tree.var(varName, type)
6 def fill( tree, varName, value ):
7 tree.fill( varName, value )
17 fill(tree,
'run', event.run)
18 fill(tree,
'lumi', event.lumi)
19 fill(tree,
'event', event.eventId)
25 var(tree,
'{pName}_pdgid'.
format(pName=pName))
26 var(tree,
'{pName}_e'.
format(pName=pName))
27 var(tree,
'{pName}_pt'.
format(pName=pName))
28 var(tree,
'{pName}_eta'.
format(pName=pName))
29 var(tree,
'{pName}_phi'.
format(pName=pName))
30 var(tree,
'{pName}_m'.
format(pName=pName))
31 var(tree,
'{pName}_q'.
format(pName=pName))
34 fill(tree,
'{pName}_pdgid'.
format(pName=pName), particle.pdgId() )
35 fill(tree,
'{pName}_e'.
format(pName=pName), particle.energy() )
36 fill(tree,
'{pName}_pt'.
format(pName=pName), particle.pt() )
37 fill(tree,
'{pName}_eta'.
format(pName=pName), particle.eta() )
38 fill(tree,
'{pName}_phi'.
format(pName=pName), particle.phi() )
39 fill(tree,
'{pName}_m'.
format(pName=pName), particle.mass() )
40 fill(tree,
'{pName}_q'.
format(pName=pName), particle.charge() )
43 var(tree,
'{pName}_pt'.
format(pName=pName))
44 var(tree,
'{pName}_phi'.
format(pName=pName))
45 var(tree,
'{pName}_sumet'.
format(pName=pName))
48 fill(tree,
'{pName}_pt'.
format(pName=pName), met.pt())
49 fill(tree,
'{pName}_phi'.
format(pName=pName), met.phi())
50 fill(tree,
'{pName}_sumet'.
format(pName=pName), met.sumEt())
60 fillTau(tree,
'{pName}_calo'.
format(pName=pName), tau.match_calo)
62 fillJet(tree,
'{pName}_pfjet'.
format(pName=pName), tau.match_pfjet)
67 var(tree,
'{pName}_nsigcharged'.
format(pName=pName))
68 var(tree,
'{pName}_isolation'.
format(pName=pName))
69 for discName
in discNames:
70 var(tree,
'{pName}_{disc}'.
format(pName=pName,
76 fill(tree,
'{pName}_nsigcharged'.
format(pName=pName), len(tau.signalCharged()))
77 fill(tree,
'{pName}_isolation'.
format(pName=pName), tau.isolation())
78 for discName, value
in tau.discs.iteritems():
79 fill(tree,
'{pName}_{disc}'.
format(pName=pName,
80 disc=discName), value)
86 var(tree,
'{pName}_e'.
format(pName=pName))
87 var(tree,
'{pName}_pt'.
format(pName=pName))
88 var(tree,
'{pName}_num'.
format(pName=pName))
91 fill(tree,
'{pName}_e'.
format(pName=pName), component.e() )
92 fill(tree,
'{pName}_pt'.
format(pName=pName), component.pt() )
93 fill(tree,
'{pName}_num'.
format(pName=pName), component.num() )
96 pdgids = [211, 22, 130, 11, 13]
108 component = jet.constituents.get(pdgid,
None)
109 if component
is not None:
111 '{pName}_{pdgid:d}'.
format(pName=pName, pdgid=pdgid),
114 import pdb; pdb.set_trace()