Created
July 18, 2016 12:31
-
-
Save jpata/398fa8ab8eb741b649baca40cde9cd9f to your computer and use it in GitHub Desktop.
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> """ | |
tf = @cxxnew TFile(pointer("asd.root"), pointer("RECREATE")) | |
th = @cxxnew TH1D(pointer("h"), pointer("h"), 100, -1.0, 1.0) | |
for i=1:100000 | |
@cxx th->Fill(randn()) | |
end | |
@cxx tf->Write() | |
@cxx tf->Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment