30#ifndef _PRUNSINGLEHISTO_H_
31#define _PRUNSINGLEHISTO_H_
229 virtual Double_t
CalcChiSquare(
const std::vector<Double_t>& par);
std::vector< UInt_t > PUIntVector
std::vector< Double_t > PDoubleVector
MSR file parser and manager for the musrfit framework.
PRunBase()
Default constructor.
Raw data file reader and format converter for μSR data.
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)
Calculates χ² between histogram data and theory.
virtual void CalcNoOfFitBins()
Calculates start/end bin indices from fit time range.
virtual Double_t CalcChiSquareExpected(const std::vector< Double_t > &par)
Calculates expected χ² based on theory predictions.
virtual Bool_t IsScaleN0AndBkg()
Determines if N₀ and background should be scaled to 1/ns.
Double_t fBackground
Background level in counts/bin (estimated from pre-t0 bins or fixed value from RUN block)
UInt_t fNoOfFitBins
Number of bins within fit range (fStartTimeBin to fEndTimeBin)
virtual ~PRunSingleHisto()
Virtual destructor cleaning up allocated resources.
virtual Bool_t PrepareViewData(PRawRunData *runData, const UInt_t histoNo)
Prepares processed histogram data for viewing/plotting.
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)
Calculates maximum likelihood for Poisson-distributed histogram counts.
virtual Bool_t EstimateBkg(UInt_t histoNo)
Estimates background from pre-t0 bins.
virtual Int_t GetStartTimeBin()
Returns the first bin index in the fit range.
virtual void CalcTheory()
Evaluates theory function at all data points or high-resolution grid.
virtual Int_t GetPacking()
Returns the bin packing factor.
virtual UInt_t GetNoOfFitBins()
Returns the number of bins included in the fit range.
virtual void EstimateN0()
Estimates initial normalization N₀ from histogram data.
virtual Bool_t GetScaleN0AndBkg()
Returns the N₀/background scaling mode.
Int_t fEndTimeBin
Last bin index in fit range (exclusive: loop as i < fEndTimeBin)
PRunSingleHisto()
Default constructor creating an empty, invalid single histogram run object.
virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock)
Determines fit range from MSR file settings.
virtual void SetFitRangeBin(const TString fitRange)
Sets fit range using bin-offset specification (COMMANDS block syntax).
virtual Int_t GetEndTimeBin()
Returns the last bin index in the fit range (exclusive).
Bool_t fScaleN0AndBkg
Scaling mode: true = scale N₀ and B to 1/ns, false = leave as 1/bin (determined by IsScaleN0AndBkg())
Int_t fStartTimeBin
First bin index in fit range (inclusive, 0-based after packing)
virtual Bool_t GetProperDataRange()
Determines data range (region of valid histogram data).
virtual Bool_t GetProperT0(PRawRunData *runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo)
Determines and validates t0 values for histogram.
virtual Double_t GetBackground()
Returns the estimated background level.
Bool_t fTheoAsData
Theory mode: true = at data points, false = high-resolution grid for smooth Fourier transforms.
Int_t fGoodBins[2]
Good bin markers for COMMANDS block: [0]=fgb (first good bin/t0), [1]=lgb (last good bin)
Int_t fPacking
Bin packing factor (REQUIRED: from RUN or GLOBAL block)
virtual Bool_t PrepareRawViewData(PRawRunData *runData, const UInt_t histoNo)
Prepares raw histogram data for viewing (minimal processing).
virtual Double_t CalcMaxLikelihoodExpected(const std::vector< Double_t > &par)
Calculates expected maximum likelihood.
virtual Bool_t PrepareData()
Main data preparation orchestrator.
virtual Bool_t PrepareFitData(PRawRunData *runData, const UInt_t histoNo)
Prepares histogram data for fitting.
PDoubleVector fForward
Forward detector histogram (background-corrected, packed)