From be9bfdf0918324ce062af276832dd29856b9ab37 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Fri, 23 Jan 2015 15:58:53 +0100 Subject: [PATCH 1/6] Added option to save data from canvas a quit for non-interactive mode (web). --- src/classes/PMusrCanvas.cpp | 919 +++++++++++++++++++++++++++++++++++- src/include/PMusrCanvas.h | 1 + 2 files changed, 918 insertions(+), 2 deletions(-) diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 17e34378..35b12f66 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -1361,6 +1361,922 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) Done(0); } +//-------------------------------------------------------------------------- +// SaveDataAsciiAndQuit +//-------------------------------------------------------------------------- +/** + *

Saves the currently seen data (data, difference, Fourier spectra, ...) in ascii column format. + * This function is used to dump the ascii output in batch mode. + */ +void PMusrCanvas::SaveDataAsciiAndQuit() +{ + // collect relevant data + PMusrCanvasAsciiDump dump; + PMusrCanvasAsciiDumpVector dumpVector; + + Int_t xminBin; + Int_t xmaxBin; + Double_t xmin; + Double_t xmax; + Double_t time, freq; + Double_t xval, yval; + + switch (fPlotType) { + case MSR_PLOT_SINGLE_HISTO: + case MSR_PLOT_ASYM: + case MSR_PLOT_MU_MINUS: + if (fDifferenceView) { // difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); + xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get time + time = fData[i].diff->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.dataX.push_back(time); + dump.data.push_back(fData[i].diff->GetBinContent(j)); + dump.dataErr.push_back(fData[i].diff->GetBinError(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL: + // get current x-range + xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_IMAG: + // get current x-range + xminBin = fData[0].diffFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL_AND_IMAG: + // get current x-range + xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); + } + } + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PWR: + // get current x-range + xminBin = fData[0].diffFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierPwr->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PHASE: + // get current x-range + xminBin = fData[0].diffFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierPhase->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + default: + break; + } + } else { // not a difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); + xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get time + time = fData[i].data->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.dataX.push_back(time); + dump.data.push_back(fData[i].data->GetBinContent(j)); + dump.dataErr.push_back(fData[i].data->GetBinError(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get time + time = fData[i].theory->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.theoryX.push_back(time); + dump.theory.push_back(fData[i].theory->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + // get current x-range + xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_IMAG: + // get current x-range + xminBin = fData[0].dataFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL_AND_IMAG: + // get current x-range + xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + + //----------------------------- + // Im + //----------------------------- + // clean up dump + dump.dataX.clear(); + dump.data.clear(); + dump.dataErr.clear(); + dump.theoryX.clear(); + dump.theory.clear(); + + // go through all data bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + + } + break; + case PV_FOURIER_PWR: + // get current x-range + xminBin = fData[0].dataFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierPwr->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierPwr->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PHASE: + // get current x-range + xminBin = fData[0].dataFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierPhase->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierPhase->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + default: + break; + } + } + break; + case MSR_PLOT_NON_MUSR: + if (fDifferenceView) { // difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); + xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetN(); j++) { + // get x and y value + fNonMusrData[i].diff->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.dataX.push_back(xval); + dump.data.push_back(yval); + dump.dataErr.push_back(fNonMusrData[i].diff->GetErrorY(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + break; + case PV_FOURIER_IMAG: + break; + case PV_FOURIER_REAL_AND_IMAG: + break; + case PV_FOURIER_PWR: + break; + case PV_FOURIER_PHASE: + break; + default: + break; + } + } else { // not a difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); + xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetN(); j++) { + // get x and y value + fNonMusrData[i].data->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.dataX.push_back(xval); + dump.data.push_back(yval); + dump.dataErr.push_back(fNonMusrData[i].data->GetErrorY(j)); + } + } + + // go through all theory bins + for (Int_t j=0; jGetN(); j++) { + // get x and y value + fNonMusrData[i].theory->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.theoryX.push_back(xval); + dump.theory.push_back(yval); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + break; + case PV_FOURIER_IMAG: + break; + case PV_FOURIER_REAL_AND_IMAG: + break; + case PV_FOURIER_PWR: + break; + case PV_FOURIER_PHASE: + break; + default: + break; + } + } + break; + default: + 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; iGetEntries()-1; i++) { + ostr = dynamic_cast(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); + if (!fout.is_open()) { + cerr << endl << ">> PMusrCanvas::SaveDataAsciiAndQuit: **ERROR** couldn't open file " << fln.Data() << " for writing." << endl; + return; + } + + // find out what is the longest data/theory vector + UInt_t maxDataLength = 0; + UInt_t maxTheoryLength = 0; + for (UInt_t i=0; i 0) + fout << dumpVector[j].dataErr[i] << ", "; + } else { + if (dumpVector[j].dataErr.size() > 0) + fout << ", , , "; + else + fout << ", , "; + } + } + // write last difference entry + if (i 0) + fout << dumpVector[dumpVector.size()-1].dataErr[i]; + } else { + if (dumpVector[dumpVector.size()-1].dataErr.size() > 0) + fout << ", , "; + else + fout << ", "; + } + fout << endl; + } + } else { // no difference view + // write header + switch (fCurrentPlotView) { + case PV_DATA: + fout << "% "; + for (UInt_t i=0; i maxTheoryLength) + maxLength = maxDataLength; + else + maxLength = maxTheoryLength; + + // write data and theory + for (UInt_t i=0; i 0) + fout << dumpVector[j].dataErr[i] << ", "; + } else { + if (dumpVector[j].dataErr.size() > 0) + fout << " , , , "; + else + fout << " , , "; + } + } + // write theory + for (UInt_t j=0; j> Data windows saved in ascii format ..." << endl; + + if (fPlotNumber == static_cast(fMsrHandler->GetMsrPlotList()->size()) - 1) + Done(0); +} + //-------------------------------------------------------------------------- // CreateStyle (private) //-------------------------------------------------------------------------- @@ -2079,7 +2995,7 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) (Int_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetTheoryTimeStart())/data->GetTheoryTimeStep()) * data->GetTheoryTimeStep() - data->GetTheoryTimeStep()/2.0; // closesd start value compatible with the user given end = start + size * data->GetTheoryTimeStep(); // closesd end value compatible with the user given - } +} // invoke histo theoHisto = new TH1F(name, name, size, start, end); @@ -4156,7 +5072,6 @@ void PMusrCanvas::PlotFourier(Bool_t unzoom) // plot fourier data Double_t xmin, xmax, ymin, ymax, binContent; UInt_t noOfPoints = 1000; - switch (fCurrentPlotView) { case PV_FOURIER_REAL: // set x-range diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h index eaf0b5ac..8e4b79d2 100644 --- a/src/include/PMusrCanvas.h +++ b/src/include/PMusrCanvas.h @@ -229,6 +229,7 @@ class PMusrCanvas : public TObject, public TQObject virtual void LastCanvasClosed(); // SLOT virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat); + virtual void SaveDataAsciiAndQuit(); private: Int_t fTimeout; ///< timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place From 8035bafec4710ccbc020278d5799cbde7a58f81f Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Fri, 23 Jan 2015 17:17:08 +0100 Subject: [PATCH 2/6] Added option to save data from canvas a quit for non-interactive mode (web). --- src/musrview.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/musrview.cpp b/src/musrview.cpp index e9cb2558..bbcc35d0 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -67,6 +67,8 @@ void musrview_syntax() cout << endl << " eps, pdf, gif, jpg, png, svg, xpm, root"; cout << endl << " example: musrview 3310.msr --png, will produce a files 3310_X.png"; cout << endl << " where 'X' stands for the plot number (starting form 0)"; + cout << endl << " --ascii: "; + cout << endl << " will produce an ascii dump of the data and fit as plotted."; cout << endl << " --timeout : given in seconds after which musrview terminates."; cout << endl << " If <= 0, no timeout will take place. Default is 0."; cout << endl; @@ -100,6 +102,7 @@ int main(int argc, char *argv[]) bool success = true; char fileName[128]; bool graphicsOutput = false; + bool asciiOutput = false; char graphicsExtension[128]; int timeout = 0; @@ -135,6 +138,8 @@ int main(int argc, char *argv[]) graphicsOutput = true; strcpy(graphicsExtension, argv[i]+2); + } else if (!strcmp(argv[i], "--ascii")) { + asciiOutput = true; } else if (!strcmp(argv[i], "--timeout")) { if (i+1 < argc) { TString str(argv[i+1]); @@ -334,6 +339,10 @@ int main(int argc, char *argv[]) musrCanvas->SaveGraphicsAndQuit(fileName, graphicsExtension); } + if (asciiOutput) { + musrCanvas->SaveDataAsciiAndQuit(); + } + // keep musrCanvas objects canvasVector.push_back(musrCanvas); } From addb1d68309f7b6ac5897dc59d0c1b5fb468cd74 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Fri, 23 Jan 2015 22:22:47 +0100 Subject: [PATCH 3/6] Added .msr file for bNMR mud file fit. --- src/external/libBNMR/045674.msr | Bin 0 -> 27124 bytes src/external/libBNMR/ExpRlx-MUD.msr | 73 ++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 src/external/libBNMR/045674.msr create mode 100644 src/external/libBNMR/ExpRlx-MUD.msr diff --git a/src/external/libBNMR/045674.msr b/src/external/libBNMR/045674.msr new file mode 100644 index 0000000000000000000000000000000000000000..df6bc823b004cbe6d6e7986dc99939c086918517 GIT binary patch literal 27124 zcma&O1yokg`u=_IeuD1q?hX;91W^$KTT}#86cn+$yA^E3?(XjH?(S~=+P>Eu-RI|f z*8i+^U=1^S_VhE)p3lDS8B&NyAdVyAcoE?R1^9y>j(8SH+u_)K5%+VDfQ5O4gL8g| zC8T3%)bz)YrtLbSk_+8yJiOYyMkk3VjcVj17G{PAxVY47TF;;eCI?dW7Hn2^%2ngvwbth6tzs2^%5Yd@XLOijwV zufN0^PxM#PS{({=N(y?q)W~nuS#1FuokJB{_vINo*1%g{rC9_^LnuHFcPp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DAdn)MgBW!#K z4#w85qg^uG#-JjKquXA)mvvp~T7eM>7$^9Vs3C|^h((MaF(QKuN05b(z(7Vo{?Pp) z0Ry_oA^``k*gASkbjAMc$m9sOaJ!canx`E5nEeydIr@`hP& z*<;>it}*wSgXZaG8~l2=nW_;B<#p3alg>2RblZ3U{=9?6&y0(WNu$#E2v%(VVi+>~ zY&dQB%ODs&H*AEb%W{Lya7o_}Pu>&yFZB)jlzzQ_3x<MHyds7;v4KB>9` z+hULE5GJn&5&0ynY6TU;fbvPzGF1|v8_Fpv3;cOqssh!JvL7BU-B`7G6l*lMBMQnp z%1g=*;M>~?E8{fGwd$3#u~IW%S)jb3_)TF_{-LlcuPbILk0TDs3B*1*rZ}rOqu2wB zboF{O)4(BVLSWBStnt0M;V^!6a zGez{`Iq73Ju=@69A&E%%d<4_+f%ZtEV;O!!&~#a!@toR45b~OM(qa;!-Nhw-e@VqM zSS6$FTr}8*F=sN`8f{+_&7KUpKkl{IS#7Ov20k;3=o?udnt2PWTpQ!#LK`1Vh!U{a zt|$ydI%2xvBuVUWF}`Rl{-`{9UgYIOg`AUa%jJo}kS#+l@4tMc zNC5=tN6)0Z_$%d{bo&9BereoLNFp#-RB((9j0pfCiDF&=nSj(d7fvd1$s$sXj|A6o zg`*lyH?#DH>^WvEdxuC9SY+kh?_=dzT3Q##REvkWP@G?#f#>g}ul*p}2 z-|H=WL}(Hc>$p%vh{c3xIFF6D1$J(}BLOH0Bh|q}x)lcgf>AB0L`xAHX~| z-WJ9h0YfsW!@t*(BT-dAe=7DQCPw`U7ZPv@6TvXn=J26lQquoPbAkMyBr}^)-y*=s zIU~*on;VLatfGZ0=BR+-v5dtKg#72*DQlU`kD z-+J`1k)hdc>xEf=m#;5RedqZ1n46OEI6CPDItOM}lT5^t2` Date: Mon, 26 Jan 2015 07:56:15 +0000 Subject: [PATCH 4/6] README edited online with Bitbucket --- README | 65 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/README b/README index ceff445b..fd52af9c 100644 --- a/README +++ b/README @@ -1,33 +1,32 @@ -# musrfit - muSR data analysis package # - -### Contents ### - -This is a data analysis package to analyze time differential muSR data. -Currently it allows the following things: - -* setting up most commonly used fitting functions for muSR -* fitting data, including global fits -* showing the fit results and the residuals -* showing the Fourier transform of the data -* extracting easily the fitting parameters to be used in other programs (gnuplot, qtiplot/origin, ...) -* allows to generate fitting input files for follow-up runs -* allows to generate global fitting input files based on a single run template -* allows to implement more sophisticated user functions - (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles) - -### Currently supported platforms: ### - -* Linux -* Mac OS X -* Windows - not really, only for the very brave ones - -### Documentation #### - -For a more exhaustive user documentation see: - - http://lmu.web.psi.ch/musrfit/user/MUSR/WebHome.html - -### Contact ### - - - +# musrfit - muSR data analysis package # + +### Contents ### + +This is a data analysis package to analyze time differential muSR and beta-NMR data. +Currently it allows the following things: + +* setting up most commonly used fitting functions for muSR and beta-NMR +* fitting data, including global fits +* showing the fit results and the residuals +* showing the Fourier transform of the data +* extracting easily the fitting parameters to be used in other programs (gnuplot, qtiplot/origin, ...) +* allows to generate fitting input files for follow-up runs +* allows to generate global fitting input files based on a single run template +* allows to implement more sophisticated user functions + (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles) + +### Currently supported platforms: ### + +* Linux +* Mac OS X +* Windows - not really, only for the very brave ones + +### Documentation #### + +For a more exhaustive user documentation see: + + http://lmu.web.psi.ch/musrfit/user/MUSR/WebHome.html + +### Contact ### + + \ No newline at end of file From 55fb9df820d4b0cc76a7bab1ad49d0fb3d0e3840 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Mon, 26 Jan 2015 16:56:36 +0100 Subject: [PATCH 5/6] Turn on batch mode for --ascii option. --- src/classes/PMusrCanvas.cpp | 1244 +++++++++++++++++------------------ src/musrview.cpp | 6 +- 2 files changed, 625 insertions(+), 625 deletions(-) diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 35b12f66..046553df 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -1382,637 +1382,637 @@ void PMusrCanvas::SaveDataAsciiAndQuit() Double_t xval, yval; switch (fPlotType) { - case MSR_PLOT_SINGLE_HISTO: - case MSR_PLOT_ASYM: - case MSR_PLOT_MU_MINUS: - if (fDifferenceView) { // difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); - xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); + case MSR_PLOT_SINGLE_HISTO: + case MSR_PLOT_ASYM: + case MSR_PLOT_MU_MINUS: + if (fDifferenceView) { // difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); + xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { + // get time + time = fData[i].diff->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.dataX.push_back(time); + dump.data.push_back(fData[i].diff->GetBinContent(j)); + dump.dataErr.push_back(fData[i].diff->GetBinError(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL: + // get current x-range + xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { - // get time - time = fData[i].diff->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.dataX.push_back(time); - dump.data.push_back(fData[i].diff->GetBinContent(j)); - dump.dataErr.push_back(fData[i].diff->GetBinError(j)); - } - } + // go through all data bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); + } + } - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL: - // get current x-range - xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_IMAG: - // get current x-range - xminBin = fData[0].diffFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL_AND_IMAG: - // get current x-range - xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); - } - } - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PWR: - // get current x-range - xminBin = fData[0].diffFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierPwr->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PHASE: - // get current x-range - xminBin = fData[0].diffFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierPhase->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - default: - break; - } - } else { // not a difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); - xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get time - time = fData[i].data->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.dataX.push_back(time); - dump.data.push_back(fData[i].data->GetBinContent(j)); - dump.dataErr.push_back(fData[i].data->GetBinError(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get time - time = fData[i].theory->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.theoryX.push_back(time); - dump.theory.push_back(fData[i].theory->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - // get current x-range - xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_IMAG: - // get current x-range - xminBin = fData[0].dataFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL_AND_IMAG: - // get current x-range - xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - - //----------------------------- - // Im - //----------------------------- - // clean up dump - dump.dataX.clear(); - dump.data.clear(); - dump.dataErr.clear(); - dump.theoryX.clear(); - dump.theory.clear(); - - // go through all data bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - - } - break; - case PV_FOURIER_PWR: - // get current x-range - xminBin = fData[0].dataFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierPwr->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierPwr->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PHASE: - // get current x-range - xminBin = fData[0].dataFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierPhase->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierPhase->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - default: - break; - } + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_IMAG: + // get current x-range + xminBin = fData[0].diffFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL_AND_IMAG: + // get current x-range + xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); + } + } + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PWR: + // get current x-range + xminBin = fData[0].diffFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierPwr->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PHASE: + // get current x-range + xminBin = fData[0].diffFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierPhase->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + default: + break; } - break; - case MSR_PLOT_NON_MUSR: - if (fDifferenceView) { // difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); - xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); + } else { // not a difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); + xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get time + time = fData[i].data->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.dataX.push_back(time); + dump.data.push_back(fData[i].data->GetBinContent(j)); + dump.dataErr.push_back(fData[i].data->GetBinError(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get time + time = fData[i].theory->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.theoryX.push_back(time); + dump.theory.push_back(fData[i].theory->GetBinContent(j)); + } + } - // fill ascii dump data - for (UInt_t i=0; i 0) + dumpVector.push_back(dump); + } - // go through all data bins - for (Int_t j=0; jGetN(); j++) { - // get x and y value - fNonMusrData[i].diff->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.dataX.push_back(xval); - dump.data.push_back(yval); - dump.dataErr.push_back(fNonMusrData[i].diff->GetErrorY(j)); - } - } + break; + case PV_FOURIER_REAL: + // get current x-range + xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_IMAG: + // get current x-range + xminBin = fData[0].dataFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL_AND_IMAG: + // get current x-range + xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + + //----------------------------- + // Im + //----------------------------- + // clean up dump + dump.dataX.clear(); + dump.data.clear(); + dump.dataErr.clear(); + dump.theoryX.clear(); + dump.theory.clear(); - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } + // go through all data bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); + } + } - break; - case PV_FOURIER_REAL: - break; - case PV_FOURIER_IMAG: - break; - case PV_FOURIER_REAL_AND_IMAG: - break; - case PV_FOURIER_PWR: - break; - case PV_FOURIER_PHASE: - break; - default: - break; - } - } else { // not a difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); - xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetN(); j++) { - // get x and y value - fNonMusrData[i].data->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.dataX.push_back(xval); - dump.data.push_back(yval); - dump.dataErr.push_back(fNonMusrData[i].data->GetErrorY(j)); - } - } - - // go through all theory bins - for (Int_t j=0; jGetN(); j++) { - // get x and y value - fNonMusrData[i].theory->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.theoryX.push_back(xval); - dump.theory.push_back(yval); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - break; - case PV_FOURIER_IMAG: - break; - case PV_FOURIER_REAL_AND_IMAG: - break; - case PV_FOURIER_PWR: - break; - case PV_FOURIER_PHASE: - break; - default: - break; - } + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + + } + break; + case PV_FOURIER_PWR: + // get current x-range + xminBin = fData[0].dataFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierPwr->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierPwr->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PHASE: + // get current x-range + xminBin = fData[0].dataFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierPhase->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierPhase->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + default: + break; } - break; - default: - break; + } + break; + case MSR_PLOT_NON_MUSR: + if (fDifferenceView) { // difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); + xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetN(); j++) { + // get x and y value + fNonMusrData[i].diff->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.dataX.push_back(xval); + dump.data.push_back(yval); + dump.dataErr.push_back(fNonMusrData[i].diff->GetErrorY(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + break; + case PV_FOURIER_IMAG: + break; + case PV_FOURIER_REAL_AND_IMAG: + break; + case PV_FOURIER_PWR: + break; + case PV_FOURIER_PHASE: + break; + default: + break; + } + } else { // not a difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); + xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetN(); j++) { + // get x and y value + fNonMusrData[i].data->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.dataX.push_back(xval); + dump.data.push_back(yval); + dump.dataErr.push_back(fNonMusrData[i].data->GetErrorY(j)); + } + } + + // go through all theory bins + for (Int_t j=0; jGetN(); j++) { + // get x and y value + fNonMusrData[i].theory->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.theoryX.push_back(xval); + dump.theory.push_back(yval); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + break; + case PV_FOURIER_IMAG: + break; + case PV_FOURIER_REAL_AND_IMAG: + break; + case PV_FOURIER_PWR: + break; + case PV_FOURIER_PHASE: + break; + default: + break; + } + } + break; + default: + break; } // generate output filename diff --git a/src/musrview.cpp b/src/musrview.cpp index bbcc35d0..2568bb7c 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -285,7 +285,7 @@ int main(int argc, char *argv[]) if (success) { // generate Root application needed for PMusrCanvas - if (graphicsOutput) { + if (graphicsOutput || asciiOutput) { argv[argc] = (char*)malloc(16*sizeof(char)); strcpy(argv[argc], "-b"); argc++; @@ -304,10 +304,10 @@ int main(int argc, char *argv[]) startupHandler->GetFourierDefaults(), startupHandler->GetMarkerList(), startupHandler->GetColorList(), - graphicsOutput); + graphicsOutput||asciiOutput); else musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(), - 10+i*100, 10+i*100, 800, 600, graphicsOutput); + 10+i*100, 10+i*100, 800, 600, graphicsOutput||asciiOutput); if (!musrCanvas->IsValid()) { cerr << endl << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit."; From acb5a1af09df01eeb30f202797eb9e98b108bf9c Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Tue, 27 Jan 2015 11:17:06 +0100 Subject: [PATCH 6/6] Remove redundant and optimize code for saving data to ascii in batch mode. --- src/classes/PMusrCanvas.cpp | 2169 ++++++++++------------------------- src/include/PMusrCanvas.h | 4 +- src/musrview.cpp | 4 +- 3 files changed, 633 insertions(+), 1544 deletions(-) diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 046553df..9762e17b 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -1362,13 +1362,12 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) } //-------------------------------------------------------------------------- -// SaveDataAsciiAndQuit +// SaveDataAscii //-------------------------------------------------------------------------- /** *

Saves the currently seen data (data, difference, Fourier spectra, ...) in ascii column format. - * This function is used to dump the ascii output in batch mode. */ -void PMusrCanvas::SaveDataAsciiAndQuit() +void PMusrCanvas::SaveDataAscii() { // collect relevant data PMusrCanvasAsciiDump dump; @@ -1382,637 +1381,637 @@ void PMusrCanvas::SaveDataAsciiAndQuit() Double_t xval, yval; switch (fPlotType) { - case MSR_PLOT_SINGLE_HISTO: - case MSR_PLOT_ASYM: - case MSR_PLOT_MU_MINUS: - if (fDifferenceView) { // difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); - xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); + case MSR_PLOT_SINGLE_HISTO: + case MSR_PLOT_ASYM: + case MSR_PLOT_MU_MINUS: + if (fDifferenceView) { // difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); + xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get time - time = fData[i].diff->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.dataX.push_back(time); - dump.data.push_back(fData[i].diff->GetBinContent(j)); - dump.dataErr.push_back(fData[i].diff->GetBinError(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL: - // get current x-range - xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); - } - } + // go through all difference data bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get time + time = fData[i].diff->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.dataX.push_back(time); + dump.data.push_back(fData[i].diff->GetBinContent(j)); + dump.dataErr.push_back(fData[i].diff->GetBinError(j)); + } + } - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_IMAG: - // get current x-range - xminBin = fData[0].diffFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL_AND_IMAG: - // get current x-range - xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); - } - } - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PWR: - // get current x-range - xminBin = fData[0].diffFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierPwr->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PHASE: - // get current x-range - xminBin = fData[0].diffFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierPhase->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - default: - break; + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL: + // get current x-range + xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_IMAG: + // get current x-range + xminBin = fData[0].diffFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL_AND_IMAG: + // get current x-range + xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); + } + } + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PWR: + // get current x-range + xminBin = fData[0].diffFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierPwr->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PHASE: + // get current x-range + xminBin = fData[0].diffFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].diffFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].diffFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].diffFourierPhase->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + default: + break; + } + } else { // not a difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); + xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get time + time = fData[i].data->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.dataX.push_back(time); + dump.data.push_back(fData[i].data->GetBinContent(j)); + dump.dataErr.push_back(fData[i].data->GetBinError(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get time + time = fData[i].theory->GetBinCenter(j); + // check if time is in the current range + if ((time >= xmin) && (time <= xmax)) { + dump.theoryX.push_back(time); + dump.theory.push_back(fData[i].theory->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + // get current x-range + xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_IMAG: + // get current x-range + xminBin = fData[0].dataFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_REAL_AND_IMAG: + // get current x-range + xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierRe->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + + //----------------------------- + // Im + //----------------------------- + // clean up dump + dump.dataX.clear(); + dump.data.clear(); + dump.dataErr.clear(); + dump.theoryX.clear(); + dump.theory.clear(); + + // go through all data bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierIm->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + + } + break; + case PV_FOURIER_PWR: + // get current x-range + xminBin = fData[0].dataFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierPwr->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierPwr->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierPwr->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + case PV_FOURIER_PHASE: + // get current x-range + xminBin = fData[0].dataFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fData[0].dataFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin); + xmax = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetNbinsX(); j++) { + // get frequency + freq = fData[i].dataFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.dataX.push_back(freq); + dump.data.push_back(fData[i].dataFourierPhase->GetBinContent(j)); + } + } + + // go through all theory bins + for (Int_t j=1; jGetNbinsX(); j++) { + // get frequency + freq = fData[i].theoryFourierPhase->GetBinCenter(j); + // check if time is in the current range + if ((freq >= xmin) && (freq <= xmax)) { + dump.theoryX.push_back(freq); + dump.theory.push_back(fData[i].theoryFourierPhase->GetBinContent(j)); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + break; + default: + break; + } } - } else { // not a difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); - xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get time - time = fData[i].data->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.dataX.push_back(time); - dump.data.push_back(fData[i].data->GetBinContent(j)); - dump.dataErr.push_back(fData[i].data->GetBinError(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get time - time = fData[i].theory->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.theoryX.push_back(time); - dump.theory.push_back(fData[i].theory->GetBinContent(j)); - } - } + break; + case MSR_PLOT_NON_MUSR: + if (fDifferenceView) { // difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); + xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } + // fill ascii dump data + for (UInt_t i=0; iGetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_IMAG: - // get current x-range - xminBin = fData[0].dataFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL_AND_IMAG: - // get current x-range - xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - - //----------------------------- - // Im - //----------------------------- - // clean up dump - dump.dataX.clear(); - dump.data.clear(); - dump.dataErr.clear(); - dump.theoryX.clear(); - dump.theory.clear(); + // go through all data bins + for (Int_t j=0; jGetN(); j++) { + // get x and y value + fNonMusrData[i].diff->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.dataX.push_back(xval); + dump.data.push_back(yval); + dump.dataErr.push_back(fNonMusrData[i].diff->GetErrorY(j)); + } + } - // go through all data bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); - } - } + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - - } - break; - case PV_FOURIER_PWR: - // get current x-range - xminBin = fData[0].dataFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierPwr->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierPwr->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PHASE: - // get current x-range - xminBin = fData[0].dataFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierPhase->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierPhase->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - default: - break; + break; + case PV_FOURIER_REAL: + break; + case PV_FOURIER_IMAG: + break; + case PV_FOURIER_REAL_AND_IMAG: + break; + case PV_FOURIER_PWR: + break; + case PV_FOURIER_PHASE: + break; + default: + break; + } + } else { // not a difference view plot + switch (fCurrentPlotView) { + case PV_DATA: + // get current x-range + xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range + xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range + xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); + xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); + + // fill ascii dump data + for (UInt_t i=0; iGetN(); j++) { + // get x and y value + fNonMusrData[i].data->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.dataX.push_back(xval); + dump.data.push_back(yval); + dump.dataErr.push_back(fNonMusrData[i].data->GetErrorY(j)); + } + } + + // go through all theory bins + for (Int_t j=0; jGetN(); j++) { + // get x and y value + fNonMusrData[i].theory->GetPoint(j,xval,yval); + // check if time is in the current range + if ((xval >= xmin) && (xval <= xmax)) { + dump.theoryX.push_back(xval); + dump.theory.push_back(yval); + } + } + + // if anything found keep it + if (dump.dataX.size() > 0) + dumpVector.push_back(dump); + } + + break; + case PV_FOURIER_REAL: + break; + case PV_FOURIER_IMAG: + break; + case PV_FOURIER_REAL_AND_IMAG: + break; + case PV_FOURIER_PWR: + break; + case PV_FOURIER_PHASE: + break; + default: + break; + } } - } - break; - case MSR_PLOT_NON_MUSR: - if (fDifferenceView) { // difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); - xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetN(); j++) { - // get x and y value - fNonMusrData[i].diff->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.dataX.push_back(xval); - dump.data.push_back(yval); - dump.dataErr.push_back(fNonMusrData[i].diff->GetErrorY(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - break; - case PV_FOURIER_IMAG: - break; - case PV_FOURIER_REAL_AND_IMAG: - break; - case PV_FOURIER_PWR: - break; - case PV_FOURIER_PHASE: - break; - default: - break; - } - } else { // not a difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); - xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetN(); j++) { - // get x and y value - fNonMusrData[i].data->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.dataX.push_back(xval); - dump.data.push_back(yval); - dump.dataErr.push_back(fNonMusrData[i].data->GetErrorY(j)); - } - } - - // go through all theory bins - for (Int_t j=0; jGetN(); j++) { - // get x and y value - fNonMusrData[i].theory->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.theoryX.push_back(xval); - dump.theory.push_back(yval); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - break; - case PV_FOURIER_IMAG: - break; - case PV_FOURIER_REAL_AND_IMAG: - break; - case PV_FOURIER_PWR: - break; - case PV_FOURIER_PHASE: - break; - default: - break; - } - } - break; - default: - break; + break; + default: + break; } // generate output filename @@ -2043,7 +2042,7 @@ void PMusrCanvas::SaveDataAsciiAndQuit() // open output data-file fout.open(fln.Data(), iostream::out); if (!fout.is_open()) { - cerr << endl << ">> PMusrCanvas::SaveDataAsciiAndQuit: **ERROR** couldn't open file " << fln.Data() << " for writing." << endl; + cerr << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << fln.Data() << " for writing." << endl; return; } @@ -2272,9 +2271,10 @@ void PMusrCanvas::SaveDataAsciiAndQuit() dumpVector.clear(); cout << endl << ">> Data windows saved in ascii format ..." << endl; - - if (fPlotNumber == static_cast(fMsrHandler->GetMsrPlotList()->size()) - 1) - Done(0); + // if (asciiOutput) { + // if (fPlotNumber == static_cast(fMsrHandler->GetMsrPlotList()->size()) - 1) + // Done(0); + // } } //-------------------------------------------------------------------------- @@ -6188,917 +6188,6 @@ void PMusrCanvas::DecrementFourierPhase() } } -//-------------------------------------------------------------------------- -// SaveDataAscii (private) -//-------------------------------------------------------------------------- -/** - *

Saves the currently seen data (data, difference, Fourier spectra, ...) in ascii column format. - */ -void PMusrCanvas::SaveDataAscii() -{ - // collect relevant data - PMusrCanvasAsciiDump dump; - PMusrCanvasAsciiDumpVector dumpVector; - - Int_t xminBin; - Int_t xmaxBin; - Double_t xmin; - Double_t xmax; - Double_t time, freq; - Double_t xval, yval; - - switch (fPlotType) { - case MSR_PLOT_SINGLE_HISTO: - case MSR_PLOT_ASYM: - case MSR_PLOT_MU_MINUS: - if (fDifferenceView) { // difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); - xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get time - time = fData[i].diff->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.dataX.push_back(time); - dump.data.push_back(fData[i].diff->GetBinContent(j)); - dump.dataErr.push_back(fData[i].diff->GetBinError(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL: - // get current x-range - xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_IMAG: - // get current x-range - xminBin = fData[0].diffFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierIm->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL_AND_IMAG: - // get current x-range - xminBin = fData[0].diffFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierRe->GetBinContent(j)); - } - } - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PWR: - // get current x-range - xminBin = fData[0].diffFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierPwr->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PHASE: - // get current x-range - xminBin = fData[0].diffFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].diffFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].diffFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].diffFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].diffFourierPhase->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - default: - break; - } - } else { // not a difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fHistoFrame->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fHistoFrame->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fHistoFrame->GetXaxis()->GetBinCenter(xminBin); - xmax = fHistoFrame->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get time - time = fData[i].data->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.dataX.push_back(time); - dump.data.push_back(fData[i].data->GetBinContent(j)); - dump.dataErr.push_back(fData[i].data->GetBinError(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get time - time = fData[i].theory->GetBinCenter(j); - // check if time is in the current range - if ((time >= xmin) && (time <= xmax)) { - dump.theoryX.push_back(time); - dump.theory.push_back(fData[i].theory->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - // get current x-range - xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_IMAG: - // get current x-range - xminBin = fData[0].dataFourierIm->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierIm->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierIm->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_REAL_AND_IMAG: - // get current x-range - xminBin = fData[0].dataFourierRe->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierRe->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierRe->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierRe->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierRe->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierRe->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - - //----------------------------- - // Im - //----------------------------- - // clean up dump - dump.dataX.clear(); - dump.data.clear(); - dump.dataErr.clear(); - dump.theoryX.clear(); - dump.theory.clear(); - - // go through all data bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierIm->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierIm->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierIm->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - - } - break; - case PV_FOURIER_PWR: - // get current x-range - xminBin = fData[0].dataFourierPwr->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierPwr->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierPwr->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierPwr->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierPwr->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierPwr->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - case PV_FOURIER_PHASE: - // get current x-range - xminBin = fData[0].dataFourierPhase->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fData[0].dataFourierPhase->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xminBin); - xmax = fData[0].dataFourierPhase->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetNbinsX(); j++) { - // get frequency - freq = fData[i].dataFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.dataX.push_back(freq); - dump.data.push_back(fData[i].dataFourierPhase->GetBinContent(j)); - } - } - - // go through all theory bins - for (Int_t j=1; jGetNbinsX(); j++) { - // get frequency - freq = fData[i].theoryFourierPhase->GetBinCenter(j); - // check if time is in the current range - if ((freq >= xmin) && (freq <= xmax)) { - dump.theoryX.push_back(freq); - dump.theory.push_back(fData[i].theoryFourierPhase->GetBinContent(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - break; - default: - break; - } - } - break; - case MSR_PLOT_NON_MUSR: - if (fDifferenceView) { // difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); - xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetN(); j++) { - // get x and y value - fNonMusrData[i].diff->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.dataX.push_back(xval); - dump.data.push_back(yval); - dump.dataErr.push_back(fNonMusrData[i].diff->GetErrorY(j)); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - break; - case PV_FOURIER_IMAG: - break; - case PV_FOURIER_REAL_AND_IMAG: - break; - case PV_FOURIER_PWR: - break; - case PV_FOURIER_PHASE: - break; - default: - break; - } - } else { // not a difference view plot - switch (fCurrentPlotView) { - case PV_DATA: - // get current x-range - xminBin = fMultiGraphData->GetXaxis()->GetFirst(); // first bin of the zoomed range - xmaxBin = fMultiGraphData->GetXaxis()->GetLast(); // last bin of the zoomed range - xmin = fMultiGraphData->GetXaxis()->GetBinCenter(xminBin); - xmax = fMultiGraphData->GetXaxis()->GetBinCenter(xmaxBin); - - // fill ascii dump data - for (UInt_t i=0; iGetN(); j++) { - // get x and y value - fNonMusrData[i].data->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.dataX.push_back(xval); - dump.data.push_back(yval); - dump.dataErr.push_back(fNonMusrData[i].data->GetErrorY(j)); - } - } - - // go through all theory bins - for (Int_t j=0; jGetN(); j++) { - // get x and y value - fNonMusrData[i].theory->GetPoint(j,xval,yval); - // check if time is in the current range - if ((xval >= xmin) && (xval <= xmax)) { - dump.theoryX.push_back(xval); - dump.theory.push_back(yval); - } - } - - // if anything found keep it - if (dump.dataX.size() > 0) - dumpVector.push_back(dump); - } - - break; - case PV_FOURIER_REAL: - break; - case PV_FOURIER_IMAG: - break; - case PV_FOURIER_REAL_AND_IMAG: - break; - case PV_FOURIER_PWR: - break; - case PV_FOURIER_PHASE: - break; - default: - break; - } - } - break; - default: - 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; iGetEntries()-1; i++) { - ostr = dynamic_cast(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); - if (!fout.is_open()) { - cerr << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << fln.Data() << " for writing." << endl; - return; - } - - // find out what is the longest data/theory vector - UInt_t maxDataLength = 0; - UInt_t maxTheoryLength = 0; - for (UInt_t i=0; i 0) - fout << dumpVector[j].dataErr[i] << ", "; - } else { - if (dumpVector[j].dataErr.size() > 0) - fout << ", , , "; - else - fout << ", , "; - } - } - // write last difference entry - if (i 0) - fout << dumpVector[dumpVector.size()-1].dataErr[i]; - } else { - if (dumpVector[dumpVector.size()-1].dataErr.size() > 0) - fout << ", , "; - else - fout << ", "; - } - fout << endl; - } - } else { // no difference view - // write header - switch (fCurrentPlotView) { - case PV_DATA: - fout << "% "; - for (UInt_t i=0; i maxTheoryLength) - maxLength = maxDataLength; - else - maxLength = maxTheoryLength; - - // write data and theory - for (UInt_t i=0; i 0) - fout << dumpVector[j].dataErr[i] << ", "; - } else { - if (dumpVector[j].dataErr.size() > 0) - fout << " , , , "; - else - fout << " , , "; - } - } - // write theory - for (UInt_t j=0; j> Data windows saved in ascii format ..." << endl; -} //-------------------------------------------------------------------------- // IsScaleN0AndBkg (private) diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h index 8e4b79d2..7b44260e 100644 --- a/src/include/PMusrCanvas.h +++ b/src/include/PMusrCanvas.h @@ -229,7 +229,7 @@ class PMusrCanvas : public TObject, public TQObject virtual void LastCanvasClosed(); // SLOT virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat); - virtual void SaveDataAsciiAndQuit(); + virtual void SaveDataAscii(); private: Int_t fTimeout; ///< timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place @@ -330,8 +330,6 @@ class PMusrCanvas : public TObject, public TQObject virtual void IncrementFourierPhase(); virtual void DecrementFourierPhase(); - virtual void SaveDataAscii(); - virtual Bool_t IsScaleN0AndBkg(); virtual UInt_t GetNeededAccuracy(PMsrParamStructure param); diff --git a/src/musrview.cpp b/src/musrview.cpp index 2568bb7c..6e035945 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -340,7 +340,9 @@ int main(int argc, char *argv[]) } if (asciiOutput) { - musrCanvas->SaveDataAsciiAndQuit(); + // save data in batch mode + musrCanvas->SaveDataAscii(); + musrCanvas->Done(0); } // keep musrCanvas objects