Merge branch 'master' into root6

This commit is contained in:
nemu
2015-09-08 14:08:37 +02:00
4 changed files with 115 additions and 3 deletions

View File

@ -5,7 +5,10 @@
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
NEW 2015-02-21 add proper Mac icon to musredit
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.
FIXED 2015-06-30 changed setf/unsetf bug (PMsr2Data.cpp)
FIXED 2015-05-15 another path check for HDF5 with ubuntu 15.04
FIXED 2015-03-16 some minor correction for ASCII export in any2many

View File

@ -1089,6 +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);
neededPrec = LastSignificant(fFourier.fPlotRange[0]);
if (LastSignificant(fFourier.fPlotRange[1]) > neededPrec)
neededPrec = LastSignificant(fFourier.fPlotRange[1]);
fout.precision(neededPrec+1);
fout << "range " << fFourier.fPlotRange[0] << " " << fFourier.fPlotRange[1] << endl;
} else {
fout << str.Data() << endl;
@ -1971,6 +1976,11 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map<UInt_t, TString> *co
// range
if ((fFourier.fPlotRange[0] != -1.0) || (fFourier.fPlotRange[1] != -1.0)) {
fout.unsetf(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 << "range " << fFourier.fPlotRange[0] << " " << fFourier.fPlotRange[1] << endl;
}

View File

@ -861,7 +861,7 @@ Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t hi
if (fScaleN0AndBkg) {
dataNorm = 1.0/ (packing * (fTimeResolution * 1.0e3)); // fTimeResolution us->ns
} else if (!fScaleN0AndBkg && (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0)) {
theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)packing;
theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)fPacking;
}
// raw data, since PMusrCanvas is doing ranging etc.
@ -1052,7 +1052,7 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
if (fScaleN0AndBkg) {
dataNorm = 1.0/ (packing * (fTimeResolution * 1.0e3)); // fTimeResolution us->ns
} else if (!fScaleN0AndBkg && (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0)) {
theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)packing;
theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)fPacking;
}
// transform raw histo data. This is done the following way (for details see the manual):

View File

@ -0,0 +1,99 @@
// in order to illustrate the c++ io stream formatting
// usage: 1) start root
// 2) root 5.34.x -> .L iotests.C // root 6.x.y -> .L iotests.C+
// 3) iotests()
#include <iostream>
using namespace std;
void dump_ioflags(const ios_base::fmtflags flags)
{
cout << endl << ">> flags decoded:" << endl;
if (flags & ios_base::boolalpha)
cout << ">> read/write bool elements as alphabetic strings (true and false)." << endl;
if (flags & ios_base::showbase)
cout << ">> write integral values preceded by their corresponding numeric base prefix." << endl;
if (flags & ios_base::showpoint)
cout << ">> write floating-point values including always the decimal point." << endl;
if (flags & ios_base::showpos)
cout << ">> write non-negative numerical values preceded by a plus sign (+)." << endl;
if (flags & ios_base::skipws)
cout << ">> skip leading whitespaces on certain input operations." << endl;
if (flags & ios_base::unitbuf)
cout << ">> flush output after each inserting operation." << endl;
if (flags & ios_base::uppercase)
cout << ">> write uppercase letters replacing lowercase letters in certain insertion operations." << endl;
if (flags & ios_base::dec)
cout << ">> read/write integral values using decimal base format." << endl;
if (flags & ios_base::hex)
cout << ">> read/write integral values using hexadecimal base format." << endl;
if (flags & ios_base::oct)
cout << ">> read/write integral values using octal base format." << endl;
if (flags & ios_base::fixed)
cout << ">> write floating point values in fixed-point notation." << endl;
if (flags & ios_base::scientific)
cout << ">> write floating-point values in scientific notation." << endl;
if (flags & ios_base::internal)
cout << ">> the output is padded to the field width by inserting fill characters at a specified internal point." << endl;
if (flags & ios_base::left)
cout << ">> the output is padded to the field width appending fill characters at the end." << endl;
if (flags & ios_base::right)
cout << ">> the output is padded to the field width by inserting fill characters at the beginning." << endl;
cout << "---" << endl;
}
void iotests()
{
Double_t dval = 13.24;
// default settings printout
cout << "default flags = " << cout.flags() << ":" << endl;
dump_ioflags(cout.flags());
cout << "dval = " << dval << endl;
cout << "++++" << endl << endl;
// printout of the 'floatfield' flags
cout << "ios_base::floatfield :" << ios_base::floatfield << endl;
dump_ioflags(ios_base::floatfield);
cout << "set floatfield flags." << endl;
cout.setf(ios_base::floatfield);
cout << "dval = " << dval << endl;
cout << "++++" << endl << endl;
// unset 'floatfield' flags in order to see if the default is recovered
cout.unsetf(ios::floatfield);
cout << "cout.unsetf(ios::floatfield) -> cout.flags()=" << cout.flags() << endl;
dump_ioflags(cout.flags());
cout << "dval = " << dval << endl;
cout << "++++" << endl << endl;
// set 'fixed' flag
cout.setf(ios_base::fixed);
cout << "cout.setf(ios_base::fixed) -> cout.flags()=" << cout.flags() << endl;
dump_ioflags(cout.flags());
cout << "dval = " << dval << endl;
cout << "++++" << endl << endl;
// unset 'fixed' flag and set 'scientific' instead
cout.unsetf(ios_base::fixed);
cout << "cout.unsetf(ios_base::fixed)" << endl;
cout.setf(ios_base::scientific);
cout << "cout.setf(ios_base::scientific) -> cout.flags()=" << cout.flags() << endl;
dump_ioflags(cout.flags());
cout << "dval = " << dval << endl;
cout << "++++" << endl << endl;
// precision playground according to http://www.cplusplus.com/reference/ios/ios_base/precision/
cout << "precision playground according to http://www.cplusplus.com/reference/ios/ios_base/precision/" << endl;
Double_t f = 3.14159;
cout.unsetf ( ios::floatfield ); // floatfield not set
cout << "cout.unsetf ( ios::floatfield ) -> cout.flags()=" << cout.flags() << endl;
dump_ioflags(cout.flags());
cout.precision(5);
cout << "set cout.precision(5)" << endl;
cout << f << endl;
cout.precision(10);
cout << "set cout.precision(10)" << endl;
cout << f << endl;
cout.setf( ios::fixed, ios::floatfield ); // floatfield set to fixed
cout << "cout.setf( ios::fixed, ios::floatfield ) -> cout.flags()=" << cout.flags() << endl;
dump_ioflags(cout.flags());
cout << f << endl;
cout << "++++" << endl << endl;
}