musrfit 1.10.0
PRunAsymmetryRRF.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PRunAsymmetryRRF.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 _PRUNASYMMETRYRRF_H_
31#define _PRUNASYMMETRYRRF_H_
32
33#include "PRunBase.h"
34
35//---------------------------------------------------------------------------
66{
67 public:
70
79 PRunAsymmetryRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData);
80
82 virtual ~PRunAsymmetryRRF();
83
89 virtual Double_t CalcChiSquare(const std::vector<Double_t>& par);
90
96 virtual Double_t CalcChiSquareExpected(const std::vector<Double_t>& par);
97
103 virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
104
111 virtual void CalcTheory();
112
117 virtual UInt_t GetNoOfFitBins();
118
123 virtual void SetFitRangeBin(const TString fitRange);
124
129 virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
130
135 virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
136
142 virtual void CalcNoOfFitBins();
143
144 protected:
152 virtual Bool_t PrepareData();
153
161 virtual Bool_t PrepareFitData();
162
172 virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]);
173
174 private:
178 Bool_t fTheoAsData;
179
184
185 Int_t fGoodBins[4];
186
189
201 Bool_t SubtractFixBkg();
202
211 Bool_t SubtractEstimatedBkg();
212
225 virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo);
226
237 virtual Bool_t GetProperDataRange(PRawRunData* runData, UInt_t histoNo[2]);
238
247 virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock);
248};
249
250#endif // _PRUNASYMMETRYRRF_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 void GetProperFitRange(PMsrGlobalBlock *globalBlock)
Determines the proper fit range from global block.
PRunAsymmetryRRF()
Default constructor.
virtual UInt_t GetNoOfFitBins()
Returns the number of bins used in the fit.
Int_t fGoodBins[4]
Good bin boundaries: [0]=forward first, [1]=forward last, [2]=backward first, [3]=backward last.
PDoubleVector fForwardErr
Forward detector histogram errors.
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)
Calculates expected chi-square (for statistical analysis).
virtual Bool_t GetProperDataRange(PRawRunData *runData, UInt_t histoNo[2])
Retrieves proper data range for histograms.
Bool_t fTheoAsData
If true, theory calculated only at data points; if false, extra points for nicer Fourier transforms.
virtual Bool_t PrepareViewData(PRawRunData *runData, UInt_t histoNo[2])
Prepares RRF data for viewing/plotting.
Bool_t SubtractEstimatedBkg()
Estimates and subtracts background from histograms.
virtual ~PRunAsymmetryRRF()
Destructor.
virtual Int_t GetStartTimeBin()
Returns the first bin used in the fit.
virtual Bool_t PrepareData()
Prepares all data for RRF fitting or viewing.
Int_t fEndTimeBin
Last bin index for fitting (after RRF transformation)
Int_t fRRFPacking
RRF packing factor from GLOBAL block (required for RRF analysis)
Bool_t SubtractFixBkg()
Subtracts fixed background from histograms.
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo)
Retrieves proper t0 values for all histograms.
virtual void SetFitRangeBin(const TString fitRange)
Sets the fit range in bins (can be changed dynamically via COMMAND block).
PDoubleVector fForward
Forward detector histogram data.
UInt_t fNoOfFitBins
Number of bins included in the fit after RRF packing.
PDoubleVector fBackward
Backward detector histogram data.
UInt_t fAlphaBetaTag
Tag indicating α/β configuration: 1=both unity, 2=α free/β unity, 3=α unity/β free,...
virtual Bool_t PrepareFitData()
Prepares RRF data specifically for fitting.
virtual void CalcTheory()
Calculates theoretical RRF asymmetry function.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Calculates chi-square for the RRF asymmetry fit.
virtual void CalcNoOfFitBins()
Calculates the number of bins to be fitted.
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
Calculates maximum likelihood estimator.
Int_t fStartTimeBin
First bin index for fitting (after RRF transformation)
PDoubleVector fBackwardErr
Backward detector histogram errors.
virtual Int_t GetEndTimeBin()
Returns the last bin used in the fit.
PRunBase()
Default constructor.
Definition PRunBase.cpp:52
Raw data file reader and format converter for μSR data.