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 87 of file ntuple.py.

References var().

Referenced by bookJet().

87 def bookComponent( tree, pName ):
88  var(tree, '{pName}_e'.format(pName=pName))
89  var(tree, '{pName}_pt'.format(pName=pName))
90  var(tree, '{pName}_num'.format(pName=pName))
91 
def var(tree, varName, type=float)
Definition: ntuple.py:5
def bookComponent(tree, pName)
Definition: ntuple.py:87
def ntuple.bookEvent (   tree)

Definition at line 13 of file ntuple.py.

References var().

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

Definition at line 54 of file ntuple.py.

References bookJet(), and bookTau().

54 def bookGenTau(tree, pName, pfdiscs, calodiscs):
55  bookJet(tree, pName)
56  bookTau(tree, '{pName}_calo'.format(pName=pName), calodiscs)
57  bookTau(tree, '{pName}_pf'.format(pName=pName), pfdiscs)
58  bookJet(tree, '{pName}_pfjet'.format(pName=pName))
59 
def bookJet(tree, pName)
Definition: ntuple.py:100
def bookTau(tree, pName, discNames)
Definition: ntuple.py:67
def bookGenTau(tree, pName, pfdiscs, calodiscs)
Definition: ntuple.py:54
def ntuple.bookJet (   tree,
  pName 
)

Definition at line 100 of file ntuple.py.

References bookComponent(), and bookParticle().

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

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

Definition at line 44 of file ntuple.py.

References var().

44 def bookMet(tree, pName):
45  var(tree, '{pName}_pt'.format(pName=pName))
46  var(tree, '{pName}_phi'.format(pName=pName))
47  var(tree, '{pName}_sumet'.format(pName=pName))
48 
def var(tree, varName, type=float)
Definition: ntuple.py:5
def bookMet(tree, pName)
Definition: ntuple.py:44
def ntuple.bookParticle (   tree,
  pName 
)

Definition at line 26 of file ntuple.py.

References var().

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

26 def bookParticle( tree, pName ):
27  var(tree, '{pName}_pdgid'.format(pName=pName))
28  var(tree, '{pName}_e'.format(pName=pName))
29  var(tree, '{pName}_pt'.format(pName=pName))
30  var(tree, '{pName}_eta'.format(pName=pName))
31  var(tree, '{pName}_phi'.format(pName=pName))
32  var(tree, '{pName}_m'.format(pName=pName))
33  var(tree, '{pName}_q'.format(pName=pName))
34 
def var(tree, varName, type=float)
Definition: ntuple.py:5
def bookParticle(tree, pName)
Definition: ntuple.py:26
def ntuple.bookTau (   tree,
  pName,
  discNames 
)

Definition at line 67 of file ntuple.py.

References bookParticle(), and var().

Referenced by bookGenTau().

67 def bookTau(tree, pName, discNames):
68  bookParticle(tree, pName)
69  var(tree, '{pName}_nsigcharged'.format(pName=pName))
70  var(tree, '{pName}_isolation'.format(pName=pName))
71  for discName in discNames:
72  var(tree, '{pName}_{disc}'.format(pName=pName,
73  disc=discName))
74 
def var(tree, varName, type=float)
Definition: ntuple.py:5
def bookParticle(tree, pName)
Definition: ntuple.py:26
def bookTau(tree, pName, discNames)
Definition: ntuple.py:67
def ntuple.fill (   tree,
  varName,
  value 
)

Definition at line 8 of file ntuple.py.

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

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

Definition at line 92 of file ntuple.py.

References fill().

Referenced by fillJet().

92 def fillComponent(tree, pName, component):
93  fill(tree, '{pName}_e'.format(pName=pName), component.e() )
94  fill(tree, '{pName}_pt'.format(pName=pName), component.pt() )
95  fill(tree, '{pName}_num'.format(pName=pName), component.num() )
96 
97 
def fillComponent(tree, pName, component)
Definition: ntuple.py:92
def fill(tree, varName, value)
Definition: ntuple.py:8
def ntuple.fillEvent (   tree,
  event 
)

Definition at line 18 of file ntuple.py.

References fill().

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

18 def fillEvent(tree, event):
19  fill(tree, 'run', event.run)
20  fill(tree, 'lumi', event.lumi)
21  fill(tree, 'event', event.eventId)
22 
23 
24 # simple particle
25 
def fillEvent(tree, event)
Definition: ntuple.py:18
def fill(tree, varName, value)
Definition: ntuple.py:8
def ntuple.fillGenTau (   tree,
  pName,
  tau 
)

Definition at line 60 of file ntuple.py.

References fillJet(), and fillTau().

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

Definition at line 106 of file ntuple.py.

References fillComponent(), fillParticle(), and edm.print().

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

106 def fillJet( tree, pName, jet ):
107  if not jet: return
108  fillParticle(tree, pName, jet )
109  for pdgid in pdgids:
110  component = jet.constituents.get(pdgid, None)
111  if component is not None:
112  fillComponent(tree,
113  '{pName}_{pdgid:d}'.format(pName=pName, pdgid=pdgid),
114  component )
115  else:
116  import pdb; pdb.set_trace()
117  print(jet)
118 
119 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def fillJet(tree, pName, jet)
Definition: ntuple.py:106
def fillParticle(tree, pName, particle)
Definition: ntuple.py:35
def fillComponent(tree, pName, component)
Definition: ntuple.py:92
def ntuple.fillMet (   tree,
  pName,
  met 
)

Definition at line 49 of file ntuple.py.

References fill().

49 def fillMet(tree, pName, met):
50  fill(tree, '{pName}_pt'.format(pName=pName), met.pt())
51  fill(tree, '{pName}_phi'.format(pName=pName), met.phi())
52  fill(tree, '{pName}_sumet'.format(pName=pName), met.sumEt())
53 
def fill(tree, varName, value)
Definition: ntuple.py:8
def fillMet(tree, pName, met)
Definition: ntuple.py:49
def ntuple.fillParticle (   tree,
  pName,
  particle 
)

Definition at line 35 of file ntuple.py.

References fill().

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

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

Definition at line 75 of file ntuple.py.

References fill(), and fillParticle().

Referenced by fillGenTau().

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

Definition at line 5 of file ntuple.py.

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

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

Variable Documentation

ntuple.pdgids

Definition at line 98 of file ntuple.py.

Referenced by CaloParticleSelector.operator()().