a musrview exception error when starting with t0's very much off to the positive side in the msr-file (MUSR-199)

This commit is contained in:
nemu 2011-07-12 07:17:38 +00:00
parent 822a0bf0b7
commit d0f520a1f4
2 changed files with 94 additions and 6 deletions

View File

@ -13,6 +13,7 @@ NEW the chi^2 calculation in single-histogram and asymmetry fits is parallelized
if musrfit is built using a compiler supporting OpenMP (e.g. GCC >= 4.2) if musrfit is built using a compiler supporting OpenMP (e.g. GCC >= 4.2)
Using --disable-omp this feature can be disabled on the configure level. Using --disable-omp this feature can be disabled on the configure level.
NEW any2many: force the user to define the exact NeXus ouput format (HDF4,HDF5,XML) NEW any2many: force the user to define the exact NeXus ouput format (HDF4,HDF5,XML)
FIXED a musrview exception error when starting with t0's very much off to the positive side in the msr-file (MUSR-199)
FIXED a linking problem when only shared libraries are built on Cygwin FIXED a linking problem when only shared libraries are built on Cygwin
FIXED the problem that in certain environments XML files could not be parsed (MUSR-122) FIXED the problem that in certain environments XML files could not be parsed (MUSR-122)
FIXED crash of musrview in case the XML startup file is present but cannot be parsed correctly FIXED crash of musrview in case the XML startup file is present but cannot be parsed correctly

View File

@ -1825,14 +1825,56 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
// check if 'use_fit_range' plotting is whished // check if 'use_fit_range' plotting is whished
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) {
startBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetDataTimeStep()); Double_t dval = (fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetDataTimeStep();
endBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1) - data->GetDataTimeStart())/data->GetDataTimeStep()); if (dval < 0.0) { // make sure that startBin >= 0
startBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that startBin <= length of data vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',";
cerr << endl << ">> will set it to data vector size" << endl << endl;
startBin = data->GetValue()->size();
} else {
startBin = (UInt_t)dval;
}
dval = (fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1) - data->GetDataTimeStart())/data->GetDataTimeStep();
if (dval < 0.0) { // make sure that endBin >= 0
endBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that endBin <= length of data vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',";
cerr << endl << ">> will set it to data vector size" << endl << endl;
endBin = data->GetValue()->size();
} else {
endBin = (UInt_t)dval;
}
} }
// check if 'sub_ranges' plotting is whished // check if 'sub_ranges' plotting is whished
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) { if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) {
startBin = (UInt_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep()); Double_t dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep();
endBin = (UInt_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep()); if (dval < 0.0) { // make sure that startBin >= 0
startBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that startBin <= length of data vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',";
cerr << endl << ">> will set it to data vector size" << endl << endl;
startBin = data->GetValue()->size();
} else {
startBin = (UInt_t)dval;
}
dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep();
if (dval < 0.0) { // make sure that endBin >= 0
endBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that endtBin <= length of data vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',";
cerr << endl << ">> will set it to data vector size" << endl << endl;
endBin = data->GetValue()->size();
} else {
endBin = (UInt_t)dval;
}
} }
for (UInt_t i=startBin; i<endBin; i++) { for (UInt_t i=startBin; i<endBin; i++) {
@ -1901,14 +1943,59 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data)
// check if 'use_fit_range' plotting is whished // check if 'use_fit_range' plotting is whished
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) { if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fUseFitRanges) {
startBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetTheoryTimeStep()); Double_t dval = (fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(0) - data->GetDataTimeStart())/data->GetTheoryTimeStep();
endBin = (UInt_t)((fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1) - data->GetDataTimeStart())/data->GetTheoryTimeStep()); if (dval < 0.0) { // make sure that startBin >= 0
startBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that startBin <= length of theory vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',";
cerr << endl << ">> will set it to theory vector size" << endl << endl;
startBin = data->GetTheory()->size();
} else {
startBin = (UInt_t)dval;
}
dval = (fMsrHandler->GetMsrRunList()->at(runNo).GetFitRange(1) - data->GetDataTimeStart())/data->GetTheoryTimeStep();
if (dval < 0.0) { // make sure that endBin >= 0
endBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that endBin <= length of theory vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',";
cerr << endl << ">> will set it to theory vector size" << endl << endl;
endBin = data->GetTheory()->size();
} else {
endBin = (UInt_t)dval;
}
} }
// check if 'sub_ranges' plotting is whished // check if 'sub_ranges' plotting is whished
if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) { if (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin.size() > 1) {
startBin = (UInt_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep()); startBin = (UInt_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep());
endBin = (UInt_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep()); endBin = (UInt_t)((fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep());
Double_t dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep();
if (dval < 0.0) { // make sure that startBin >= 0
startBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that startBin <= length of theory vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',";
cerr << endl << ">> will set it to theory vector size" << endl << endl;
startBin = data->GetTheory()->size();
} else {
startBin = (UInt_t)dval;
}
dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep();
if (dval < 0.0) { // make sure that endBin >= 0
endBin = 0;
cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl;
} else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that endtBin <= length of theory vector
cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',";
cerr << endl << ">> will set it to theory vector size" << endl << endl;
endBin = data->GetTheory()->size();
} else {
endBin = (UInt_t)dval;
}
} }
for (UInt_t i=startBin; i<endBin; i++) { for (UInt_t i=startBin; i<endBin; i++) {