musrfit 1.10.0
PRunAsymmetry.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PRunAsymmetry.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 _PRUNASYMMETRY_H_
31#define _PRUNASYMMETRY_H_
32
33#include "PRunBase.h"
34
35//---------------------------------------------------------------------------
61class PRunAsymmetry : public PRunBase
62{
63 public:
66
75 PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData);
76
78 virtual ~PRunAsymmetry();
79
85 virtual Double_t CalcChiSquare(const std::vector<Double_t>& par);
86
92 virtual Double_t CalcChiSquareExpected(const std::vector<Double_t>& par);
93
99 virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
100
107 virtual void CalcTheory();
108
113 virtual UInt_t GetNoOfFitBins();
114
119 virtual void SetFitRangeBin(const TString fitRange);
120
125 virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
126
131 virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
132
137 virtual Int_t GetPacking() { return fPacking; }
138
144 virtual void CalcNoOfFitBins();
145
146 protected:
154 virtual Bool_t PrepareData();
155
163 virtual Bool_t PrepareFitData();
164
171 virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]);
172
182 virtual Bool_t PrepareRRFViewData(PRawRunData* runData, UInt_t histoNo[2]);
183
184 private:
187 Int_t fPacking;
188 Bool_t fTheoAsData;
189
194
195 Int_t fGoodBins[4];
196
199
214 Bool_t SubtractFixBkg();
215
234 Bool_t SubtractEstimatedBkg();
235
253 virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo);
254
270 virtual Bool_t GetProperDataRange(PRawRunData* runData, UInt_t histoNo[2]);
271
281 virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock);
282};
283
284#endif // _PRUNASYMMETRY_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 Int_t GetPacking()
Returns the packing factor.
UInt_t fNoOfFitBins
Number of bins included in the fit.
PRunAsymmetry()
Default constructor.
Int_t fPacking
Bin packing factor from RUN or GLOBAL block.
PDoubleVector fForwardErr
Forward detector histogram errors.
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock)
Determines the proper fit range from global block.
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo)
Retrieves proper t0 values for all histograms.
virtual Int_t GetStartTimeBin()
Returns the first bin used in the fit.
Bool_t SubtractFixBkg()
Subtracts fixed background from histograms.
PDoubleVector fBackwardErr
Backward detector histogram errors.
virtual void CalcNoOfFitBins()
Calculates the number of bins to be fitted.
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)
Calculates expected chi-square (for statistical analysis).
virtual void CalcTheory()
Calculates theoretical asymmetry function.
virtual Bool_t PrepareViewData(PRawRunData *runData, UInt_t histoNo[2])
Prepares data for viewing/plotting.
UInt_t fAlphaBetaTag
Tag indicating α/β configuration: 1=both unity, 2=α free/β unity, 3=α unity/β free,...
virtual Bool_t PrepareFitData()
Prepares data specifically for fitting.
Int_t fGoodBins[4]
Good bin boundaries: [0]=forward first, [1]=forward last, [2]=backward first, [3]=backward last.
Int_t fEndTimeBin
Last bin index for fitting.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Calculates chi-square for the current parameter set.
virtual ~PRunAsymmetry()
Destructor.
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
Calculates maximum likelihood estimator.
virtual Bool_t PrepareRRFViewData(PRawRunData *runData, UInt_t histoNo[2])
Prepares rotating reference frame (RRF) data for viewing.
virtual UInt_t GetNoOfFitBins()
Returns the number of bins used in the fit.
virtual Bool_t GetProperDataRange(PRawRunData *runData, UInt_t histoNo[2])
Retrieves proper data range for histograms.
virtual Bool_t PrepareData()
Prepares all data for fitting or viewing.
PDoubleVector fForward
Forward detector histogram data.
virtual Int_t GetEndTimeBin()
Returns the last bin used in the fit.
Bool_t SubtractEstimatedBkg()
Estimates and subtracts background from histograms.
PDoubleVector fBackward
Backward detector histogram data.
Int_t fStartTimeBin
First bin index for fitting.
Bool_t fTheoAsData
If true, theory calculated only at data points; if false, extra points for nicer Fourier transforms.
virtual void SetFitRangeBin(const TString fitRange)
Sets the fit range in bins.
PRunBase()
Default constructor.
Definition PRunBase.cpp:52
Raw data file reader and format converter for μSR data.