Skip to content

Commit c8f2c09

Browse files
authored
Merge pull request #8 from hyperk/upgrade_datamodel
Upgrade datamodel
2 parents 067936c + 185f333 commit c8f2c09

File tree

199 files changed

+7482
-57309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+7482
-57309
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
*.root
1+
.vscode
22
*.o
33
*.swp
4-
*.root
54
*.log
65
.depend
6+
example/analysis
7+
example/analysis_fullrec
8+
example/data
9+
example/*.root
710
leaf/DataModelRootDict*
811
leaf/HKAstroAnalysis.*
912
leaf/DataModel

README.md

Lines changed: 58 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,81 @@
1-
# LEAF
2-
Low Energy Algoritm Framework
1+
# :seedling: LEAF :seedling:
2+
3+
<ins>**L**</ins>ow <ins>**E**</ins>nergy <ins>**A**</ins>lgorithm <ins>**F**</ins>ramework
4+
5+
6+
# DESCRIPTION
37

48
This algorithm is an alternative and simple LE fitter than can be used for HyperK and SuperK.
59

610
~~~~~~~~~~~~~~~~~~~~~~~~~
711
2020/02/09: LEAF was convert as a C++ class and can be included in your code.
12+
~~~~~~~~~~~~~~~~~~~~~~~~~
813

9-
New compilation method:
1014

11-
source RunAtStart.sh
12-
./SetupDataModel.sh
13-
cd leaf/
14-
make clean; make
15-
16-
In order to use the class in your code look at example/
17-
~~~~~~~~~~~~~~~~~~~~~~~~~
15+
# DOWNLOAD AND PRE-REQUISITES
16+
17+
To download this repository use :
18+
19+
```
20+
git clone --single-branch --branch develop_lite https://github.com/hyperk/LEAF.git
21+
```
22+
23+
Then make sure the following pre-requisites are installed.
24+
1. ROOT v5r34 or superior (not tested for older versions, but might work).
25+
2. WCSim version compatible with your ROOT version.
26+
3. BONSAI installation (although LEAF can work without it).
27+
28+
# COMPATIBILITY
1829

19-
# Pre-requisite to use the code:
20-
1. BONSAI installation.
21-
2. ROOT v5r34 or superior (not tested for older versions, but might work).
22-
3. HKAstroAnalysis class is private and can be downloaded by SK collaborators on sukap cluster.
30+
Versions listed below have been tested so far.
2331

24-
# Compatibility tested so far:
2532
1. WCSim-hybrid version: for geometries "HyperK", "HyperK_mPMT", "HyperK_HybridmPMT", "HyperK_HybridmPMT10PC"
2633
2. In general, with all WCSim-hybrid geometries using whether BoxandLine20inchHQE or PMT3inchR14374 PMTs.
2734
3. With official HK WCSim: Ask G. Pronost.
2835

29-
# How to:
30-
1. Source RunAtStart.sh after you updated your ROOT directory.
31-
2. Use the script ./SetupDataModel.sh to define the DataModel (if you have hk-AstroAnalysis, you should setup the global variable)
32-
2. Enter the leaf/ repository and make clean;make
33-
3. Enter the example repository and make clean;make
34-
4. One example of how to run the code is set in example: test_example.sh
35-
5. inputs PDF, input from WCSim can be downloaded on sukap cluster. Please untar them in the LEAF repository.
36-
6. You can use shell scripts in shell/ in order to run the fitter or launch on batch.
37-
38-
# Useful scripts in ./macros and ./shell
39-
You can compile with GNUMake like following in ./macros:
36+
37+
# INSTALLATION
38+
39+
1. Go to libWCSIM/ repository and make softlinks to your WCSim installation.
40+
```
41+
$ cd libWCSIM/
42+
$ ln -s /path/to/your/WCSim/include/ include
43+
$ ln -s /path/to/your/WCSim/src/ src
44+
$ ln -s /path/to/your/WCSim/lib/libWCSimRoot.so libWCSimRoot.so
45+
$ ln -s /path/to/your/WCSim/lib/libWCSimRoot.so.1.12.xx libWCSimRoot.so.1.12.xx
4046
```
47+
2. Go to the cloned LEAF repository and source the script RunAtStart.sh after making sure you are sourcing the proper ROOT directory.
48+
```
49+
$ cd /path/to/the/cloned/repository/LEAF
50+
$ source ./RunAtStart.sh
51+
```
52+
3. Enter the leaf/ repository and `make clean; make`
53+
4. Enter the example/ repository and `make clean; make`
54+
5. One example of how to run the code is set in example: test_example.sh
55+
56+
# TUNING FILES
57+
58+
Tuning files are provided in the inputs/ repository (e.g. ./inputs/timePDF_Directionality_DRnew.root) and are made from 10 MeV electrons generated isotropically and uniformly in the tank.
59+
Alternatively, you can generate your own PDFs by following the commands below.
60+
61+
1. Go to macros/ repository and compile AnalyzeWSHierarchy and ProducePDF with GNUMake.
62+
```
63+
$ cd ./macros
64+
$ make AnalyzeWSHierarchy
4165
$ make ProducePDF
4266
```
43-
## Making tuning file (e.g. ./inputs/timePDF_Directionality_DRnew.root)
44-
1. Produce plots by AnalyzeWSHierarchy: reads out WCSim output and makes plots.
45-
2. Produce time PDF (and angular PDF) by ProducePDF: uses plots made by AnalyzeWSHierarchy and generate PDFs for LEAF.
4667

68+
2. Produce plots using AnalyzeWSHierarchy which reads out WCSim output. Optionally, you can index a range of events to read with -s (start index) and -e (end index). Use option -h if when using a hybrid HK geometry presenting both PMTs and mPMTs.
4769
```
48-
$ AnalyzeWSHierarchy -f wcrim_hybrid.root -o plots.root
49-
$ ProducePDF -f plots.root -o PDF.root
70+
$ ./AnalyzeWSHierarchy -i wcrim.root -o plots.root -s 0 -e 1000 -h
5071
```
5172

52-
## Making generic plots
53-
- LEAFOutputAnalysisHybrid_leafclass: read LEAF output to produce generic plots. If one uses the master branch for LEAF, please use LEAFOutputAnalysisHybrid_master
73+
3. Produce time PDF and angular PDF using ProducePDF: uses plots made using AnalyzeWSHierarchy and generate PDFs for LEAF.
74+
```
75+
$ ./ProducePDF -i wcsim.root -o PDF.root -s 0 -e 1000 -v
76+
```
5477

55-
## Shell scripts for analysis of large files
56-
You can refere shell scripts in ./shell in order to analyze many files.
57-
They are not working with latest LEAF class and its examples. They are just example how to analyze.
78+
Pathes to PDF files required as inputs for LEAF are hard-coded inside leaf/LeafSplines.cc, inside the LoadSplines() methods.
79+
Make sure these pathes are consistant with the files you generate on your own.
5880

59-
- generateShellXX.c: this is a root macro which generates shell scripts to be submitted to sukap by LauncherXX.sh
60-
- generateShell.c
61-
- generateShell_analyzeWCSim.c
62-
- LauncherXX.sh: this submits jobs to sukap
63-
- Launcher.sh
64-
- Launcher_analyzeWCSim.sh
65-
- Merger_analyzeWCSim.sh: merge generated output by Launcher_analyzeWCSim.sh
6681

SetupDataModel.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

example/GNUmakefile

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,62 @@
11
# Makefile by Guillaume Pronost for LEAF example @ 2020/02/09
22

33
OSNAME = $(shell uname -s)
4+
LEAFDIR = ..
45

56
include ../Makefile/Makefile.${OSNAME}
67

7-
88
# set compiler options for ROOT
99
CXXFLAGS += $(shell root-config --cflags)
10-
CXXFLAGS += '-fPIC' -std=c++11 -Wall -Wpedantic -Wno-long-long
10+
CXXFLAGS += -fPIC -std=c++17 -Wall -Wpedantic -Wno-long-long
11+
ROOT_VERSION = $(shell root-config --version | cut -d'.' -f1,2)
12+
ifeq ($(shell echo "$(ROOT_VERSION) >= 6.0" | bc -l), 1)
13+
HK_USE_ROOT7 = 1
14+
CXXFLAGS += -DHK_USE_ROOT7
15+
endif
1116

12-
INCFLAGS = -I. -I$(shell root-config --incdir)
13-
INCFLAGS += -I$(WCSIM_BUILD_DIR)/include/WCSim
14-
# INCFLAGS += -I$(WCSIMDIR)/include
15-
# INCFLAGS += -I$(BONSAIDIR)/bonsai
17+
INCFLAGS = -I.
18+
#INCFLAGS += -I$(shell root-config --incdir) #included in --cflags
19+
INCFLAGS += -I$(LEAFDIR)/libWCSIM/include
1620
INCFLAGS += -I$(LEAFDIR)/leaf
17-
INCFLAGS += -I$(LEAFDIR)/leaf/DataModel
21+
INCFLAGS += -I$(LEAFDIR)/leaf/DataModel-lite
1822

19-
# LIBS += -L${WCSIMDIR} -lWCSimRoot
20-
LIBS += -L${WCSIM_BUILD_DIR}/lib -lWCSimRoot
23+
LIBS += -L$(LEAFDIR)/libWCSIM -lWCSimRoot
2124
LIBS += $(shell root-config --libs) -lMinuit
2225
# LIBS_BONSAI += -L${BONSAIDIR} -lWCSimBonsai
23-
LIBS_LEAF += -L${LEAFDIR}/lib -lDataModelLite -lHKManager -lLEAF #-lHKAstroAnalysis
24-
26+
LIBS_LEAF += -L${LEAFDIR}/lib -lLEAF -lHKManager -lDataModelLite
2527

26-
OBJECT = analysis
28+
OBJECT = analysis analysis_fullrec
2729

28-
CXXFLAGS += -std=c++17
30+
all: ROOT_CHECK $(OBJECT)
2931

30-
all: $(OBJECT)
32+
ROOT_CHECK:
33+
ifeq ($(HK_USE_ROOT7),1)
34+
@echo '<< compile with ROOT7 >>'
35+
else
36+
@echo '<< compile with old ROOT >>'
37+
@echo $(DATAMODEL_SOURCES)
38+
endif
3139

3240
analysis: analysis.o
33-
@echo '<< compiling bin analysis >>'
34-
@$(CXX) -g $(CXXFLAGS) -o $@ $^ $(LIBS) $(LIBS_BONSAI) $(LIBS_LEAF)
35-
36-
41+
@echo '<< compiling bin $@ >>'
42+
@$(CXX) -g $(CXXFLAGS) $^ $(LIBS) $(LIBS_LEAF) -o $@
43+
44+
analysis_fullrec: analysis_fullrec.o
45+
@echo '<< compiling bin $@ >>'
46+
@$(CXX) -g $(CXXFLAGS) $^ $(LIBS) $(LIBS_LEAF) -o $@
47+
3748
# default rules
3849
.cc.o:
3950
@echo '<< compiling' $< '>>'
4051
@$(CXX) $(CXXFLAGS) $(INCFLAGS) -c $<
41-
42-
%.o: %.cc %.hh
52+
53+
.cpp.o:
4354
@echo '<< compiling' $< '>>'
44-
@$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
55+
@$(CXX) $(CXXFLAGS) $(INCFLAGS) -c $<
4556

46-
%.o: %.cpp
57+
%.o: %.cpp %.hpp
4758
@echo '<< compiling' $< '>>'
4859
@$(CXX) $(CXXFLAGS) $(INCFLAGS) -c -o $@ $<
49-
5060

5161
%.o: %.C %.h
5262
@echo '<< compiling' $< '>>'

example/GNUmakefile_nobonsai

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)