// Author: Ingo Froehlich
// Written: 10/07/2007
// Modified: 
// PBulkInterface Class Header

#ifndef _PBULKINTERFACE_H_
#define _PBULKINTERFACE_H_

#include "PParticle.h"
#include "TTree.h"

#define PPROJECTOR_PRIORITY    99
#define FILTER_PRIORITY        60
#define DECAY_PRIORITY         50
#define FILEINPUT_PRIORITY     1

class PBulkInterface;
PBulkInterface *makeGlobalBulk();
PBulkInterface &fPBulkInterface();

class PBulkInterface: public TObject {

 private:

    static Int_t gBulkCounter; 
    
 protected:
    
    Double_t current_weight;
    Int_t    bulk_id;      //Unique bulk ID
    Int_t    fPriority;    //order when adding the bulk in PReaction
    TTree   *tree;         //Pointer to storage tree
    Int_t   *size_branches;
    Int_t   *key_branches;
    Int_t   *current_size_branches[MAX_NUM_BRANCHES];
    PParticle **particle_array_branches[MAX_NUM_BRANCHES];

 public:

    PBulkInterface();
    
    virtual bool Modify(PParticle ** array, int *decay_done, int *num, int maxnum);  //Modify particle bulk

    void SetWeight(Double_t c) {current_weight = c;};
    Double_t GetWeight(void) {return current_weight;};

    void SetPriority(Int_t p) {
	fPriority = p;
    };
    Int_t GetPriority() {return fPriority;};

    void SetTree(TTree *my_tree) {tree = my_tree;};
    TTree *GetTree(void)         {return tree;};

    void SetSizeBranches(Int_t *my_size_branches)  {size_branches = my_size_branches;};
    void SetKeysBranches(Int_t *my_key_branches)   {key_branches = my_key_branches;};
    void SetBranchNum   (Int_t i, Int_t *my_size)  {current_size_branches[i] = my_size;};
    void SetBranchArray (Int_t i, PParticle **my_particle) {particle_array_branches[i] = my_particle;};

    Int_t *GetSizeBranches()     {return size_branches;};
    Int_t *GetKeysBranches()     {return key_branches;};
    Int_t *GetBranchNum(Int_t i) {return current_size_branches[i];};
    PParticle **GetBranchArray (Int_t i) {return particle_array_branches[i];};

ClassDef(PBulkInterface,0) // Pluto bulk interface base class
};


#endif 

















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