This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//compile as c++ -g `root-config --cflags --libs` CloneTreeCorruption.cc -o CloneTreeCorruption | |
#include "TFile.h" | |
#include "TTree.h" | |
int main(int argc, const char** argv) { | |
TFile* inf = new TFile("DoubleEG_Run2015D_v4_7_post.root"); | |
TTree* intree = (TTree*)(inf->Get("mt2")); | |
ULong64_t evt; | |
intree->SetBranchAddress("evt", &evt); | |
TFile* outf = new TFile("out.root", "RECREATE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dask | |
import sys, glob | |
import numpy as np | |
def fixPath(): | |
newpath = [] | |
for v in sys.path: | |
if "cvmfs" in v and "pandas" in v: | |
continue | |
newpath += [v] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cProfile, time | |
def func(): | |
s = 0 | |
for i in range(100000): | |
s += i | |
p = cProfile.Profile(time.clock) | |
p.runcall(func) | |
p.print_stats() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cxx | |
const ROOT_PATH = "/Users/joosep/Documents/root-build/" | |
addHeaderDir(joinpath(ROOT_PATH, "include"), kind=C_System) | |
for lib in ["Core", "RIO", "Hist"] | |
Libdl.dlopen("$ROOT_PATH/lib$lib.so", Libdl.RTLD_GLOBAL) | |
end | |
cxx"""#include <TFile.h> """ | |
cxx"""#include <TH1D.h> """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/setup.py b/setup.py | |
index 6569037..48d1603 100755 | |
--- a/setup.py | |
+++ b/setup.py | |
@@ -80,8 +80,9 @@ librootnumpy = Extension( | |
extra_compile_args=root_cflags + [ | |
'-Wno-unused-function', | |
'-Wno-write-strings', | |
+ '-mmacosx-version-min=10.7' | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[SingleElectron] | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_1.root = 0 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_10.root = 14136 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_100.root = 27350 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_101.root = 25062 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_102.root = 22851 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_103.root = 30098 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_104.root = 25321 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_105.root = 13815 | |
/store/user/jpata/tth/Mar29_rereco_v1/SingleElectron/Mar29_rereco_v1/170329_155828/0000/tree_106.root = 14586 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Compile with: | |
//c++ `root-config --cflags --libs --evelibs` -Wno-unsequenced -O3 code/simple_loop.cc -o simple_loop | |
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <TFile.h> | |
#include <TROOT.h> | |
#include <TH1D.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Universe = vanilla | |
Executable = example_job.sh | |
Arguments = 10 | |
#The logs directory must exist | |
Log = logs/example_job.$(Cluster).log | |
Output = logs/example_job.out.$(Cluster).$(Process) | |
Error = logs/example_job.err.$(Cluster).$(Process) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//compile with g++ -fPIC mylib.cc -shared -o mylib.dylib | |
class MyClass { | |
public: | |
MyClass(const char* filename) { | |
//do something with filename | |
} | |
double func(int a) { | |
//an expensive C++ function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
from test_uproot import vals | |
if __name__ == "__main__": | |
h = ROOT.TH1D("h", "h", 10, 0, 1) | |
for v in vals: | |
h.Fill(v) | |
print("h1") |