merging master with root6 branch

This commit is contained in:
2015-02-20 13:51:26 +01:00
46 changed files with 2260 additions and 419 deletions

View File

@@ -22,15 +22,17 @@ SUBDIRS = external/MusrRoot \
external/mud \
$(PNEXUSDIRS) \
classes \
external
external \
musredit \
musrgui
if BUILD_MUSRGUI
SUBDIRS += $(EDITORDIR)
#SUBDIRS += $(EDITORDIR)
EXTRA_DIST = $(EDITORDIR)/Makefile
endif
if BUILD_MUSREDIT
SUBDIRS += $(EDITORDIR)
#SUBDIRS += $(EDITORDIR)
EXTRA_DIST = $(EDITORDIR)/Makefile
endif

View File

@@ -200,6 +200,23 @@ void PFourier::Transform(UInt_t apodizationTag)
}
}
//--------------------------------------------------------------------------
// GetMaxFreq
//--------------------------------------------------------------------------
/**
* <p>returns the maximal frequency in units choosen, i.e. Gauss, Tesla, MHz, Mc/s
*/
Double_t PFourier::GetMaxFreq()
{
UInt_t noOfFourierBins = 0;
if (fNoOfBins % 2 == 0)
noOfFourierBins = fNoOfBins/2;
else
noOfFourierBins = (fNoOfBins+1)/2;
return fResolution*noOfFourierBins;
}
//--------------------------------------------------------------------------
// GetRealFourier
//--------------------------------------------------------------------------

View File

@@ -43,8 +43,8 @@ using namespace std;
#define YINFO 0.2
#define YTITLE 0.95
static const char *gFiletypes[] = { "All files", "*",
"Data files", "*.dat",
static const char *gFiletypes[] = { "Data files", "*.dat",
"All files", "*",
0, 0 };
ClassImpQ(PFourierCanvas)
@@ -119,7 +119,7 @@ PFourierCanvas::PFourierCanvas(vector<PFourier*> &fourier, const Char_t* title,
CreateXaxisTitle();
CreateStyle();
InitFourierDataSets();
InitFourierCanvas(title, wtopx, wtopy, ww, wh);
InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling
}
@@ -163,7 +163,7 @@ PFourierCanvas::PFourierCanvas(vector<PFourier*> &fourier, const Char_t* title,
CreateXaxisTitle();
CreateStyle();
InitFourierDataSets();
InitFourierCanvas(title, wtopx, wtopy, ww, wh);
InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh);
gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling
}
@@ -856,7 +856,7 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w
if (!fBatchMode) {
fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp();
fBar = fImp->GetMenuBar();
fPopupMain = fBar->AddPopup("&MusrFT");
fPopupMain = fBar->AddPopup("MusrFT");
fPopupFourier = new TGPopupMenu();
@@ -918,7 +918,7 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w
fTitlePad->Draw();
// fourier pad
fFourierPad = new TPad("fourierPad", "fourierPad", 0.0, YINFO, 1.0, YTITLE);
fFourierPad = new TPad("fFourierPad", "fFourierPad", 0.0, YINFO, 1.0, YTITLE);
if (fFourierPad == 0) {
cerr << endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: Couldn't invoke fFourierPad";
cerr << endl;
@@ -1345,8 +1345,8 @@ void PFourierCanvas::DecrementFourierPhase()
if ((fFourierHistos[i].dataFourierRe != 0) && (fFourierHistos[i].dataFourierIm != 0)) {
for (Int_t j=0; j<fFourierHistos[i].dataFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
// calculate new fourier data set value
re = fFourierHistos[i].dataFourierRe->GetBinContent(j) * cp + fFourierHistos[i].dataFourierIm->GetBinContent(j) * sp;
im = fFourierHistos[i].dataFourierIm->GetBinContent(j) * cp - fFourierHistos[i].dataFourierRe->GetBinContent(j) * sp;
re = fFourierHistos[i].dataFourierRe->GetBinContent(j) * cp - fFourierHistos[i].dataFourierIm->GetBinContent(j) * sp;
im = fFourierHistos[i].dataFourierIm->GetBinContent(j) * cp + fFourierHistos[i].dataFourierRe->GetBinContent(j) * sp;
// overwrite fourier data set value
fFourierHistos[i].dataFourierRe->SetBinContent(j, re);
fFourierHistos[i].dataFourierIm->SetBinContent(j, im);

View File

@@ -2861,29 +2861,6 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines)
fGlobal = global;
}
/*
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fittype : " << fGlobal.GetFitType();
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: data bin range: ";
for (UInt_t i=0; i<4; i++) {
cout << fGlobal.GetDataRange(i) << ", ";
}
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: t0's : ";
for (UInt_t i=0; i<fGlobal.GetT0BinSize(); i++)
cout << fGlobal.GetT0Bin(i) << ", ";
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: addt0's : ";
for (UInt_t i=0; i<fGlobal.GetAddT0BinEntries(); i++) {
cout << endl << " debug> --> " << i << ": ";
for (UInt_t j=0; j<(UInt_t)fGlobal.GetAddT0BinSize(i); j++) {
cout << fGlobal.GetAddT0Bin(i,j) << ", ";
}
}
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fit in bin: " << fGlobal.IsFitRangeInBin();
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fit offset: " << fGlobal.GetFitRangeOffset(0) << ", " << fGlobal.GetFitRangeOffset(1);
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fit : " << fGlobal.GetFitRange(0) << ", " << fGlobal.GetFitRange(1);
cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: packing : " << fGlobal.GetPacking();
cout << endl;
*/
return !error;
}
@@ -5054,7 +5031,7 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity()
cerr << endl << ">> forward parameter number not defined. Necessary for single histogram fits." << endl;
return false;
}
if (fRuns[i].GetNormParamNo() > static_cast<Int_t>(fParam.size())) {
if ((fRuns[i].GetNormParamNo() > static_cast<Int_t>(fParam.size())) && !fFourierOnly) {
// check if forward histogram number is a function
if (fRuns[i].GetNormParamNo() - MSR_PARAM_FUN_OFFSET > static_cast<Int_t>(fParam.size())) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
@@ -5338,6 +5315,9 @@ Bool_t PMsrHandler::CheckFuncs()
{
Bool_t result = true;
if (fFourierOnly)
return result;
PIntVector funVec;
PIntVector funBlock;
PIntVector funLineBlockNo;

View File

@@ -35,10 +35,15 @@ using namespace std;
#include <TRandom.h>
#include <TROOT.h>
#include <TObjString.h>
#include <TGFileDialog.h>
#include "PMusrCanvas.h"
#include "PFourier.h"
static const char *gFiletypes[] = { "Data files", "*.dat",
"All files", "*",
0, 0 };
ClassImp(PMusrCanvasPlotRange)
//--------------------------------------------------------------------------
@@ -128,7 +133,6 @@ PMusrCanvas::PMusrCanvas()
fImp = 0;
fBar = 0;
fPopupMain = 0;
fPopupSave = 0;
fPopupFourier = 0;
fStyle = 0;
@@ -181,8 +185,8 @@ PMusrCanvas::PMusrCanvas()
*/
PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
const Bool_t batch) :
fBatchMode(batch), fPlotNumber(number)
const Bool_t batch, const Bool_t fourier) :
fStartWithFourier(fourier), fBatchMode(batch), fPlotNumber(number)
{
fTimeout = 0;
fTimeoutTimer = 0;
@@ -236,8 +240,8 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
PMsrFourierStructure fourierDefault,
const PIntVector markerList, const PIntVector colorList,
const Bool_t batch) :
fBatchMode(batch),
const Bool_t batch, const Bool_t fourier) :
fStartWithFourier(fourier), fBatchMode(batch),
fPlotNumber(number), fFourier(fourierDefault),
fMarkerList(markerList), fColorList(colorList)
{
@@ -703,7 +707,62 @@ void PMusrCanvas::UpdateDataTheoryPad()
}
// generate the histo plot
PlotData();
if (!fStartWithFourier || (fPlotType == MSR_PLOT_NON_MUSR)) {
PlotData();
} else { // show Fourier straight ahead.
// set the menu properly
if (!fBatchMode)
fPopupMain->UnCheckEntry(P_MENU_ID_DATA+P_MENU_PLOT_OFFSET*fPlotNumber);
// filter proper Fourier plot tag, and set the menu tags properly
switch (fFourier.fPlotTag) {
case FOURIER_PLOT_REAL:
fCurrentPlotView = PV_FOURIER_REAL;
if (!fBatchMode) {
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_REAL);
fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_PLUS);
fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS);
}
break;
case FOURIER_PLOT_IMAG:
fCurrentPlotView = PV_FOURIER_IMAG;
if (!fBatchMode) {
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_IMAG);
fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_PLUS);
fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS);
}
break;
case FOURIER_PLOT_REAL_AND_IMAG:
fCurrentPlotView = PV_FOURIER_REAL_AND_IMAG;
if (!fBatchMode) {
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_REAL_AND_IMAG);
fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_PLUS);
fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS);
}
break;
case FOURIER_PLOT_POWER:
fCurrentPlotView = PV_FOURIER_PWR;
if (!fBatchMode) {
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PWR);
}
break;
case FOURIER_PLOT_PHASE:
fCurrentPlotView = PV_FOURIER_PHASE;
if (!fBatchMode) {
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE);
}
break;
default:
fCurrentPlotView = PV_FOURIER_PWR;
if (!fBatchMode) {
fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PWR);
}
break;
}
HandleFourier();
PlotFourier();
}
}
//--------------------------------------------------------------------------
@@ -1282,8 +1341,16 @@ void PMusrCanvas::HandleMenuPopup(Int_t id)
cout << "**INFO** averaging of a single data set doesn't make any sense, will ignore 'a' ..." << endl;
return;
}
} else if (id == P_MENU_ID_SAVE_DATA+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_SAVE_ASCII) {
SaveDataAscii();
} else if (id == P_MENU_ID_EXPORT_DATA+P_MENU_PLOT_OFFSET*fPlotNumber) {
static TString dir(".");
TGFileInfo fi;
fi.fFileTypes = gFiletypes;
fi.fIniDir = StrDup(dir);
fi.fOverwrite = true;
new TGFileDialog(0, fImp, kFDSave, &fi);
if (fi.fFilename && strlen(fi.fFilename)) {
ExportData(fi.fFilename);
}
}
// check if phase increment/decrement needs to be ghost
@@ -1362,13 +1429,20 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat)
}
//--------------------------------------------------------------------------
// SaveDataAscii
// ExportData
//--------------------------------------------------------------------------
/**
* <p>Saves the currently seen data (data, difference, Fourier spectra, ...) in ascii column format.
*
* \param fileName file name to be used to save the data.
*/
void PMusrCanvas::SaveDataAscii()
void PMusrCanvas::ExportData(const Char_t *fileName)
{
if (fileName == 0) { // path file name NOT provided, generate a default path file name
cerr << endl << ">> PMusrCanvas::ExportData **ERROR** NO path file name provided. Will do nothing." << endl;
return;
}
// collect relevant data
PMusrCanvasAsciiDump dump;
PMusrCanvasAsciiDumpVector dumpVector;
@@ -2014,35 +2088,13 @@ void PMusrCanvas::SaveDataAscii()
break;
}
// generate output filename
// in order to handle names with "." correctly this slightly odd data-filename generation
TObjArray *tokens = fMsrHandler->GetFileName().Tokenize(".");
TObjString *ostr;
TString str;
TString fln = TString("");
for (Int_t i=0; i<tokens->GetEntries()-1; i++) {
ostr = dynamic_cast<TObjString*>(tokens->At(i));
fln += ostr->GetString() + TString(".");
}
if (!fDifferenceView) {
fln += "data.ascii";
} else {
fln += "diff.ascii";
}
if (tokens) {
delete tokens;
tokens = 0;
}
// open file
ofstream fout;
// open output data-file
fout.open(fln.Data(), iostream::out);
fout.open(fileName, iostream::out);
if (!fout.is_open()) {
cerr << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << fln.Data() << " for writing." << endl;
cerr << endl << ">> PMusrCanvas::ExportData: **ERROR** couldn't open file " << fileName << " for writing." << endl;
return;
}
@@ -2366,7 +2418,6 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
fImp = 0;
fBar = 0;
fPopupMain = 0;
fPopupSave = 0;
fPopupFourier = 0;
fMainCanvas = 0;
@@ -2415,10 +2466,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
fPopupMain->AddEntry("Average", P_MENU_ID_AVERAGE+P_MENU_PLOT_OFFSET*fPlotNumber);
fPopupMain->AddSeparator();
fPopupSave = new TGPopupMenu();
fPopupSave->AddEntry("Save ascii", P_MENU_ID_SAVE_DATA+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_SAVE_ASCII);
fPopupMain->AddPopup("&Save Data", fPopupSave);
fPopupMain->AddEntry("Export Data", P_MENU_ID_EXPORT_DATA+P_MENU_PLOT_OFFSET*fPlotNumber);
fBar->MapSubwindows();
fBar->Layout();
@@ -3358,10 +3406,14 @@ void PMusrCanvas::HandleFourier()
// check if fourier needs to be calculated
if (fData[0].dataFourierRe == 0) {
Int_t bin;
bin = fHistoFrame->GetXaxis()->GetFirst();
double startTime = fHistoFrame->GetBinCenter(bin);
bin = fHistoFrame->GetXaxis()->GetLast();
double endTime = fHistoFrame->GetBinCenter(bin);
double startTime = fXmin;
double endTime = fXmax;
if (!fStartWithFourier) { // fHistoFrame presen, hence get start/end from it
bin = fHistoFrame->GetXaxis()->GetFirst();
startTime = fHistoFrame->GetBinCenter(bin);
bin = fHistoFrame->GetXaxis()->GetLast();
endTime = fHistoFrame->GetBinCenter(bin);
}
for (UInt_t i=0; i<fData.size(); i++) {
// calculate fourier transform of the data
PFourier fourierData(fData[i].data, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, fFourier.fFourierPower);
@@ -3800,7 +3852,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].data->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].data, fData[0].data->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].data, fData[0].data->GetBinCenter(i));
}
fDataAvg.data->SetBinContent(i, dval/fData.size());
}
@@ -3814,7 +3866,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].dataFourierRe->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].dataFourierRe, fData[0].dataFourierRe->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].dataFourierRe, fData[0].dataFourierRe->GetBinCenter(i));
}
fDataAvg.dataFourierRe->SetBinContent(i, dval/fData.size());
}
@@ -3828,7 +3880,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].dataFourierIm->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].dataFourierIm, fData[0].dataFourierIm->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].dataFourierIm, fData[0].dataFourierIm->GetBinCenter(i));
}
fDataAvg.dataFourierIm->SetBinContent(i, dval/fData.size());
}
@@ -3842,7 +3894,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].dataFourierPwr->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].dataFourierPwr, fData[0].dataFourierPwr->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].dataFourierPwr, fData[0].dataFourierPwr->GetBinCenter(i));
}
fDataAvg.dataFourierPwr->SetBinContent(i, dval/fData.size());
}
@@ -3856,7 +3908,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].dataFourierPhase->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].dataFourierPhase, fData[0].dataFourierPhase->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].dataFourierPhase, fData[0].dataFourierPhase->GetBinCenter(i));
}
fDataAvg.dataFourierPhase->SetBinContent(i, dval/fData.size());
}
@@ -3870,7 +3922,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].theory->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].theory, fData[0].theory->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].theory, fData[0].theory->GetBinCenter(i));
}
fDataAvg.theory->SetBinContent(i, dval/fData.size());
}
@@ -3880,7 +3932,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].theoryFourierRe->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].theoryFourierRe, fData[0].theoryFourierRe->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].theoryFourierRe, fData[0].theoryFourierRe->GetBinCenter(i));
}
fDataAvg.theoryFourierRe->SetBinContent(i, dval/fData.size());
}
@@ -3894,7 +3946,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].theoryFourierIm->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].theoryFourierIm, fData[0].theoryFourierIm->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].theoryFourierIm, fData[0].theoryFourierIm->GetBinCenter(i));
}
fDataAvg.theoryFourierIm->SetBinContent(i, dval/fData.size());
}
@@ -3908,7 +3960,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].theoryFourierPwr->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].theoryFourierPwr, fData[0].theoryFourierPwr->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].theoryFourierPwr, fData[0].theoryFourierPwr->GetBinCenter(i));
}
fDataAvg.theoryFourierPwr->SetBinContent(i, dval/fData.size());
}
@@ -3922,7 +3974,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].theoryFourierPhase->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].theoryFourierPhase, fData[0].theoryFourierPhase->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].theoryFourierPhase, fData[0].theoryFourierPhase->GetBinCenter(i));
}
fDataAvg.theoryFourierPhase->SetBinContent(i, dval/fData.size());
}
@@ -3936,7 +3988,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].diff->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].diff, fData[0].diff->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].diff, fData[0].diff->GetBinCenter(i));
}
fDataAvg.diff->SetBinContent(i, dval/fData.size());
}
@@ -3950,7 +4002,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].diffFourierRe->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].diffFourierRe, fData[0].diffFourierRe->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].diffFourierRe, fData[0].diffFourierRe->GetBinCenter(i));
}
fDataAvg.diffFourierRe->SetBinContent(i, dval/fData.size());
}
@@ -3964,7 +4016,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].diffFourierIm->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].diffFourierIm, fData[0].diffFourierIm->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].diffFourierIm, fData[0].diffFourierIm->GetBinCenter(i));
}
fDataAvg.diffFourierIm->SetBinContent(i, dval/fData.size());
}
@@ -3978,7 +4030,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].diffFourierPwr->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].diffFourierPwr, fData[0].diffFourierPwr->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].diffFourierPwr, fData[0].diffFourierPwr->GetBinCenter(i));
}
fDataAvg.diffFourierPwr->SetBinContent(i, dval/fData.size());
}
@@ -3992,7 +4044,7 @@ void PMusrCanvas::HandleAverage()
for (Int_t i=0; i<fData[0].diffFourierPhase->GetNbinsX(); i++) {
dval = 0.0;
for (UInt_t j=0; j<fData.size(); j++) {
dval += GetInterpolatedValue(fData[j].diffFourierPhase, fData[0].diffFourierPhase->GetBinContent(i));
dval += GetInterpolatedValue(fData[j].diffFourierPhase, fData[0].diffFourierPhase->GetBinCenter(i));
}
fDataAvg.diffFourierPhase->SetBinContent(i, dval/fData.size());
}

View File

@@ -27,6 +27,8 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <cmath>
#include "PPrepFourier.h"
//--------------------------------------------------------------------------
@@ -48,10 +50,11 @@ PPrepFourier::PPrepFourier()
/**
* <p>Constructor.
*/
PPrepFourier::PPrepFourier(const Int_t *bkgRange, const Int_t packing) :
PPrepFourier::PPrepFourier(const Int_t packing, const Int_t *bkgRange, PDoubleVector bkg) :
fPacking(packing)
{
SetBkgRange(bkgRange);
SetBkg(bkg);
}
//--------------------------------------------------------------------------
@@ -112,6 +115,20 @@ void PPrepFourier::SetBkgRange(const Int_t *bkgRange)
}
}
//--------------------------------------------------------------------------
// SetBkgRange
//--------------------------------------------------------------------------
/**
* <p>set the background values for all the histos.
*
* \param bkg vector
*/
void PPrepFourier::SetBkg(PDoubleVector bkg)
{
for (unsigned int i=0; i<bkg.size(); i++)
fBkg.push_back(bkg[i]);
}
//--------------------------------------------------------------------------
// SetPacking
//--------------------------------------------------------------------------
@@ -157,29 +174,46 @@ void PPrepFourier::DoBkgCorrection()
}
// if no bkg-range is given, nothing needs to be done
if ((fBkgRange[0] == -1) && (fBkgRange[1] == -1)) {
if ((fBkgRange[0] == -1) && (fBkgRange[1] == -1) && (fBkg.size() == 0)) {
return;
}
// make sure that the bkg range is ok
for (unsigned int i=0; i<fRawData.size(); i++) {
if ((fBkgRange[0] >= fRawData[i].rawData.size()) || (fBkgRange[1] >= fRawData[i].rawData.size())) {
cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!";
if ((fBkgRange[0] != -1) && (fBkgRange[1] != -1)) { // background range is given
// make sure that the bkg range is ok
for (unsigned int i=0; i<fRawData.size(); i++) {
if ((fBkgRange[0] >= fRawData[i].rawData.size()) || (fBkgRange[1] >= fRawData[i].rawData.size())) {
cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!";
return;
}
}
Double_t bkg=0.0;
for (unsigned int i=0; i<fRawData.size(); i++) {
// calculate the bkg for the given range
for (int j=fBkgRange[0]; j<=fBkgRange[1]; j++) {
bkg += fRawData[i].rawData[j];
}
bkg /= (fBkgRange[1]-fBkgRange[0]+1);
cout << "debug> background " << i << ": " << bkg << endl;
// correct data
for (unsigned int j=0; j<fData[i].size(); j++)
fData[i][j] -= bkg;
}
} else { // there might be an explicit background list
// check if there is a background list
if (fBkg.size() == 0)
return;
// check if there are as many background values than data values
if (fBkg.size() != fData.size()) {
cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** #bkg values != #histos. Will do nothing here." << endl;
return;
}
}
Double_t bkg=0.0;
for (unsigned int i=0; i<fRawData.size(); i++) {
// calculate the bkg for the given range
for (int j=fBkgRange[0]; j<=fBkgRange[1]; j++) {
bkg += fRawData[i].rawData[j];
}
bkg /= (fBkgRange[1]-fBkgRange[0]+1);
// correct data
for (unsigned int j=0; j<fData[i].size(); j++)
fData[i][j] -= bkg;
for (unsigned int i=0; i<fData.size(); i++)
for (unsigned int j=0; j<fData[i].size(); j++)
fData[i][j] -= fBkg[i];
}
}
@@ -218,20 +252,6 @@ void PPrepFourier::DoPacking()
}
}
//--------------------------------------------------------------------------
// DoFiltering
//--------------------------------------------------------------------------
/**
* <p>Not implemented yet.
*/
void PPrepFourier::DoFiltering()
{
// make sure fData are already present, and if not create the necessary data sets
if (fData.size() != fRawData.size()) {
InitData();
}
}
//--------------------------------------------------------------------------
// DoLifeTimeCorrection
//--------------------------------------------------------------------------
@@ -417,7 +437,7 @@ TH1F *PPrepFourier::GetData(const UInt_t idx)
}
//--------------------------------------------------------------------------
// InitData
// InitData (private)
//--------------------------------------------------------------------------
/**
* <p>Copy raw-data to internal data from t0 to the size of raw-data.

View File

@@ -19,4 +19,8 @@ if BUILD_BMWLIBS
libCalcMeanFieldsLEM
endif
SUBDIRS = $(ASDIRS) $(CUBADIRS) $(BMWDIRS)
if BUILD_BNMRLIBS
BNMRDIRS = libBNMR
endif
SUBDIRS = $(ASDIRS) $(CUBADIRS) $(BMWDIRS) $(BNMRDIRS)

52
src/external/libBNMR/Makefile.am vendored Normal file
View File

@@ -0,0 +1,52 @@
## Process this file with automake to create Makefile.in
h_sources = \
TBNMR.h
h_linkdef = \
TBNMRLinkDef.h
dict_h_sources = \
TBNMRDict.h
cpp_sources = \
TBNMR.cpp
dict_cpp_sources = \
TBNMRDict.cpp
include_HEADERS = $(h_sources)
noinst_HEADERS = $(h_linkdef) $(dict_h_sources)
AM_CPPFLAGS = -I$(top_srcdir)/src/include $(PMUSR_CFLAGS) -I$(ROOTINCDIR)
AM_CXXFLAGS = $(LOCAL_LIB_CXXFLAGS)
BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources)
AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@
CLEANFILES = *Dict.cpp *Dict.h *~ core
%Dict.cpp %Dict.h: %.h %LinkDef.h
@ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^
lib_LTLIBRARIES = libBNMR.la
libBNMR_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources)
libBNMR_la_LIBADD = $(ROOT_LIBS)
libBNMR_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS)
## However, create some symbolic links to the shared library
## in order to unify the function call on different operating systems
if IS_DARWIN
install-exec-hook:
$(LN_S) -f $(libdir)/libBNMR.dylib $(libdir)/libBNMR.so
uninstall-hook:
rm -f $(libdir)/libBNMR.so
endif
if IS_CYGWIN
install-exec-hook:
$(LN_S) -f $(bindir)/cygBNMR-$(PLUGIN_MAJOR_VERSION)-$(PLUGIN_MINOR_VERSION)-$(PLUGIN_MAJOR_VERSION).dll $(libdir)/libBNMR.so
uninstall-hook:
rm -f $(libdir)/libBNMR.so
endif

View File

@@ -55,6 +55,7 @@ class PFourier
virtual const char* GetDataTitle() { return fData->GetTitle(); }
virtual const Int_t GetUnitTag() { return fUnitTag; }
virtual Double_t GetResolution() { return fResolution; }
virtual Double_t GetMaxFreq();
virtual TH1F* GetRealFourier(const Double_t scale = 1.0);
virtual TH1F* GetImaginaryFourier(const Double_t scale = 1.0);
virtual TH1F* GetPowerFourier(const Double_t scale = 1.0);

View File

@@ -127,7 +127,6 @@ class PFourierCanvas : public TObject, public TQObject
TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area
TGMenuBar *fBar; ///< menu bar
TGPopupMenu *fPopupMain; ///< popup menu MusrFT in the main menu bar
// TGPopupMenu *fPopupSave; ///< popup menu of the MusrFT/Save Data sub menu
TGPopupMenu *fPopupFourier; ///< popup menu of the MusrFT/Fourier sub menu
// canvas related variables

View File

@@ -36,6 +36,12 @@ using namespace std;
#include <TString.h>
// the following ifdef is needed for GCC 4.6 or higher, fftw 3.3 or higher and root 5.30.03 or lower
#ifdef __CINT__
typedef struct { char a[7]; } __float128; // needed since cint doesn't know it
#endif
#include "fftw3.h"
#define PMUSR_SUCCESS 0
#define PMUSR_WRONG_STARTUP_SYNTAX -1
#define PMUSR_MSR_FILE_NOT_FOUND -2

View File

@@ -67,7 +67,7 @@
#define P_MENU_ID_FOURIER 10002
#define P_MENU_ID_DIFFERENCE 10003
#define P_MENU_ID_AVERAGE 10004
#define P_MENU_ID_SAVE_DATA 10005
#define P_MENU_ID_EXPORT_DATA 10005
#define P_MENU_PLOT_OFFSET 1000
@@ -79,8 +79,6 @@
#define P_MENU_ID_FOURIER_PHASE_PLUS 105
#define P_MENU_ID_FOURIER_PHASE_MINUS 106
#define P_MENU_ID_SAVE_ASCII 200
//------------------------------------------------------------------------
/**
* <p>
@@ -204,11 +202,13 @@ class PMusrCanvas : public TObject, public TQObject
public:
PMusrCanvas();
PMusrCanvas(const Int_t number, const Char_t* title,
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch);
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch,
const Bool_t fourier=false);
PMusrCanvas(const Int_t number, const Char_t* title,
Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh,
PMsrFourierStructure fourierDefault,
const PIntVector markerList, const PIntVector colorList, const Bool_t batch);
const PIntVector markerList, const PIntVector colorList, const Bool_t batch,
const Bool_t fourier=false);
virtual ~PMusrCanvas();
virtual Bool_t IsValid() { return fValid; }
@@ -229,9 +229,10 @@ class PMusrCanvas : public TObject, public TQObject
virtual void LastCanvasClosed(); // SLOT
virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat);
virtual void SaveDataAscii();
virtual void ExportData(const Char_t *fileName);
private:
Bool_t fStartWithFourier; ///< flag if true, the Fourier transform will be presented bypassing the time domain representation
Int_t fTimeout; ///< timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place
Bool_t fScaleN0AndBkg; ///< true=N0 and background is scaled to (1/ns), otherwise (1/bin) for the single histogram case
Bool_t fBatchMode; ///< musrview in ROOT batch mode
@@ -259,7 +260,6 @@ class PMusrCanvas : public TObject, public TQObject
TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area
TGMenuBar *fBar; ///< menu bar
TGPopupMenu *fPopupMain; ///< popup menu Musrfit in the main menu bar
TGPopupMenu *fPopupSave; ///< popup menu of the Musrfit/Save Data sub menu
TGPopupMenu *fPopupFourier; ///< popup menu of the Musrfit/Fourier sub menu
// canvas related variables

View File

@@ -34,7 +34,8 @@
#include <vector>
using namespace std;
#include "TH1F.h"
#include <TH1F.h>
#include <TMath.h>
#include "PMusr.h"
@@ -59,16 +60,16 @@ typedef struct {
class PPrepFourier {
public:
PPrepFourier();
PPrepFourier(const Int_t *bkgRange, const Int_t packing);
PPrepFourier(const Int_t packing, const Int_t *bkgRange, PDoubleVector bkg);
virtual ~PPrepFourier();
void SetBkgRange(const Int_t *bkgRange);
void SetPacking(const Int_t packing);
void AddData(musrFT_data &data);
void DoBkgCorrection();
void DoPacking();
void DoFiltering();
void DoLifeTimeCorrection(Double_t fudge);
virtual void SetBkgRange(const Int_t *bkgRange);
virtual void SetBkg(PDoubleVector bkg);
virtual void SetPacking(const Int_t packing);
virtual void AddData(musrFT_data &data);
virtual void DoBkgCorrection();
virtual void DoPacking();
virtual void DoLifeTimeCorrection(Double_t fudge);
TString GetInfo(const UInt_t idx);
UInt_t GetNoOfData() { return fRawData.size(); }
@@ -79,9 +80,10 @@ class PPrepFourier {
vector<musrFT_data> fRawData;
vector<PDoubleVector>fData;
Int_t fBkgRange[2];
PDoubleVector fBkg;
Int_t fPacking;
void InitData();
virtual void InitData();
};
#endif // _PPREPFOURIER_H_

View File

@@ -65,7 +65,8 @@ typedef struct {
TString graphicFormat; ///< format for the graphical output dump
TString dumpFln; ///< dump file name for Fourier data output
TString msrFlnOut; ///< dump file name for msr-file generation
int bkg[2]; ///< background range
int bkg_range[2]; ///< background range
vector<double> bkg; ///< background value
TString fourierOpt; ///< Fourier options, i.e. real, imag, power, phase
TString apodization; ///< apodization setting: none, weak, medium, strong
int fourierPower; ///< Fourier power for zero padding, i.e. 2^fourierPower points
@@ -95,7 +96,7 @@ void musrFT_syntax()
cout << endl << " -df, --data-file <data-file> : This allows to feed only muSR data file(s) to";
cout << endl << " perform the Fourier transform. Since the extended <msr-file> information";
cout << endl << " are missing, they will need to be provided by to options, or musrFT";
cout << endl << " tries to guess, based on musrFT_startup.xml settings.";
cout << endl << " tries to guess, based on musrfit_startup.xml settings.";
cout << endl << " Options: ";
cout << endl << " --help : display this help and exit";
cout << endl << " --version : output version information and exit";
@@ -106,13 +107,13 @@ void musrFT_syntax()
cout << endl << " Supported graphic-format-extension: eps, pdf, gif, jpg, png, svg, xpm, root";
cout << endl << " --dump <fln> : rather than starting a root session and showing Fourier graphs of the data,";
cout << endl << " it will output the Fourier data in an ascii file <fln>.";
cout << endl << " --filter : filter and filter-specific-information -- ***TO BE WRITTEN YET***.";
cout << endl << " -b, --background <start> <end>: background interval used to estimate the backround to be";
cout << endl << " -br, --background-range <start> <end>: background interval used to estimate the background to be";
cout << endl << " subtracted before the Fourier transform. <start>, <end> to be given in bins.";
cout << endl << " -bg, --background <list> : gives the background explicit for each histogram.";
cout << endl << " -fo, --fourier-option <fopt>: <fopt> can be 'real', 'imag', 'real+imag', 'power', or 'phase'.";
cout << endl << " If this is not defined (neither on the command line nor in the musrFT_startup.xml),";
cout << endl << " If this is not defined (neither on the command line nor in the musrfit_startup.xml),";
cout << endl << " default will be 'power'.";
cout << endl << " -apod, --apodization <val> : <val> can be either 'none', 'weak', 'medium', 'strong'.";
cout << endl << " -ap, --apodization <val> : <val> can be either 'none', 'weak', 'medium', 'strong'.";
cout << endl << " Default will be 'none'.";
cout << endl << " -fp, --fourier-power <N> : <N> being the Fourier power, i.e. 2^<N> used for zero padding.";
cout << endl << " Default is -1, i.e. no zero padding will be performed.";
@@ -132,9 +133,10 @@ void musrFT_syntax()
cout << endl << " E.g. musrFT -df lem15_his_01234.root --histo 1 3, will only be needed together with";
cout << endl << " the option --data-file. If multiple data file are given, <list> will apply";
cout << endl << " to all data-files given. If --histo is not given, all histos of a data file will be used.";
cout << endl << " <list> can be anything like: 2 3 6, or 2-17, or 1-6 9, etc.";
cout << endl << " -a, --average : show the average of all Fourier transformed data.";
cout << endl << " --t0 <list> : A list of t0's can be provided. This in conjunction with --data-file and";
cout << endl << " --fourier-option real allows to get the proper inital phase if t0's are known.";
cout << endl << " --fourier-option real allows to get the proper initial phase if t0's are known.";
cout << endl << " If a single t0 for multiple histos is given, it is assume, that this t0 is common";
cout << endl << " to all histos.";
cout << endl << " Example: musrFT -df lem15_his_01234.root -fo real --t0 2750 --histo 1 3";
@@ -160,8 +162,8 @@ void musrFT_init(musrFT_startup_param &startupParam)
startupParam.graphicFormat = TString("");
startupParam.dumpFln = TString("");
startupParam.msrFlnOut = TString("");
startupParam.bkg[0] = -1;
startupParam.bkg[1] = -1;
startupParam.bkg_range[0] = -1;
startupParam.bkg_range[1] = -1;
startupParam.fourierOpt = TString("??");
startupParam.apodization = TString("none");
startupParam.fourierPower = -1;
@@ -321,27 +323,44 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa
}
startupParam.dumpFln = argv[i+1];
i++;
} else if (tstr.Contains("--filter")) {
cout << endl << "debug> found option filter. NOT YET ANY FUNCTIONALITY." << endl;
} else if (tstr.Contains("-b") || tstr.Contains("--background")) {
} else if (tstr.Contains("-br") || tstr.Contains("--background-range")) {
if (i+2 >= argc) { // something is wrong since there needs to be two arguments here
cerr << endl << ">> musrFT **ERROR** found option --background with wrong number of arguments." << endl;
cerr << endl << ">> musrFT **ERROR** found option --background-range with wrong number of arguments." << endl;
return 2;
}
TString bkg[2];
bkg[0] = argv[i+1];
bkg[1] = argv[i+2];
if (!bkg[0].IsDigit()) {
cerr << endl << ">> musrFT **ERROR** <start> bin of option --background is NOT an int-number! ('" << bkg[0] << "')." << endl;
TString bkgRange[2];
bkgRange[0] = argv[i+1];
bkgRange[1] = argv[i+2];
if (!bkgRange[0].IsDigit()) {
cerr << endl << ">> musrFT **ERROR** <start> bin of option --background-range is NOT an int-number! ('" << bkgRange[0] << "')." << endl;
return 2;
}
if (!bkg[1].IsDigit()) {
cerr << endl << ">> musrFT **ERROR** <end> bin of option --background is NOT an int-number! ('" << bkg[1] << "')." << endl;
if (!bkgRange[1].IsDigit()) {
cerr << endl << ">> musrFT **ERROR** <end> bin of option --background-range is NOT an int-number! ('" << bkgRange[1] << "')." << endl;
return 2;
}
startupParam.bkg[0] = bkg[0].Atoi();
startupParam.bkg[1] = bkg[1].Atoi();
startupParam.bkg_range[0] = bkgRange[0].Atoi();
startupParam.bkg_range[1] = bkgRange[1].Atoi();
i += 2;
} else if (tstr.BeginsWith("-bg") || !tstr.CompareTo("--background")) {
TString topt("");
while (++i < argc) {
if (argv[i][0] == '-') {
--i;
break;
} else {
topt = argv[i];
if (!topt.IsFloat()) {
cerr << endl << ">> musrFT **ERROR** found option --background='" << topt << "' which is not a float" << endl;
return 2;
}
startupParam.bkg.push_back(topt.Atoi());
}
}
if (startupParam.bkg.size() == 0) { // something is wrong since there needs to be an argument here
cerr << endl << ">> musrFT **ERROR** found option --background without argument!" << endl;
return 2;
}
} else if (tstr.BeginsWith("-fo") || tstr.BeginsWith("--fourier-option")) {
if (i+1 >= argc) { // something is wrong since there needs to be two arguments here
cerr << endl << ">> musrFT **ERROR** found option --fourier-option without arguments." << endl;
@@ -354,7 +373,7 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa
}
startupParam.fourierOpt = topt;
i++;
} else if (tstr.BeginsWith("-apod") || tstr.BeginsWith("--apodization")) {
} else if (tstr.BeginsWith("-ap") || tstr.BeginsWith("--apodization")) {
if (i+1 >= argc) { // something is wrong since there needs to be two arguments here
cerr << endl << ">> musrFT **ERROR** found option --apodization without arguments." << endl;
return 2;
@@ -453,7 +472,7 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa
startupParam.t0.push_back(topt.Atoi());
}
}
if (startupParam.dataFln.size() == 0) { // something is wrong since there needs to be an argument here
if (startupParam.t0.size() == 0) { // something is wrong since there needs to be an argument here
cerr << endl << ">> musrFT **ERROR** found option --t0 without argument!" << endl;
return 2;
}
@@ -550,11 +569,11 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa
cerr << endl << ">> musrFT **ERROR** neither <msr-file> nor <data-file> defined." << endl;
return 2;
}
if (startupParam.bkg[0] > startupParam.bkg[1]) {
cerr << endl << ">> musrFT **WARNING** in --background, start=" << startupParam.bkg[0] << " > end=" << startupParam.bkg[1] << ", will swap them." << endl;
double swap = startupParam.bkg[0];
startupParam.bkg[0] = startupParam.bkg[1];
startupParam.bkg[1] = swap;
if (startupParam.bkg_range[0] > startupParam.bkg_range[1]) {
cerr << endl << ">> musrFT **WARNING** in --background-range, start=" << startupParam.bkg_range[0] << " > end=" << startupParam.bkg_range[1] << ", will swap them." << endl;
double swap = startupParam.bkg_range[0];
startupParam.bkg_range[0] = startupParam.bkg_range[1];
startupParam.bkg_range[1] = swap;
}
if (startupParam.fourierRange[0] > startupParam.fourierRange[1]) {
cerr << endl << ">> musrFT **WARNING** in --fourier-range, start=" << startupParam.fourierRange[0] << " > end=" << startupParam.fourierRange[1] << ", will swap them." << endl;
@@ -875,8 +894,8 @@ void musrFT_dumpMsrFile(musrFT_startup_param &param)
if ((param.t0.size() > 1) && (j < param.t0.size())) {
fout << "t0 " << param.t0[j] << endl;
}
if ((param.bkg[0] > -1) && (param.bkg[1] > -1))
fout << "background " << param.bkg[0] << " " << param.bkg[1] << endl;
if ((param.bkg_range[0] > -1) && (param.bkg_range[1] > -1))
fout << "background " << param.bkg_range[0] << " " << param.bkg_range[1] << endl;
fout << "#--------------------------------------------------------------" << endl;
}
}
@@ -1027,7 +1046,7 @@ int main(int argc, char *argv[])
startupHandler->SetStartupOptions(startup_options);
// defines the raw time-domain data vector
PPrepFourier data(startupParam.bkg, startupParam.packing);
PPrepFourier data(startupParam.packing, startupParam.bkg_range, startupParam.bkg);
// load msr-file(s)
vector<PMsrHandler*> msrHandler;
@@ -1146,6 +1165,24 @@ int main(int argc, char *argv[])
if (fourierBlock->fFourierBlockPresent) {
// get units
unitTag = fourierBlock->fUnits;
if (startupParam.fourierUnits.BeginsWith("??")) {
switch (unitTag) {
case FOURIER_UNIT_GAUSS:
startupParam.fourierUnits = TString("Gauss");
break;
case FOURIER_UNIT_TESLA:
startupParam.fourierUnits = TString("Tesla");
break;
case FOURIER_UNIT_FREQ:
startupParam.fourierUnits = TString("MHz");
break;
case FOURIER_UNIT_CYCLES:
startupParam.fourierUnits = TString("Mc/s");
break;
default:
break;
}
}
// get fourier power
if (startupParam.fourierPower == -1) { // no Fourier power given from the command line, hence check FOURIER block
if (fourierBlock->fFourierPower > 1)
@@ -1277,9 +1314,6 @@ int main(int argc, char *argv[])
// calculate background levels and subtract them from the data
data.DoBkgCorrection();
// do the time domain filtering now
data.DoFiltering();
// do lifetime correction
if (startupParam.lifetimecorrection != 0.0)
data.DoLifeTimeCorrection(startupParam.lifetimecorrection);
@@ -1321,7 +1355,13 @@ int main(int argc, char *argv[])
fourier[i]->Transform(apodTag);
}
double end = millitime();
cout << endl << "debug> after FFT. calculation time: " << (end-start)/1.0e3 << " (sec)." << endl;
cout << endl << "info> after FFT. calculation time: " << (end-start)/1.0e3 << " (sec)." << endl;
// make sure that a Fourier range is provided, if not calculate one
if ((startupParam.fourierRange[0] == -1.0) && (startupParam.fourierRange[1] == -1.0)) {
startupParam.fourierRange[0] = 0.0;
startupParam.fourierRange[1] = fourier[0]->GetMaxFreq();
}
PFourierCanvas *fourierCanvas = 0;

5
src/musredit/Makefile.am Normal file
View File

@@ -0,0 +1,5 @@
## Process this file with automake to create Makefile.in
CLEANFILES = *~ core

View File

@@ -85,6 +85,8 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
fKeyWord = eDefaultSavePath;
} else if (qName == "title_from_data_file") {
fKeyWord = eTitleFromDataFile;
} else if (qName == "musrview_show_fourier") {
fKeyWord = eMusrviewShowFourier;
} else if (qName == "enable_musrt0") {
fKeyWord = eEnableMusrT0;
} else if (qName == "keep_minuit2_output") {
@@ -130,7 +132,9 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
} else if (qName == "musr_web_statistic") {
fKeyWord = eHelpStatistic;
} else if (qName == "musr_web_msr2data") {
fKeyWord = eHelpMsr2Data;
fKeyWord = eHelpMsr2Data;
} else if (qName == "musr_web_musrFT") {
fKeyWord = eHelpMusrFT;
} else if (qName == "chain_fit") {
fKeyWord = eChainFit;
} else if (qName == "write_data_header") {
@@ -240,6 +244,13 @@ bool PAdminXMLParser::characters(const QString& str)
flag = false;
fAdmin->setTitleFromDataFileFlag(flag);
break;
case eMusrviewShowFourier:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->setMusrviewShowFourierFlag(flag);
break;
case eEnableMusrT0:
if (str == "y")
flag = true;
@@ -338,6 +349,9 @@ bool PAdminXMLParser::characters(const QString& str)
case eHelpMsr2Data:
fAdmin->setHelpUrl("msr2data", str);
break;
case eHelpMusrFT:
fAdmin->setHelpUrl("musrFT", str);
break;
case eChainFit:
if (str == "y")
flag = true;
@@ -598,6 +612,8 @@ PAdmin::PAdmin() : QObject()
fInstitute = QString("");
fFileFormat = QString("");
fMusrviewShowFourier = false;
fTitleFromDataFile = false;
fEnableMusrT0 = false;
fLifetimeCorrection = true;

View File

@@ -69,12 +69,12 @@ class PAdminXMLParser : public QXmlDefaultHandler
private:
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eEnableMusrT0,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eMusrviewShowFourier, eEnableMusrT0,
eFontName, eFontSize, eExecPath, eDefaultSavePath,
eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection, eMsrDefaultFilePath,
eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel,
eFuncPixmap, eFuncParams, eHelpMain, eHelpTitle, eHelpParameters, eHelpTheory, eHelpFunctions,
eHelpRun, eHelpCommand, eHelpFourier, eHelpPlot, eHelpStatistic, eHelpMsr2Data,
eHelpRun, eHelpCommand, eHelpFourier, eHelpPlot, eHelpStatistic, eHelpMsr2Data, eHelpMusrFT,
eChainFit, eWriteDataHeader, eIgnoreDataHeaderInfo, eWriteColumnData,
eRecreateDataFile, eOpenFileAfterFitting, eCreateMsrFileOnly, eFitOnly, eGlobal, eGlobalPlus};
@@ -118,6 +118,7 @@ class PAdmin : public QObject
QString getExecPath() { return fExecPath; }
QString getDefaultSavePath() { return fDefaultSavePath; }
bool getTitleFromDataFileFlag() { return fTitleFromDataFile; }
bool getMusrviewShowFourierFlag() { return fMusrviewShowFourier; }
bool getEnableMusrT0Flag() { return fEnableMusrT0; }
bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; }
bool getDumpAsciiFlag() { return fDumpAscii; }
@@ -139,6 +140,7 @@ class PAdmin : public QObject
void setTimeout(const int ival) { fTimeout = ival; }
void setTitleFromDataFileFlag(const bool flag) { fTitleFromDataFile = flag; }
void setMusrviewShowFourierFlag(const bool flag) { fMusrviewShowFourier = flag; }
void setEnableMusrT0Flag(const bool flag) { fEnableMusrT0 = flag; }
void setKeepMinuit2OutputFlag(const bool flag) { fKeepMinuit2Output = flag; }
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
@@ -180,13 +182,14 @@ class PAdmin : public QObject
QVector<QString> fRecentFile; ///< keep vector of recent path-file names
bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no)
bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no).
bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no).
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
bool fMusrviewShowFourier; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true).
bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no)
bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no).
bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no).
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
QString fBeamline; ///< name of the beamline. Used to generate default run header lines.
QString fInstitute; ///< name of the institute. Used to generate default run header lines.

View File

@@ -0,0 +1,565 @@
/****************************************************************************
PGetMusrFTOptionsDialog.cpp
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
*****************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2015 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QLineEdit>
#include <QValidator>
#include <QComboBox>
#include <QMessageBox>
#include "PHelp.h"
#include "PGetMusrFTOptionsDialog.h"
#define MUSRFT_OPT_UNDEF 0
#define MUSRFT_OPT_REAL 1
#define MUSRFT_OPT_IMAG 2
#define MUSRFT_OPT_REAL_AND_IMAG 3
#define MUSRFT_OPT_POWER 4
#define MUSRFT_OPT_PHASE 5
#define MUSRFT_APOD_UNDEF 0
#define MUSRFT_APOD_WEAK 1
#define MUSRFT_APOD_MEDIUM 2
#define MUSRFT_APOD_STRONG 3
#define MUSRFT_UNIT_UNDEF 0
#define MUSRFT_UNIT_GAUSS 1
#define MUSRFT_UNIT_TESLA 2
#define MUSRFT_UNIT_FREQ 3
#define MUSRFT_UNIT_CYCLE 4
//----------------------------------------------------------------------------------------------------
/**
* <p>Constructor.
*
* \param currentMsrFile path-file name of the currently active msr-file in musredit
* \param prevCmd list of the last (potential) previously call.
* \param helpUrl help url for the asymmetry run block
*/
PGetMusrFTOptionsDialog::PGetMusrFTOptionsDialog(QString currentMsrFile, QStringList &prevCmd, const QString helpUrl) :
fCurrentMsrFileName(currentMsrFile), fHelpUrl(helpUrl)
{
setupUi(this);
setModal(true);
fBkgRangeStartBin_lineEdit->setValidator( new QIntValidator(fBkgRangeStartBin_lineEdit) );
fBkgRangeEndBin_lineEdit->setValidator( new QIntValidator(fBkgRangeEndBin_lineEdit) );
fPacking_lineEdit->setValidator( new QIntValidator(fPacking_lineEdit) );
fTimeRangeStart_lineEdit->setValidator( new QDoubleValidator(fTimeRangeStart_lineEdit) );
fTimeRangeEnd_lineEdit->setValidator( new QDoubleValidator(fTimeRangeEnd_lineEdit) );
fFourierPower_lineEdit->setValidator( new QIntValidator(fFourierPower_lineEdit) );
fLifetimeCorrection_lineEdit->setValidator( new QDoubleValidator(fLifetimeCorrection_lineEdit) );
fFourierRangeStart_lineEdit->setValidator( new QDoubleValidator(fFourierRangeStart_lineEdit) );
fFourierRangeEnd_lineEdit->setValidator( new QDoubleValidator(fFourierRangeEnd_lineEdit) );
fPacking_lineEdit->setText("1");
// populate dialog with the previous cmd call
bool msrTag = true;
QString str, str1, line;
int idx;
for (int i=0; i<prevCmd.size(); i++) {
// collect msr-file-names
if (msrTag) {
line = "";
while (prevCmd[i].contains(".msr") && (i<prevCmd.size())) {
// split msr-file path-name into path and name
str = prevCmd[i];
idx = str.lastIndexOf("/");
str1 = str;
str.remove(idx, str.length()-idx);
fMsrFilePaths << str;
str1.remove(0, idx+1);
fMsrFileNames << str1;
line += str1 + " ";
i++;
}
line.remove(line.length()-1, 1);
fMsrFileSelector_lineEdit->setText(line);
msrTag = false;
}
// collect data-file-names
if (prevCmd[i] == "-df") {
i++;
line = "";
while (!prevCmd[i].startsWith("-") && (i<prevCmd.size())) {
// split msr-file path-name into path and name
str = prevCmd[i];
idx = str.lastIndexOf("/");
str1 = str;
str.remove(idx, str.length()-idx);
fDataFilePaths << str;
str1.remove(0, idx+1);
fDataFileNames << str1;
line += str1 + " ";
i++;
}
line.remove(line.length()-1, 1);
fDataFileSelector_lineEdit->setText(line);
}
// background-range
if (prevCmd[i] == "-br") {
fBkgRangeStartBin_lineEdit->setText(prevCmd[++i]);
fBkgRangeEndBin_lineEdit->setText(prevCmd[++i]);
}
// fourier-option
if (prevCmd[i] == "-fo") {
if (prevCmd[i+1] == "real")
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_REAL);
else if (prevCmd[i+1] == "imag")
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_IMAG);
else if (prevCmd[i+1] == "real+imag")
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_REAL_AND_IMAG);
else if (prevCmd[i+1] == "power")
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_POWER);
else if (prevCmd[i+1] == "phase")
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_PHASE);
else
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_UNDEF);
i++;
}
// apodization
if (prevCmd[i] == "-ap") {
if (prevCmd[i+1] == "weak")
fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_WEAK);
else if (prevCmd[i+1] == "medium")
fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_MEDIUM);
else if (prevCmd[i+1] == "strong")
fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_STRONG);
else
fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_UNDEF);
i++;
}
// fourier-power
if (prevCmd[i] == "-fp") {
fFourierPower_lineEdit->setText(prevCmd[++i]);
}
// units
if (prevCmd[i] == "-u") {
if (prevCmd[i+1] == "Gauss")
fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_GAUSS);
else if (prevCmd[i+1] == "Tesla")
fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_TESLA);
else if (prevCmd[i+1] == "MHz")
fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_FREQ);
else if (prevCmd[i+1] == "Mc/s")
fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_CYCLE);
else
fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_UNDEF);
i++;
}
// phase
if (prevCmd[i] == "-ph") {
// NOT YET IMPLEMENTED
}
// fourier-range
if (prevCmd[i] == "-fr") {
fFourierRangeStart_lineEdit->setText(prevCmd[++i]);
fFourierRangeEnd_lineEdit->setText(prevCmd[++i]);
}
// time-range
if (prevCmd[i] == "-tr") {
fTimeRangeStart_lineEdit->setText(prevCmd[++i]);
fTimeRangeEnd_lineEdit->setText(prevCmd[++i]);
}
// histo list
if (prevCmd[i] == "--histo") {
i++;
line = "";
while (!prevCmd[i].startsWith("-") && (i<prevCmd.size())) {
line += prevCmd[i++] + " ";
}
line.remove(line.length()-1, 1);
fHistoList_lineEdit->setText(line);
}
// average tag
if (prevCmd[i] == "-a") {
fAveragedView_checkBox->setCheckState(Qt::Checked);
}
// t0 list
if (prevCmd[i] == "--t0") {
i++;
line = "";
while (!prevCmd[i].startsWith("-") && (i<prevCmd.size())) {
line += prevCmd[i++] + " ";
}
line.remove(line.length()-1, 1);
fT0_lineEdit->setText(line);
}
// packing
if (prevCmd[i] == "-pa") {
fPacking_lineEdit->setText(prevCmd[++i]);
}
// title
if (prevCmd[i] == "--title") {
fFourierTitle_lineEdit->setText(prevCmd[i+1]);
}
// create msr-file tag
if (prevCmd[i] == "--create-msr-file") {
fCreateMsrFileName = prevCmd[++i];
fCreateMsrFile_checkBox->setCheckState(Qt::Checked);
}
// lifetime correction
if (prevCmd[i] == "-lc") {
fLifetimeCorrection_lineEdit->setText(prevCmd[++i]);
}
}
// connect all necessary single and slots
connect(fCurrentMsrFile_checkBox, SIGNAL( stateChanged(int) ), this, SLOT( currentMsrFileTagChanged(int) ) );
connect(fAllMsrFiles_checkBox, SIGNAL( stateChanged(int) ), this, SLOT( allMsrFileTagChanged(int) ) );
connect(fMsrFileSelector_pushButton, SIGNAL( clicked() ), this, SLOT( selectMsrFileNames() ) );
connect(fDataFileSelector_pushButton, SIGNAL( clicked() ), this, SLOT( selectDataFileNames() ) );
connect(fCreateMsrFile_checkBox, SIGNAL( stateChanged(int) ), this, SLOT( createMsrFileChanged(int) ) );
connect(fMsrFileNameClear_pushButton, SIGNAL (clicked() ), this, SLOT( clearMsrFileNames() ) );
connect(fDataFileNameClear_pushButton, SIGNAL (clicked() ), this, SLOT( clearDataFileNames() ) );
connect(fResetAll_pushButton, SIGNAL( clicked() ), this, SLOT( resetAll() ) );
}
//----------------------------------------------------------------------------------------------------
/**
* <p>returns the musrFT command line options.
*/
QStringList PGetMusrFTOptionsDialog::getMusrFTOptions()
{
QStringList cmd;
QString str("");
QStringList strList;
// check if currently active msr-file shall be used
if (fCurrentMsrFile_checkBox->checkState() == Qt::Checked) {
cmd << fCurrentMsrFileName;
} else {
// msr-files
for (int i=0; i<fMsrFilePaths.size(); i++) {
str = fMsrFilePaths[i]+"/"+fMsrFileNames[i];
cmd << str;
}
// data-files
if (fDataFilePaths.size() > 0) {
cmd << "-df";
for (int i=0; i<fDataFilePaths.size(); i++) {
str = fDataFilePaths[i]+"/"+fDataFileNames[i];
cmd << str;
}
}
}
// background range
if ((fBkgRangeStartBin_lineEdit->text().length() > 0) && (fBkgRangeEndBin_lineEdit->text().length() > 0)) {
cmd << "-br";
cmd << fBkgRangeStartBin_lineEdit->text();
cmd << fBkgRangeEndBin_lineEdit->text();
}
// background values
if (fBkgList_lineEdit->text().length() > 0) {
}
// fourier-option
if (fFourierOption_comboBox->currentText() != "UnDef") {
cmd << "-fo";
cmd << fFourierOption_comboBox->currentText();
}
// apodization
cmd << "-ap";
cmd << fApodization_comboBox->currentText();
// fourier-power
if (fFourierPower_lineEdit->text().length() > 0) {
cmd << "-fp";
cmd << fFourierPower_lineEdit->text();
}
// units
if (fFourierUnits_comboBox->currentText() != "UnDef") {
cmd << "-u";
cmd << fFourierUnits_comboBox->currentText();
}
// phase
// fourier-range
if ((fFourierRangeStart_lineEdit->text().length() > 0) && (fFourierRangeEnd_lineEdit->text().length() > 0)) {
cmd << "-fr";
cmd << fFourierRangeStart_lineEdit->text();
cmd << fFourierRangeEnd_lineEdit->text();
}
// time-range
if ((fTimeRangeStart_lineEdit->text().length() > 0) && (fTimeRangeEnd_lineEdit->text().length() > 0)) {
cmd << "-tr";
cmd << fTimeRangeStart_lineEdit->text();
cmd << fTimeRangeEnd_lineEdit->text();
}
// histo list
if (fHistoList_lineEdit->text().length() > 0) {
cmd << "--histo";
strList = fHistoList_lineEdit->text().split(" ", QString::SkipEmptyParts);
for (int i=0; i<strList.size(); i++)
cmd << strList[i];
}
// averaged view
if (fAveragedView_checkBox->checkState() == Qt::Checked)
cmd << "-a";
// t0 list
if (fT0_lineEdit->text().length() > 0) {
cmd << "--t0";
strList = fT0_lineEdit->text().split(" ", QString::SkipEmptyParts);
for (int i=0; i<strList.size(); i++)
cmd << strList[i];
}
// packing
if (fPacking_lineEdit->text().length() > 0) {
cmd << "-pa";
cmd << fPacking_lineEdit->text();
}
// title
if (fFourierTitle_lineEdit->text().length() > 0) {
cmd << "--title";
cmd << fFourierTitle_lineEdit->text();
}
// create-msr-file
if (fCreateMsrFile_checkBox->checkState() == Qt::Checked) {
cmd << "--create-msr-file";
cmd << fCreateMsrFileName;
}
// lifetimecorrection
if (fLifetimeCorrection_lineEdit->text().length() > 0) {
cmd << "-lc";
cmd << fLifetimeCorrection_lineEdit->text();
}
return cmd;
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when fCurrentMsrFile_checkBox is checked/unchecked. If checked, it will clean up
* the msr-file path-file list and the data-file path-file list.
*/
void PGetMusrFTOptionsDialog::currentMsrFileTagChanged(int state)
{
if (state == Qt::Checked) {
fAllMsrFiles_checkBox->setCheckState(Qt::Unchecked);
// remove all msr-data-file-names and data-path-file-names
fMsrFilePaths.clear();
fMsrFileNames.clear();
fMsrFileSelector_lineEdit->setText("");
fDataFilePaths.clear();
fDataFileNames.clear();
fDataFileSelector_lineEdit->setText("");
}
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when fAllMsrFiles_checkBox is checked/unchecked. Currently it has no functionality.
*/
void PGetMusrFTOptionsDialog::allMsrFileTagChanged(int state)
{
if (state == Qt::Checked) {
fCurrentMsrFile_checkBox->setCheckState(Qt::Unchecked);
}
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when fMsrFileSelector_pushButton is clicked. Collects the msr-file path-name list.
*/
void PGetMusrFTOptionsDialog::selectMsrFileNames()
{
QStringList flns = QFileDialog::getOpenFileNames( this, tr("Open msr-File(s)"), tr( "./" ),
tr( "msr-Files (*.msr);;All Files (*)" ));
QString str(""), str1("");
int idx;
if (flns.size() > 0) {
// delete already present elements
fMsrFilePaths.clear();
fMsrFileNames.clear();
// split path-name into path and name
for (int i=0; i<flns.size(); i++) {
str = flns[i];
idx = str.lastIndexOf("/");
str1 = str;
str.remove(idx, str.length()-idx);
fMsrFilePaths << str;
str1.remove(0, idx+1);
fMsrFileNames << str1;
}
// populate fMsrFileSelector_lineEdit
str = QString("");
for (int i=0; i<fMsrFileNames.size()-1; i++) {
str += fMsrFileNames[i] + " ";
}
str += fMsrFileNames[fMsrFileNames.size()-1];
fMsrFileSelector_lineEdit->setText(str);
}
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when the fMsrFileNameClear_pushButton is clicked.
*/
void PGetMusrFTOptionsDialog::clearMsrFileNames()
{
fMsrFileSelector_lineEdit->setText("");
fMsrFilePaths.clear();
fMsrFileNames.clear();
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when fDataFileSelector_pushButton is clicked. Collects the data-file path-name list.
*/
void PGetMusrFTOptionsDialog::selectDataFileNames()
{
QStringList flns = QFileDialog::getOpenFileNames( this, tr("Open msr-File(s)"), tr( "./" ),
tr( "data-Files (*.root *.bin *.msr *.nxs *.mdu);;All Files (*)" ));
QString str(""), str1("");
int idx;
if (flns.size() > 0) {
// delete already present elements
fDataFilePaths.clear();
fDataFileNames.clear();
// split path-name into path and name
for (int i=0; i<flns.size(); i++) {
str = flns[i];
idx = str.lastIndexOf("/");
str1 = str;
str.remove(idx, str.length()-idx);
fDataFilePaths << str;
str1.remove(0, idx+1);
fDataFileNames << str1;
}
// populate fMsrFileSelector_lineEdit
str = QString("");
for (int i=0; i<fDataFileNames.size()-1; i++) {
str += fDataFileNames[i] + " ";
}
str += fDataFileNames[fDataFileNames.size()-1];
fDataFileSelector_lineEdit->setText(str);
}
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when the fDataFileNameClear_pushButton is clicked.
*/
void PGetMusrFTOptionsDialog::clearDataFileNames()
{
fDataFileSelector_lineEdit->setText("");
fDataFilePaths.clear();
fDataFileNames.clear();
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when the create-msr-file tag has changed
*/
void PGetMusrFTOptionsDialog::createMsrFileChanged(int state)
{
if (state == Qt::Checked) {
fCreateMsrFileName = QFileDialog::getSaveFileName(this, tr("Create msr-file"), "./", tr("msr-Files (*.msr);;All Files (*)"));
if (fCreateMsrFileName.length() == 0)
fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked);
} else {
fCreateMsrFileName = "";
}
}
//----------------------------------------------------------------------------------------------------
/**
* <p>SLOT called when the Reset All button is pressed. Will remove all settings.
*/
void PGetMusrFTOptionsDialog::resetAll()
{
fCurrentMsrFile_checkBox->setCheckState(Qt::Unchecked);
fAllMsrFiles_checkBox->setCheckState(Qt::Unchecked);
fMsrFilePaths.clear();
fMsrFileNames.clear();
fMsrFileSelector_lineEdit->setText("");
fDataFilePaths.clear();
fDataFileNames.clear();
fDataFileSelector_lineEdit->setText("");
fBkgRangeStartBin_lineEdit->setText("");
fBkgRangeEndBin_lineEdit->setText("");
fBkgList_lineEdit->setText("");
fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_UNDEF);
fPacking_lineEdit->setText("");
fTimeRangeStart_lineEdit->setText("");
fTimeRangeEnd_lineEdit->setText("");
fHistoList_lineEdit->setText("");
fT0_lineEdit->setText("");
fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_UNDEF);
fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_UNDEF);
fFourierPower_lineEdit->setText("");
fLifetimeCorrection_lineEdit->setText("");
fFourierRangeStart_lineEdit->setText("");
fFourierRangeEnd_lineEdit->setText("");
fAveragedView_checkBox->setCheckState(Qt::Unchecked);
fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked);
fFourierTitle_lineEdit->setText("");
}
//----------------------------------------------------------------------------------------------------
/**
* <p>Generates a help content window showing the description for musrFT.
*/
void PGetMusrFTOptionsDialog::helpContent()
{
if (fHelpUrl.isEmpty()) {
QMessageBox::information(this, "**INFO**", "Will eventually show a help window");
} else {
#ifdef _WIN32GCC
QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!");
#else
PHelp *help = new PHelp(fHelpUrl);
help->show();
#endif // _WIN32GCC
}
}

View File

@@ -0,0 +1,69 @@
/****************************************************************************
PGetMusrFTOptionsDialog.h
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
*****************************************************************************/
/***************************************************************************
* Copyright (C) 2010-2015 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _PGETMUSRFTOPTIONSDIALOG_H_
#define _PGETMUSRFTOPTIONSDIALOG_H_
#include <QDialog>
#include <QStringList>
#include "ui_PGetMusrFTOptionsDialog.h"
class PGetMusrFTOptionsDialog : public QDialog, private Ui::PGetMusrFTOptionsDialog
{
Q_OBJECT
public:
PGetMusrFTOptionsDialog(QString currentMsrFile, QStringList &prevCmd, const QString helpUrl);
QStringList getMusrFTOptions();
public slots:
void helpContent();
private slots:
void currentMsrFileTagChanged(int state);
void allMsrFileTagChanged(int state);
void selectMsrFileNames();
void clearMsrFileNames();
void selectDataFileNames();
void clearDataFileNames();
void createMsrFileChanged(int state);
void resetAll();
private:
QStringList fMsrFilePaths; ///< list keeping all the paths from the msr-file path-name list
QStringList fMsrFileNames; ///< list keeping all the names from the msr-file path-name list
QStringList fDataFilePaths; ///< list keeping all the paths from the data-file path-name list
QStringList fDataFileNames; ///< list keeping all the names from the data-file path-name list
QString fCreateMsrFileName; ///< keeps the msr-path-file name for msr-file creation
QString fCurrentMsrFileName; ///< keeps the msr-path-file name of the currently active msr-file in musredit.
QString fHelpUrl; ///< help url for the asymmetry run block
};
#endif // _PGETMUSRFTOPTIONSDIALOG_H_

View File

@@ -61,6 +61,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout()));
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));

View File

@@ -46,6 +46,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
public:
PPrefsDialog(PAdmin *admin);
bool getMusrviewShowFourierFlag() { return fFourier_checkBox->isChecked(); }
bool getKeepMinuit2OutputFlag() { return fKeepMn2Output_checkBox->isChecked(); }
bool getTitleFromDataFileFlag() { return fTitleFromData_checkBox->isChecked(); }
bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); }

View File

@@ -55,6 +55,7 @@ using namespace std;
#include <QTextBlock>
#include <QTextDocumentFragment>
#include <QTextList>
#include <QProcess>
#include <QtDebug>
@@ -68,6 +69,7 @@ using namespace std;
#include "PFitOutputHandler.h"
#include "PDumpOutputHandler.h"
#include "PPrefsDialog.h"
#include "PGetMusrFTOptionsDialog.h"
#include "PGetDefaultDialog.h"
#include "PMusrEditAbout.h"
#include "PMsr2DataDialog.h"
@@ -550,6 +552,12 @@ void PTextEdit::setupMusrActions()
menu->addAction(fMusrT0Action);
fMusrT0Action->setEnabled(fAdmin->getEnableMusrT0Flag());
a = new QAction( QIcon( QPixmap (":/images/musrFT.xpm") ), tr( "Raw Fourier" ), this );
a->setStatusTip( tr("Start musrFT") );
connect( a, SIGNAL( triggered() ), this, SLOT( musrFT() ) );
tb->addAction(a);
menu->addAction(a);
a = new QAction( QIcon( QPixmap( ":/images/musrprefs.xpm" ) ), tr( "&Preferences" ), this );
a->setStatusTip( tr("Show Preferences") );
connect( a, SIGNAL( triggered() ), this, SLOT( musrPrefs() ) );
@@ -2183,7 +2191,10 @@ void PTextEdit::musrView()
str = *fFilenames.find( currentEditor() );
QString numStr;
numStr.setNum(fAdmin->getTimeout());
cmd += str + "\" --timeout " + numStr + " &";
cmd += str + "\" --timeout " + numStr;
if (fAdmin->getMusrviewShowFourierFlag())
cmd += " -f ";
cmd += " &";
int status=system(cmd.toLatin1());
}
@@ -2223,6 +2234,33 @@ void PTextEdit::musrT0()
QString fln = *fFilenames.find( currentEditor() );
}
//----------------------------------------------------------------------------------------------------
/**
* <p>Calls musrFT via selection/option dialog. It will ask the user if he/she wants to overwrite some
* of the default settings.
*/
void PTextEdit::musrFT()
{
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
if (dlg == 0) {
QMessageBox::critical(this, "**ERROR** musrFT", "Couldn't invoke musrFT Options Dialog.");
return;
}
if (dlg->exec() == QDialog::Accepted) {
fMusrFTPrevCmd = dlg->getMusrFTOptions();
QProcess proc(this);
proc.setStandardOutputFile("musrFT.log");
proc.setStandardErrorFile("musrFT.log");
proc.startDetached("musrFT", fMusrFTPrevCmd);
}
delete dlg;
dlg = 0;
}
//----------------------------------------------------------------------------------------------------
/**
* <p>Calls the preferences dialog which is used to set some global options.
@@ -2237,6 +2275,7 @@ void PTextEdit::musrPrefs()
}
if (dlg->exec() == QDialog::Accepted) {
fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag());
fAdmin->setKeepMinuit2OutputFlag(dlg->getKeepMinuit2OutputFlag());
fAdmin->setTitleFromDataFileFlag(dlg->getTitleFromDataFileFlag());
fAdmin->setEnableMusrT0Flag(dlg->getEnableMusrT0Flag());

View File

@@ -131,6 +131,7 @@ private slots:
void musrMsr2Data();
void musrView();
void musrT0();
void musrFT();
void musrPrefs();
void musrSwapMsrMlog();
void musrDump();
@@ -157,6 +158,7 @@ private:
bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher
QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling
QString fLastDirInUse; ///< string holding the path from where the last file was loaded.
QStringList fMusrFTPrevCmd;
QAction *fMusrT0Action;

View File

@@ -0,0 +1,842 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PGetMusrFTOptionsDialog</class>
<widget class="QDialog" name="PGetMusrFTOptionsDialog">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>711</width>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
<string>musrFT Options</string>
</property>
<widget class="QGroupBox" name="fFourier_groupBox">
<property name="geometry">
<rect>
<x>20</x>
<y>400</y>
<width>671</width>
<height>201</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string> Fourier </string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>641</width>
<height>156</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_22">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="fFourierOptions_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Options&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fFourierOption_comboBox">
<item>
<property name="text">
<string>UnDef</string>
</property>
</item>
<item>
<property name="text">
<string>real</string>
</property>
</item>
<item>
<property name="text">
<string>imag</string>
</property>
</item>
<item>
<property name="text">
<string>real+imag</string>
</property>
</item>
<item>
<property name="text">
<string>power</string>
</property>
</item>
<item>
<property name="text">
<string>phase</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>218</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QLabel" name="fFourierUnits_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Units&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fFourierUnits_comboBox">
<item>
<property name="text">
<string>UnDef</string>
</property>
</item>
<item>
<property name="text">
<string>Gauss</string>
</property>
</item>
<item>
<property name="text">
<string>Tesla</string>
</property>
</item>
<item>
<property name="text">
<string>MHz</string>
</property>
</item>
<item>
<property name="text">
<string>Mc/s</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_23">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<item>
<widget class="QLabel" name="fFourierPower_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Power&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fFourierPower_lineEdit"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>88</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="fLifetimeCorrection_label">
<property name="text">
<string>Lifetime Correction</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fLifetimeCorrection_lineEdit"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<item>
<widget class="QLabel" name="fFourierRange_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Range&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QLabel" name="fFourierRangeStart_label">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fFourierRangeStart_lineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="fFourierRangeEnd_label">
<property name="text">
<string>End</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fFourierRangeEnd_lineEdit"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>118</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="QCheckBox" name="fAveragedView_checkBox">
<property name="text">
<string>Averaged View</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>278</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="fCreateMsrFile_checkBox">
<property name="text">
<string>Create msr-File</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<widget class="QLabel" name="fFourierTitle_label">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fFourierTitle_lineEdit"/>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QGroupBox" name="fHistoInfo_groupBox">
<property name="geometry">
<rect>
<x>20</x>
<y>160</y>
<width>671</width>
<height>231</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string> Histo Info </string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>641</width>
<height>188</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="fBkgRange_label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Background Range (in Bins)</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="fBkgStartBin_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;StartBin&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fBkgRangeStartBin_lineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="fBkgEndBin_label">
<property name="text">
<string>EndBin:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fBkgRangeEndBin_lineEdit"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="fBkgList_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Background List&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fBkgList_lineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="fApodization_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Apodization&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="fApodization_comboBox">
<item>
<property name="text">
<string>none</string>
</property>
</item>
<item>
<property name="text">
<string>weak</string>
</property>
</item>
<item>
<property name="text">
<string>medium</string>
</property>
</item>
<item>
<property name="text">
<string>strong</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="fPacking_label">
<property name="text">
<string>Packing</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fPacking_lineEdit"/>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>168</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="fTimeRange_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Time Range (usec)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="fTimeRangeStart_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Start&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fTimeRangeStart_lineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="fTimeRangeEnd_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;End&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fTimeRangeEnd_lineEdit"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="fHistoList_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Histo List&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fHistoList_lineEdit"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="fT0_label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;T0's&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fT0_lineEdit"/>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QGroupBox" name="fFileSelection_groupBox">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>671</width>
<height>141</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>File Selection</string>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>19</x>
<y>31</y>
<width>641</width>
<height>96</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_27">
<item>
<widget class="QCheckBox" name="fCurrentMsrFile_checkBox">
<property name="text">
<string>Current msr-File</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fAllMsrFiles_checkBox">
<property name="text">
<string>ALL msr-Files</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>318</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_25">
<item>
<widget class="QPushButton" name="fMsrFileSelector_pushButton">
<property name="text">
<string>Select msr-File(s)</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fMsrFileSelector_lineEdit"/>
</item>
<item>
<widget class="QPushButton" name="fMsrFileNameClear_pushButton">
<property name="toolTip">
<string>clear msr-file name list</string>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_26">
<item>
<widget class="QPushButton" name="fDataFileSelector_pushButton">
<property name="text">
<string>Select data-File(s)</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="fDataFileSelector_lineEdit"/>
</item>
<item>
<widget class="QPushButton" name="fDataFileNameClear_pushButton">
<property name="toolTip">
<string>clear data-file name list</string>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>20</x>
<y>610</y>
<width>671</width>
<height>29</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_24">
<item>
<widget class="QPushButton" name="fHelp_pushButton">
<property name="text">
<string>Help</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>78</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="fResetAll_pushButton">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reset All</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<tabstops>
<tabstop>fCurrentMsrFile_checkBox</tabstop>
<tabstop>fAllMsrFiles_checkBox</tabstop>
<tabstop>fMsrFileSelector_pushButton</tabstop>
<tabstop>fMsrFileSelector_lineEdit</tabstop>
<tabstop>fMsrFileNameClear_pushButton</tabstop>
<tabstop>fDataFileSelector_pushButton</tabstop>
<tabstop>fDataFileSelector_lineEdit</tabstop>
<tabstop>fDataFileNameClear_pushButton</tabstop>
<tabstop>fBkgRangeStartBin_lineEdit</tabstop>
<tabstop>fBkgRangeEndBin_lineEdit</tabstop>
<tabstop>fBkgList_lineEdit</tabstop>
<tabstop>fApodization_comboBox</tabstop>
<tabstop>fPacking_lineEdit</tabstop>
<tabstop>fTimeRangeStart_lineEdit</tabstop>
<tabstop>fTimeRangeEnd_lineEdit</tabstop>
<tabstop>fHistoList_lineEdit</tabstop>
<tabstop>fT0_lineEdit</tabstop>
<tabstop>fFourierOption_comboBox</tabstop>
<tabstop>fFourierUnits_comboBox</tabstop>
<tabstop>fFourierPower_lineEdit</tabstop>
<tabstop>fLifetimeCorrection_lineEdit</tabstop>
<tabstop>fFourierRangeStart_lineEdit</tabstop>
<tabstop>fFourierRangeEnd_lineEdit</tabstop>
<tabstop>fAveragedView_checkBox</tabstop>
<tabstop>fCreateMsrFile_checkBox</tabstop>
<tabstop>fFourierTitle_lineEdit</tabstop>
<tabstop>fResetAll_pushButton</tabstop>
<tabstop>fHelp_pushButton</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PGetMusrFTOptionsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>683</x>
<y>611</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PGetMusrFTOptionsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>689</x>
<y>611</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>fHelp_pushButton</sender>
<signal>clicked()</signal>
<receiver>PGetMusrFTOptionsDialog</receiver>
<slot>helpContent()</slot>
<hints>
<hint type="sourcelabel">
<x>85</x>
<y>627</y>
</hint>
<hint type="destinationlabel">
<x>147</x>
<y>624</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>helpContent()</slot>
</slots>
</ui>

View File

@@ -33,9 +33,9 @@
<item>
<widget class="QTabWidget" name="fTabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<widget class="QWidget" name="fGeneral_tab">
<attribute name="title">
<string>general</string>
</attribute>
@@ -75,7 +75,7 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab">
<widget class="QWidget" name="fMusrfit_tab">
<attribute name="title">
<string>musrfit</string>
</attribute>
@@ -158,7 +158,25 @@
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<widget class="QWidget" name="fMusrview_tab">
<attribute name="title">
<string>musrview</string>
</attribute>
<widget class="QCheckBox" name="fFourier_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>141</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>start with Fourier</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrt0_tab">
<attribute name="title">
<string>musrt0</string>
</attribute>

View File

@@ -0,0 +1,28 @@
/* XPM */
static char *dummy[]={
"22 22 3 1",
". c None",
"# c #000000",
"a c #ff0000",
"..##....###...##......",
"......................",
"######################",
"......................",
".........a............",
".........a............",
".........a............",
".........a............",
".........aa...........",
"........aaa...........",
"........aaa...........",
"........a.a...........",
"........a.a...........",
".......aa.aa..........",
".......aa..aa.........",
"a.aaa..a....aaa...aa..",
"aa.aaa.a......aaa.aaaa",
"......a..........aa...",
"######################",
"......................",
".#######.####..####...",
"......................"};

View File

@@ -83,6 +83,7 @@ HEADERS = musredit.h \
PFitOutputHandler.h \
PDumpOutputHandler.h \
PPrefsDialog.h \
PGetMusrFTOptionsDialog.h \
PGetDefaultDialog.h \
PGetTitleBlockDialog.h \
PGetParameterBlockDialog.h \
@@ -106,6 +107,7 @@ SOURCES = PHelp.cpp \
PFitOutputHandler.cpp \
PDumpOutputHandler.cpp \
PPrefsDialog.cpp \
PGetMusrFTOptionsDialog.cpp \
PGetDefaultDialog.cpp \
PGetTitleBlockDialog.cpp \
PGetParameterBlockDialog.cpp \
@@ -126,6 +128,7 @@ FORMS = forms/PFindDialog.ui \
forms/PGetDefaultDialog.ui \
forms/PMusrEditAbout.ui \
forms/PPrefsDialog.ui \
forms/PGetMusrFTOptionsDialog.ui \
forms/PGetTitleBlockDialog.ui \
forms/PGetParameterBlockDialog.ui \
forms/PGetTheoryBlockDialog.ui \

View File

@@ -1,40 +1,41 @@
<RCC>
<qresource>
<file>images/editcopy.xpm</file>
<file>images/editcut.xpm</file>
<file>images/editfind.xpm</file>
<file>images/editnext.xpm</file>
<file>images/editpaste.xpm</file>
<file>images/editprevious.xpm</file>
<file>images/editredo.xpm</file>
<file>images/editundo.xpm</file>
<file>images/filenew.xpm</file>
<file>images/fileopen.xpm</file>
<file>images/fileprint.xpm</file>
<file>images/filereload.xpm</file>
<file>images/filesave.xpm</file>
<file>images/musrasym.xpm</file>
<file>images/musrcalcchisq.xpm</file>
<file>images/musrfit.xpm</file>
<file>images/musrmsr2data.xpm</file>
<file>images/musrprefs.xpm</file>
<file>images/musrsinglehisto.xpm</file>
<file>images/musrswap.xpm</file>
<file>images/musrt0.xpm</file>
<file>images/musrview.xpm</file>
<file>images/musrdump.xpm</file>
<file>latex_images/abragam.png</file>
<file>latex_images/asymmetry.png</file>
<file>latex_images/bessel.png</file>
<file>latex_images/combiLGKT.png</file>
<file>latex_images/generalExp.png</file>
<file>latex_images/internalBessel.png</file>
<file>latex_images/internalField.png</file>
<file>latex_images/polynom.png</file>
<file>latex_images/simpleExp.png</file>
<file>latex_images/simpleGauss.png</file>
<file>latex_images/statExpKT.png</file>
<file>latex_images/statGssKT.png</file>
<file>latex_images/tfCos.png</file>
</qresource>
<qresource prefix="/">
<file>images/editcopy.xpm</file>
<file>images/editcut.xpm</file>
<file>images/editfind.xpm</file>
<file>images/editnext.xpm</file>
<file>images/editpaste.xpm</file>
<file>images/editprevious.xpm</file>
<file>images/editredo.xpm</file>
<file>images/editundo.xpm</file>
<file>images/filenew.xpm</file>
<file>images/fileopen.xpm</file>
<file>images/fileprint.xpm</file>
<file>images/filereload.xpm</file>
<file>images/filesave.xpm</file>
<file>images/musrasym.xpm</file>
<file>images/musrcalcchisq.xpm</file>
<file>images/musrfit.xpm</file>
<file>images/musrmsr2data.xpm</file>
<file>images/musrprefs.xpm</file>
<file>images/musrsinglehisto.xpm</file>
<file>images/musrswap.xpm</file>
<file>images/musrt0.xpm</file>
<file>images/musrview.xpm</file>
<file>images/musrFT.xpm</file>
<file>images/musrdump.xpm</file>
<file>latex_images/abragam.png</file>
<file>latex_images/asymmetry.png</file>
<file>latex_images/bessel.png</file>
<file>latex_images/combiLGKT.png</file>
<file>latex_images/generalExp.png</file>
<file>latex_images/internalBessel.png</file>
<file>latex_images/internalField.png</file>
<file>latex_images/polynom.png</file>
<file>latex_images/simpleExp.png</file>
<file>latex_images/simpleGauss.png</file>
<file>latex_images/statExpKT.png</file>
<file>latex_images/statGssKT.png</file>
<file>latex_images/tfCos.png</file>
</qresource>
</RCC>

View File

@@ -31,6 +31,7 @@
<musr_web_plot>file://@DOCDIR@/html/user/MUSR/MusrFit.html#ThePlotBlock</musr_web_plot>
<musr_web_statistic>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheStatisticBlock</musr_web_statistic>
<musr_web_msr2data>file://@DOCDIR@/html/user/MUSR/Msr2Data.html</musr_web_msr2data>
<musr_web_musrFT>file://@DOCDIR@/html/user/MUSR/MusrFit.html#A_2.3_musrFT</musr_web_musrFT>
</help_section>
<font_settings>
<font_name>Courier New</font_name>

5
src/musrgui/Makefile.am Normal file
View File

@@ -0,0 +1,5 @@
## Process this file with automake to create Makefile.in
CLEANFILES = *~ core

View File

@@ -57,9 +57,12 @@ using namespace std;
*/
void musrview_syntax()
{
cout << endl << "usage: musrview <msr-file> [--<graphic-format-extension>] [--timeout <timeout>] | --version | --help";
cout << endl << "usage: musrview <msr-file> [Options]";
cout << endl << " <msr-file>: msr/mlog input file";
cout << endl << " 'musrview <msr-file>' will execute musrview";
cout << endl << " Options:";
cout << endl << " --help : display this help and exit.";
cout << endl << " --version : output version information and exit.";
cout << endl << " -f, --fourier: will directly present the Fourier transform of the <msr-file>.";
cout << endl << " --<graphic-format-extension>: ";
cout << endl << " will produce a graphics-output-file without starting a root session.";
cout << endl << " the name is based on the <msr-file>, e.g. 3310.msr -> 3310_0.png";
@@ -71,9 +74,6 @@ void musrview_syntax()
cout << endl << " will produce an ascii dump of the data and fit as plotted.";
cout << endl << " --timeout <timeout>: <timeout> given in seconds after which musrview terminates.";
cout << endl << " If <timeout> <= 0, no timeout will take place. Default <timeout> is 0.";
cout << endl;
cout << endl << " 'musrview' or 'musrview --help' will show this help";
cout << endl << " 'musrview --version' will print the musrview version";
cout << endl << endl;
}
@@ -101,6 +101,7 @@ int main(int argc, char *argv[])
int status;
bool success = true;
char fileName[128];
bool fourier = false;
bool graphicsOutput = false;
bool asciiOutput = false;
char graphicsExtension[128];
@@ -132,6 +133,8 @@ int main(int argc, char *argv[])
} else if (!strcmp(argv[i], "--help")) {
show_syntax = true;
break;
} else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--fourier")) {
fourier = true;
} else if (!strcmp(argv[i], "--eps") || !strcmp(argv[i], "--pdf") || !strcmp(argv[i], "--gif") ||
!strcmp(argv[i], "--jpg") || !strcmp(argv[i], "--png") || !strcmp(argv[i], "--svg") ||
!strcmp(argv[i], "--xpm") || !strcmp(argv[i], "--root")) {
@@ -304,10 +307,13 @@ int main(int argc, char *argv[])
startupHandler->GetFourierDefaults(),
startupHandler->GetMarkerList(),
startupHandler->GetColorList(),
graphicsOutput||asciiOutput);
graphicsOutput||asciiOutput,
fourier);
else
musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(),
10+i*100, 10+i*100, 800, 600, graphicsOutput||asciiOutput);
10+i*100, 10+i*100, 800, 600,
graphicsOutput||asciiOutput,
fourier);
if (!musrCanvas->IsValid()) {
cerr << endl << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit.";
@@ -340,8 +346,12 @@ int main(int argc, char *argv[])
}
if (asciiOutput) {
// generate export data file name
TString str(fileName);
str.Remove(str.Last('.'));
str += ".dat";
// save data in batch mode
musrCanvas->SaveDataAscii();
musrCanvas->ExportData(str.Data());
musrCanvas->Done(0);
}