Deal with missing alpha line for beta-NMR.

This commit is contained in:
salman 2018-08-24 17:42:23 +02:00
parent c66849e133
commit 22141ae98d
2 changed files with 21 additions and 22 deletions

View File

@ -5881,12 +5881,12 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity()
break; break;
case PRUN_ASYMMETRY_BNMR: case PRUN_ASYMMETRY_BNMR:
// check alpha // check alpha
if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) { // if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; // cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;
cerr << endl << ">> alpha parameter number missing which is needed for an asymmetry fit."; // cerr << endl << ">> alpha parameter number missing which is needed for an asymmetry fit.";
cerr << endl << ">> Consider to check the manual ;-)" << endl; // cerr << endl << ">> Consider to check the manual ;-)" << endl;
return false; // return false;
} // }
// check that there is a forward parameter number // check that there is a forward parameter number
if (fRuns[i].GetForwardHistoNo() == -1) { if (fRuns[i].GetForwardHistoNo() == -1) {
cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1;

View File

@ -105,25 +105,24 @@ PRunAsymmetryBNMR::PRunAsymmetryBNMR(PMsrHandler *msrInfo, PRunDataHandler *rawD
PMsrParamList *param = msrInfo->GetMsrParamList(); PMsrParamList *param = msrInfo->GetMsrParamList();
// check if alpha is given // check if alpha is given
Bool_t alphaFixedToOne = false;
if (fRunInfo->GetAlphaParamNo() == -1) { // no alpha given if (fRunInfo->GetAlphaParamNo() == -1) { // no alpha given
cerr << endl << ">> PRunAsymmetryBNMR::PRunAsymmetryBNMR(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!"; // cerr << endl << ">> PRunAsymmetryBNMR::PRunAsymmetryBNMR(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!";
cerr << endl; // cerr << endl;
fValid = false; // fValid = false;
return; // return;
} alphaFixedToOne = true;
// check if alpha parameter is within proper bounds } else if ((fRunInfo->GetAlphaParamNo() < 0) || (fRunInfo->GetAlphaParamNo() > (Int_t)param->size())) { // check if alpha parameter is within proper bounds
if ((fRunInfo->GetAlphaParamNo() < 0) || (fRunInfo->GetAlphaParamNo() > (Int_t)param->size())) {
cerr << endl << ">> PRunAsymmetryBNMR::PRunAsymmetryBNMR(): **ERROR** alpha parameter no = " << fRunInfo->GetAlphaParamNo(); cerr << endl << ">> PRunAsymmetryBNMR::PRunAsymmetryBNMR(): **ERROR** alpha parameter no = " << fRunInfo->GetAlphaParamNo();
cerr << endl << ">> This is out of bound, since there are only " << param->size() << " parameters."; cerr << endl << ">> This is out of bound, since there are only " << param->size() << " parameters.";
cerr << endl; cerr << endl;
fValid = false; fValid = false;
return; return;
} } else { // check if alpha is fixed
// check if alpha is fixed
Bool_t alphaFixedToOne = false;
if (((*param)[fRunInfo->GetAlphaParamNo()-1].fStep == 0.0) && if (((*param)[fRunInfo->GetAlphaParamNo()-1].fStep == 0.0) &&
((*param)[fRunInfo->GetAlphaParamNo()-1].fValue == 1.0)) ((*param)[fRunInfo->GetAlphaParamNo()-1].fValue == 1.0))
alphaFixedToOne = true; alphaFixedToOne = true;
}
// check if beta is given // check if beta is given
Bool_t betaFixedToOne = false; Bool_t betaFixedToOne = false;
@ -222,18 +221,18 @@ Double_t PRunAsymmetryBNMR::CalcChiSquare(const std::vector<Double_t>& par)
break; break;
case 2: // alpha != 1, beta == 1 case 2: // alpha != 1, beta == 1
a = par[fRunInfo->GetAlphaParamNo()-1]; a = par[fRunInfo->GetAlphaParamNo()-1];
f = fTheory->Func(time, par, fFuncValues)/2; f = fTheory->Func(time, par, fFuncValues)/2.0;
asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0)) - (-f*(a+1.0)-(a-1.0))/((a+1.0)+f*(a-1.0)); asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0)) - (-f*(a+1.0)-(a-1.0))/((a+1.0)+f*(a-1.0));
break; break;
case 3: // alpha == 1, beta != 1 case 3: // alpha == 1, beta != 1
b = par[fRunInfo->GetBetaParamNo()-1]; b = par[fRunInfo->GetBetaParamNo()-1];
f = fTheory->Func(time, par, fFuncValues)/2; f = fTheory->Func(time, par, fFuncValues)/2.0;
asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0))-f*(b+1.0)/(2.0+f*(b-1.0)); asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0))-f*(b+1.0)/(2.0+f*(b-1.0));
break; break;
case 4: // alpha != 1, beta != 1 case 4: // alpha != 1, beta != 1
a = par[fRunInfo->GetAlphaParamNo()-1]; a = par[fRunInfo->GetAlphaParamNo()-1];
b = par[fRunInfo->GetBetaParamNo()-1]; b = par[fRunInfo->GetBetaParamNo()-1];
f = fTheory->Func(time, par, fFuncValues)/2; f = fTheory->Func(time, par, fFuncValues)/2.0;
asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0))-(-f*(a*b+1.0)-(a-1.0))/((a+1.0)+f*(a*b-1.0)); asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0))-(-f*(a*b+1.0)-(a-1.0))/((a+1.0)+f*(a*b-1.0));
break; break;
default: default: