Randomized generator selection added.
[u/mrichter/AliRoot.git] / EVGEN / AliGenCocktail.h
... / ...
CommitLineData
1#ifndef ALIGENCOCKTAIL_H
2#define ALIGENCOCKTAIL_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8// Container class for AliGenerator through recursion.
9// (Container is itself an AliGenerator)
10// Author: andreas.morsch@cern.ch
11//
12
13#include "AliGenerator.h"
14#include <TArrayF.h>
15
16class AliGenCocktailEntry;
17class TArrayF;
18
19
20class AliGenCocktail : public AliGenerator
21{
22 public:
23 AliGenCocktail();
24 AliGenCocktail(const AliGenCocktail &cocktail);
25
26 virtual ~AliGenCocktail();
27 virtual void Init();
28 virtual void FinishRun();
29 virtual void Generate();
30 virtual void SetVertexSmear(VertexSmear_t smear);
31 virtual void SetRandomise(Bool_t flag) {fRandom = flag;}
32
33 //
34 // Add a new generator to the list
35 virtual void AddGenerator
36 (AliGenerator *Generator, const char* Name, Float_t RateExp );
37 virtual TList* Entries() {return fEntries;}
38 // Iterators
39 AliGenCocktailEntry* FirstGenerator();
40 AliGenCocktailEntry* NextGenerator();
41 void FirstGeneratorPair(AliGenCocktailEntry*&e1, AliGenCocktailEntry*&e2);
42 void NextGeneratorPair (AliGenCocktailEntry*&e1, AliGenCocktailEntry*&e2);
43 AliGenCocktail & operator=(const AliGenCocktail & rhs);
44
45 protected:
46 Int_t fNGenerators; // Number of generators booked
47 Bool_t fRandom; // Flag to select random generator from list
48 TArrayF fProb; // Probability of an event (if fRandom == kTRUE)
49 TList *fEntries; // List of Generators
50 TObjLink *flnk1; // ! Iterator for first generator
51 TObjLink *flnk2; // ! Iterator for second generator
52
53//
54 private:
55 void Copy(TObject &arun) const;
56 ClassDef(AliGenCocktail,1) // Particle cocktail generator a la SHAKER
57};
58
59#endif
60
61
62
63
64