4 Commits b4e44fe09f ... 36ecfb1bbc

Autor SHA1 Mensagem Data
  Andrew Savchenko 36ecfb1bbc Complete example program. 9 anos atrás
  Andrew Savchenko f9c2fb3bb5 update ignore rules 9 anos atrás
  Andrew Savchenko 914d4f71a6 Initial version from pylam 9 anos atrás
  Andrew Savchenko 86309e6d55 rename filenames 9 anos atrás

+ 5 - 10
.gitignore

@@ -1,13 +1,8 @@
-# Compiled Object files
-*.slo
-*.lo
+*.d
 *.o
-
-# Compiled Dynamic libraries
 *.so
-*.dylib
 
-# Compiled Static libraries
-*.lai
-*.la
-*.a
+*.root
+*.pdf
+*.png
+*.jpe?g

+ 51 - 0
tof_resolution/Makefile

@@ -0,0 +1,51 @@
+# defaults
+ifndef DEBUG
+CXXFLAGS ?= -O3 -march=native -fomit-frame-pointer -pipe -DDEBUG
+else
+CXXFLAGS += -ggdb3
+endif
+#LDFLAGS ?= -Wl,-O1
+LDFLAGS ?= -Wl,-O1 -Wl,--as-needed
+STRIP ?= strip --strip-unneeded -R .comment
+
+# root-dependant stuff
+ROOTCFLAGS ?= $(shell root-config --cflags)
+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 = htree.cpp tof.cpp
+OBJS = $(SRCS:.cpp=.o)
+DEPS = $(SRCS:.cpp=.d)
+
+##### RULES #####
+.PHONY: all clean deps distclean tags
+
+all: htree
+
+deps: $(DEPS)
+
+%.d: %.cpp
+	$(CXX) $(DEPFLAGS) $(CXXFLAGS) -MM -MG $< > $@
+
+### Binaries rules
+htree: $(DEPS) $(OBJS) Makefile
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(ROOTLIBS) -o $@
+ifndef DEBUG
+	$(STRIP) $@
+endif
+
+# misc and cleanup
+tags:
+	ctags $(SRCS)
+clean:
+	rm -f $(OBJS) $(DEPS)
+distclean: clean
+	rm -f $(BINS) tags
+
+# on distclean per-file deps will be removed anyway
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),distclean)
+-include $(DEPS)
+endif
+endif

tor_resolution/do_htree.C → tof_resolution/do_htree.C


tor_resolution/htree.C → tof_resolution/htree.cpp


tor_resolution/htree.h → tof_resolution/htree.h


+ 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;
+}