4 Commits b4e44fe09f ... 36ecfb1bbc

Auteur SHA1 Bericht Datum
  Andrew Savchenko 36ecfb1bbc Complete example program. 9 jaren geleden
  Andrew Savchenko f9c2fb3bb5 update ignore rules 9 jaren geleden
  Andrew Savchenko 914d4f71a6 Initial version from pylam 9 jaren geleden
  Andrew Savchenko 86309e6d55 rename filenames 9 jaren geleden
6 gewijzigde bestanden met toevoegingen van 71 en 10 verwijderingen
  1. 5 10
      .gitignore
  2. 51 0
      tof_resolution/Makefile
  3. 0 0
      tof_resolution/do_htree.C
  4. 0 0
      tof_resolution/htree.cpp
  5. 0 0
      tof_resolution/htree.h
  6. 15 0
      tof_resolution/tof.cpp

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