musrfit/src/include/PFitterFcnDKS.h
Andreas Suter c64c74dbf8 modernized code to C++11 and newer.
This allows to analyze the code by external code analyzers. Since a lot is adopted,
the version is changed to 1.4.3

Conflicts:
	src/classes/PFitter.cpp
	src/classes/PFourier.cpp
	src/classes/PMsrHandler.cpp
	src/classes/PMusrCanvas.cpp
	src/classes/PRunAsymmetry.cpp
	src/classes/PRunAsymmetryRRF.cpp
	src/classes/PRunListCollection.cpp
	src/classes/PRunSingleHisto.cpp
	src/classes/PRunSingleHistoRRF.cpp
	src/classes/PStartupHandler.cpp
	src/include/PFourier.h
	src/include/PRunListCollection.h
	src/musrFT.cpp
2019-04-24 17:44:58 +02:00

86 lines
4.3 KiB
C++

/***************************************************************************
PFitterFcnDKS.h
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2016 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _PFITTERFCNDKS_H_
#define _PFITTERFCNDKS_H_
#include <vector>
#include <string>
#include "Minuit2/FCNBase.h"
#include "DKSBaseMuSR.h"
#include "PRunListCollection.h"
typedef struct {
UInt_t fN0; ///< N0 parameter index
UInt_t fNbkg; ///< Nbkg parameter index
} PNidx;
/**
* <p>This is the minuit2 interface function class providing the function to be optimized (chisq or log max-likelihood).
*/
class PFitterFcnDKS : public ROOT::Minuit2::FCNBase
{
public:
PFitterFcnDKS(PRunListCollection *runList, const Bool_t useChi2, const UInt_t dksTag, const std::string theo);
virtual ~PFitterFcnDKS();
virtual Bool_t IsValid() { return fValid; }
virtual Double_t Up() const { return fUp; }
virtual Double_t operator()(const std::vector<Double_t> &par) const;
virtual UInt_t GetTotalNoOfFittedBins() { return fRunListCollection->GetTotalNoOfBinsFitted(); }
virtual UInt_t GetNoOfFittedBins(const UInt_t idx) { return fRunListCollection->GetNoOfBinsFitted(idx); }
virtual void CalcExpectedChiSquare(const std::vector<Double_t> &par, Double_t &totalExpectedChisq, std::vector<Double_t> &expectedChisqPerRun);
virtual int GetDeviceName(std::string &devName);
private:
Bool_t fValid; ///< flag needed to ensure a valid state
std::string fTheoStr; ///< theory string for DKS compilation
Double_t fUp; ///< for chisq == 1.0, i.e. errors are 1 std. deviation errors. for log max-likelihood == 0.5, i.e. errors are 1 std. deviation errors (for details see the minuit2 user manual).
Bool_t fUseChi2; ///< true = chisq fit, false = log max-likelihood fit
PRunListCollection *fRunListCollection; ///< pre-processed data to be fitted
mutable DKSBaseMuSR fDKS;
std::vector<void *> fMemDataSingleHisto; ///< vector holding the initial addresses of the single histo data sets on the GPU
std::vector<void *> fMemDataSingleHistoErr; ///< vector holding the initial addresses of the single histo error sets on the GPU
std::vector<void *> fMemDataAsymmetry; ///< vector holding the initial addresses of the asymmetry data sets on the GPU
std::vector<void *> fMemDataAsymmetryErr; ///< vector holding the initial addresses of the asymmetry error sets on the GPU
std::vector<void *> fMemDataMuMinus; ///< vector holding the initial addresses of the mu minus data sets on the GPU
std::vector<void *> fMemDataMuMinusErr; ///< vector holding the initial addresses of the mu minus error sets on the GPU
std::vector<PNidx> fNidx; ///< N0 / Nbkg parameter index vector
virtual void InitDKS(const UInt_t dksTag);
virtual void FreeDKS();
};
#endif // _PFITTERFCNDKS_H_