]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA6/AliGenPythia.h
Charm production process configuration for pPb and pp added
[u/mrichter/AliRoot.git] / PYTHIA6 / 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     typedef enum {kCluster, kCell} JetRecMode_t;
31           
32     AliGenPythia();
33     AliGenPythia(Int_t npart);
34     AliGenPythia(const AliGenPythia &Pythia);
35     virtual ~AliGenPythia();
36     virtual void    Generate();
37     virtual void    Init();
38     // set a cut on the Z coord. of the primary vertex (cm)
39     //
40     virtual void    SetEventListRange(Int_t eventFirst=-1, Int_t eventLast=-1);
41     // select process type
42     virtual void    SetProcess(Process_t proc = kPyCharm) {fProcess = proc;}
43     // select structure function
44     virtual void    SetStrucFunc(StrucFunc_t func = kGRVHO) {fStrucFunc = func;}
45     // select pt of hard scattering 
46     virtual void    SetPtHard(Float_t ptmin = 0, Float_t ptmax = 1.e10)
47         {fPtHardMin = ptmin; fPtHardMax = ptmax; }
48     virtual void    SetYHard(Float_t ymin = -1.e10, Float_t ymax = 1.e10)
49         {fYHardMin = ymin; fYHardMax = ymax; }
50     // Set initial and final state gluon radiation
51     virtual void    SetGluonRadiation(Int_t iIn, Int_t iFin)
52         {fGinit = iIn; fGfinal = iFin;}
53     virtual void    SetPtKick(Float_t kt = 1.)
54         {fPtKick = kt;}
55     // set centre of mass energy
56     virtual void    SetEnergyCMS(Float_t energy = 5500) {fEnergyCMS = energy;}
57     // treat protons as inside nuclei
58     virtual void    SetNuclei(Int_t a1, Int_t a2);
59     virtual void    SetJetEtRange(Float_t etmin = 0., Float_t etmax = 1.e4)
60         {fEtMinJet = etmin; fEtMaxJet = etmax;}
61     virtual void    SetJetEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
62         {fEtaMinJet = etamin; fEtaMaxJet = etamax;}
63     virtual void    SetJetReconstructionMode(Int_t mode = kCell) {fJetReconstruction = mode;}
64     virtual void    SetJetPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
65         {fPhiMinJet = TMath::Pi()*phimin/180.; fPhiMaxJet = TMath::Pi()*phimax/180.;}
66     virtual void    SetGammaEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
67         {fEtaMinGamma = etamin; fEtaMaxGamma = etamax;}
68     virtual void    SetGammaPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
69         {fPhiMinGamma = TMath::Pi()*phimin/180.; fPhiMaxGamma = TMath::Pi()*phimax/180.;}
70     // Set option for feed down from higher family
71     virtual void SetFeedDownHigherFamily(Bool_t opt) {
72       fFeedDownOpt = opt;
73     }
74     // Set option for selecting particles kept in stack according to flavor
75     // or to parent selection
76     virtual void SetStackFillOpt(StackFillOpt_t opt) {
77       fStackFillOpt = opt;
78     }
79     // Set fragmentation option
80     virtual void SetFragmentation(const Bool_t opt) {
81       fFragmentation = opt;
82     }
83     // Set counting mode
84     virtual void SetCountMode(const CountMode_t mode) {
85       fCountMode = mode;
86     }
87     
88     // get cross section of process
89     virtual Float_t GetXsection() const {return fXsection;}
90     // get triggered jets
91     void GetJets(Int_t& njets, Int_t& ntrig, Float_t[4][10]);
92     void RecJetsUA1(Float_t eCellMin, Float_t eCellSeed, Float_t eMin, Float_t rMin, 
93                     Int_t& njets, Float_t jets[4][50]);    
94     void LoadEvent();
95     // Getters
96     virtual Process_t    GetProcess() {return fProcess;}
97     virtual StrucFunc_t  GetStrucFunc() {return fStrucFunc;}
98     virtual void         GetPtHard(Float_t& ptmin, Float_t& ptmax)
99         {ptmin = fPtHardMin; ptmax = fPtHardMax = ptmax;}
100     virtual Float_t      GetEnergyCMS() {return fEnergyCMS;}
101     virtual void         GetNuclei(Int_t&  a1, Int_t& a2)
102         {a1 = fNucA1; a2 = fNucA2;}
103     virtual void         GetJetEtRange(Float_t& etamin, Float_t& etamax)
104         {etamin = fEtaMinJet; etamax = fEtaMaxJet;}
105     virtual void         GetJetPhiRange(Float_t& phimin, Float_t& phimax)
106         {phimin = fPhiMinJet*180./TMath::Pi(); phimax = fPhiMaxJet*180/TMath::Pi();}
107     virtual void         GetGammaEtaRange(Float_t& etamin, Float_t& etamax)
108         {etamin = fEtaMinGamma; etamax = fEtaMaxGamma;}
109     virtual void         GetGammaPhiRange(Float_t& phimin, Float_t& phimax)
110         {phimin = fPhiMinGamma*180./TMath::Pi(); phimax = fPhiMaxGamma*180./TMath::Pi();}
111     //
112     virtual void FinishRun();
113     Bool_t CheckTrigger(TParticle* jet1, TParticle* jet2);
114     
115     // Assignment Operator
116     AliGenPythia & operator=(const AliGenPythia & rhs);
117  protected:
118     // adjust the weight from kinematic cuts
119     void   AdjustWeights();
120     Int_t  GenerateMB();
121     void   MakeHeader();    
122
123     TClonesArray* fParticles;       //Particle  List
124     
125     Process_t   fProcess;           //Process type
126     StrucFunc_t fStrucFunc;         //Structure Function
127     Float_t     fEnergyCMS;         //Centre of mass energy
128     Float_t     fKineBias;          //!Bias from kinematic selection
129     Int_t       fTrials;            //!Number of trials for current event
130     Int_t       fTrialsRun;         //!Number of trials for run
131     Float_t     fQ;                 //Mean Q
132     Float_t     fX1;                //Mean x1
133     Float_t     fX2;                //Mean x2
134     Int_t       fNev;               //Number of events 
135     Int_t       fFlavorSelect;      //Heavy Flavor Selection
136     Float_t     fXsection;          //Cross-section
137     AliPythia   *fPythia;           //!Pythia 
138     Float_t     fPtHardMin;         //lower pT-hard cut 
139     Float_t     fPtHardMax;         //higher pT-hard cut
140     Float_t     fYHardMin;          //lower  y-hard cut 
141     Float_t     fYHardMax;          //higher y-hard cut
142     Int_t       fNucA1;             //mass number nucleus side 1
143     Int_t       fNucA2;             //mass number nucleus side 2
144     Int_t       fGinit;             //initial state gluon radiation
145     Int_t       fGfinal;            //final state gluon radiation
146     Float_t     fPtKick;            //Transverse momentum kick
147     Bool_t      fFullEvent;         //!Write Full event if true
148     AliDecayer  *fDecayer;          //!Pointer to the decayer instance
149     Int_t       fDebugEventFirst;   //!First event to debug
150     Int_t       fDebugEventLast;    //!Last  event to debug
151     Float_t     fEtMinJet;          //Minimum et of triggered Jet
152     Float_t     fEtMaxJet;          //Maximum et of triggered Jet
153     Float_t     fEtaMinJet;         //Minimum eta of triggered Jet
154     Float_t     fEtaMaxJet;         //Maximum eta of triggered Jet
155     Float_t     fPhiMinJet;         //Minimum phi of triggered Jet
156     Float_t     fPhiMaxJet;         //Maximum phi of triggered Jet
157     Int_t       fJetReconstruction; //Jet Reconstruction mode 
158     Float_t     fEtaMinGamma;       // Minimum eta of triggered gamma
159     Float_t     fEtaMaxGamma;       // Maximum eta of triggered gamma
160     Float_t     fPhiMinGamma;       // Minimum phi of triggered gamma
161     Float_t     fPhiMaxGamma;       // Maximum phi of triggered gamma
162
163     StackFillOpt_t fStackFillOpt;   // Stack filling with all particles with
164                                     // that flavour or only with selected
165                                     // parents and their decays
166     Bool_t fFeedDownOpt;            // Option to set feed down from higher
167                                     // quark families (e.g. b->c)
168     Bool_t fFragmentation;          // Option to activate fragmentation by Pythia
169     //
170
171     CountMode_t fCountMode;         // Options for counting when the event will be finished.
172     // fCountMode = kCountAll         --> All particles that end up in the
173     //                                    stack are counted
174     // fCountMode = kCountParents     --> Only selected parents are counted
175     // fCountMode = kCountTrackabless --> Only particles flagged for tracking
176     //                                     are counted
177     //
178     ClassDef(AliGenPythia,4) // AliGenerator interface to Pythia
179 };
180 #endif
181
182
183
184
185