musrfit 1.10.0
PPrepFourier.h
Go to the documentation of this file.
1/***************************************************************************
2
3 PPrepFourier.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 _PPREPFOURIER_H_
31#define _PPREPFOURIER_H_
32
33#include <iostream>
34#include <vector>
35
36#include <TH1F.h>
37#include <TMath.h>
38
39#include "PMusr.h"
40
41//----------------------------------------------------------------------------
52 Int_t dataSetTag;
53 TString info;
54 Double_t timeResolution;
55 Int_t t0;
56 Double_t timeRange[2];
58};
59
60//----------------------------------------------------------------------------
88 public:
91
98 PPrepFourier(const Int_t packing, const Int_t *bkgRange, PDoubleVector bkg);
99
101 virtual ~PPrepFourier();
102
107 virtual void SetBkgRange(const Int_t *bkgRange);
108
113 virtual void SetBkg(PDoubleVector bkg);
114
119 virtual void SetPacking(const Int_t packing);
120
125 virtual void AddData(musrFT_data &data);
126
133 virtual void DoBkgCorrection();
134
141 virtual void DoPacking();
142
151 virtual void DoLifeTimeCorrection(Double_t fudge);
152
158 TString GetInfo(const UInt_t idx);
159
165 Int_t GetDataSetTag(const UInt_t idx);
166
171 UInt_t GetNoOfData() { return fRawData.size(); }
172
180 std::vector<TH1F*> GetData();
181
190 TH1F *GetData(const UInt_t idx);
191
192 private:
193 std::vector<musrFT_data> fRawData;
194 std::vector<PDoubleVector> fData;
195 Int_t fBkgRange[2];
197 Int_t fPacking;
198
205 virtual void InitData();
206};
207
208#endif // _PPREPFOURIER_H_
209
std::vector< Double_t > PDoubleVector
Definition PMusr.h:399
virtual void InitData()
Initializes processed data from raw data.
Int_t fBkgRange[2]
Background range: [0]=start bin, [1]=end bin (-1=unused)
std::vector< PDoubleVector > fData
Processed data (after t0, corrections, packing)
PPrepFourier()
Default constructor (requires separate configuration)
virtual void DoLifeTimeCorrection(Double_t fudge)
Applies muon lifetime correction for theory-free analysis.
Int_t fPacking
Rebinning factor (1=no rebinning, N=combine N bins)
virtual void SetPacking(const Int_t packing)
Sets rebinning/packing factor for data reduction.
std::vector< musrFT_data > fRawData
Raw input data sets with metadata.
PDoubleVector fBkg
Explicit background values (one per data set)
UInt_t GetNoOfData()
Returns number of stored data sets.
virtual void SetBkg(PDoubleVector bkg)
Sets explicit background values for each data set.
Int_t GetDataSetTag(const UInt_t idx)
Returns data set tag identifier.
virtual void AddData(musrFT_data &data)
Adds a time-domain data set for processing.
std::vector< TH1F * > GetData()
Creates ROOT histograms for all processed data sets.
virtual ~PPrepFourier()
Destructor.
virtual void DoBkgCorrection()
Applies background correction to all data sets.
virtual void SetBkgRange(const Int_t *bkgRange)
Sets background range for automatic background calculation.
TString GetInfo(const UInt_t idx)
Returns metadata string for a specific data set.
virtual void DoPacking()
Applies rebinning/packing to reduce data points.
Data structure holding raw time-domain μSR data with metadata.
PDoubleVector rawData
Raw time-domain data vector (bin counts)
Double_t timeResolution
Time resolution in microseconds (μs)
Double_t timeRange[2]
Time range to process: [0]=start, [1]=end in microseconds (μs)
Int_t dataSetTag
Data set identifier tag (needed for average-per-data-set operations)
TString info
Metadata string (run name, histogram info, etc.)
Int_t t0
Time zero bin number (start of valid data)