CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 86 of file ntuple.py.

References var().

Referenced by bookJet().

86 
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))
def var
Definition: ntuple.py:4
def bookComponent
Definition: ntuple.py:86
def ntuple.bookEvent (   tree)

Definition at line 12 of file ntuple.py.

References var().

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

Definition at line 53 of file ntuple.py.

References bookJet(), and bookTau().

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

Definition at line 43 of file ntuple.py.

References var().

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

Definition at line 25 of file ntuple.py.

References var().

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

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

Definition at line 7 of file ntuple.py.

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

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

Definition at line 91 of file ntuple.py.

References fill().

Referenced by fillJet().

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

Definition at line 17 of file ntuple.py.

References fill().

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

Definition at line 59 of file ntuple.py.

References fillJet(), and fillTau().

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

Definition at line 105 of file ntuple.py.

References fillComponent(), fillParticle(), and 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 
def fillJet
Definition: ntuple.py:105
def fillParticle
Definition: ntuple.py:34
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def fillComponent
Definition: ntuple.py:91
def ntuple.fillMet (   tree,
  pName,
  met 
)

Definition at line 48 of file ntuple.py.

References fill().

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

Variable Documentation

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

Definition at line 97 of file ntuple.py.

Referenced by CaloParticleSelector.operator()().