CMS 3D CMS Logo

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

Functions

def bookComponent
 
def bookEvent
 
def bookGenTau
 
def bookJet
 
def bookMet
 
def bookParticle
 
def bookTau
 
def fill
 
def fillComponent
 
def fillEvent
 
def fillGenTau
 
def fillJet
 
def fillMet
 
def fillParticle
 
def fillTau
 
def var
 

Variables

list pdgids = [211, 22, 130, 11, 13]
 

Function Documentation

def ntuple.bookComponent (   tree,
  pName 
)

Definition at line 85 of file ntuple.py.

References var().

Referenced by bookJet().

85 
86 def bookComponent( tree, pName ):
87  var(tree, '{pName}_e'.format(pName=pName))
88  var(tree, '{pName}_pt'.format(pName=pName))
89  var(tree, '{pName}_num'.format(pName=pName))
def var
Definition: ntuple.py:3
def bookComponent
Definition: ntuple.py:85
def ntuple.bookEvent (   tree)

Definition at line 11 of file ntuple.py.

References var().

11 
12 def bookEvent(tree):
13  var(tree, 'run')
14  var(tree, 'lumi')
15  var(tree, 'event')
def var
Definition: ntuple.py:3
def bookEvent
Definition: ntuple.py:11
def ntuple.bookGenTau (   tree,
  pName,
  pfdiscs,
  calodiscs 
)

Definition at line 52 of file ntuple.py.

References bookJet(), and bookTau().

52 
53 def bookGenTau(tree, pName, pfdiscs, calodiscs):
54  bookJet(tree, pName)
55  bookTau(tree, '{pName}_calo'.format(pName=pName), calodiscs)
56  bookTau(tree, '{pName}_pf'.format(pName=pName), pfdiscs)
57  bookJet(tree, '{pName}_pfjet'.format(pName=pName))
def bookTau
Definition: ntuple.py:65
def bookGenTau
Definition: ntuple.py:52
def bookJet
Definition: ntuple.py:98
def ntuple.bookJet (   tree,
  pName 
)

Definition at line 98 of file ntuple.py.

References bookComponent(), and bookParticle().

Referenced by SimpleTreeAnalyzer.ZJetsTreeAnalyzer.beginLoop(), and bookGenTau().

98 
99 def bookJet( tree, pName ):
100  bookParticle(tree, pName )
101  for pdgid in pdgids:
102  bookComponent(tree, '{pName}_{pdgid:d}'.format(pName=pName, pdgid=pdgid))
103  # var(tree, '{pName}_npart'.format(pName=pName))
def bookJet
Definition: ntuple.py:98
def bookComponent
Definition: ntuple.py:85
def bookParticle
Definition: ntuple.py:24
def ntuple.bookMet (   tree,
  pName 
)

Definition at line 42 of file ntuple.py.

References var().

42 
43 def bookMet(tree, pName):
44  var(tree, '{pName}_pt'.format(pName=pName))
45  var(tree, '{pName}_phi'.format(pName=pName))
46  var(tree, '{pName}_sumet'.format(pName=pName))
def bookMet
Definition: ntuple.py:42
def var
Definition: ntuple.py:3
def ntuple.bookParticle (   tree,
  pName 
)

Definition at line 24 of file ntuple.py.

References var().

Referenced by ZJetsTreeAnalyzer.ZJetsTreeAnalyzer.beginLoop(), bookJet(), and bookTau().

24 
25 def bookParticle( tree, pName ):
26  var(tree, '{pName}_pdgid'.format(pName=pName))
27  var(tree, '{pName}_e'.format(pName=pName))
28  var(tree, '{pName}_pt'.format(pName=pName))
29  var(tree, '{pName}_eta'.format(pName=pName))
30  var(tree, '{pName}_phi'.format(pName=pName))
31  var(tree, '{pName}_m'.format(pName=pName))
32  var(tree, '{pName}_q'.format(pName=pName))
def var
Definition: ntuple.py:3
def bookParticle
Definition: ntuple.py:24
def ntuple.bookTau (   tree,
  pName,
  discNames 
)

Definition at line 65 of file ntuple.py.

References bookParticle(), and var().

Referenced by bookGenTau().

65 
66 def bookTau(tree, pName, discNames):
67  bookParticle(tree, pName)
68  var(tree, '{pName}_nsigcharged'.format(pName=pName))
69  var(tree, '{pName}_isolation'.format(pName=pName))
70  for discName in discNames:
71  var(tree, '{pName}_{disc}'.format(pName=pName,
72  disc=discName))
def bookTau
Definition: ntuple.py:65
def var
Definition: ntuple.py:3
def bookParticle
Definition: ntuple.py:24
def ntuple.fill (   tree,
  varName,
  value 
)

Definition at line 6 of file ntuple.py.

Referenced by fillComponent(), fillEvent(), fillMet(), fillParticle(), and fillTau().

6 
7 def fill( tree, varName, value ):
8  tree.fill( varName, value )
9 
10 # event information
def fill
Definition: ntuple.py:6
def ntuple.fillComponent (   tree,
  pName,
  component 
)

Definition at line 90 of file ntuple.py.

References fill().

Referenced by fillJet().

90 
91 def fillComponent(tree, pName, component):
92  fill(tree, '{pName}_e'.format(pName=pName), component.e() )
93  fill(tree, '{pName}_pt'.format(pName=pName), component.pt() )
94  fill(tree, '{pName}_num'.format(pName=pName), component.num() )
95 
def fill
Definition: ntuple.py:6
def fillComponent
Definition: ntuple.py:90
def ntuple.fillEvent (   tree,
  event 
)

Definition at line 16 of file ntuple.py.

References fill().

Referenced by ThePEG::LesHouchesInterface.doReadEvent(), and ThePEG::LesHouchesInterface.getEvent().

16 
17 def fillEvent(tree, event):
18  fill(tree, 'run', event.run)
19  fill(tree, 'lumi', event.lumi)
20  fill(tree, 'event', event.eventId)
21 
22 
23 # simple particle
def fillEvent
Definition: ntuple.py:16
def fill
Definition: ntuple.py:6
def ntuple.fillGenTau (   tree,
  pName,
  tau 
)

Definition at line 58 of file ntuple.py.

References fillJet(), and fillTau().

58 
59 def fillGenTau(tree, pName, tau):
60  fillJet(tree, pName, tau)
61  fillTau(tree, '{pName}_calo'.format(pName=pName), tau.match_calo)
62  fillTau(tree, '{pName}_pf'.format(pName=pName), tau.match_pf)
63  fillJet(tree, '{pName}_pfjet'.format(pName=pName), tau.match_pfjet)
64 
def fillJet
Definition: ntuple.py:104
def fillGenTau
Definition: ntuple.py:58
def fillTau
Definition: ntuple.py:73
def ntuple.fillJet (   tree,
  pName,
  jet 
)

Definition at line 104 of file ntuple.py.

References fillComponent(), and fillParticle().

Referenced by fillGenTau(), and SimpleTreeAnalyzer.ZJetsTreeAnalyzer.process().

105 def fillJet( tree, pName, jet ):
106  if not jet: return
107  fillParticle(tree, pName, jet )
108  for pdgid in pdgids:
109  component = jet.constituents.get(pdgid, None)
110  if component is not None:
111  fillComponent(tree,
112  '{pName}_{pdgid:d}'.format(pName=pName, pdgid=pdgid),
113  component )
114  else:
115  import pdb; pdb.set_trace()
116  print jet
117 
def fillJet
Definition: ntuple.py:104
def fillParticle
Definition: ntuple.py:33
def fillComponent
Definition: ntuple.py:90
def ntuple.fillMet (   tree,
  pName,
  met 
)

Definition at line 47 of file ntuple.py.

References fill().

47 
48 def fillMet(tree, pName, met):
49  fill(tree, '{pName}_pt'.format(pName=pName), met.pt())
50  fill(tree, '{pName}_phi'.format(pName=pName), met.phi())
51  fill(tree, '{pName}_sumet'.format(pName=pName), met.sumEt())
def fill
Definition: ntuple.py:6
def fillMet
Definition: ntuple.py:47
def ntuple.fillParticle (   tree,
  pName,
  particle 
)

Definition at line 33 of file ntuple.py.

References fill().

Referenced by fillJet(), fillTau(), and ZJetsTreeAnalyzer.ZJetsTreeAnalyzer.process().

33 
34 def fillParticle( tree, pName, particle ):
35  fill(tree, '{pName}_pdgid'.format(pName=pName), particle.pdgId() )
36  fill(tree, '{pName}_e'.format(pName=pName), particle.energy() )
37  fill(tree, '{pName}_pt'.format(pName=pName), particle.pt() )
38  fill(tree, '{pName}_eta'.format(pName=pName), particle.eta() )
39  fill(tree, '{pName}_phi'.format(pName=pName), particle.phi() )
40  fill(tree, '{pName}_m'.format(pName=pName), particle.mass() )
41  fill(tree, '{pName}_q'.format(pName=pName), particle.charge() )
def fillParticle
Definition: ntuple.py:33
def fill
Definition: ntuple.py:6
def ntuple.fillTau (   tree,
  pName,
  tau 
)

Definition at line 73 of file ntuple.py.

References fill(), and fillParticle().

Referenced by fillGenTau().

73 
74 def fillTau(tree, pName, tau):
75  if not tau: return
76  fillParticle(tree, pName, tau)
77  fill(tree, '{pName}_nsigcharged'.format(pName=pName), len(tau.signalCharged()))
78  fill(tree, '{pName}_isolation'.format(pName=pName), tau.isolation())
79  for discName, value in tau.discs.iteritems():
80  fill(tree, '{pName}_{disc}'.format(pName=pName,
81  disc=discName), value)
82 
83 
84 # jet
def fillParticle
Definition: ntuple.py:33
def fillTau
Definition: ntuple.py:73
def fill
Definition: ntuple.py:6
def ntuple.var (   tree,
  varName,
  type = float 
)

Definition at line 3 of file ntuple.py.

Referenced by bookComponent(), bookEvent(), bookMet(), bookParticle(), and bookTau().

3 
4 def var( tree, varName, type=float ):
5  tree.var(varName, type)
def var
Definition: ntuple.py:3

Variable Documentation

list ntuple.pdgids = [211, 22, 130, 11, 13]

Definition at line 96 of file ntuple.py.