CMS 3D CMS Logo

Functions | Variables
ntuple Namespace Reference

Functions

def bookComponent (tree, pName)
 
def bookEvent (tree)
 
def bookGenTau (tree, pName, pfdiscs, calodiscs)
 
def bookJet (tree, pName)
 
def bookMet (tree, pName)
 
def bookParticle (tree, pName)
 
def bookTau (tree, pName, discNames)
 
def fill (tree, varName, value)
 
def fillComponent (tree, pName, component)
 
def fillEvent (tree, event)
 
def fillGenTau (tree, pName, tau)
 
def fillJet (tree, pName, jet)
 
def fillMet (tree, pName, met)
 
def fillParticle (tree, pName, particle)
 
def fillTau (tree, pName, tau)
 
def var (tree, varName, type=float)
 

Variables

 pdgids
 

Function Documentation

def ntuple.bookComponent (   tree,
  pName 
)

Definition at line 86 of file ntuple.py.

References var().

Referenced by bookJet().

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))
90 
def var(tree, varName, type=float)
Definition: ntuple.py:4
def bookComponent(tree, pName)
Definition: ntuple.py:86
def ntuple.bookEvent (   tree)

Definition at line 12 of file ntuple.py.

References var().

12 def bookEvent(tree):
13  var(tree, 'run')
14  var(tree, 'lumi')
15  var(tree, 'event')
16 
def var(tree, varName, type=float)
Definition: ntuple.py:4
def bookEvent(tree)
Definition: ntuple.py:12
def ntuple.bookGenTau (   tree,
  pName,
  pfdiscs,
  calodiscs 
)

Definition at line 53 of file ntuple.py.

References bookJet(), and bookTau().

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))
58 
def bookJet(tree, pName)
Definition: ntuple.py:99
def bookTau(tree, pName, discNames)
Definition: ntuple.py:66
def bookGenTau(tree, pName, pfdiscs, calodiscs)
Definition: ntuple.py:53
def ntuple.bookJet (   tree,
  pName 
)

Definition at line 99 of file ntuple.py.

References bookComponent(), and bookParticle().

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

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))
104 
def bookParticle(tree, pName)
Definition: ntuple.py:25
def bookJet(tree, pName)
Definition: ntuple.py:99
def bookComponent(tree, pName)
Definition: ntuple.py:86
def ntuple.bookMet (   tree,
  pName 
)

Definition at line 43 of file ntuple.py.

References var().

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))
47 
def var(tree, varName, type=float)
Definition: ntuple.py:4
def bookMet(tree, pName)
Definition: ntuple.py:43
def ntuple.bookParticle (   tree,
  pName 
)

Definition at line 25 of file ntuple.py.

References var().

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

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))
33 
def var(tree, varName, type=float)
Definition: ntuple.py:4
def bookParticle(tree, pName)
Definition: ntuple.py:25
def ntuple.bookTau (   tree,
  pName,
  discNames 
)

Definition at line 66 of file ntuple.py.

References bookParticle(), and var().

Referenced by bookGenTau().

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))
73 
def var(tree, varName, type=float)
Definition: ntuple.py:4
def bookParticle(tree, pName)
Definition: ntuple.py:25
def bookTau(tree, pName, discNames)
Definition: ntuple.py:66
def ntuple.fill (   tree,
  varName,
  value 
)

Definition at line 7 of file ntuple.py.

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

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

Definition at line 91 of file ntuple.py.

References fill().

Referenced by fillJet().

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 
96 
def fillComponent(tree, pName, component)
Definition: ntuple.py:91
def fill(tree, varName, value)
Definition: ntuple.py:7
def ntuple.fillEvent (   tree,
  event 
)

Definition at line 17 of file ntuple.py.

References fill().

Referenced by HcalTB02Analysis.produce(), gen::FortranCallback.resetIterationsPerEvent(), and CaloVNoiseSignalGenerator.~CaloVNoiseSignalGenerator().

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
24 
def fillEvent(tree, event)
Definition: ntuple.py:17
def fill(tree, varName, value)
Definition: ntuple.py:7
def ntuple.fillGenTau (   tree,
  pName,
  tau 
)

Definition at line 59 of file ntuple.py.

References fillJet(), and fillTau().

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 
65 
def fillTau(tree, pName, tau)
Definition: ntuple.py:74
def fillGenTau(tree, pName, tau)
Definition: ntuple.py:59
def fillJet(tree, pName, jet)
Definition: ntuple.py:105
def ntuple.fillJet (   tree,
  pName,
  jet 
)

Definition at line 105 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 
118 
def fillJet(tree, pName, jet)
Definition: ntuple.py:105
def fillParticle(tree, pName, particle)
Definition: ntuple.py:34
def fillComponent(tree, pName, component)
Definition: ntuple.py:91
def ntuple.fillMet (   tree,
  pName,
  met 
)

Definition at line 48 of file ntuple.py.

References fill().

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())
52 
def fill(tree, varName, value)
Definition: ntuple.py:7
def fillMet(tree, pName, met)
Definition: ntuple.py:48
def ntuple.fillParticle (   tree,
  pName,
  particle 
)

Definition at line 34 of file ntuple.py.

References fill().

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

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() )
42 
def fillParticle(tree, pName, particle)
Definition: ntuple.py:34
def fill(tree, varName, value)
Definition: ntuple.py:7
def ntuple.fillTau (   tree,
  pName,
  tau 
)

Definition at line 74 of file ntuple.py.

References fill(), and fillParticle().

Referenced by fillGenTau().

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 six.iteritems(tau.discs):
80  fill(tree, '{pName}_{disc}'.format(pName=pName,
81  disc=discName), value)
82 
83 
84 # jet
85 
def fillTau(tree, pName, tau)
Definition: ntuple.py:74
def fillParticle(tree, pName, particle)
Definition: ntuple.py:34
def fill(tree, varName, value)
Definition: ntuple.py:7
def ntuple.var (   tree,
  varName,
  type = float 
)

Definition at line 4 of file ntuple.py.

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

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

Variable Documentation

ntuple.pdgids

Definition at line 97 of file ntuple.py.