musrfit  1.9.2
PRunSingleHistoRRF.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  PRunSingleHistoRRF.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 _PRUNSINGLEHISTORRF_H_
31 #define _PRUNSINGLEHISTORRF_H_
32 
33 #include "PRunBase.h"
34 
39 {
40  public:
42  PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData);
43  virtual ~PRunSingleHistoRRF();
44 
45  virtual Double_t CalcChiSquare(const std::vector<Double_t>& par);
46  virtual Double_t CalcChiSquareExpected(const std::vector<Double_t>& par);
47  virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
48  virtual void CalcTheory();
49 
50  virtual UInt_t GetNoOfFitBins();
51 
52  virtual void SetFitRangeBin(const TString fitRange);
53 
54  virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
55  virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
56 
57  virtual void CalcNoOfFitBins();
58 
59  protected:
60  virtual Bool_t PrepareData();
61  virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo);
62  virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo);
63 
64  private:
65  Double_t fN0EstimateEndTime;
66 
67  UInt_t fNoOfFitBins;
68  Double_t fBackground;
69  Double_t fBkgErr;
70  Int_t fRRFPacking;
71  Bool_t fTheoAsData;
72 
73  Int_t fGoodBins[2];
74 
75  Int_t fStartTimeBin;
76  Int_t fEndTimeBin;
77 
83 
84  virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo);
85  virtual Bool_t GetProperDataRange();
86  virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock);
87  virtual Double_t GetMainFrequency(PDoubleVector &data);
88  virtual Double_t EstimateN0(Double_t &errN0, Double_t freqMax);
89  virtual Bool_t EstimateBkg(UInt_t histoNo);
90 };
91 
92 #endif // _PRUNSINGLEHISTORRF_H_
Int_t fGoodBins[2]
keep first/last good bins. 0=fgb, 1=lgb
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock)
virtual Int_t GetEndTimeBin()
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
virtual Double_t EstimateN0(Double_t &errN0, Double_t freqMax)
PDoubleVector fMerr
vector holding the error of M(t): M_err = exp(+t/tau) sqrt(N(t)).
Double_t fN0EstimateEndTime
end time in (us) over which N0 is estimated.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Double_t fBkgErr
estimate error on the estimated background
virtual UInt_t GetNoOfFitBins()
virtual Bool_t GetProperDataRange()
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo)
Int_t fEndTimeBin
bin at which the fit ends
PDoubleVector fM
vector holding M(t) = [N(t)-N_bkg] exp(+t/tau). Needed to estimate N0.
PDoubleVector fAerr
vector holding the errors of estimated A(t)
PDoubleVector fForward
forward histo data
virtual Double_t GetMainFrequency(PDoubleVector &data)
virtual Bool_t EstimateBkg(UInt_t histoNo)
UInt_t fNoOfFitBins
number of bins to be fitted
std::vector< UInt_t > PUIntVector
Definition: PMusr.h:172
std::vector< Double_t > PDoubleVector
Definition: PMusr.h:196
virtual Int_t GetStartTimeBin()
virtual Bool_t PrepareData()
virtual Bool_t PrepareViewData(PRawRunData *runData, const UInt_t histoNo)
Int_t fStartTimeBin
bin at which the fit starts
virtual Bool_t PrepareFitData(PRawRunData *runData, const UInt_t histoNo)
virtual void SetFitRangeBin(const TString fitRange)
PDoubleVector fW
vector holding the weight needed to estimate N0, and errN0.
EPMusrHandleTag
Definition: PMusr.h:220
Bool_t fTheoAsData
true=only calculate the theory points at the data points, false=calculate more points for the theory ...
Double_t fBackground
needed if background range is given (units: 1/bin)
Int_t fRRFPacking
RRF packing for this particular run. Given in the GLOBAL-block.
virtual void CalcNoOfFitBins()
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)