diff --git a/configure.ac b/configure.ac index 6f66fba6..a9c1362c 100644 --- a/configure.ac +++ b/configure.ac @@ -220,7 +220,7 @@ AC_SUBST(ROOT_CFLAGS) # It should be checked properly for -lMinuit2 -- at the moment we simply look if a header file is present in the include directory: AC_CHECK_FILE([${ROOTINCDIR}/../include/Minuit2/MnMinimize.h], AC_MSG_RESULT([Minuit2 headers found... OK]), - AC_MSG_ERROR([Minuit2 headers not found... Please check!])) + AC_MSG_WARN([Minuit2 headers not found... Please check!])) dnl ----------------------------------------------- diff --git a/src/external/TFitPofB-lib/classes/Makefile.TFitPofB b/src/external/TFitPofB-lib/classes/Makefile.TFitPofB index eec4dc90..f2469b5c 100644 --- a/src/external/TFitPofB-lib/classes/Makefile.TFitPofB +++ b/src/external/TFitPofB-lib/classes/Makefile.TFitPofB @@ -6,14 +6,14 @@ ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags) #--------------------------------------------------- OS = LINUX -CXX = g++-4.2.4 +CXX = g++-4.4.0 CXXFLAGS = -O3 -Wall -fopenmp -Wno-trigraphs -fPIC MUSRFITINCLUDE = ../../../include #MUSRFITINCLUDE = /home/l_wojek/rep/analysis/musrfit/src/include LOCALINCLUDE = ../include ROOTINCLUDE = $(ROOTSYS)/include INCLUDES = -I$(LOCALINCLUDE) -I$(MUSRFITINCLUDE) -I$(ROOTINCLUDE) -LD = g++-4.2.4 +LD = g++-4.4.0 LDFLAGS = -O3 SOFLAGS = -O3 -shared -fopenmp -lfftw3_threads -lfftw3 -lm -lpthread diff --git a/src/external/TFitPofB-lib/classes/TFitPofBStartupHandler.cpp b/src/external/TFitPofB-lib/classes/TFitPofBStartupHandler.cpp index 85ae238a..6f77f18a 100644 --- a/src/external/TFitPofB-lib/classes/TFitPofBStartupHandler.cpp +++ b/src/external/TFitPofB-lib/classes/TFitPofBStartupHandler.cpp @@ -33,6 +33,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include #include using namespace std; diff --git a/src/external/TFitPofB-lib/classes/TLondon1D.cpp b/src/external/TFitPofB-lib/classes/TLondon1D.cpp index 0b1089f7..6bcec9e4 100644 --- a/src/external/TFitPofB-lib/classes/TLondon1D.cpp +++ b/src/external/TFitPofB-lib/classes/TLondon1D.cpp @@ -140,7 +140,7 @@ TLondon1D3LSub::~TLondon1D3LSub() { // creates (a pointer to) the TPofTCalc object (with the FFT plan) //------------------ -TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true), fDeadLayerChanged(true) { +TLondon1DHS::TLondon1DHS() : fCalcNeeded(true), fFirstCall(true) { // read startup file string startup_path_name("TFitPofB_startup.xml"); @@ -618,7 +618,7 @@ TProximity1D1LHS::TProximity1D1LHS() : fCalcNeeded(true), fFirstCall(true) { fParForPofB.push_back(startupHandler->GetDeltaB()); fParForPofB.push_back(0.0); fParForPofB.push_back(0.0); // Bkg-Field - fParForPofB.push_back(0.005); // Bkg-width + fParForPofB.push_back(0.01); // Bkg-width fParForPofB.push_back(0.0); // Bkg-weight TTrimSPData *x = new TTrimSPData(rge_path, energy_vec); @@ -669,7 +669,7 @@ double TProximity1D1LHS::operator()(double t, const vector &par) const { fParForBofZ.push_back(fPar[i]); // cout << "fParForBofZ[" << i-2 << "] = " << fParForBofZ[i-2] << endl; } - fFirstCall=false; + fFirstCall = false; width_changed = true; dead_layer_changed = true; // cout << this << endl; diff --git a/src/external/TFitPofB-lib/classes/TPofBCalc.cpp b/src/external/TFitPofB-lib/classes/TPofBCalc.cpp index d2a42216..d4a089ef 100644 --- a/src/external/TFitPofB-lib/classes/TPofBCalc.cpp +++ b/src/external/TFitPofB-lib/classes/TPofBCalc.cpp @@ -11,6 +11,7 @@ #include "TPofTCalc.h" #include +#include #include #include #include diff --git a/src/external/TFitPofB-lib/classes/TPofTCalc.cpp b/src/external/TFitPofB-lib/classes/TPofTCalc.cpp index 8dc5dbf5..76b41e49 100644 --- a/src/external/TFitPofB-lib/classes/TPofTCalc.cpp +++ b/src/external/TFitPofB-lib/classes/TPofTCalc.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include diff --git a/src/external/TFitPofB-lib/classes/TSkewedGss.cpp b/src/external/TFitPofB-lib/classes/TSkewedGss.cpp new file mode 100644 index 00000000..8cab1045 --- /dev/null +++ b/src/external/TFitPofB-lib/classes/TSkewedGss.cpp @@ -0,0 +1,149 @@ +/*************************************************************************** + + TSkewedGss.cpp + + Author: Bastian M. Wojek + e-mail: bastian.wojek@psi.ch + + 2009/01/24 + +***************************************************************************/ + +#include "TSkewedGss.h" +#include +#include +using namespace std; + +#include +#include "TFitPofBStartupHandler.h" + +ClassImp(TSkewedGss) + +//------------------ +// Destructor of the TSkewedGss class -- cleaning up +//------------------ + +TSkewedGss::~TSkewedGss() { + fPar.clear(); + fParForPofB.clear(); + fParForPofT.clear(); + delete fPofT; + fPofT = 0; +} + +//------------------ +// Constructor of the TSkewedGss class -- creates (a pointer to) the TPofTCalc object (with the FFT plan) +//------------------ + +TSkewedGss::TSkewedGss() : fCalcNeeded(true), fFirstCall(true) { + + // read startup file + string startup_path_name("TFitPofB_startup.xml"); + + TSAXParser *saxParser = new TSAXParser(); + TFitPofBStartupHandler *startupHandler = new TFitPofBStartupHandler(); + saxParser->ConnectToHandler("TFitPofBStartupHandler", startupHandler); + int status (saxParser->ParseFile(startup_path_name.c_str())); + // check for parse errors + if (status) { // error + cout << endl << "**WARNING** reading/parsing TFitPofB_startup.xml failed." << endl; + } + + fWisdom = startupHandler->GetWisdomFile(); + + fParForPofT.push_back(0.0); // phase + fParForPofT.push_back(startupHandler->GetDeltat()); + fParForPofT.push_back(startupHandler->GetDeltaB()); + + fParForPofB.push_back(startupHandler->GetDeltat()); + fParForPofB.push_back(startupHandler->GetDeltaB()); + fParForPofB.push_back(0.0); // nu0 + fParForPofB.push_back(0.0); // s- + fParForPofB.push_back(0.0); // s+ + + TPofTCalc *y = new TPofTCalc(fWisdom, fParForPofT); + fPofT = y; + y = 0; + delete y; + + // clean up + if (saxParser) { + delete saxParser; + saxParser = 0; + } + if (startupHandler) { + delete startupHandler; + startupHandler = 0; + } +} + +//------------------ +// TSkewedGss-Method that calls the procedures to create p(B) and P(t) +// It finally returns P(t) for a given t. +// Parameters: all the parameters for the function to be fitted through TSkewedGss (phase,freq0,sigma-,sigma+) +//------------------ + +double TSkewedGss::operator()(double t, const vector &par) const { + + assert(par.size() == 4); + + if(t<0.0) + return 1.0; + + // check if the function is called the first time and if yes, read in parameters + + if(fFirstCall){ + fPar = par; + fFirstCall=false; + } + + // check if any parameter has changed + + bool par_changed(false); + bool only_phase_changed(false); + + for (unsigned int i(0); iDoFFT(PofB); + + }/* else { + cout << "Only the phase parameter has changed, (re-)calculating P(t) now..." << endl; + }*/ + + fPofT->CalcPol(fParForPofT); + + fCalcNeeded = false; + } + + return fPofT->Eval(t); + +} + diff --git a/src/external/TFitPofB-lib/include/TSkewedGss.h b/src/external/TFitPofB-lib/include/TSkewedGss.h new file mode 100644 index 00000000..b7074ffd --- /dev/null +++ b/src/external/TFitPofB-lib/include/TSkewedGss.h @@ -0,0 +1,39 @@ +/*************************************************************************** + + TSkewedGss.h + + Author: Bastian M. Wojek + e-mail: bastian.wojek@psi.ch + + 2009/01/24 + +***************************************************************************/ + +#ifndef _TSkewedGss_H_ +#define _TSkewedGss_H_ + +#include "PUserFcnBase.h" +#include "TPofTCalc.h" + +class TSkewedGss : public PUserFcnBase { + +public: + // default constructor + TSkewedGss(); + ~TSkewedGss(); + + double operator()(double, const vector&) const; + +private: + mutable vector fPar; + TPofTCalc *fPofT; + mutable bool fCalcNeeded; + mutable bool fFirstCall; + mutable vector fParForPofT; + mutable vector fParForPofB; + string fWisdom; + + ClassDef(TSkewedGss,1) +}; + +#endif //_TSkewedGss_H_ diff --git a/src/external/scripts/msr2data b/src/external/scripts/msr2data index ce7b43f9..36e41041 100644 --- a/src/external/scripts/msr2data +++ b/src/external/scripts/msr2data @@ -11,11 +11,11 @@ if [ "$#" -lt 2 ] ; then "musrfit-msr to db/dat converter" -USAGE: msr2data FIRSTRUN# LASTRUN# EXTENSION [noheader | nosummary | fit-TEMPLATERUN# | -oOUTPUT_FILE | -k | data ] +USAGE: msr2data FIRSTRUN# LASTRUN# EXTENSION [noheader | nosummary | fit-TEMPLATERUN# | -oOUTPUT_FILE | -k | -t | data ] OR - msr2data \[SPACE SEPARATED LIST OF RUNS\] EXTENSION [noheader | nosummary | fit-TEMPLATERUN# | -oOUTPUT_FILE | -k | data ] + msr2data \[SPACE SEPARATED LIST OF RUNS\] EXTENSION [noheader | nosummary | fit-TEMPLATERUN# | -oOUTPUT_FILE | -k | -t | data ] OR - msr2data RUNLISTFILE EXTENSION [noheader | nosummary | fit-TEMPLATERUN# | -oOUTPUT_FILE | -k | data ] + msr2data RUNLISTFILE EXTENSION [noheader | nosummary | fit-TEMPLATERUN# | -oOUTPUT_FILE | -k | -t | data ] This small script converts subsequent musrfit msr output files into one db- or column-ASCII-file using bash/awk. @@ -61,6 +61,8 @@ template for the first musrfit input file. The results of the fits will be writt For keeping the MINUIT2 output files after calling musrfit, i.e. invoke musrfit with the option "--keep-mn2-output" just pass the option "-k" to msr2data. If you pass this option to msr2data but do not fit any data, the option will just be ignored. +If musrfit should add the title present in the first data file mentioned in a RUN block to the title line of the mlog output file, pass the option "-t" to msr2data. Then musrfit is called with the option "--title-from-data-file". If you pass this option to msr2data but do not fit any data, the option will just be ignored. + If your musrfit output files do not have an extension as specified above like "200.msr" you have to call the script as in the following example. Example 5: @@ -283,7 +285,15 @@ else for PAR in "$@" do if [ "$PAR" == "-k" ]; then - MUSRFITPARAM="-k" + MUSRFITPARAM+=" -k" + break + fi + done + + for PAR in "$@" + do + if [ "$PAR" == "-t" ]; then + MUSRFITPARAM+=" -t" break fi done @@ -395,7 +405,7 @@ else if [ "${CUR_PAR:0:2}" == "-o" ]; then if [ "$CUR_PAR" == "-o" ]; then if [ "$l" -ne "$LAST_OPT_PAR" ] && [ "$NEXT_PAR" != "noheader" ] && [ "$NEXT_PAR" != "nosummary" ] \ - && [ "${NEXT_PAR:0:3}" != "fit" ] && [ "$NEXT_PAR" != "-k" ]; then + && [ "${NEXT_PAR:0:3}" != "fit" ] && [ "$NEXT_PAR" != "-k" ] && [ "$NEXT_PAR" != "-t" ]; then OUTFILE=$NEXT_PAR break else