improved handling of RRF freq in the msr-file
This commit is contained in:
@ -2942,7 +2942,7 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines)
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(2));
|
||||
str = ostr->GetString();
|
||||
global.SetRRFFreq(dval, str.Data());
|
||||
if (global.GetRRFFreq(str.Data()) == 0.0)
|
||||
if (global.GetRRFFreq(str.Data()) == RRF_FREQ_UNDEF)
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
@ -5890,7 +5890,7 @@ Bool_t PMsrHandler::CheckRRFSettings()
|
||||
Int_t fittype = fGlobal.GetFitType();
|
||||
|
||||
// first set of tests: if RRF parameters are set, check if RRF fit is chosen.
|
||||
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) != 0.0) {
|
||||
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) != RRF_FREQ_UNDEF) {
|
||||
if (fittype != -1) { // check if GLOBAL fittype is set
|
||||
if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) &&
|
||||
(fittype != MSR_FITTYPE_ASYM_RRF)) {
|
||||
@ -5935,7 +5935,7 @@ Bool_t PMsrHandler::CheckRRFSettings()
|
||||
fittype = fGlobal.GetFitType();
|
||||
if ((fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) ||
|
||||
(fittype == MSR_FITTYPE_ASYM_RRF)) { // make sure RRF freq and RRF packing are set
|
||||
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == 0.0) {
|
||||
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == RRF_FREQ_UNDEF) {
|
||||
cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but";
|
||||
cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it.";
|
||||
return false;
|
||||
@ -5959,7 +5959,7 @@ Bool_t PMsrHandler::CheckRRFSettings()
|
||||
cerr << endl << ">> This is currently not supported.";
|
||||
return false;
|
||||
}
|
||||
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == 0.0) {
|
||||
if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == RRF_FREQ_UNDEF) {
|
||||
cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but";
|
||||
cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it.";
|
||||
return false;
|
||||
|
@ -710,7 +710,7 @@ void PRawRunData::SetTempError(const UInt_t idx, const Double_t errTemp)
|
||||
PMsrGlobalBlock::PMsrGlobalBlock()
|
||||
{
|
||||
fGlobalPresent = false;
|
||||
fRRFFreq = 0.0; // rotating reference frequency in units given by fRRFUnitTag. Only needed for fittype 1
|
||||
fRRFFreq = RRF_FREQ_UNDEF; // rotating reference frequency in units given by fRRFUnitTag. Only needed for fittype 1
|
||||
fRRFUnitTag = RRF_UNIT_UNDEF; // RRF unit tag. Default: undefined
|
||||
fRRFPhase = 0.0;
|
||||
fRRFPacking = -1; // undefined RRF packing/rebinning
|
||||
@ -730,7 +730,7 @@ PMsrGlobalBlock::PMsrGlobalBlock()
|
||||
// GetRRFFreq (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> get RRF frequency value in specific units. If units is unknown, 0.0 will be returned.
|
||||
* <p> get RRF frequency value in specific units. If units is unknown, RRF_UNDEF_FREQ will be returned.
|
||||
*
|
||||
* \param unit unit string in which the units shall be given
|
||||
*/
|
||||
@ -747,10 +747,8 @@ Double_t PMsrGlobalBlock::GetRRFFreq(const char *unit)
|
||||
unitTag = RRF_UNIT_Mcs;
|
||||
else if (!unitStr.CompareTo("T", TString::kIgnoreCase))
|
||||
unitTag = RRF_UNIT_T;
|
||||
else {
|
||||
cerr << endl << ">> PMsrGlobalBlock::GetRRFFreq: **ERROR** found undefined RRF unit '" << unit << "'!" << endl;
|
||||
return freq;
|
||||
}
|
||||
else
|
||||
return RRF_FREQ_UNDEF;
|
||||
|
||||
// calc the conversion factor
|
||||
if (unitTag == fRRFUnitTag)
|
||||
|
@ -146,6 +146,8 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it
|
||||
#define RRF_UNIT_G 3
|
||||
#define RRF_UNIT_T 4
|
||||
|
||||
#define RRF_FREQ_UNDEF 1.0e10
|
||||
|
||||
//-------------------------------------------------------------
|
||||
/**
|
||||
* <p>typedef to make to code more readable. Definition of a bool vector.
|
||||
|
Reference in New Issue
Block a user