Browse Source

Complete example program.

Andrew Savchenko 7 years ago
parent
commit
36ecfb1bbc
3 changed files with 26 additions and 6 deletions
  1. 5 0
      .gitignore
  2. 6 6
      tof_resolution/Makefile
  3. 15 0
      tof_resolution/tof.cpp

+ 5 - 0
.gitignore

@@ -1,3 +1,8 @@
 *.d
 *.o
 *.so
+
+*.root
+*.pdf
+*.png
+*.jpe?g

+ 6 - 6
tof_resolution/Makefile

@@ -10,26 +10,26 @@ STRIP ?= strip --strip-unneeded -R .comment
 
 # root-dependant stuff
 ROOTCFLAGS ?= $(shell root-config --cflags)
-CXXFLAGS += -Wall -pipe -D_FILE_OFFSET_BITS=64 $(ROOTCFLAGS) -fvisibility-inlines-hidden
-ROOTLIBS = $(shell root-config --libs) -lEG -lpythia6 -lEGPythia6
+CXXFLAGS += -std=c++11 -Wall -pipe -D_FILE_OFFSET_BITS=64 $(ROOTCFLAGS) -fvisibility-inlines-hidden
+ROOTLIBS = $(shell root-config --libs)
 DEPFLAGS = -isystem $(shell root-config --incdir)
 
-SRCS = pylam.cpp
+SRCS = htree.cpp tof.cpp
 OBJS = $(SRCS:.cpp=.o)
 DEPS = $(SRCS:.cpp=.d)
 
 ##### RULES #####
 .PHONY: all clean deps distclean tags
 
-all: pylam
+all: htree
 
 deps: $(DEPS)
 
 %.d: %.cpp
-	$(CXX) $(DEPFLAGS) -MM -MG $< > $@
+	$(CXX) $(DEPFLAGS) $(CXXFLAGS) -MM -MG $< > $@
 
 ### Binaries rules
-pylam: $(DEPS) $(OBJS) Makefile
+htree: $(DEPS) $(OBJS) Makefile
 	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(ROOTLIBS) -o $@
 ifndef DEBUG
 	$(STRIP) $@

+ 15 - 0
tof_resolution/tof.cpp

@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include "htree.h"
+
+int main (const int argc, char *const argv[])
+{
+    if (argc !=2) {
+        puts("Please provide a single file name for input data!");
+        return 1;
+    }
+
+    htree t(argv[1]);
+    t.Loop();
+
+    return 0;
+}