FIXED wrong asymmetry fit plotting if data range is not provided (MUSR-203). Added units to run duration in TPsiRunHeader

This commit is contained in:
nemu 2011-09-09 06:37:22 +00:00
parent fc31214dec
commit 7cedf2eb14
3 changed files with 18 additions and 11 deletions

View File

@ -16,6 +16,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 wrong asymmetry fit plotting if data range is not provided (MUSR-203)
FIXED broken run-list interface to msr2data in musredit/musrgui (MUSR-202) FIXED broken run-list interface to msr2data in musredit/musrgui (MUSR-202)
FIXED some severe issues in the run-number-digit determination of msr2data introduced in late 2010 FIXED some severe issues in the run-number-digit determination of msr2data introduced in late 2010
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 musrview exception error when starting with t0's very much off to the positive side in the msr-file (MUSR-199)

View File

@ -1066,13 +1066,19 @@ Bool_t PRunAsymmetry::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2])
Int_t offset = (Int_t)(10.0e-3/fTimeResolution); // needed in case first good bin is not given, default = 10ns Int_t offset = (Int_t)(10.0e-3/fTimeResolution); // needed in case first good bin is not given, default = 10ns
// check if data range has been provided, and if not try to estimate them // check if data range has been provided, and if not try to estimate them
if (fRunInfo->GetDataRange(0) < 0) { if (fRunInfo->GetDataRange(0) < 0) {
start[0] = (static_cast<Int_t>(t0[0])+offset) - ((static_cast<Int_t>(t0[0])+offset)/packing)*packing; Int_t diff = offset;
cerr << endl << ">> PRunAsymmetry::PrepareViewData(): **WARNING** data range (forward) was not provided, will try data range start = " << start[0] << ".";
cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; // calculate start position for plotting
cerr << endl; Int_t val = static_cast<Int_t>(t0[1])+diff-packing*((static_cast<Int_t>(t0[1])+diff)/packing);
} else if (fRunInfo->GetDataRange(2) < 0) { do {
start[1] = (static_cast<Int_t>(t0[1])+offset) - ((static_cast<Int_t>(t0[1])+offset)/packing)*packing; if (static_cast<Double_t>(val)+t0[1]-t0[0] < 0.0)
cerr << endl << ">> PRunAsymmetry::PrepareViewData(): **WARNING** data range (backward) was not provided, will try data range start = " << start[1] << "."; val += packing;
} while (static_cast<Double_t>(val) + t0[1] - t0[0] < 0.0);
start[0] = val;
start[1] = val + static_cast<Int_t>(t0[1] - t0[0]);
cerr << endl << ">> PRunAsymmetry::PrepareViewData(): **WARNING** data range (forward/backward) not provided, will try data range start = t0_f/b+10ns.";
cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE.";
cerr << endl; cerr << endl;
} else { } else {

View File

@ -641,7 +641,7 @@ TObjArray* TPsiRunHeader::GetHeader(UInt_t &count)
fHeader.AddLast(tostr); fHeader.AddLast(tostr);
// add run duration // add run duration
str.Form("%03d - Run Duration: %d", count++, GetRunDuration()); str.Form("%03d - Run Duration: %d sec", count++, GetRunDuration());
tostr = new TObjString(str); tostr = new TObjString(str);
fHeader.AddLast(tostr); fHeader.AddLast(tostr);
@ -1021,12 +1021,12 @@ Bool_t TPsiRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString pa
} else if (str.Contains("- Run Number: ")) { } else if (str.Contains("- Run Number: ")) {
tokens = str.Tokenize(":"); tokens = str.Tokenize(":");
if (tokens->GetEntries() < 2) { if (tokens->GetEntries() < 2) {
cerr << endl << ">> TPsiRunHeader::ExtractHeaderInformation(..) **ERROR** " << str.Data() << " couldn't tokenize it." << endl << endl; cerr << endl << ">> TPsiRunHeader::ExtractHeaderInformation(..) **ERROR** '" << str.Data() << "' couldn't tokenize it." << endl << endl;
return false; return false;
} }
ostr = dynamic_cast<TObjString*>(tokens->At(1)); ostr = dynamic_cast<TObjString*>(tokens->At(1));
if (!ostr->GetString().IsDigit()) { if (!ostr->GetString().IsDigit()) {
cerr << endl << ">> TPsiRunHeader::ExtractHeaderInformation(..) **ERROR** " << str.Data() << " doesn't contain a valid run number" << endl << endl; cerr << endl << ">> TPsiRunHeader::ExtractHeaderInformation(..) **ERROR** '" << str.Data() << "' doesn't contain a valid run number" << endl << endl;
return false; return false;
} }
fRunNumber = ostr->GetString().Atoi(); fRunNumber = ostr->GetString().Atoi();
@ -1550,7 +1550,7 @@ void TPsiRunHeader::DumpHeader() const
cout << endl << setw(name_width) << left << "Run Stop Time" << setw(old_width) << ": " << GetStopTimeString(); cout << endl << setw(name_width) << left << "Run Stop Time" << setw(old_width) << ": " << GetStopTimeString();
// write run duration // write run duration
cout << endl << setw(name_width) << left << "Run Duration" << setw(old_width) << ": " << GetRunDuration(); cout << endl << setw(name_width) << left << "Run Duration" << setw(old_width) << ": " << GetRunDuration() << " sec";
// write laboratory // write laboratory
cout << endl << setw(name_width) << left << "Laboratory" << setw(old_width) << ": " << GetLaboratory().Data(); cout << endl << setw(name_width) << left << "Laboratory" << setw(old_width) << ": " << GetLaboratory().Data();