musrfit 1.10.0
PRunMuMinus.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PRunMuMinus.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 _PRUNMUMINUS_H_
31#define _PRUNMUMINUS_H_
32
33#include "PRunBase.h"
34
97class PRunMuMinus : public PRunBase
98{
99 public:
107 PRunMuMinus();
108
131 PRunMuMinus(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag, Bool_t theoAsData);
132
139 virtual ~PRunMuMinus();
140
162 virtual Double_t CalcChiSquare(const std::vector<Double_t>& par);
163
182 virtual Double_t CalcChiSquareExpected(const std::vector<Double_t>& par);
183
208 virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par);
209
232 virtual void CalcTheory();
233
249 virtual UInt_t GetNoOfFitBins();
250
269 virtual void SetFitRangeBin(const TString fitRange);
270
275 virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
276
281 virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
282
287 virtual Int_t GetPacking() { return fPacking; }
288
307 virtual void CalcNoOfFitBins();
308
309 protected:
326 virtual Bool_t PrepareData();
327
351 virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo);
352
373 virtual Bool_t PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo);
374
375 private:
377
391 Int_t fPacking;
392
403
414 Int_t fGoodBins[2];
415
428
431
449 virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo);
450
465 virtual Bool_t GetProperDataRange();
466
485 virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock);
486};
487
488#endif // _PRUNMUMINUS_H_
std::vector< UInt_t > PUIntVector
Definition PMusr.h:361
EPMusrHandleTag
Definition PMusr.h:413
std::vector< Double_t > PDoubleVector
Definition PMusr.h:385
MSR file parser and manager for the musrfit framework.
PRunBase()
Default constructor.
Definition PRunBase.cpp:54
Raw data file reader and format converter for μSR data.
virtual Int_t GetStartTimeBin()
Returns the first bin index in the fit range.
virtual ~PRunMuMinus()
Virtual destructor cleaning up allocated resources.
Bool_t fTheoAsData
Theory calculation mode flag.
PRunMuMinus()
Default constructor creating an empty, invalid μ⁻ run object.
Int_t fPacking
Bin packing factor (REQUIRED for μ⁻).
Int_t fGoodBins[2]
Good bin markers for bin-based fit range specification.
virtual Bool_t PrepareData()
Main data preparation routine for μ⁻ fitting and viewing.
virtual Int_t GetPacking()
Returns the bin packing factor.
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)
Calculates expected χ² based on theory predictions (statistical diagnostic).
virtual Bool_t GetProperDataRange()
Determines data range (region of valid histogram data).
virtual void SetFitRangeBin(const TString fitRange)
Sets fit range using bin-offset specification (COMMANDS block syntax).
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock)
Determines fit range from MSR file settings.
virtual UInt_t GetNoOfFitBins()
Returns the number of bins included in the fit range.
virtual void CalcTheory()
Evaluates theory function at all data points (or high-resolution grid).
PDoubleVector fForward
Forward detector histogram data (background-corrected, packed).
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo)
Determines and validates t0 values for μ⁻ histogram.
Int_t fEndTimeBin
Last bin index in fit range (exclusive: loop as i < fEndTimeBin)
Int_t fStartTimeBin
First bin index in fit range (inclusive, 0-based after packing)
virtual Bool_t PrepareFitData(PRawRunData *runData, const UInt_t histoNo)
Prepares μ⁻ histogram data for fitting.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Calculates χ² between μ⁻ data and theory (least-squares fit metric).
virtual Int_t GetEndTimeBin()
Returns the last bin index in the fit range (exclusive).
virtual void CalcNoOfFitBins()
Calculates start/end bin indices from fit time range.
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
Calculates negative log-likelihood for Poisson statistics (low-count fit metric).
virtual Bool_t PrepareRawViewData(PRawRunData *runData, const UInt_t histoNo)
Prepares μ⁻ histogram data for viewing/plotting (minimal processing).
UInt_t fNoOfFitBins
Number of bins within fit range (between fStartTimeBin and fEndTimeBin)