// Author: I. Froehlich
// Written: 18.8.2010
// Revised: 

#ifndef _PF2_H_
#define _PF2_H_

#include "TF2.h"
#include "PProjector.h"


class PF2: public TF2 {

 public:

    
    //Standard ROOT ctors
    PF2();
    PF2(const char *name, const char *formula, Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1);
    //PF2(const char *name, void *fcn, Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1, Int_t npar=0);

    PF2(const char *name, Double_t (*fcn)(Double_t *, Double_t *), Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1, Int_t npar=0);
    PF2(const char *name, Double_t (*fcn)(const Double_t *, const Double_t *), Double_t xmin=0, Double_t xmax=1, Double_t ymin=0, Double_t ymax=1, Int_t npar=0);
    PF2(const char *name, ROOT::Math::ParamFunctor f, Double_t xmin = 0, Double_t xmax = 1, Double_t ymin = 0, Double_t ymax = 1, Int_t npar = 0);  
    PF2(const PF2 &f2);
  
    //Pluto ctor
    PF2(const char *name, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax);

    virtual Double_t    EvalPar(const Double_t *x, const Double_t *params);
    //TF wrapper

  
    Bool_t Add(const char *command);
    Bool_t Add(TH1 *histo, const char *command = "");
    Bool_t Add(TH2 *histo, const char *command = "");
    Bool_t Add(TH3 *histo, const char *command = "");
    Bool_t Add(TGraph *graph, const char *command = "");
    Bool_t Add(TGraph2D *graph, const char *command = "");

    void SetEpsilon(Double_t e) {
	epsilon = e;
    };

    Bool_t MakeIntegral(void);
    void GetRandom2(Double_t &xrandom, Double_t &yrandom);


 protected:

    using TF2::Integral;
    Double_t Integral(Double_t ax, Double_t bx, Double_t ay, Double_t by, Double_t epsilon);

    Double_t epsilon;

    PProjector *projector;
    Double_t   *vf, *vx, *vy;


    ClassDef(PF2, 0)  // Pluto TF2 extension

};

#endif
 PF2.h:1
 PF2.h:2
 PF2.h:3
 PF2.h:4
 PF2.h:5
 PF2.h:6
 PF2.h:7
 PF2.h:8
 PF2.h:9
 PF2.h:10
 PF2.h:11
 PF2.h:12
 PF2.h:13
 PF2.h:14
 PF2.h:15
 PF2.h:16
 PF2.h:17
 PF2.h:18
 PF2.h:19
 PF2.h:20
 PF2.h:21
 PF2.h:22
 PF2.h:23
 PF2.h:24
 PF2.h:25
 PF2.h:26
 PF2.h:27
 PF2.h:28
 PF2.h:29
 PF2.h:30
 PF2.h:31
 PF2.h:32
 PF2.h:33
 PF2.h:34
 PF2.h:35
 PF2.h:36
 PF2.h:37
 PF2.h:38
 PF2.h:39
 PF2.h:40
 PF2.h:41
 PF2.h:42
 PF2.h:43
 PF2.h:44
 PF2.h:45
 PF2.h:46
 PF2.h:47
 PF2.h:48
 PF2.h:49
 PF2.h:50
 PF2.h:51
 PF2.h:52
 PF2.h:53
 PF2.h:54
 PF2.h:55
 PF2.h:56
 PF2.h:57
 PF2.h:58
 PF2.h:59
 PF2.h:60
 PF2.h:61
 PF2.h:62
 PF2.h:63
 PF2.h:64