musrfit 1.10.0
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-2026 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
39//--------------------------------------------------------------------------
65class PFitterFcn : public ROOT::Minuit2::FCNBase
66{
67 public:
68 //----------------------------------------------------------------------
80 PFitterFcn(PRunListCollection *runList, Bool_t useChi2);
81
86
87 //----------------------------------------------------------------------
102 Double_t Up() const { return fUp; }
103
104 //----------------------------------------------------------------------
125 Double_t operator()(const std::vector<Double_t> &par) const;
126
127 //----------------------------------------------------------------------
133 UInt_t GetTotalNoOfFittedBins() { return fRunListCollection->GetTotalNoOfBinsFitted(); }
134
135 //----------------------------------------------------------------------
142 UInt_t GetNoOfFittedBins(const UInt_t idx) { return fRunListCollection->GetNoOfBinsFitted(idx); }
143
144 //----------------------------------------------------------------------
163 void CalcExpectedChiSquare(const std::vector<Double_t> &par, Double_t &totalExpectedChisq, std::vector<Double_t> &expectedChisqPerRun);
164
165 private:
166 Double_t fUp;
167 Bool_t fUseChi2;
169};
170
171#endif // _PFITTERFCN_H_
PRunListCollection * fRunListCollection
Pointer to preprocessed muSR data collection.
Definition PFitterFcn.h:168
UInt_t GetNoOfFittedBins(const UInt_t idx)
Returns number of fitted bins for a specific run.
Definition PFitterFcn.h:142
void CalcExpectedChiSquare(const std::vector< Double_t > &par, Double_t &totalExpectedChisq, std::vector< Double_t > &expectedChisqPerRun)
Calculates expected χ² (or maxLH) for quality assessment.
~PFitterFcn()
Destructor.
Double_t fUp
Error definition: 1.0 for χ² (1σ = Δχ²=1), 0.5 for maxLH (1σ = ΔmaxLH=0.5)
Definition PFitterFcn.h:166
Double_t operator()(const std::vector< Double_t > &par) const
Evaluates objective function for given parameters.
Double_t Up() const
Returns error definition for Minuit2 (Up value).
Definition PFitterFcn.h:102
Bool_t fUseChi2
Fit mode flag: true = χ² minimization, false = max log-likelihood.
Definition PFitterFcn.h:167
PFitterFcn(PRunListCollection *runList, Bool_t useChi2)
Constructor for objective function.
UInt_t GetTotalNoOfFittedBins()
Returns total number of bins used in the fit across all runs.
Definition PFitterFcn.h:133
Manager class for all processed μSR run data during fitting.