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

◆ bookComponent()

def ntuple.bookComponent (   tree,
  pName 
)

Definition at line 87 of file ntuple.py.

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 

References var().

Referenced by bookJet().

◆ bookEvent()

def ntuple.bookEvent (   tree)

Definition at line 13 of file ntuple.py.

13 def bookEvent(tree):
14  var(tree, 'run')
15  var(tree, 'lumi')
16  var(tree, 'event')
17 

References var().

◆ bookGenTau()

def ntuple.bookGenTau (   tree,
  pName,
  pfdiscs,
  calodiscs 
)

Definition at line 54 of file ntuple.py.

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 

References bookJet(), and bookTau().

◆ bookJet()

def ntuple.bookJet (   tree,
  pName 
)

Definition at line 100 of file ntuple.py.

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 

References bookComponent(), and bookParticle().

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

◆ bookMet()

def ntuple.bookMet (   tree,
  pName 
)

Definition at line 44 of file ntuple.py.

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 

References var().

◆ bookParticle()

def ntuple.bookParticle (   tree,
  pName 
)

Definition at line 26 of file ntuple.py.

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 

References var().

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

◆ bookTau()

def ntuple.bookTau (   tree,
  pName,
  discNames 
)

Definition at line 67 of file ntuple.py.

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 

References bookParticle(), and var().

Referenced by bookGenTau().

◆ fill()

def ntuple.fill (   tree,
  varName,
  value 
)

Definition at line 8 of file ntuple.py.

8 def fill( tree, varName, value ):
9  tree.fill( varName, value )
10 
11 # event information
12 

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

◆ fillComponent()

def ntuple.fillComponent (   tree,
  pName,
  component 
)

Definition at line 92 of file ntuple.py.

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 

References fill().

Referenced by fillJet().

◆ fillEvent()

def ntuple.fillEvent (   tree,
  event 
)

Definition at line 18 of file ntuple.py.

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 

References fill().

◆ fillGenTau()

def ntuple.fillGenTau (   tree,
  pName,
  tau 
)

Definition at line 60 of file ntuple.py.

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 

References fillJet(), and fillTau().

◆ fillJet()

def ntuple.fillJet (   tree,
  pName,
  jet 
)

Definition at line 106 of file ntuple.py.

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 

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

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

◆ fillMet()

def ntuple.fillMet (   tree,
  pName,
  met 
)

Definition at line 49 of file ntuple.py.

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 

References fill().

◆ fillParticle()

def ntuple.fillParticle (   tree,
  pName,
  particle 
)

Definition at line 35 of file ntuple.py.

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 

References fill().

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

◆ fillTau()

def ntuple.fillTau (   tree,
  pName,
  tau 
)

Definition at line 75 of file ntuple.py.

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 

References fill(), and fillParticle().

Referenced by fillGenTau().

◆ var()

def ntuple.var (   tree,
  varName,
  type = float 
)

Definition at line 5 of file ntuple.py.

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

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

Variable Documentation

◆ pdgids

ntuple.pdgids

Definition at line 98 of file ntuple.py.

Referenced by CaloParticleSelector.operator()().

ntuple.bookParticle
def bookParticle(tree, pName)
Definition: ntuple.py:26
ntuple.fillJet
def fillJet(tree, pName, jet)
Definition: ntuple.py:106
ntuple.fillParticle
def fillParticle(tree, pName, particle)
Definition: ntuple.py:35
ntuple.fillComponent
def fillComponent(tree, pName, component)
Definition: ntuple.py:92
ntuple.bookTau
def bookTau(tree, pName, discNames)
Definition: ntuple.py:67
ntuple.bookComponent
def bookComponent(tree, pName)
Definition: ntuple.py:87
ntuple.fill
def fill(tree, varName, value)
Definition: ntuple.py:8
ntuple.bookJet
def bookJet(tree, pName)
Definition: ntuple.py:100
ntuple.bookGenTau
def bookGenTau(tree, pName, pfdiscs, calodiscs)
Definition: ntuple.py:54
ntuple.bookMet
def bookMet(tree, pName)
Definition: ntuple.py:44
ntuple.fillMet
def fillMet(tree, pName, met)
Definition: ntuple.py:49
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
ntuple.var
def var(tree, varName, type=float)
Definition: ntuple.py:5
ntuple.fillEvent
def fillEvent(tree, event)
Definition: ntuple.py:18
ntuple.bookEvent
def bookEvent(tree)
Definition: ntuple.py:13
format
ntuple.fillTau
def fillTau(tree, pName, tau)
Definition: ntuple.py:75
ntuple.fillGenTau
def fillGenTau(tree, pName, tau)
Definition: ntuple.py:60