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