musrfit  1.9.2
PUserFcnBase.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  PUserFcnBase.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 _PUSERFCNBASE_H_
31 #define _PUSERFCNBASE_H_
32 
33 #include <vector>
34 
35 #include "TObject.h"
36 #include "TSAXParser.h"
37 
38 //--------------------------------------------------------------------------------------------
42 class PUserFcnBase : public TObject
43 {
44  public:
46  virtual ~PUserFcnBase() {}
47 
48  virtual Bool_t NeedGlobalPart() const { return false; }
49  virtual void SetGlobalPart(std::vector<void *> &globalPart, UInt_t idx) {}
50  virtual Bool_t GlobalPartIsValid() const { return false; }
51 
52  virtual Double_t operator()(Double_t t, const std::vector<Double_t> &param) const = 0;
53 
54  ClassDef(PUserFcnBase, 1)
55 };
56 
57 //--------------------------------------------------------------------------
58 // This function is a replacement for the ParseFile method of TSAXParser.
59 //--------------------------------------------------------------------------
60 Int_t parseXmlFile(TSAXParser*, const Char_t*);
61 
62 #endif // _PUSERFCNBASE_H_
virtual Bool_t GlobalPartIsValid() const
if a user function is using a global part, this function returns if the global object part is valid (...
Definition: PUserFcnBase.h:50
virtual Bool_t NeedGlobalPart() const
if a user function needs a global part this function should return true, otherwise false (default: fa...
Definition: PUserFcnBase.h:48
virtual Double_t operator()(Double_t t, const std::vector< Double_t > &param) const =0
virtual ~PUserFcnBase()
Definition: PUserFcnBase.h:46
virtual void SetGlobalPart(std::vector< void *> &globalPart, UInt_t idx)
if a user function is using a global part, this function is used to invoke and retrieve the proper gl...
Definition: PUserFcnBase.h:49
Int_t parseXmlFile(TSAXParser *, const Char_t *)