diff --git a/LTF/Makefile b/LTF/Makefile index b67b86d..bec012a 100644 --- a/LTF/Makefile +++ b/LTF/Makefile @@ -12,7 +12,7 @@ ROOTINCLUDES= ifdef WITH_ROOT WITH_ROOT=-D__WITH_ROOT__ ROOTLIBS=$(shell root-config --libs) -ROOTINCLUDES=-I$(shell root-config --incdir) +ROOTINCLUDES=-I$(shell root-config --incdir) $(WITH_ROOT) endif # take eigen from local copy in 'Eigen_copy' or from @@ -34,7 +34,9 @@ endif ########################################################### # all -all: slib bin +all: + $(MAKE) slib + $(MAKE) bin ########################################################### @@ -61,7 +63,7 @@ bin: $(programs) $(programs): %: %.cxx @mkdir -p bin - $(CXX) $< -o bin/$(notdir $@) -O0 -g -Wall -Wno-sign-compare -Wno-unused-variable -Wl,-rpath,$(PWD)/lib -std=gnu++17 -I. -I$(EIGEN_INCLUDE) $(ROOTINCLUDES) -Llib/ -lLTF -lstdc++ $(ROOTLIBS) + $(CXX) $< -o bin/$(notdir $@) -O0 -g -Wall -Wno-sign-compare -Wno-unused-variable -Wl,-rpath,$(PWD)/lib -std=gnu++17 -I. -I$(EIGEN_INCLUDE) $(ROOTINCLUDES) -Llib/ -lLTF -lstdc++ $(ROOTLIBS) ########################################################### diff --git a/LTF/example1_LTF_gaus.cxx b/LTF/example1_LTF_gaus.cxx index c731f69..96cdf44 100644 --- a/LTF/example1_LTF_gaus.cxx +++ b/LTF/example1_LTF_gaus.cxx @@ -28,6 +28,7 @@ #include "LTF/LTF.h" #include "LTF/LTF_ROOTTools.h" +#include void PrintAsciiTable(const map&, TH1D* data); @@ -36,7 +37,6 @@ void PrintAsciiTable(const map&, TH1D* data); int example1_LTF_gaus() { using namespace std; - gStyle->SetOptStat(0); gSystem->Load("libLTF.so"); TH1D::AddDirectory(false); TH1::SetDefaultSumw2(true); diff --git a/LTF/example2_LTF_gaus2D.cxx b/LTF/example2_LTF_gaus2D.cxx index a942a3c..63f0a3b 100644 --- a/LTF/example2_LTF_gaus2D.cxx +++ b/LTF/example2_LTF_gaus2D.cxx @@ -28,6 +28,7 @@ #include "LTF/LTF.h" #include "LTF/LTF_ROOTTools.h" #include +#include #include using namespace std; @@ -40,7 +41,6 @@ void PrintAsciiTable(const map,TH1D*>& templates, TH1D* data); //! main int example2_LTF_gaus2D() { - gStyle->SetOptStat(0); gSystem->Load("libLTF.so"); TH1D::AddDirectory(false); TH1::SetDefaultSumw2(true); diff --git a/LTF/example3_LTF_gaus_sigma.cxx b/LTF/example3_LTF_gaus_sigma.cxx index 327805a..4e2f6b0 100644 --- a/LTF/example3_LTF_gaus_sigma.cxx +++ b/LTF/example3_LTF_gaus_sigma.cxx @@ -27,6 +27,7 @@ #if defined __WITH_ROOT__ || defined __CLING__ #include "LTF/LTF.h" #include "LTF/LTF_ROOTTools.h" +#include #include #include @@ -40,7 +41,6 @@ void PrintAsciiTable(const map,TH1D*>& templates, TH1D* data); //! main int example2_LTF_gaus_sigma() { - gStyle->SetOptStat(0); gSystem->Load("libLTF.so"); TH1D::AddDirectory(false); TH1::SetDefaultSumw2(true); diff --git a/LTF/src/LTF_ROOTTools.cxx b/LTF/src/LTF_ROOTTools.cxx index c641dca..8f81f1c 100644 --- a/LTF/src/LTF_ROOTTools.cxx +++ b/LTF/src/LTF_ROOTTools.cxx @@ -146,7 +146,7 @@ TH1D* LTF_ROOTTools::MakeHistogram(const Eigen::VectorXd& values, vector TH1D* hist = bins.empty() ? new TH1D("hist","hist",values.size(),0,values.size() ) : new TH1D("hist","hist",bins.size()-1, &bins[0]); - if ( bins.size() && values.size() != bins.size()-1 ) {cout<<"ERROR! binning and number of entries does not fit!"<SetBinContent(i+1, values(i)); if ( V.size() ) { @@ -512,6 +512,8 @@ void LTF_ROOTTools::plotLiTeFit(const LTF::LiTeFit& fit, const vector& b void LTF_ROOTTools::plotLiTeFit_2D(const LTF::LiTeFit& fit, const vector bins ) { + gStyle->SetOptStat(0); + gSystem->mkdir("plots"); auto& M = fit.M; if ( M.cols() != 3 ) {cout<<"Error! only 2-dim plotting implemented."< > LTF_Tools::read_correlations(std::string file //! std::vector > LTF_Tools::corr_to_cov( const std::vector >& corr, const std::vector& percenterr, const std::vector& data) { std::vector err(data.size()); - for ( int i = 0 ; i > cov(err.size()); - for ( int i = 0 ; i 1e-3) ) cout<