From 24bc2cbb0be5cfc9d6b7c10c3022b6b46b7e75a4 Mon Sep 17 00:00:00 2001 From: Suter Andreas Date: Tue, 8 Sep 2015 15:50:06 +0200 Subject: [PATCH 1/2] hopefully final fix for the FOURIER range output. --- src/classes/PMsrHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index afac766b..67c59201 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -1089,11 +1089,11 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) } else if (sstr.BeginsWith("range_for_phase_correction")) { fout << "range_for_phase_correction " << fFourier.fRangeForPhaseCorrection[0] << " " << fFourier.fRangeForPhaseCorrection[1] << endl; } else if (sstr.BeginsWith("range ")) { - fout.unsetf(ios::floatfield); + fout.setf(ios::fixed,ios::floatfield); neededPrec = LastSignificant(fFourier.fPlotRange[0]); if (LastSignificant(fFourier.fPlotRange[1]) > neededPrec) neededPrec = LastSignificant(fFourier.fPlotRange[1]); - fout.precision(neededPrec+1); + fout.precision(neededPrec); fout << "range " << fFourier.fPlotRange[0] << " " << fFourier.fPlotRange[1] << endl; } else { fout << str.Data() << endl; @@ -1976,11 +1976,11 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co // range if ((fFourier.fPlotRange[0] != -1.0) || (fFourier.fPlotRange[1] != -1.0)) { - fout.unsetf(ios::floatfield); + fout.setf(ios::fixed,ios::floatfield); UInt_t neededPrec = LastSignificant(fFourier.fPlotRange[0]); if (LastSignificant(fFourier.fPlotRange[1]) > neededPrec) neededPrec = LastSignificant(fFourier.fPlotRange[1]); - fout.precision(neededPrec+1); + fout.precision(neededPrec); fout << "range " << fFourier.fPlotRange[0] << " " << fFourier.fPlotRange[1] << endl; } From 6c0a266e6a4a2f892c426fe8486a4fe8c50332c5 Mon Sep 17 00:00:00 2001 From: Suter Andreas Date: Mon, 14 Sep 2015 09:44:49 +0200 Subject: [PATCH 2/2] any2many export of MusrRoot crashed when first histo group was != 0. This happend when exporting to PSI-BIN or WKM. This is fixed now. --- ChangeLog | 2 ++ src/classes/PRunDataHandler.cpp | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d19ff69..37f7c0cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ changes since 0.14.0 =================================== NEW 2015-02-23 implemented an average-per-data-set option for musrFT. NEW 2015-02-21 add proper Mac icon to musredit +FIXED 2015-09-14 any2many export of MusrRoot crashed when first histo group was != 0. + This happend when exporting to PSI-BIN or WKM. This is fixed now. FIXED 2015-09-08 fixed error in view_packing for single histo (wrong norm of the theory). FIXED 2015-09-04 minor change in Fourier-block output (PMsrHandler::WriteMsrLogFile and PMsrHandler::WriteMsrLogFile) to avoid truncated range labels. diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index 3cd13218..bebc1cf0 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -1744,7 +1744,7 @@ Bool_t PRunDataHandler::ReadRootFile() for (UInt_t i=0; igroupHistoList.size(); i++) { found = false; for (UInt_t j=0; jgroupHistoList[i] == ivec[i]) + if (fAny2ManyInfo->groupHistoList[i] == ivec[j]) found = true; } if (!found) { @@ -5084,7 +5084,11 @@ Bool_t PRunDataHandler::WriteWkmFile(TString fln) if (lem_wkm_style) cout << endl << "TOF(M3S1): nocut"; cout << endl << "Groups: " << fData[0].GetNoOfHistos(); - cout << endl << "Channels: " << static_cast(fData[0].GetDataBin(1)->size()/fAny2ManyInfo->rebin); + UInt_t histo0 = 1; + if (fAny2ManyInfo->groupHistoList.size() != 0) { // red/green list found + histo0 = fAny2ManyInfo->groupHistoList[0]+1; // take the first available red/green entry + } + cout << endl << "Channels: " << static_cast(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin); cout.precision(10); cout << endl << "Resolution: " << fData[0].GetTimeResolution()*fAny2ManyInfo->rebin/1.0e3; // ns->us cout.setf(ios::fixed,ios::floatfield); // floatfield set to fixed @@ -5173,7 +5177,11 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) // run number psibin.put_runNumber_int(fData[0].GetRunNumber()); // length of histograms - psibin.put_histoLength_bin((int)(fData[0].GetDataBin(1)->size()/fAny2ManyInfo->rebin)); + UInt_t histo0 = 1; + if (fAny2ManyInfo->groupHistoList.size() != 0) { // red/green list found + histo0 = fAny2ManyInfo->groupHistoList[0]+1; // take the first available red/green entry + } + psibin.put_histoLength_bin((int)(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin)); // number of histograms psibin.put_numberHisto_int((int)fData[0].GetNoOfHistos()); // run title = sample (10 char) / temp (10 char) / field (10 char) / orientation (10 char)