/////////////////////////////////////////////////////////////////////////////
//
// PDecayChannel
//
//  Author:   Volker Hejny
//  Written:  27.08.99
//  Revised:  15.06.00 MK
//  Revised:  23.07.07 IF
//
// This class implements a list of decay modes (normally for one particle.
// Each instance is linked to a next one if there are more choices to 
// decay.
// -----------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////

#ifndef _PDECAYCHANNEL_H_
#define _PDECAYCHANNEL_H_

#include "TObject.h"
#include "TArrayI.h"
#include "TF1.h"
#include "TF2.h"
class PParticle;

using namespace std;
#include <iostream>

class PDecayChannel : public TObject {

 private:
    Double_t		Weight;			// branching ratio
    Int_t		NumOfDaughters;         // number of decay products
    TArrayI             Daughters;              // particle ids of decay products
    PDecayChannel*	Next;		        // pointer to an alternative channel
  
 public:
  
    PDecayChannel();
    ~PDecayChannel();
  
    // Add one decay channel by referencing an existing one.
    void AddChannel(PDecayChannel *n);

    // Add one decay channel by giving the weight and the particle ids. In
    // case of more than four particles one could also use a array of ids
    // together with its length.
    void AddChannel(Double_t w, Int_t d1); 
    void AddChannel(Double_t w, Int_t d1, Int_t d2);
    void AddChannel(Double_t w, Int_t d1, Int_t d2, Int_t d3);
    void AddChannel(Double_t w, Int_t d1, Int_t d2, Int_t d3, Int_t d4);
    void AddChannel(Double_t w, Int_t nd, Int_t* ld);
  
    // The same as above using PParticle* instead of ids.
    void AddChannel(Double_t w, PParticle *d1);
    void AddChannel(Double_t w, PParticle *d1, PParticle *d2);
    void AddChannel(Double_t w, PParticle *d1, PParticle *d2, PParticle *d3);
    void AddChannel(Double_t w, PParticle *d1, PParticle *d2, PParticle *d3, PParticle *d4);
    void AddChannel(Double_t w, Int_t nd, PParticle **ld);
  
    // The same as above using particle names instead of ids.
    void AddChannel(Double_t w, const char *d1);
    void AddChannel(Double_t w, const char *d1, const char *d2);
    void AddChannel(Double_t w, const char *d1, const char *d2, const char *d3);
    void AddChannel(Double_t w, const char *d1, const char *d2, const char *d3, const char *d4);
    void AddChannel(Double_t w, Int_t nd, char **ld);
  
    // Get the information out of the class ...
    Double_t GetWeight();
    Int_t   *GetDaughters(int &n);
    PDecayChannel *GetNext();
    PDecayChannel *GetLast();

    void setAngleFunction(TF1 *) {Warning("setAngleFunction", "setAngleFunction is obsolete");};
    void setAngleFunction(TF2 *) {Warning("setAngleFunction", "setAngleFunction is obsolete");};
  
    // Unlink means to return the next decay channel and to set Next to NULL
    PDecayChannel *Unlink();
  
    // print decay channel information
    void Print(const Option_t *delme=NULL) const;
  
    ClassDef(PDecayChannel, 0)//Pluto Decay Channel Class

};  // end of PDecayChannel
						
#endif // _PDECAYCHANNEL_H_
 PDecayChannel.h:1
 PDecayChannel.h:2
 PDecayChannel.h:3
 PDecayChannel.h:4
 PDecayChannel.h:5
 PDecayChannel.h:6
 PDecayChannel.h:7
 PDecayChannel.h:8
 PDecayChannel.h:9
 PDecayChannel.h:10
 PDecayChannel.h:11
 PDecayChannel.h:12
 PDecayChannel.h:13
 PDecayChannel.h:14
 PDecayChannel.h:15
 PDecayChannel.h:16
 PDecayChannel.h:17
 PDecayChannel.h:18
 PDecayChannel.h:19
 PDecayChannel.h:20
 PDecayChannel.h:21
 PDecayChannel.h:22
 PDecayChannel.h:23
 PDecayChannel.h:24
 PDecayChannel.h:25
 PDecayChannel.h:26
 PDecayChannel.h:27
 PDecayChannel.h:28
 PDecayChannel.h:29
 PDecayChannel.h:30
 PDecayChannel.h:31
 PDecayChannel.h:32
 PDecayChannel.h:33
 PDecayChannel.h:34
 PDecayChannel.h:35
 PDecayChannel.h:36
 PDecayChannel.h:37
 PDecayChannel.h:38
 PDecayChannel.h:39
 PDecayChannel.h:40
 PDecayChannel.h:41
 PDecayChannel.h:42
 PDecayChannel.h:43
 PDecayChannel.h:44
 PDecayChannel.h:45
 PDecayChannel.h:46
 PDecayChannel.h:47
 PDecayChannel.h:48
 PDecayChannel.h:49
 PDecayChannel.h:50
 PDecayChannel.h:51
 PDecayChannel.h:52
 PDecayChannel.h:53
 PDecayChannel.h:54
 PDecayChannel.h:55
 PDecayChannel.h:56
 PDecayChannel.h:57
 PDecayChannel.h:58
 PDecayChannel.h:59
 PDecayChannel.h:60
 PDecayChannel.h:61
 PDecayChannel.h:62
 PDecayChannel.h:63
 PDecayChannel.h:64
 PDecayChannel.h:65
 PDecayChannel.h:66
 PDecayChannel.h:67
 PDecayChannel.h:68
 PDecayChannel.h:69
 PDecayChannel.h:70
 PDecayChannel.h:71
 PDecayChannel.h:72
 PDecayChannel.h:73
 PDecayChannel.h:74
 PDecayChannel.h:75
 PDecayChannel.h:76
 PDecayChannel.h:77
 PDecayChannel.h:78
 PDecayChannel.h:79
 PDecayChannel.h:80
 PDecayChannel.h:81
 PDecayChannel.h:82
 PDecayChannel.h:83
 PDecayChannel.h:84
 PDecayChannel.h:85
 PDecayChannel.h:86