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

#ifndef _PHADRONDECAY_H_
#define _PHADRONDECAY_H_

#include "TF1.h"
#include "TF2.h"
#include "PChannelModel.h"
#include "PDynamicData.h"
#include "PKinematics.h"

class PHadronDecay : public PChannelModel  {
  
 public:
    PHadronDecay();
    PHadronDecay(const Char_t *id, const Char_t *de, Int_t key);
    PDistribution *Clone(const char*delme=NULL) const;

    Bool_t   Init(void);
    Bool_t   SampleMass(void);
    Bool_t   SampleMass(Double_t *mass, Int_t *didx=NULL);

    Bool_t   GetWidth(Double_t mass, Double_t *width, Int_t didx=-1);

    int      GetDepth(int i=0);
//    Bool_t GetBR(Double_t mass, Double_t *br, Double_t totalwidth=-1);

    Double_t Eval(Double_t x, Double_t y = 0, Double_t z = 0, Double_t t = 0) const;
    Double_t EvalPar(const Double_t *x, const Double_t *params);
    //TF1 wrapper

    void Use_m0_over_m(int i)    {use_m0_over_m = i;};
    void SetCutoffVersion(int i) {cutoff_version = i;};

 protected:

    int    parent_id, id1, id2;          //PIDs
    double parent_mass, mass1, mass2;  //Static Masses
    double parent_g0; //Static Width of parent
    
    //Width Configuration
    int use_fixed_delta;
    double fixed_delta;
    int angular_l;
    int cutoff_l;
    int use_m0_over_m, cutoff_version; //0=theis,1=ernst,2=none
    double w0;

    double HadronWidth(const double &m, const double &ma, const double &mb);

    ClassDef(PHadronDecay, 0)  // Decay of Hadron -> Hadron(stable) + Hadron(stable)
};

#endif


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