]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA6/AliGenPythiaPlus.h
Create the rec-point branch even in the case of no digits. Please review and fix...
[u/mrichter/AliRoot.git] / PYTHIA6 / AliGenPythiaPlus.h
CommitLineData
39d810c8 1#ifndef ALIGENPYTHIAPLUS_H
2#define ALIGENPYTHIAPLUS_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6
7/* $Id$ */
8
9//
10// Generator using the TPythia interface (via AliPythia)
11// to generate pp collisions.
12// Using SetNuclei() also nuclear modifications to the structure functions
13// can be taken into account. This makes, of course, only sense for the
14// generation of the products of hard processes (heavy flavor, jets ...)
15//
16// andreas.morsch@cern.ch
17//
18
19#include "AliGenMC.h"
20#include "AliPythia.h"
21
22class AliPythiaBase;
23class TParticle;
24class AliGenPythiaEventHeader;
25class AliGenEventHeader;
26class AliStack;
27class AliRunLoader;
28
29class AliGenPythiaPlus : public AliGenMC
30{
31 public:
32
33 typedef enum {kFlavorSelection, kParentSelection} StackFillOpt_t;
34 typedef enum {kCountAll, kCountParents, kCountTrackables} CountMode_t;
35 typedef enum {kCluster, kCell} JetRecMode_t;
36
37 AliGenPythiaPlus();
38 AliGenPythiaPlus(AliPythiaBase* pythia);
39 virtual ~AliGenPythiaPlus();
40 virtual void Generate();
41 virtual void Init();
42 // Range of events to be printed
43 virtual void SetEventListRange(Int_t eventFirst=-1, Int_t eventLast=-1);
44 // Select process type
45 virtual void SetProcess(Process_t proc = kPyCharm) {fProcess = proc;}
46 // Select structure function
47 virtual void SetStrucFunc(StrucFunc_t func = kCTEQ5L) {fStrucFunc = func;}
48 // Select pt of hard scattering
49 virtual void SetPtHard(Float_t ptmin = 0, Float_t ptmax = 1.e10)
50 {fPtHardMin = ptmin; fPtHardMax = ptmax; }
51 // y of hard scattering
52 virtual void SetYHard(Float_t ymin = -1.e10, Float_t ymax = 1.e10)
53 {fYHardMin = ymin; fYHardMax = ymax; }
54 // Set initial and final state gluon radiation
55 virtual void SetGluonRadiation(Int_t iIn, Int_t iFin)
56 {fGinit = iIn; fGfinal = iFin;}
57 // Intrinsic kT
58 virtual void SetPtKick(Float_t kt = 1.)
59 {fPtKick = kt;}
60 // Use the Pythia 6.3 new multiple interations scenario
61 virtual void UseNewMultipleInteractionsScenario() {fNewMIS = kTRUE;}
62 // Switch off heavy flavors
63 virtual void SwitchHFOff() {fHFoff = kTRUE;}
64 // Set centre of mass energy
65 virtual void SetEnergyCMS(Float_t energy = 5500) {fEnergyCMS = energy;}
66 // Treat protons as inside nuclei with mass numbers a1 and a2
67 virtual void SetNuclei(Int_t a1, Int_t a2);
68 //
69 // Trigger options
70 //
71 // Energy range for jet trigger
72 virtual void SetJetEtRange(Float_t etmin = 0., Float_t etmax = 1.e4)
73 {fEtMinJet = etmin; fEtMaxJet = etmax;}
74 // Eta range for jet trigger
75 virtual void SetJetEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
76 {fEtaMinJet = etamin; fEtaMaxJet = etamax;}
77 // Phi range for jet trigger
78 virtual void SetJetPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
79 {fPhiMinJet = TMath::Pi()*phimin/180.; fPhiMaxJet = TMath::Pi()*phimax/180.;}
80 // Jet reconstruction mode; default is cone algorithm
81 virtual void SetJetReconstructionMode(Int_t mode = kCell) {fJetReconstruction = mode;}
82 // Eta range for gamma trigger
83 virtual void SetGammaEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
84 {fEtaMinGamma = etamin; fEtaMaxGamma = etamax;}
85 // Phi range for gamma trigger
86 virtual void SetGammaPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
87 {fPhiMinGamma = TMath::Pi()*phimin/180.; fPhiMaxGamma = TMath::Pi()*phimax/180.;}
88 // Select jets with fragmentation photon or pi0 going to PHOS or EMCAL
89 virtual void SetFragPhotonInCalo(Bool_t b) {fFragPhotonInCalo = b;}
90 virtual void SetPi0InCalo (Bool_t b) {fPi0InCalo = b;}
91 virtual void SetPhotonInCalo(Bool_t b) {fPhotonInCalo = b;}
92 virtual void SetCheckPHOS (Bool_t b) {fCheckPHOS = b;}
93 virtual void SetCheckEMCAL(Bool_t b) {fCheckEMCAL = b;}
94 virtual void SetFragPhotonInEMCAL(Bool_t b) {fCheckEMCAL = b; fFragPhotonInCalo = b;}
95 virtual void SetFragPhotonInPHOS(Bool_t b) {fCheckPHOS = b; fFragPhotonInCalo = b;}
96 virtual void SetPi0InEMCAL(Bool_t b) {fCheckEMCAL = b; fPi0InCalo = b;}
97 virtual void SetPi0InPHOS(Bool_t b) {fCheckPHOS = b; fPi0InCalo = b;}
98 virtual void SetPhotonInEMCAL(Bool_t b) {fCheckEMCAL = b; fPhotonInCalo = b;}
99 virtual void SetPhotonInPHOS(Bool_t b) {fCheckPHOS = b; fPhotonInCalo = b;}
100 virtual void SetPhotonInPHOSeta(Bool_t b) {fCheckPHOSeta = b; fPhotonInCalo = b;}
101 virtual void SetFragPhotonOrPi0MinPt(Float_t pt) {fFragPhotonOrPi0MinPt = pt;}
102 virtual void SetPhotonMinPt(Float_t pt) {fPhotonMinPt = pt;}
103 // Trigger and rotate event
104 void RotatePhi(Int_t iphcand, Bool_t& okdd);
105 // Trigger on a single particle
106 virtual void SetTriggerParticle(Int_t particle = 0, Float_t etamax = 0.9)
107 {fTriggerParticle = particle; fTriggerEta = etamax;}
108 //
109 // Heavy flavor options
110 //
111 // Set option for feed down from higher family
112 virtual void SetFeedDownHigherFamily(Bool_t opt) {
113 fFeedDownOpt = opt;
114 }
115 // Set option for selecting particles kept in stack according to flavor
116 // or to parent selection
117 virtual void SetStackFillOpt(StackFillOpt_t opt) {
118 fStackFillOpt = opt;
119 }
120 // Set fragmentation option
121 virtual void SetFragmentation(Bool_t opt) {
122 fFragmentation = opt;
123 }
124 // Set counting mode
125 virtual void SetCountMode(CountMode_t mode) {
126 fCountMode = mode;
127 }
128 //
129 // Quenching
130 //
131 // Set quenching mode 0 = no, 1 = AM, 2 = IL
132 virtual void SetQuench(Int_t flag = 0) {fQuench = flag;}
133 virtual void SetHadronisation(Int_t flag = 1) {fHadronisation = flag;}
134 virtual void SetReadFromFile(const Text_t *filname) {fFileName = filname; fReadFromFile = 1;}
135
136 //
137 // Pile-up
138 //
139 // Get interaction rate for pileup studies
140 virtual void SetInteractionRate(Float_t rate,Float_t timewindow = 90.e-6);
141 virtual Float_t GetInteractionRate() const {return fInteractionRate;}
142 // Get cross section of process
143 virtual Float_t GetXsection() const {return fXsection;}
144 // Get triggered jets
145 void GetJets(Int_t& njets, Int_t& ntrig, Float_t jets[4][10]);
146 void RecJetsUA1(Int_t& njets, Float_t jets[4][50]);
147 void SetPycellParameters(Float_t etamax = 2., Int_t neta = 274, Int_t nphi = 432,
148 Float_t thresh = 0., Float_t etseed = 4.,
149 Float_t minet = 10., Float_t r = 1.);
150
151 // Getters
152 virtual Process_t GetProcess() const {return fProcess;}
153 virtual StrucFunc_t GetStrucFunc() const {return fStrucFunc;}
154 virtual void GetPtHard(Float_t& ptmin, Float_t& ptmax) const
155 {ptmin = fPtHardMin; ptmax = fPtHardMax;}
156 virtual Float_t GetEnergyCMS() const {return fEnergyCMS;}
157 virtual void GetNuclei(Int_t& a1, Int_t& a2) const
158 {a1 = fAProjectile; a2 = fATarget;}
159 virtual void GetJetEtRange(Float_t& etamin, Float_t& etamax) const
160 {etamin = fEtaMinJet; etamax = fEtaMaxJet;}
161 virtual void GetJetPhiRange(Float_t& phimin, Float_t& phimax) const
162 {phimin = fPhiMinJet*180./TMath::Pi(); phimax = fPhiMaxJet*180/TMath::Pi();}
163 virtual void GetGammaEtaRange(Float_t& etamin, Float_t& etamax) const
164 {etamin = fEtaMinGamma; etamax = fEtaMaxGamma;}
165 virtual void GetGammaPhiRange(Float_t& phimin, Float_t& phimax) const
166 {phimin = fPhiMinGamma*180./TMath::Pi(); phimax = fPhiMaxGamma*180./TMath::Pi();}
167 //
168 Bool_t IsInEMCAL(Float_t phi, Float_t eta);
169 Bool_t IsInPHOS(Float_t phi, Float_t eta);
170 //
171 virtual void FinishRun();
172 Bool_t CheckTrigger(TParticle* jet1, TParticle* jet2);
173 //Used in some processes to selected child properties
174 Bool_t CheckKinematicsOnChild();
175 void GetSubEventTime();
176
177 protected:
178 // adjust the weight from kinematic cuts
179 void AdjustWeights() const;
180 Int_t GenerateMB();
181 void MakeHeader();
182 void GeneratePileup();
183 AliPythiaBase *fPythia; //!Pythia
184 Process_t fProcess; //Process type
185 StrucFunc_t fStrucFunc; //Structure Function
186 Float_t fEnergyCMS; //Centre of mass energy
187 Float_t fKineBias; //!Bias from kinematic selection
188 Int_t fTrials; //!Number of trials for current event
189 Int_t fTrialsRun; //!Number of trials for run
190 Float_t fQ; //Mean Q
191 Float_t fX1; //Mean x1
192 Float_t fX2; //Mean x2
193 Float_t fEventTime; //Time of the subevent
194 Float_t fInteractionRate; //Interaction rate (set by user)
195 Float_t fTimeWindow; //Time window for pileup events (set by user)
196 Int_t fCurSubEvent; //Index of the current sub-event
197 TArrayF *fEventsTime; //Subevents time for pileup
198 Int_t fNev; //Number of events
199 Int_t fFlavorSelect; //Heavy Flavor Selection
200 Float_t fXsection; //Cross-section
201 Float_t fPtHardMin; //lower pT-hard cut
202 Float_t fPtHardMax; //higher pT-hard cut
203 Float_t fYHardMin; //lower y-hard cut
204 Float_t fYHardMax; //higher y-hard cut
205 Int_t fGinit; //initial state gluon radiation
206 Int_t fGfinal; //final state gluon radiation
207 Int_t fHadronisation; //hadronisation
208 Int_t fNpartons; //Number of partons before hadronisation
209 Int_t fReadFromFile; //read partons from file
210 Int_t fQuench; //Flag for quenching
211 Float_t fPtKick; //Transverse momentum kick
212 Bool_t fFullEvent; //!Write Full event if true
213 AliDecayer *fDecayer; //!Pointer to the decayer instance
214 Int_t fDebugEventFirst; //!First event to debug
215 Int_t fDebugEventLast; //!Last event to debug
216 Float_t fEtMinJet; //Minimum et of triggered Jet
217 Float_t fEtMaxJet; //Maximum et of triggered Jet
218 Float_t fEtaMinJet; //Minimum eta of triggered Jet
219 Float_t fEtaMaxJet; //Maximum eta of triggered Jet
220 Float_t fPhiMinJet; //Minimum phi of triggered Jet
221 Float_t fPhiMaxJet; //Maximum phi of triggered Jet
222 Int_t fJetReconstruction; //Jet Reconstruction mode
223 Float_t fEtaMinGamma; // Minimum eta of triggered gamma
224 Float_t fEtaMaxGamma; // Maximum eta of triggered gamma
225 Float_t fPhiMinGamma; // Minimum phi of triggered gamma
226 Float_t fPhiMaxGamma; // Maximum phi of triggered gamma
227 Float_t fPycellEtaMax; // Max. eta for Pycell
228 Int_t fPycellNEta; // Number of eta bins for Pycell
229 Int_t fPycellNPhi; // Number of phi bins for Pycell
230 Float_t fPycellThreshold; // Pycell threshold
231 Float_t fPycellEtSeed; // Pycell seed
232 Float_t fPycellMinEtJet; // Pycell min. jet et
233 Float_t fPycellMaxRadius; // Pycell cone radius
234 StackFillOpt_t fStackFillOpt; // Stack filling with all particles with
235 // that flavour or only with selected
236 // parents and their decays
237 Bool_t fFeedDownOpt; // Option to set feed down from higher
238 // quark families (e.g. b->c)
239 Bool_t fFragmentation; // Option to activate fragmentation by Pythia
240 Bool_t fSetNuclei; // Flag indicating that SetNuclei has been called
241 Bool_t fNewMIS; // Flag for the new multipple interactions scenario
242 Bool_t fHFoff; // Flag for switching heafy flavor production off
243 Int_t fTriggerParticle; // Trigger on this particle ...
244 Float_t fTriggerEta; // .. within |eta| < fTriggerEta
245 CountMode_t fCountMode; // Options for counting when the event will be finished.
246 // fCountMode = kCountAll --> All particles that end up in the
247 // stack are counted
248 // fCountMode = kCountParents --> Only selected parents are counted
249 // fCountMode = kCountTrackabless --> Only particles flagged for tracking
250 // are counted
251 //
252 //
253
254 AliGenPythiaEventHeader* fHeader; //! Event header
255 AliRunLoader* fRL; //! Run Loader
256 const Text_t* fFileName; //! Name of file to read from
257
258
259 Bool_t fFragPhotonInCalo; // Option to ask for Fragmentation Photon in calorimeters acceptance
260 Bool_t fPi0InCalo; // Option to ask for Pi0 in calorimeters acceptance
261 Bool_t fPhotonInCalo; // Option to ask for Decay Photon in calorimeter acceptance
262 Bool_t fCheckEMCAL; // Option to ask for FragPhoton or Pi0 in calorimeters EMCAL acceptance
263 Bool_t fCheckPHOS; // Option to ask for FragPhoton or Pi0 in calorimeters PHOS acceptance
264 Bool_t fCheckPHOSeta; // Option to ask for PHOS eta acceptance
265 Float_t fFragPhotonOrPi0MinPt; // Minimum momentum of Fragmentation Photon or Pi0
266 Float_t fPhotonMinPt; // Minimum momentum of Photon
267 //Calorimeters eta-phi acceptance
268 Float_t fPHOSMinPhi; // Minimum phi PHOS
269 Float_t fPHOSMaxPhi; // Maximum phi PHOS
270 Float_t fPHOSEta; // Minimum eta PHOS
271 Float_t fEMCALMinPhi; // Minimum phi EMCAL
272 Float_t fEMCALMaxPhi; // Maximum phi EMCAL
273 Float_t fEMCALEta; // Maximum eta EMCAL
274
275 private:
276 AliGenPythiaPlus(const AliGenPythiaPlus &Pythia);
277 AliGenPythiaPlus & operator=(const AliGenPythiaPlus & rhs);
278
279 ClassDef(AliGenPythiaPlus, 1) // AliGenerator interface to Pythia
280};
281#endif
282
283
284
285
286