cosmetic in the musrview legend concerning the units

This commit is contained in:
nemu 2011-05-05 12:34:32 +00:00
parent 2fe5c035e5
commit 89ea4cb63f
3 changed files with 21 additions and 5 deletions

View File

@ -12,6 +12,7 @@ FIXED bug reported in MUSR-183: missing background for 2nd histo in asymmetry fi
FIXED Makefiles so that the NeXus support will not be built if it has not been enabled during the configure stage FIXED Makefiles so that the NeXus support will not be built if it has not been enabled during the configure stage
FIXED ASCII export from musrview in case of a Fourier-Power- or Fourier-Phase-difference plot FIXED ASCII export from musrview in case of a Fourier-Power- or Fourier-Phase-difference plot
FIXED bug in asymmetry fit with fixed background FIXED bug in asymmetry fit with fixed background
CHANGED cosmetics in the musrview legend concerning the units
CHANGED the user-function dependency from libPMusr to libPUserFcnBase CHANGED the user-function dependency from libPMusr to libPUserFcnBase
musrfit 0.9.0 - changes since 0.8.0 musrfit 0.9.0 - changes since 0.8.0

View File

@ -749,8 +749,13 @@ void PMusrCanvas::UpdateInfoPad()
if (dval == PMUSR_UNDEFINED) { if (dval == PMUSR_UNDEFINED) {
tstr += TString("??,"); tstr += TString("??,");
} else { } else {
sprintf(sval, "%0.2lf", dval); if (dval < 1.0e4) { // Gauss makes sense as a unit
tstr += TString(sval) + TString("G,"); sprintf(sval, "%0.2lf", dval);
tstr += TString(sval) + TString("G,");
} else { // Tesla makes sense as a unit
sprintf(sval, "%0.2lf", dval/1.0e4);
tstr += TString(sval) + TString("T,");
}
} }
// energy if present // energy if present
tstr += TString("E="); tstr += TString("E=");
@ -758,8 +763,13 @@ void PMusrCanvas::UpdateInfoPad()
if (dval == PMUSR_UNDEFINED) { if (dval == PMUSR_UNDEFINED) {
tstr += TString("??,"); tstr += TString("??,");
} else { } else {
sprintf(sval, "%0.2lf", dval); if (dval < 1.0e3) { // keV makes sense as a unit
tstr += TString(sval) + TString("keV,"); sprintf(sval, "%0.2lf", dval);
tstr += TString(sval) + TString("keV,");
} else { // MeV makes sense as a unit
sprintf(sval, "%0.2lf", dval/1.0e3);
tstr += TString(sval) + TString("MeV,");
}
} }
// setup if present // setup if present
tstr += fRunList->GetSetup(*runs[runNo].GetRunName()); tstr += fRunList->GetSetup(*runs[runNo].GetRunName());

View File

@ -1679,9 +1679,14 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
runData.SetEnergy(PMUSR_UNDEFINED); runData.SetEnergy(PMUSR_UNDEFINED);
runData.SetTransport(PMUSR_UNDEFINED); runData.SetTransport(PMUSR_UNDEFINED);
// get field // get field
Double_t scale = 0.0;
if (psiBin.get_field().find("G"));
scale = 1.0;
if (psiBin.get_field().find("T"));
scale = 1.0e4;
status = sscanf(psiBin.get_field().c_str(), "%lfG", &dval); status = sscanf(psiBin.get_field().c_str(), "%lfG", &dval);
if (status == 1) if (status == 1)
runData.SetField(dval); runData.SetField(scale*dval);
// get temperature // get temperature
PDoubleVector tempVec(psiBin.get_temperatures_vector()); PDoubleVector tempVec(psiBin.get_temperatures_vector());
PDoubleVector tempDevVec(psiBin.get_devTemperatures_vector()); PDoubleVector tempDevVec(psiBin.get_devTemperatures_vector());