added the class PFitterFcnDKS which eventually will handle the DKS/GPU binding. Currently it is without real functionality
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "PMsrHandler.h"
|
||||
#include "PRunListCollection.h"
|
||||
#include "PFitterFcn.h"
|
||||
#include "PFitterFcnDKS.h"
|
||||
|
||||
#define PMN_INTERACTIVE 0
|
||||
#define PMN_CONTOURS 1
|
||||
@@ -74,6 +75,7 @@ class PFitter
|
||||
Bool_t DoFit();
|
||||
|
||||
private:
|
||||
Bool_t fDKSReady; ///< flag. true: fit via DKS/GPU. false: fit on CPU
|
||||
Bool_t fIsValid; ///< flag. true: the fit is valid.
|
||||
Bool_t fIsScanOnly; ///< flag. true: scan along some parameters (no fitting).
|
||||
Bool_t fConverged; ///< flag. true: the fit has converged.
|
||||
@@ -92,6 +94,7 @@ class PFitter
|
||||
PIntPairVector fCmdList; ///< command list, first=cmd, second=cmd line index
|
||||
|
||||
PFitterFcn *fFitterFcn; ///< pointer to the fitter function object
|
||||
PFitterFcnDKS *fFitterFcnDKS; ///< pointer to the DKS fitter function object
|
||||
|
||||
ROOT::Minuit2::MnUserParameters fMnUserParams; ///< minuit2 input parameter list
|
||||
ROOT::Minuit2::FunctionMinimum *fFcnMin; ///< function minimum object
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "PRunListCollection.h"
|
||||
|
||||
/**
|
||||
* <p>This is the minuit2 interface function class porviding the function to be optimized (chisq or log max-likelihood).
|
||||
* <p>This is the minuit2 interface function class providing the function to be optimized (chisq or log max-likelihood).
|
||||
*/
|
||||
class PFitterFcn : public ROOT::Minuit2::FCNBase
|
||||
{
|
||||
|
||||
61
src/include/PFitterFcnDKS.h
Normal file
61
src/include/PFitterFcnDKS.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/***************************************************************************
|
||||
|
||||
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 "Minuit2/FCNBase.h"
|
||||
|
||||
#include "PRunListCollection.h"
|
||||
|
||||
/**
|
||||
* <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, Bool_t useChi2);
|
||||
~PFitterFcnDKS();
|
||||
|
||||
Double_t Up() const { return fUp; }
|
||||
Double_t operator()(const std::vector<Double_t> &par) const;
|
||||
|
||||
UInt_t GetTotalNoOfFittedBins() { return fRunListCollection->GetTotalNoOfBinsFitted(); }
|
||||
UInt_t GetNoOfFittedBins(const UInt_t idx) { return fRunListCollection->GetNoOfBinsFitted(idx); }
|
||||
void CalcExpectedChiSquare(const std::vector<Double_t> &par, Double_t &totalExpectedChisq, std::vector<Double_t> &expectedChisqPerRun);
|
||||
|
||||
private:
|
||||
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
|
||||
};
|
||||
|
||||
#endif // _PFITTERFCNDKS_H_
|
||||
Reference in New Issue
Block a user