Fix for event mixing, when it was selecting events out of range of multiplicity cut
[u/mrichter/AliRoot.git] / EVGEN / AliGenCocktailAfterBurner.h
CommitLineData
0b359ada 1#ifndef AliGenCocktailAfterBurner_H
2#define AliGenCocktailAfterBurner_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)
20dddfab 10// Author: piotr.skowronski@cern.ch
0b359ada 11//
88cb7938 12
13#include <TMCProcess.h>
14
0b359ada 15#include "AliGenCocktail.h"
2b9786f4 16#include "AliRun.h"
0b359ada 17
18class AliGenCocktailEntry;
19class AliStack;
cc41459d 20class AliCollisionGeometry;
9c64a93a 21class AliGenCocktailEventHeader;
22
cc41459d 23
0b359ada 24class AliGenCocktailAfterBurner : public AliGenCocktail
25{
20dddfab 26//container class for other generators
27//extends AliGenCocktail functionality
28//with possiblity of adding after-burners
29
0b359ada 30 public:
31 AliGenCocktailAfterBurner();
0b359ada 32 virtual ~AliGenCocktailAfterBurner();
20dddfab 33
34 virtual void Init();
35 virtual void Generate();
36 virtual void SetTracks(Int_t stackno);
0b359ada 37 //
38 // Add a new generator to the list
20dddfab 39 virtual void AddAfterBurner
0b359ada 40 (AliGenerator *Generator, char* Name, Float_t RateExp );
0b359ada 41
20dddfab 42 AliStack* GetStack(Int_t n) const;
43 AliStack* GetActiveStack() const{return fActiveStack;}
cc41459d 44
cc41459d 45 AliCollisionGeometry* GetCollisionGeometry(Int_t n) const;
cc41459d 46
20dddfab 47 AliGenerator* GetCurrentGenerator() const;
0b359ada 48 virtual void SetActiveEventNumber(Int_t actev);
20dddfab 49 Int_t GetActiveEventNumber() const {return fActiveEvent;}
ed15ce56 50 virtual Int_t GetNumberOfEvents() const {return AliRunLoader::Instance()->GetNumberOfEventsPerRun() + fNBgEvents;}
20dddfab 51 void SetNBgEvents(Int_t nbg=0){fNBgEvents = nbg;}
e3b21c34 52 AliGenCocktailEventHeader* GetActiveEventHeader() const { return fHeaders[fActiveEvent]; }
984c69bd 53
acc86a24 54 static TMCProcess IntToMCProcess(Int_t no);
0af12c00 55
0b359ada 56 protected:
984c69bd 57 Int_t fNAfterBurners; // Number of afterburners
58 TList *fAfterBurnerEntries;// List of afterburners
2b9786f4 59 Bool_t fGenerationDone; // flag if generation is already done
60 // during first call of Generate method
61 // if true just return event to gAlice
62 //
984c69bd 63 TObjArray *fInternalStacks; //! List of internal stacks
cc41459d 64
9c64a93a 65 AliCollisionGeometry** fCollisionGeometries; //! List of Collision Geometries
66 AliGenCocktailEventHeader** fHeaders; //! List of Headers
cc41459d 67
984c69bd 68 Int_t fCurrentEvent; // Number of current event/stack
0b359ada 69
984c69bd 70
71 AliStack* fActiveStack; //! pointer to the current stack
72 Int_t fActiveEvent; //HBT Processor needs more then one event to do correlations
73 //Due to complications in fortran, it first calls C routine
74 //that sets the active event to be read. All alihbtp_gettrack
75 //are addressed to this event
0b359ada 76
984c69bd 77 AliGenerator *fCurrentGenerator; // Current event generator
20dddfab 78 Int_t fNBgEvents; //Nuber of backgrouns events
79 //(events that are generated only temporarly)
80 //needed by some afterburners that works better with higher statistics
81 //this generates such a artificial one
198bb1c7 82 private:
93a2041b 83 AliGenCocktailAfterBurner(const AliGenCocktailAfterBurner& in);
84 AliGenCocktailAfterBurner & operator=(const AliGenCocktailAfterBurner & rhs);
0af12c00 85
466bfded 86 ClassDef(AliGenCocktailAfterBurner,2) // Particle cocktail generator a la SHAKER
87 //background events added
0b359ada 88};
89
90inline AliGenerator*
20dddfab 91 AliGenCocktailAfterBurner::GetCurrentGenerator() const
0b359ada 92{
93 return fCurrentGenerator;
94}
95
96
97#endif
98
99
100
101
102