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