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