From 8e4ee09aee9818d8e69c714e64d705edcc89db38 Mon Sep 17 00:00:00 2001 From: nemu Date: Fri, 24 Apr 2009 15:07:54 +0000 Subject: [PATCH] added to possibilty to use a parameter rather than a number in the phase Fourier block: now all what is needed. Elimated debug flag from the Makefiles --- src/Makefile | 2 +- src/classes/Makefile.PMusr | 2 +- src/classes/Makefile.PUserFcn | 4 ++-- src/classes/PMsrHandler.cpp | 12 ++++++++++-- src/include/PMusr.h | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Makefile b/src/Makefile index 19f1d834..16537e0c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -34,7 +34,7 @@ endif # -- Linux ifeq ($(OS),LINUX) CXX = g++ -CXXFLAGS = -g -Wall -fPIC +CXXFLAGS = -Wall -fPIC PMUSRPATH = ./include MNPATH = $(ROOTSYS)/include INCLUDES = -I $(PMUSRPATH) -I $(MNPATH) diff --git a/src/classes/Makefile.PMusr b/src/classes/Makefile.PMusr index 95f30102..b1e576a0 100644 --- a/src/classes/Makefile.PMusr +++ b/src/classes/Makefile.PMusr @@ -42,7 +42,7 @@ endif # -- Linux ifeq ($(OS),LINUX) CXX = g++ -CXXFLAGS = -g -O3 -Wall -Wno-trigraphs -fPIC +CXXFLAGS = -O3 -Wall -Wno-trigraphs -fPIC PMUSRPATH = ../include MNPATH = $(ROOTSYS)/include GSLPATH = /usr/include/gsl diff --git a/src/classes/Makefile.PUserFcn b/src/classes/Makefile.PUserFcn index 584ab0a3..4ec31d92 100644 --- a/src/classes/Makefile.PUserFcn +++ b/src/classes/Makefile.PUserFcn @@ -35,7 +35,7 @@ endif # -- Linux ifeq ($(OS),LINUX) CXX = g++ -CXXFLAGS = -g -Wall -Wno-trigraphs -fPIC +CXXFLAGS = -Wall -Wno-trigraphs -fPIC INCLUDES = -I../include LD = g++ LDFLAGS = -g @@ -45,7 +45,7 @@ endif # -- Darwin ifeq ($(OS),DARWIN) CXX = g++ -CXXFLAGS = -g -Wall -Wno-trigraphs -fPIC +CXXFLAGS = -Wall -Wno-trigraphs -fPIC INCLUDES = -I../include LD = g++ LDFLAGS = -g diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index f19fc916..8dd29d59 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -758,9 +758,14 @@ int PMsrHandler::WriteMsrLogFile(TString ext) } // write 'phase' if present - if (fFourier.fPhase != -999.0) { - f << endl << "phase " << fFourier.fPhase; + if (fFourier.fPhaseParamNo > 0) { + f << endl << "phase par" << fFourier.fPhaseParamNo; CheckAndWriteComment(f, ++lineNo); + } else { + if (fFourier.fPhase != -999.0) { + f << endl << "phase " << fFourier.fPhase; + CheckAndWriteComment(f, ++lineNo); + } } // write 'range_for_phase_correction' if present @@ -1937,6 +1942,7 @@ void PMsrHandler::InitFourierParameterStructure(PMsrFourierStructure &fourier) fourier.fFourierPower = -1; // zero padding, default: -1 = NOT GIVEN fourier.fApodization = FOURIER_APOD_NOT_GIVEN; // apodization, default: NOT GIVEN fourier.fPlotTag = FOURIER_PLOT_NOT_GIVEN; // initial plot tag, default: NOT GIVEN + fourier.fPhaseParamNo = 0; // initial parameter no = 0 means not a parameter fourier.fPhase = -999.0; // fourier phase: -999 = NOT GIVEN for (unsigned int i=0; i<2; i++) { fourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN @@ -2095,6 +2101,8 @@ bool PMsrHandler::HandleFourierEntry(PMsrLines &lines) error = true; continue; } + // keep the parameter number + fourier.fPhaseParamNo = no; // get parameter value fourier.fPhase = fParam[no-1].fValue; } else { diff --git a/src/include/PMusr.h b/src/include/PMusr.h index dccc08cf..505c47f6 100644 --- a/src/include/PMusr.h +++ b/src/include/PMusr.h @@ -289,6 +289,7 @@ typedef struct { int fFourierPower; ///< i.e. zero padding up to 2^fFourierPower, default = 0 which means NO zero padding int fApodization; ///< tag indicating the kind of apodization wished, 0=no appodization (default), 1=weak, 2=medium, 3=strong (for details see the docu) int fPlotTag; ///< tag used for initial plot. 0=real, 1=imaginary, 2=real & imaginary (default), 3=power, 4=phase + int fPhaseParamNo; ///< parameter number if used instead of a phase value double fPhase; ///< phase double fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction double fPlotRange[2]; ///< field/frequency plot range