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

#ifndef _PSCATTERCROSSSECTION_H_
#define _PSCATTERCROSSSECTION_H_


#include "TF1.h"
#include "TF2.h"
#include "PAngularDistribution.h"
#include "PProjector.h"
#include "PF2.h"


class PScatterCrossSection : public PAngularDistribution  {
  
 public:
    PScatterCrossSection();
    PScatterCrossSection(const Char_t *id, const Char_t *de);
    PDistribution *Clone(const char *delme=NULL) const;

    Bool_t Init(void);
    Bool_t Prepare(void);

    Bool_t AddEquation(char *command);
    Bool_t AddHistogram(TH2 *histo, char *command);
    Bool_t AddHistogram(TH1 *histo, char *command);

    using TF1::SetRange;
    void SetRange(Double_t mymin, Double_t mymax) {
	TF1::SetRange(qmin, qmax);
	qmax = mymax;
	qmin = mymin;
    };

    void SetNpx(Int_t my_npx);
    void SetNpy(Int_t my_npy);
  
    PF2 *GetFunction(void) {return pf2;};

 protected:
    
    double SamplePolarAngle(double);

    Double_t qmin,qmax;
    Double_t costheta, q;

    PF2 *pf2;
    
    PParticle *vprimary;
    Double_t  *vf;
    Bool_t MakeVars(void);

    Int_t npx, npy;

    ClassDef(PScatterCrossSection, 0)  //Cross section model for the reaction a+b -> c+d

};

#endif


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