musrfit  1.9.2
PRunBase.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  PRunBase.h
4 
5  Author: Andreas Suter
6  e-mail: andreas.suter@psi.ch
7 
8 ***************************************************************************/
9 
10 /***************************************************************************
11  * Copyright (C) 2007-2023 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 _PRUNBASE_H_
31 #define _PRUNBASE_H_
32 
33 #include <vector>
34 #include <memory>
35 
36 #include <TString.h>
37 
38 #include "PMusr.h"
39 #include "PMsrHandler.h"
40 #include "PRunDataHandler.h"
41 #include "PTheory.h"
42 
43 //------------------------------------------------------------------------------------------
47 class PRunBase
48 {
49  public:
50  PRunBase();
51  PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag);
52  virtual ~PRunBase();
53 
54  virtual Double_t CalcChiSquare(const std::vector<Double_t>& par) = 0;
55  virtual Double_t CalcMaxLikelihood(const std::vector<Double_t>& par) = 0;
56  virtual void SetFitRange(PDoublePairVector fitRange);
57 
58  virtual void CalcTheory() = 0;
59 
60  virtual UInt_t GetRunNo() { return fRunNo; }
61  virtual PRunData* GetData() { return &fData; }
62  virtual void CleanUp();
63  virtual Bool_t IsValid() { return fValid; }
64 
65  protected:
66  Bool_t fValid;
67 
69 
70  Int_t fRunNo;
74 
76  Double_t fTimeResolution;
79  std::vector<PDoubleVector> fAddT0s;
80 
81  Double_t fFitStartTime;
82  Double_t fFitEndTime;
83 
85  std::unique_ptr<PTheory> fTheory;
86 
88 
89  virtual Bool_t PrepareData() = 0;
90 
91  virtual void CalculateKaiserFilterCoeff(Double_t wc, Double_t A, Double_t dw);
92  virtual void FilterTheo();
93 };
94 
95 #endif // _PRUNBASE_H_
Bool_t fValid
flag showing if the state of the class is valid
Definition: PRunBase.h:66
virtual void CleanUp()
Definition: PRunBase.cpp:182
virtual void SetFitRange(PDoublePairVector fitRange)
Definition: PRunBase.cpp:142
PRunDataHandler * fRawData
holds the raw run data
Definition: PRunBase.h:73
std::vector< PDoubleVector > fAddT0s
all t0 bins of all addrun&#39;s of a run! The derived classes will handle it.
Definition: PRunBase.h:79
virtual Double_t CalcMaxLikelihood(const std::vector< Double_t > &par)=0
pure virtual, i.e. needs to be implemented by the deriving class!!
virtual void CalcTheory()=0
pure virtual, i.e. needs to be implemented by the deriving class!!
PMsrHandler * fMsrInfo
msr-file handler
Definition: PRunBase.h:71
Double_t fTimeResolution
time resolution in (us)
Definition: PRunBase.h:76
PMetaData fMetaData
keeps the meta data from the data file like field, temperature, energy, ...
Definition: PRunBase.h:77
PDoubleVector fKaiserFilter
stores the Kaiser filter vector (needed for the RRF).
Definition: PRunBase.h:87
virtual ~PRunBase()
Definition: PRunBase.cpp:123
PRunData fData
data to be fitted, viewed, i.e. binned data
Definition: PRunBase.h:75
std::vector< Double_t > PDoubleVector
Definition: PMusr.h:196
virtual PRunData * GetData()
returns the data to be fitted
Definition: PRunBase.h:61
virtual Double_t CalcChiSquare(const std::vector< Double_t > &par)=0
pure virtual, i.e. needs to be implemented by the deriving class!!
virtual UInt_t GetRunNo()
returns the number of runs of the msr-file
Definition: PRunBase.h:60
virtual Bool_t PrepareData()=0
pure virtual, i.e. needs to be implemented by the deriving class!!
virtual void CalculateKaiserFilterCoeff(Double_t wc, Double_t A, Double_t dw)
Definition: PRunBase.cpp:200
virtual Bool_t IsValid()
returns if the state is valid
Definition: PRunBase.h:63
PDoubleVector fT0s
all t0 bins of a run! The derived classes will handle it.
Definition: PRunBase.h:78
EPMusrHandleTag fHandleTag
tag telling whether this is used for fit, view, ...
Definition: PRunBase.h:68
EPMusrHandleTag
Definition: PMusr.h:220
PMsrRunBlock * fRunInfo
run info used to filter out needed infos of a run
Definition: PRunBase.h:72
PRunBase()
Definition: PRunBase.cpp:47
Double_t fFitEndTime
fit end time
Definition: PRunBase.h:82
std::vector< PDoublePair > PDoublePairVector
Definition: PMusr.h:208
Double_t fFitStartTime
fit start time
Definition: PRunBase.h:81
virtual void FilterTheo()
Definition: PRunBase.cpp:240
std::unique_ptr< PTheory > fTheory
theory needed to calculate chi-square
Definition: PRunBase.h:85
Int_t fRunNo
number of the run within the msr-file
Definition: PRunBase.h:70
PDoubleVector fFuncValues
is keeping the values of the functions from the FUNCTIONS block
Definition: PRunBase.h:84