added fit type selector for DKS
This commit is contained in:
parent
aedacbcd34
commit
bdd8c16650
@ -186,6 +186,7 @@ void PFitterFcnDKS::CalcExpectedChiSquare(const std::vector<Double_t> &par, Doub
|
||||
void PFitterFcnDKS::InitDKS(const UInt_t dksTag)
|
||||
{
|
||||
Int_t ierr = 0;
|
||||
Int_t fitType = FITTYPE_UNDEFINED;
|
||||
|
||||
// if any device was allocated before, free the device resources
|
||||
FreeDKS();
|
||||
@ -281,6 +282,8 @@ void PFitterFcnDKS::InitDKS(const UInt_t dksTag)
|
||||
}
|
||||
fDKS.writeData<double>(fMemDataSingleHisto[i], &runData->GetValue()->at(startTimeBin), minSize);
|
||||
}
|
||||
if (fRunListCollection->GetNoOfSingleHisto() > 0)
|
||||
fitType = FITTYPE_SINGLE_HISTO;
|
||||
|
||||
// asymmetry
|
||||
fMemDataAsymmetry.resize(fRunListCollection->GetNoOfAsymmetry());
|
||||
@ -309,6 +312,15 @@ void PFitterFcnDKS::InitDKS(const UInt_t dksTag)
|
||||
fDKS.writeData<double>(fMemDataAsymmetry[i], &runData->GetValue()->at(startTimeBin), minSize);
|
||||
fDKS.writeData<double>(fMemDataAsymmetryErr[i], &runData->GetError()->at(startTimeBin), minSize);
|
||||
}
|
||||
if (fRunListCollection->GetNoOfAsymmetry() > 0) {
|
||||
if (fitType == FITTYPE_UNDEFINED) {
|
||||
fitType = FITTYPE_ASYMMETRY;
|
||||
} else {
|
||||
cerr << ">>PFitterFcnDKS::InitDKS: **ERROR** mixed fit types found. This is currently not supported!" << endl;
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// set the function string and compile the program
|
||||
ierr = fDKS.callCompileProgram(fTheoStr, !fUseChi2);
|
||||
@ -319,7 +331,7 @@ void PFitterFcnDKS::InitDKS(const UInt_t dksTag)
|
||||
}
|
||||
|
||||
// checks device properties if openCL
|
||||
ierr = fDKS.checkMuSRKernels();
|
||||
ierr = fDKS.checkMuSRKernels(fitType);
|
||||
if (ierr != 0) {
|
||||
cerr << ">> PFitterFcnDKS::InitDKS: **ERROR** muSR kernel checks failed!" << endl;
|
||||
fValid = false;
|
||||
|
@ -36,11 +36,6 @@
|
||||
#include "DKSBaseMuSR.h"
|
||||
#include "PRunListCollection.h"
|
||||
|
||||
#define FITTYPE_UNDEFINED 0
|
||||
#define FITTYPE_SINGLE_HISTO 1
|
||||
#define FITTYPE_ASYMMETRY 2
|
||||
#define FITTYPE_MU_MINUS 3
|
||||
|
||||
typedef struct {
|
||||
UInt_t fN0; ///< N0 parameter index
|
||||
UInt_t fNbkg; ///< Nbkg parameter index
|
||||
|
Loading…
x
Reference in New Issue
Block a user