Commit 9e01f98a authored by Erik Asbjørn Mikkelsen Jensen's avatar Erik Asbjørn Mikkelsen Jensen
Browse files

moved expansion code to separate directory and tidied up

parent 7244c3fe
......@@ -5,7 +5,9 @@ LDLIBS = $$(root-config --glibs)
DATATABLES = ame16/mass16.txt ame16/rct1-16.txt ame16/rct2-16.txt nubase16/nubase2016.txt
EXAMPLE_FIGURES = qec-all.pdf qec-no-estimates.pdf
EXAMPLE_DATAFILES = qec.dat qbn.dat
EXECUTABLES = dataprinter expand-nuchart-QEC expand-nuchart-QECp expand-nuchart-QEC2p
EXPDIR = expansion
EXPEXS = expand-nuchart-QEC expand-nuchart-QECp expand-nuchart-QEC2p
EXS = dataprinter
......@@ -15,16 +17,13 @@ default: nuchart.root
all: default $(EXAMPLE_FIGURES) qbn.dat
nuchart.root: treemaker.py expand-nuchart-QEC expand-nuchart-QECp expand-nuchart-QEC2p
nuchart.root: treemaker.py $(addprefix $(EXPDIR)/, $(EXPEXS))
ifeq ($(ROOTSYS), ) # source thisroot.sh if ROOTSYS is not defined
source $$(root-config --bindir)/thisroot.sh && python3 treemaker.py
else
python3 treemaker.py
endif
./expand-nuchart-QEC
./expand-nuchart-QECp
./expand-nuchart-QEC2p
$(foreach exec, $(addprefix $(EXPDIR)/, $(EXPEXS)), ./$(exec); )
qec-all.pdf qec-no-estimates.pdf: graph-example-qec.py
python3 $<
......@@ -39,13 +38,13 @@ qbn.dat: dataprinter nuchart.root Makefile
dataprinter: dataprinter.cxx
$(CXX) $(CXXFLAGS) -o $@ $< $(LDLIBS)
expand-nuchart-QEC: expand-nuchart-QEC.cxx
$(EXPDIR)/expand-nuchart-QEC: $(EXPDIR)/expand-nuchart-QEC.cxx
$(CXX) $(CXXFLAGS) -o $@ $< $(LDLIBS)
expand-nuchart-QECp: expand-nuchart-QECp.cxx
$(EXPDIR)/expand-nuchart-QECp: $(EXPDIR)/expand-nuchart-QECp.cxx
$(CXX) $(CXXFLAGS) -o $@ $< $(LDLIBS)
expand-nuchart-QEC2p: expand-nuchart-QEC2p.cxx
$(EXPDIR)/expand-nuchart-QEC2p: $(EXPDIR)/expand-nuchart-QEC2p.cxx
$(CXX) $(CXXFLAGS) -o $@ $< $(LDLIBS)
treemaker.py: datagetter.py
......@@ -54,4 +53,4 @@ datagetter.py: $(DATATABLES)
clean:
$(RM) -r __pycache__
$(RM) nuchart.root $(EXECUTABLES) $(EXAMPLE_FIGURES) $(EXAMPLE_DATAFILES)
$(RM) nuchart.root $(addprefix $(EXPDIR)/, $(EXPEXS)) $(EXS) $(EXAMPLE_FIGURES) $(EXAMPLE_DATAFILES)
......@@ -2,7 +2,7 @@
* Make example with N:Z:E colour plot (see Uffe Bergmann) using matshow or pcolor or something else in matplotlib
* Make QBa:A figure
* Do TODO's in top of *datagetter.py*
* Do TODO in top of *datagetter.py*
# DONE
......@@ -10,5 +10,4 @@
* Everything prior ✔
* Make generic script which writes desired values from root file to a text file ✔
* Combine subprojects into one big project ✔
* Make QEC example more sophisticated (still not completely finished, see *graph-example-qec.py*) ✔
\ No newline at end of file
* Make QEC example ✔
root nuchart.root :
a->Print()
a->Show(0), a->Show(1), ..., a->Show(3435)
new TBrowser
# assumed clicked around in TBrowser and closed again
a->SetMarkerStyle(21)
a->Draw("Z:N:QB", "", "colz")
a->SetMarkerSize(4) # or similar, [1, 7]
a->Draw("Z:N:QB", "5 < A && A < 65 && QB_est == 0", "colz")
a->Draw("Z >> (100, 0, 99)", "")
a->Draw("Z >> (100, 0, 99)", "QB > 0")
.q
back at terminal :
root QECdatamaker.cxx --> qec.dat
.q
python3 qec.py --> qec.pdf
......@@ -12,10 +12,6 @@
using namespace std;
using namespace TMath;
/*
* As a new thing, compared to 'expand-nuchart-QEC.cxx', we define our parameters and structs
* here to be able to access them globally.
*/
Double_t QECP = 0.0, S2pD = 0.0;
Double_t QECP_err = 0.0, S2pD_err = 0.0;
Double_t QEC2p = 0.0;
......@@ -81,7 +77,7 @@ int main() {
QECP = QEC.QEC;
QECP_err = QEC_err.QEC_err;
a->GetEntry(indD);
if (S2p.S2p_calc == 0) { // this is new compared to 'expand-nuchart-QEC.cxx': Sp might not be defined, so we need to check for this
if (S2p.S2p_calc == 0) {
QEC2p_NAN();
} else {
if (S2p.S2p_est == 1) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment