musrfit  1.9.2
PFunctionHandler.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  PFunctionHandler.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 _PFUNCTIONHANDLER_H_
31 #define _PFUNCTIONHANDLER_H_
32 
33 #include <iostream>
34 #include <vector>
35 
36 #include <TString.h>
37 
38 #include "PMusr.h"
39 #include "PFunctionGrammar.h"
40 #include "PFunction.h"
41 
46 {
47  public:
49  virtual ~PFunctionHandler();
50 
51  virtual Bool_t IsValid() { return fValid; }
52  virtual Bool_t DoParse();
53  virtual Bool_t CheckMapAndParamRange(UInt_t mapSize, UInt_t paramSize);
54  virtual double Eval(Int_t funNo, std::vector<Int_t> map, std::vector<double> param, PMetaData metaData);
55  virtual Int_t GetFuncNo(UInt_t idx);
56  virtual Int_t GetFuncIndex(Int_t funcNo);
57  virtual UInt_t GetNoOfFuncs() { return fFuncs.size(); }
58  virtual TString GetFuncString(UInt_t idx);
59 
60  private:
61  Bool_t fValid;
62 
64  std::vector<PFunction> fFuncs;
65  std::vector<TString> fFuncComment;
66 };
67 
68 #endif // _PFUNCTIONHANDLER_H_
69 
Bool_t fValid
true = function handler has valid functions
virtual UInt_t GetNoOfFuncs()
virtual Bool_t CheckMapAndParamRange(UInt_t mapSize, UInt_t paramSize)
virtual TString GetFuncString(UInt_t idx)
virtual Int_t GetFuncNo(UInt_t idx)
virtual double Eval(Int_t funNo, std::vector< Int_t > map, std::vector< double > param, PMetaData metaData)
PMsrLines fLines
stores the msr-file FUNCTIONS block as clear text.
virtual ~PFunctionHandler()
virtual Bool_t IsValid()
std::vector< PFunction > fFuncs
vector of all evaluatable functions
std::vector< PMsrLineStructure > PMsrLines
Definition: PMusr.h:539
PFunctionHandler(PMsrLines lines)
virtual Int_t GetFuncIndex(Int_t funcNo)
virtual Bool_t DoParse()
std::vector< TString > fFuncComment
vector of prepended function comments