Skip to content

Instantly share code, notes, and snippets.

@giffels
Last active December 8, 2017 12:49
Show Gist options
  • Save giffels/1f99050207152b3f224d4b4c5c388f35 to your computer and use it in GitHub Desktop.
Save giffels/1f99050207152b3f224d4b4c5c388f35 to your computer and use it in GitHub Desktop.
Using ROOT in combination with scons
#include "TApplication.h"
#include "TCanvas.h"
#include "TH1F.h"
int main (int argc, char* argv[]) {
TApplication my_app("tapp", &argc, argv);
TCanvas my_canvas("c1", "c1");
TH1F my_histo("h1", "h1", 100, -5., 5.);
my_histo.FillRandom("gaus", 100000);
my_histo.Draw();
my_canvas.Update();
my_app.Run();
return 0;
}
import subprocess
root_link_flags = subprocess.check_output(['root-config', '--libs']).split()
root_cc_flags = subprocess.check_output(['root-config', '--cflags']).split()
Program(target="root_test", source=["root_test.cc"],
CCFLAGS = root_cc_flags, LINKFLAGS = root_link_flags)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment