from PyAnalysisUtils import PDG if particle.pdgId() != PDG.mu: print PDG.pdgid_to_name (particle.pdgId())
for (i1, i2) in combo.combinations (items, 2):The functions contained in this module are:
from PyAnalysisUtils.interpolate import interpolate points = [[0.05, 0.4424], [0.15, 0.4058], [0.25, 0.4753], [0.35, 0.7823], [0.45, 0.8636], [0.55, 0.9798], [0.65, 0.8224], [0.75, 0.7925]] print interpolate (points, 0.27, 3)
from PyAnalysisUtils.normphi import normphi angle = normphi (angle)The implementation here is intended for the case where the angle is known not to be huge (for example, the result of addition or subtraction of normalized angles).
from PyAnalysisUtils.rtime import rtime rtime (func, arg)The report will be printed when the function returns.
The main function in here is draw_obj(obj [, options]). This is similar to obj->Draw(options), but some extra functionality is added:
Besides draw_obj, a few other functions are available.
from PyAnalysisUtils.rebin2 import rebin2 # Group together 2 bins in x, 5 in y. hnew = rebin2 (h, 'newname', 2, 5)
import ROOT from PyAnalysisUtils.root_pickle import dump_root hlist = [] for i in range (10): name = 'h%d' % i hlist.append (ROOT.TH1F (name, name, 10, 0, 10)) dump_root (hlist, 'test.root')This writes a list of histograms to test.root. The histograms may be read back like this:
import ROOT from PyAnalysisUtils.root_pickle import load_root hlist = load_root ('test.root')The following additional notes apply.
14 H0 19.8 -3.30 -3.10 290.7 -19.8 -0.9 -267.0 395.2 15 Z0 87.8 -0.52 0.06 89.4 87.6 5.1 -47.4 134.0 16 Z0 107.6 -1.46 -3.09 91.8 -107.4 -6.0 -219.6 261.2 17 TAU- 86 33.1 -0.33 1.58 1.8 -0.2 33.1 -11.2 34.9 18 TAU+ 88 271 92.2 -0.38 -0.31 1.8 87.8 -27.9 -36.2 99.0 19 MU- 34.7 -1.73 1.99 0.1 -14.3 31.7 -94.8 101.0 20 MU+ 100.5 -1.04 -2.76 0.1 -93.2 -37.7 -124.7 160.2 21 U 0.3 -0.17 -1.22 0.3 0.1 -0.3 -0.1 0.4 25 UBAR 2.9 0.79 2.37 0.3 -2.1 2.0 2.6 3.9 26 D 0.4 0.50 0.21 0.3 0.4 0.1 0.2 0.5 27 U 2.1 -5.75 2.70 0.3 -1.9 0.9 -325.6 325.6 33 GLUE 1.4 3.50 1.29 0.0 0.4 1.3 22.8 22.9 37 U 0.6 2.20 -2.28 0.0 -0.4 -0.5 2.8 2.9 39 UBAR 0.6 0.55 0.86 0.0 0.4 0.5 0.4 0.7 40 U 0.5 5.35 -0.89 0.0 0.3 -0.4 47.6 47.6 41 UBAR 0.5 5.20 2.25 -0.0 -0.3 0.4 40.8 40.8 42 D 0.4 -2.01 -2.50 0.0 -0.3 -0.2 -1.4 1.5 43 DBAR 0.4 -6.05 0.64 0.0 0.3 0.2 -83.5 83.5 81 GLUE 0.4 4.61 2.64 -0.0 -0.3 0.2 19.5 19.5 86 NUT 25.7 -0.36 1.58 0.0 -0.2 25.7 -9.4 27.3 88 ANUT 11.6 -0.38 -0.31 -0.0 11.1 -3.5 -4.5 12.5 271 PHOT 12.8 -0.42 -0.30 -0.0 12.2 -3.7 -5.5 13.9The first number is the particle barcode number. This is followed by the particle type, and then by the barcode numbers of any decay daughters (up to 3). This is followed by the four-momemtum in two versions: first as pt, eta, phi, m, and then as px, py, pz, e.