musrfit  1.9.2
PFitterFcn.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  PFitterFcn.h
4 
5  Author: Andreas Suter
6  e-mail: andreas.suter@psi.ch
7 
8 ***************************************************************************/
9 
10 /***************************************************************************
11  * Copyright (C) 2007-2023 by Andreas Suter *
12  * andreas.suter@psi.ch *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the *
26  * Free Software Foundation, Inc., *
27  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28  ***************************************************************************/
29 
30 #ifndef _PFITTERFCN_H_
31 #define _PFITTERFCN_H_
32 
33 #include <vector>
34 
35 #include "Minuit2/FCNBase.h"
36 
37 #include "PRunListCollection.h"
38 
42 class PFitterFcn : public ROOT::Minuit2::FCNBase
43 {
44  public:
45  PFitterFcn(PRunListCollection *runList, Bool_t useChi2);
46  ~PFitterFcn();
47 
48  Double_t Up() const { return fUp; }
49  Double_t operator()(const std::vector<Double_t> &par) const;
50 
52  UInt_t GetNoOfFittedBins(const UInt_t idx) { return fRunListCollection->GetNoOfBinsFitted(idx); }
53  void CalcExpectedChiSquare(const std::vector<Double_t> &par, Double_t &totalExpectedChisq, std::vector<Double_t> &expectedChisqPerRun);
54 
55  private:
56  Double_t fUp;
57  Bool_t fUseChi2;
59 };
60 
61 #endif // _PFITTERFCN_H_
virtual UInt_t GetNoOfBinsFitted(const UInt_t idx) const
UInt_t GetNoOfFittedBins(const UInt_t idx)
Definition: PFitterFcn.h:52
PFitterFcn(PRunListCollection *runList, Bool_t useChi2)
Definition: PFitterFcn.cpp:41
virtual UInt_t GetTotalNoOfBinsFitted() const
Double_t operator()(const std::vector< Double_t > &par) const
Definition: PFitterFcn.cpp:71
void CalcExpectedChiSquare(const std::vector< Double_t > &par, Double_t &totalExpectedChisq, std::vector< Double_t > &expectedChisqPerRun)
Definition: PFitterFcn.cpp:106
Double_t Up() const
Definition: PFitterFcn.h:48
UInt_t GetTotalNoOfFittedBins()
Definition: PFitterFcn.h:51
Bool_t fUseChi2
true = chisq fit, false = log max-likelihood fit
Definition: PFitterFcn.h:57
PRunListCollection * fRunListCollection
pre-processed data to be fitted
Definition: PFitterFcn.h:58
Double_t fUp
for chisq == 1.0, i.e. errors are 1 std. deviation errors. for log max-likelihood == 0...
Definition: PFitterFcn.h:56