This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / EVGEN / AliGenCocktail.h
1 #ifndef ALIGENCOCKTAIL_H
2 #define ALIGENCOCKTAIL_H
3 ///////////////////////////////////////////////////////////
4 //                                                       //
5 //  Class to generate the particles for the MC           //
6 //  The base class is empty                              //
7 //                                                       //
8 ///////////////////////////////////////////////////////////
9
10 #include "TNamed.h"
11 #include "TF1.h"
12 #include "TArrayF.h"
13 #include "TTree.h"
14 #include "AliGenerator.h"
15 #include <TClass.h>
16
17 class AliGenCocktailEntry : public TObject
18 {
19  protected:
20     AliGenerator *fGenerator;
21     Int_t fNGenerated;
22     Int_t fFirst;
23     Int_t fLast;
24     Float_t fRate;
25     Float_t fKineBias;
26     Float_t fBias;
27     TString fName;
28  public:
29     AliGenCocktailEntry()
30         {
31             fGenerator =0;
32             fNGenerated=0;
33             fFirst=-1;
34             fLast=-1;
35             fRate=0;
36             fKineBias=1;
37             fBias=1;
38             fName="unknown";
39         }
40     
41     AliGenCocktailEntry
42         (AliGenerator* Generator, TString Name, Float_t RateExp)
43         {
44             fGenerator=Generator;
45             fNGenerated=0;
46             fFirst=-1;
47             fLast=-1;
48             fRate=RateExp;
49             fName=Name;
50 //          
51             fKineBias=1;
52             fBias=1;
53
54         }
55     ~AliGenCocktailEntry(){;}
56     AliGenerator* Generator() {return fGenerator;}
57     void SetGenerator(AliGenerator* generator){fGenerator=generator;}
58     void SetFirst(Int_t first){fFirst=first;}
59     void SetLast (Int_t last ){fLast =last;}
60     Int_t GetFirst(){return fFirst;}
61     Int_t GetLast (){return fLast;}
62     Float_t Rate(){return fRate;}
63     void  PrintInfo();
64  private:
65     ClassDef(AliGenCocktailEntry,1)
66 };
67
68
69 class AliGenCocktail : public AliGenerator
70 {
71  protected:
72     //
73     // Number of generators booked
74
75     Int_t fNGenerators;
76     //
77     // List of Generators
78     TList  *fEntries;
79     // Iterators
80     TObjLink *flnk1;
81     TObjLink *flnk2;
82  public:
83     AliGenCocktail();
84     virtual ~AliGenCocktail();
85     virtual void Init();
86     virtual void Generate();
87     //
88     // Add a new generator to the list
89     virtual void AddGenerator
90         (AliGenerator *Generator, TString Name, Float_t RateExp );
91     virtual TList* Entries() {return fEntries;}
92     // Iterators
93     AliGenCocktailEntry*  FirstGenerator();
94     AliGenCocktailEntry*  NextGenerator();
95     void FirstGeneratorPair(AliGenCocktailEntry*&, AliGenCocktailEntry*&);
96     void NextGeneratorPair (AliGenCocktailEntry*&, AliGenCocktailEntry*&);
97     ClassDef(AliGenCocktail,1)
98 //
99 };
100
101 #endif
102
103
104
105
106