]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenPythia.h
Functions renamed to get a prefix PHOS
[u/mrichter/AliRoot.git] / EVGEN / AliGenPythia.h
1 #ifndef ALIGENPYTHIA_H
2 #define ALIGENPYTHIA_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 //
9 // Generator using the TPythia interface (via AliPythia)
10 // to generate pp collisions.
11 // Using SetNuclei() also nuclear modifications to the structure functions
12 // can be taken into account. This makes, of course, only sense for the
13 // generation of the products of hard processes (heavy flavor, jets ...)
14 //
15 // andreas.morsch@cern.ch
16 //
17
18 #include "AliGenMC.h"
19 #include "AliPythia.h"
20
21 class AliPythia;
22 class TParticle;
23
24 class AliGenPythia : public AliGenMC
25 {
26  public:
27
28   typedef enum {kFlavorSelection, kParentSelection} StackFillOpt_t;
29   typedef enum {kCountAll, kCountParents, kCountTrackables} CountMode_t;
30
31     AliGenPythia();
32     AliGenPythia(Int_t npart);
33     AliGenPythia(const AliGenPythia &Pythia);
34     virtual ~AliGenPythia();
35     virtual void    Generate();
36     virtual void    Init();
37     // set a cut on the Z coord. of the primary vertex (cm)
38     //
39     virtual void    SetEventListRange(Int_t eventFirst=-1, Int_t eventLast=-1);
40     // select process type
41     virtual void    SetProcess(Process_t proc = kPyCharm) {fProcess = proc;}
42     // select structure function
43     virtual void    SetStrucFunc(StrucFunc_t func = kGRVHO) {fStrucFunc = func;}
44     // select pt of hard scattering 
45     virtual void    SetPtHard(Float_t ptmin = 0, Float_t ptmax = 1.e10)
46         {fPtHardMin = ptmin; fPtHardMax = ptmax; }
47     virtual void    SetYHard(Float_t ymin = -1.e10, Float_t ymax = 1.e10)
48         {fYHardMin = ymin; fYHardMax = ymax; }
49     // set centre of mass energy
50     virtual void    SetEnergyCMS(Float_t energy = 5500) {fEnergyCMS = energy;}
51     // treat protons as inside nuclei
52     virtual void    SetNuclei(Int_t a1, Int_t a2);
53     virtual void    SetJetEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
54         {fEtaMinJet = etamin; fEtaMaxJet = etamax;}
55     virtual void    SetJetPhiRange(Float_t phimin = -180., Float_t phimax = 180.)
56         {fPhiMinJet = TMath::Pi()*phimin/180.; fPhiMaxJet = TMath::Pi()*phimax/180.;}
57     virtual void    SetGammaEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
58         {fEtaMinGamma = etamin; fEtaMaxGamma = etamax;}
59     virtual void    SetGammaPhiRange(Float_t phimin = -180., Float_t phimax = 180.)
60         {fPhiMinGamma = TMath::Pi()*phimin/180.; fPhiMaxGamma = TMath::Pi()*phimax/180.;}
61     // Set option for feed down from higher family
62     virtual void SetFeedDownHigherFamily(Bool_t opt) {
63       fFeedDownOpt = opt;
64     }
65     // Set option for selecting particles kept in stack according to flavor
66     // or to parent selection
67     virtual void SetStackFillOpt(StackFillOpt_t opt) {
68       fStackFillOpt = opt;
69     }
70     // Set fragmentation option
71     virtual void SetFragmentation(const Bool_t opt) {
72       fFragmentation = opt;
73     }
74     // Set counting mode
75     virtual void SetCountMode(const CountMode_t mode) {
76       fCountMode = mode;
77     }
78     
79     // get cross section of process
80     virtual Float_t GetXsection() const {return fXsection;}
81     // Getters
82     virtual Process_t    GetProcess() {return fProcess;}
83     virtual StrucFunc_t  GetStrucFunc() {return fStrucFunc;}
84     virtual void         GetPtHard(Float_t& ptmin, Float_t& ptmax)
85         {ptmin = fPtHardMin; ptmax = fPtHardMax = ptmax;}
86     virtual Float_t      GetEnergyCMS() {return fEnergyCMS;}
87     virtual void         GetNuclei(Int_t&  a1, Int_t& a2)
88         {a1 = fNucA1; a2 = fNucA2;}
89     virtual void         GetJetEtaRange(Float_t& etamin, Float_t& etamax)
90         {etamin = fEtaMinJet; etamax = fEtaMaxJet;}
91     virtual void         GetJetPhiRange(Float_t& phimin, Float_t& phimax)
92         {phimin = fPhiMinJet*180./TMath::Pi(); phimax = fPhiMaxJet*180/TMath::Pi();}
93     virtual void         GetGammaEtaRange(Float_t& etamin, Float_t& etamax)
94         {etamin = fEtaMinGamma; etamax = fEtaMaxGamma;}
95     virtual void         GetGammaPhiRange(Float_t& phimin, Float_t& phimax)
96         {phimin = fPhiMinGamma*180./TMath::Pi(); phimax = fPhiMaxGamma*180./TMath::Pi();}
97     //
98     virtual void FinishRun();
99     Bool_t CheckTrigger(TParticle* jet1, TParticle* jet2) const;
100     
101     // Assignment Operator
102     AliGenPythia & operator=(const AliGenPythia & rhs);
103  protected:
104     // adjust the weight from kinematic cuts
105     void   AdjustWeights();
106     Int_t  GenerateMB();
107     void   MakeHeader() const;    
108
109     TClonesArray* fParticles;     //Particle  List
110     
111     Process_t   fProcess;         //Process type
112     StrucFunc_t fStrucFunc;       //Structure Function
113     Float_t     fEnergyCMS;       //Centre of mass energy
114     Float_t     fKineBias;        //!Bias from kinematic selection
115     Int_t       fTrials;          //!Number of trials for current event
116     Int_t       fTrialsRun;       //!Number of trials for run
117     Float_t     fQ;               //Mean Q
118     Float_t     fX1;              //Mean x1
119     Float_t     fX2;              //Mean x2
120     Int_t       fNev;             //Number of events 
121     Int_t       fFlavorSelect;    //Heavy Flavor Selection
122     Float_t     fXsection;        //Cross-section
123     AliPythia   *fPythia;         //!Pythia 
124     Float_t     fPtHardMin;       //lower pT-hard cut 
125     Float_t     fPtHardMax;       //higher pT-hard cut
126     Float_t     fYHardMin;        //lower  y-hard cut 
127     Float_t     fYHardMax;        //higher y-hard cut
128     Int_t       fNucA1;           //mass number nucleus side 1
129     Int_t       fNucA2;           //mass number nucleus side 2
130     Bool_t      fFullEvent;       //!Write Full event if true
131     AliDecayer  *fDecayer;        //!Pointer to the decayer instance
132     Int_t       fDebugEventFirst; //!First event to debug
133     Int_t       fDebugEventLast;  //!Last  event to debug
134     Float_t     fEtaMinJet;       //Minimum eta of triggered Jet
135     Float_t     fEtaMaxJet;       //Maximum eta of triggered Jet
136     Float_t     fPhiMinJet;       //Minimum phi of triggered Jet
137     Float_t     fPhiMaxJet;       //Maximum phi of triggered Jet
138
139     Float_t     fEtaMinGamma;     // Minimum eta of triggered gamma
140     Float_t     fEtaMaxGamma;     // Maximum eta of triggered gamma
141     Float_t     fPhiMinGamma;     // Minimum phi of triggered gamma
142     Float_t     fPhiMaxGamma;     // Maximum phi of triggered gamma
143
144     StackFillOpt_t fStackFillOpt; // Stack filling with all particles with
145                                   // that flavour or only with selected
146                                   // parents and their decays
147     Bool_t fFeedDownOpt;          // Option to set feed down from higher
148                                   // quark families (e.g. b->c)
149     Bool_t fFragmentation;        // Option to activate fragmentation by Pythia
150     //
151
152     CountMode_t fCountMode;        // Options for counting when the event will be finished.
153     // fCountMode = kCountAll         --> All particles that end up in the
154     //                                    stack are counted
155     // fCountMode = kCountParents     --> Only selected parents are counted
156     // fCountMode = kCountTrackabless --> Only particles flagged for tracking
157     //                                     are counted
158     //
159     ClassDef(AliGenPythia,3) // AliGenerator interface to Pythia
160 };
161 #endif
162
163
164
165
166