Skip to content

Instantly share code, notes, and snippets.

View ndawe's full-sized avatar

Noel Dawe ndawe

View GitHub Profile
@ndawe
ndawe / gist:4088495
Created November 16, 2012 16:03
root_numpy crash
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
Thread 2 (Thread 0x7f890ce9e700 (LWP 7609)):
#0 0x00007f89136adfd0 in sem_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00000000004c9eaf in PyEval_RestoreThread ()
#2 0x00000000004d59ff in ?? ()
#3 0x000000000045f912 in PyEval_EvalFrameEx ()
@ndawe
ndawe / gist:4107663
Created November 18, 2012 21:38
numpy_root histogram functions
import ROOT
import numpy as np
import ctypes
from rootpy.plotting import Hist, Hist2D, Hist3D
NULL_DOUBLE_P = ctypes.POINTER(ctypes.c_double)()
def array_fill(hist, data, weights=None):
sample_weight:
[ 4.00598725e-106 4.00598725e-106 4.91627788e-105 2.24355403e-003
5.78717038e-002 4.00598725e-106 4.91627788e-105 1.07356398e-103
1.57636332e-104 2.73278144e-002 1.16624680e-002 3.64200942e-104
8.76243476e-002 5.54496636e-005 4.00598725e-106 4.03426583e-204
4.00598725e-106 3.31825327e-104 6.44530564e-103 4.00598725e-106
4.00598725e-106 3.79262644e-102 1.15663209e-104 5.55791534e-104
1.93974860e-001 4.00598725e-106 4.38345661e-105 1.93974860e-001
1.34273015e-105 9.49335285e-003 2.31113450e-103 4.00598725e-106
4.00598725e-106 4.91627788e-105 4.00598725e-106 8.76243476e-002
roosh group.phys-higgs.167777_057599.161617._00003.hhskim.mc12_p1130_hadhad.root
WARNING:ROOT.TClass.TClass] no dictionary for class AttributeListLayout is available
WARNING:ROOT.TClass.TClass] no dictionary for class pair<string,string> is available
Welcome to the ROOSH terminal
type help for help
group.phys..adhad.root > ls
cutflow_event tau
cutflow_event_mc_weight tauMeta
group.phys..adhad.root > load tau
group.phys..adhad.root > tau.to_array(['jet_pt'])
import ROOT
ROOT.gSystem.Load('GoodRunsLists/StandAlone/libGoodRunsLists.so')
from ROOT import Root
grl_str = '''\
<?xml version="1.0"?>
<!DOCTYPE LumiRangeCollection SYSTEM "http://atlas-runquery.cern.ch/LumiRangeCollection.dtd">
<!-- This document was created by goodruns: http://pypi.python.org/pypi/goodruns/ on 2013-07-16 at 08:24:28 -->
<LumiRangeCollection>
<NamedLumiRange>
DEBUG=1 python
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from rootpy import stl
INFO:rootpy.logger] | No default log handler configured. See `logging` module |
INFO:rootpy.logger] \ To suppress: 'rootpy.log.basic_config_colorized()' /
DEBUG:rootpy.utils.quickroot] Loaded libHist (required by TH1)
DEBUG:rootpy] Using ROOT 5.34/03
>>> stl.map('int,vector<map<int, float> >')
group.phys-higgs.periodB.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851_EXT0/
group.phys-higgs.periodB.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsim_rereco_p851_EXT0/
group.phys-higgs.periodB.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsup_rereco_p851_EXT0/
group.phys-higgs.periodD.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851_EXT0/
group.phys-higgs.periodD.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsim_rereco_p851_EXT0/
group.phys-higgs.periodD.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsup_rereco_p851_EXT0/
group.phys-higgs.periodE.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851_EXT0/
group.phys-higgs.periodE.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsim_rereco_p851_EXT0/
group.phys-higgs.periodE.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsup_rereco_p851_EXT0/
group.phys-higgs.periodF.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851_EXT0/
group.phys-higgs.periodB.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851.120606194325_EXT0:
INCOMPLETE:
COMPLETE: SFU-LCG2_LOCALGROUPDISK
group.phys-higgs.periodB.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851.120606194310_EXT0:
INCOMPLETE:
COMPLETE: SFU-LCG2_LOCALGROUPDISK
group.phys-higgs.periodB.DESD_SGLMU.pro10.embedding-02-41.Ztautau_hh_isol_mfsdn_rereco_p851.120606194255_EXT0:
INCOMPLETE:
@ndawe
ndawe / gist:7411021
Last active December 28, 2015 00:09
from root_numpy import tree2rec
from root_numpy.testdata import get_filepath
from rootpy.io import root_open
import rootpy.compiled as C
C.register_code("""
double mult(double x, double y)
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.