musrfit 1.10.0
PRunAsymmetryBNMR.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PRunAsymmetryBNMR.h
4
5 Author: Zaher Salman
6 Based on PRunAsymmetry.h by Andreas Suter
7 e-mail: zaher.salman@psi.ch
8
9***************************************************************************/
10
11/***************************************************************************
12 * Copyright (C) 2018-2026 by Zaher Salman *
13 * zaher.salman@psi.ch *
14 * *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
19 * *
20 * This program is distributed in the hope that it will be useful, *
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
23 * GNU General Public License for more details. *
24 * *
25 * You should have received a copy of the GNU General Public License *
26 * along with this program; if not, write to the *
27 * Free Software Foundation, Inc., *
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
29 ***************************************************************************/
30
31#ifndef _PRUNASYMMETRYBNMR_H_
32#define _PRUNASYMMETRYBNMR_H_
33
34#include "PRunBase.h"
35
36//---------------------------------------------------------------------------
63{
64 public:
67
76 PRunAsymmetryBNMR(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData);
77
79 virtual ~PRunAsymmetryBNMR();
80
86 virtual Double_t CalcChiSquare(const std::vector<Double_t>& par);
87
93 virtual Double_t CalcChiSquareExpected(const std::vector<Double_t>& par);
94
100 virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
101
108 virtual void CalcTheory();
109
114 virtual UInt_t GetNoOfFitBins();
115
120 virtual void SetFitRangeBin(const TString fitRange);
121
126 virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
127
132 virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
133
138 virtual Int_t GetPacking() { return fPacking; }
139
145 virtual void CalcNoOfFitBins();
146
147 protected:
155 virtual Bool_t PrepareData();
156
164 virtual Bool_t PrepareFitData();
165
172 virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]);
173
174 private:
177 Int_t fPacking;
178 Bool_t fTheoAsData;
179
188
189 Int_t fGoodBins[4];
190
193
198 Bool_t SubtractFixBkg();
199
204 Bool_t SubtractEstimatedBkg();
205
214 virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo);
215
222 virtual Bool_t GetProperDataRange(PRawRunData* runData, UInt_t histoNo[2]);
223
228 virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock);
229
236 virtual Double_t EstimateAlpha();
237};
238
239#endif // _PRUNASYMMETRYBNMR_H_
std::vector< UInt_t > PUIntVector
Definition PMusr.h:375
EPMusrHandleTag
Definition PMusr.h:427
std::vector< Double_t > PDoubleVector
Definition PMusr.h:399
MSR file parser and manager for the musrfit framework.
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo)
Retrieves proper t0 values for all histograms.
UInt_t fAlphaBetaTag
Tag indicating α/β configuration: 1=both unity, 2=α free/β unity, 3=α unity/β free,...
Bool_t SubtractEstimatedBkg()
Estimates and subtracts background from histograms.
Bool_t SubtractFixBkg()
Subtracts fixed background from histograms.
virtual Int_t GetStartTimeBin()
Returns the first bin used in the fit.
virtual ~PRunAsymmetryBNMR()
Destructor.
virtual UInt_t GetNoOfFitBins()
Returns the number of bins used in the fit.
virtual Bool_t PrepareViewData(PRawRunData *runData, UInt_t histoNo[2])
Prepares data for viewing/plotting.
UInt_t fNoOfFitBins
Number of bins included in the fit.
PDoubleVector fBackwardmErr
Negative helicity backward histogram errors.
virtual Double_t EstimateAlpha()
Estimates α parameter from data.
virtual Int_t GetEndTimeBin()
Returns the last bin used in the fit.
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)
Calculates expected chi-square (for statistical analysis).
virtual Bool_t PrepareFitData()
Prepares data specifically for fitting.
PDoubleVector fForwardm
Negative helicity forward histogram data.
virtual Bool_t PrepareData()
Prepares all data for fitting or viewing.
PDoubleVector fForwardpErr
Positive helicity forward histogram errors.
Bool_t fTheoAsData
If true, theory calculated only at data points; if false, extra points for nicer Fourier transforms.
Int_t fGoodBins[4]
Good bin boundaries: [0]=forward first, [1]=forward last, [2]=backward first, [3]=backward last.
Int_t fStartTimeBin
First bin index for fitting.
virtual void CalcNoOfFitBins()
Calculates the number of bins to be fitted.
PDoubleVector fBackwardpErr
Positive helicity backward histogram errors.
virtual void CalcTheory()
Calculates theoretical asymmetry function.
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
Calculates maximum likelihood estimator.
virtual Int_t GetPacking()
Returns the packing factor.
PDoubleVector fForwardmErr
Negative helicity forward histogram errors.
PDoubleVector fBackwardp
Positive helicity backward histogram data.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Calculates chi-square for the current parameter set.
virtual void SetFitRangeBin(const TString fitRange)
Sets the fit range in bins.
PDoubleVector fBackwardm
Negative helicity backward histogram data.
Int_t fEndTimeBin
Last bin index for fitting.
PRunAsymmetryBNMR()
Default constructor.
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock)
Determines the proper fit range from global block.
PDoubleVector fForwardp
Positive helicity forward histogram data.
virtual Bool_t GetProperDataRange(PRawRunData *runData, UInt_t histoNo[2])
Retrieves proper data range for histograms.
Int_t fPacking
Bin packing factor from RUN or GLOBAL block.
PRunBase()
Default constructor.
Definition PRunBase.cpp:52
Raw data file reader and format converter for μSR data.