ATLAS Offline Software
Classes | Functions | Variables
PyAlgorithmExample Namespace Reference

Classes

class  Args
 
class  Holder
 
class  Parthists
 
class  Parthists_Ele
 
class  Parthists_Muo
 
class  Parthists_Taujet
 
class  Parthists_Z
 
class  Partlisthists
 
class  PyAlgorithmExample
 The example algorithm. More...
 
class  PyCompositeParticle
 
class  Z
 

Functions

def mybook (name, n, lo, hi)
 
def min_dr (p, l)
 
def neutrinos_from_colinear_approximation (a, b, metx, mety)
 
def Partlisthists_Ele (name)
 
def Partlisthists_Muo (name)
 
def Partlisthists_Taujet (name)
 
def Partlisthists_Z (name, m_max=250 *GeV)
 
def fulldata (p)
 

Variables

int EoverP = 0
 
float MZ = 91.19*GeV
 

Function Documentation

◆ fulldata()

def PyAlgorithmExample.fulldata (   p)

Definition at line 332 of file PyAlgorithmExample.py.

332 def fulldata (p):
333  dt = p.dataType()
334  return dt != ParticleDataType.Fast and dt != ParticleDataType.True
335 
336 

◆ min_dr()

def PyAlgorithmExample.min_dr (   p,
  l 
)

Definition at line 57 of file PyAlgorithmExample.py.

57 def min_dr (p, l):
58  hlv = p.hlv()
59  dr = 999
60  ppmin = None
61  for pp in l:
62  this_dr = hlv.deltaR (pp.hlv())
63  if this_dr < dr:
64  dr = this_dr
65  ppmin = pp
66  return (dr, ppmin)
67 
68 
69 #
70 # Basic histograms for a particle: pt, eta, phi.
71 #

◆ mybook()

def PyAlgorithmExample.mybook (   name,
  n,
  lo,
  hi 
)

Definition at line 41 of file PyAlgorithmExample.py.

41 def mybook (name, n, lo, hi):
42  # This will make a AIDA histogram.
43  # I don't use this because i want to use all root methods
44  # on the histograms, and i also want to be able to use root_pickle
45  # with them.
46  #return book ("/stat/" + name, name, n, lo, hi)
47 
48  # This will make a native root histogram.
49  gROOT.cd() # otherwise, we can get hists created in input files...
50  return TH1F (name, name, n, lo, hi)
51 
52 
53 #
54 # Find the particle in list L closest in DR to the particle P.
55 # return a list (DR, PMIN), where PMIN is that closest particle.
56 #

◆ neutrinos_from_colinear_approximation()

def PyAlgorithmExample.neutrinos_from_colinear_approximation (   a,
  b,
  metx,
  mety 
)

Definition at line 136 of file PyAlgorithmExample.py.

136 def neutrinos_from_colinear_approximation (a, b, metx, mety):
137  # numerator
138  numerator = a.px()*b.py() - a.py()*b.px()
139 
140  # fraction
141  x_a = numerator/(b.py()*(a.px()+metx)-b.px()*(a.py()+mety))
142  x_b = numerator/(a.px()*(b.py()+mety)-a.py()*(b.px()+metx))
143 
144  def make_nu (p, scale):
145  hlv = p.hlv()
146  hlv *= scale
147  hlv.setE(hlv.vect().mag())
148  # Below should really be Neutrino instead of TruthParticle.
149  # But as of 10.2.0, anyway, Neutrino doesn't get dictionary
150  # information generated.
151  nu = g.TruthParticle()
152  nu.set4Mom (hlv)
153  return nu
154 
155  return (make_nu (a, 1./x_a - 1),
156  make_nu (b, 1./x_b - 1))
157 
158 
159 
160 #
161 # Like CompositeParticle, but a) behaves like a python sequence, and
162 # b) remembers the original python objects. (If we put an object
163 # into CompositeParticle and then get it out again, it will be
164 # a different python object.)
165 #

◆ Partlisthists_Ele()

def PyAlgorithmExample.Partlisthists_Ele (   name)

Definition at line 234 of file PyAlgorithmExample.py.

234 def Partlisthists_Ele (name):
235  return Partlisthists (name, Parthists_Ele (name))
236 
237 
238 
239 #
240 # Define histograms for muons.
241 # This is based on the generic Parthists set of histograms,
242 # and adds additional ones specifically for muons.
243 #

◆ Partlisthists_Muo()

def PyAlgorithmExample.Partlisthists_Muo (   name)

Definition at line 254 of file PyAlgorithmExample.py.

254 def Partlisthists_Muo (name):
255  return Partlisthists (name, Parthists_Muo (name))
256 
257 
258 
259 #
260 # Define histograms for tau jets.
261 # This is based on the generic Parthists set of histograms,
262 # and adds additional ones specifically for tau jets.
263 #

◆ Partlisthists_Taujet()

def PyAlgorithmExample.Partlisthists_Taujet (   name)

Definition at line 300 of file PyAlgorithmExample.py.

300 def Partlisthists_Taujet (name):
301  return Partlisthists (name, Parthists_Taujet (name))
302 
303 
304 
305 #
306 # Define histograms for Z-like particles.
307 # This is based on the generic Parthists set of histograms,
308 # and adds additional ones specifically for Z's and H's.
309 #

◆ Partlisthists_Z()

def PyAlgorithmExample.Partlisthists_Z (   name,
  m_max = 250*GeV 
)

Definition at line 322 of file PyAlgorithmExample.py.

322 def Partlisthists_Z (name, m_max = 250*GeV):
323  return Partlisthists (name, Parthists_Z (name, m_max))
324 
325 
326 
327 
328 #
329 # Helper to test the data type of P.
330 # Returns true if it's from full simulation.
331 #

Variable Documentation

◆ EoverP

int PyAlgorithmExample.EoverP = 0

Definition at line 122 of file PyAlgorithmExample.py.

◆ MZ

float PyAlgorithmExample.MZ = 91.19*GeV

Definition at line 129 of file PyAlgorithmExample.py.

PyAlgorithmExample.fulldata
def fulldata(p)
Definition: PyAlgorithmExample.py:332
PyAlgorithmExample.Partlisthists_Ele
def Partlisthists_Ele(name)
Definition: PyAlgorithmExample.py:234
PyAlgorithmExample.neutrinos_from_colinear_approximation
def neutrinos_from_colinear_approximation(a, b, metx, mety)
Definition: PyAlgorithmExample.py:136
PyAlgorithmExample.Partlisthists_Z
def Partlisthists_Z(name, m_max=250 *GeV)
Definition: PyAlgorithmExample.py:322
PyAlgorithmExample.mybook
def mybook(name, n, lo, hi)
Definition: PyAlgorithmExample.py:41
PyAlgorithmExample.min_dr
def min_dr(p, l)
Definition: PyAlgorithmExample.py:57
PyAlgorithmExample.Partlisthists_Taujet
def Partlisthists_Taujet(name)
Definition: PyAlgorithmExample.py:300
PyAlgorithmExample.Partlisthists_Muo
def Partlisthists_Muo(name)
Definition: PyAlgorithmExample.py:254
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26