Additional software trigger posiibilities for pions and gammas (G. Conesa)
[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;
28
8d2cd130 29class AliGenPythia : 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 AliGenPythia();
38 AliGenPythia(Int_t npart);
39 AliGenPythia(const AliGenPythia &Pythia);
40 virtual ~AliGenPythia();
41 virtual void Generate();
42 virtual void Init();
43 // set a cut on the Z coord. of the primary vertex (cm)
44 //
45 virtual void SetEventListRange(Int_t eventFirst=-1, Int_t eventLast=-1);
46 // select process type
47 virtual void SetProcess(Process_t proc = kPyCharm) {fProcess = proc;}
48 // select structure function
fa49ba58 49 virtual void SetStrucFunc(StrucFunc_t func = kCTEQ5L) {fStrucFunc = func;}
8d2cd130 50 // select pt of hard scattering
51 virtual void SetPtHard(Float_t ptmin = 0, Float_t ptmax = 1.e10)
52 {fPtHardMin = ptmin; fPtHardMax = ptmax; }
53 virtual void SetYHard(Float_t ymin = -1.e10, Float_t ymax = 1.e10)
54 {fYHardMin = ymin; fYHardMax = ymax; }
55 // Set initial and final state gluon radiation
56 virtual void SetGluonRadiation(Int_t iIn, Int_t iFin)
57 {fGinit = iIn; fGfinal = iFin;}
58 virtual void SetPtKick(Float_t kt = 1.)
59 {fPtKick = kt;}
beac474c 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;}
8d2cd130 64 // set centre of mass energy
65 virtual void SetEnergyCMS(Float_t energy = 5500) {fEnergyCMS = energy;}
66 // treat protons as inside nuclei
67 virtual void SetNuclei(Int_t a1, Int_t a2);
68 virtual void SetJetEtRange(Float_t etmin = 0., Float_t etmax = 1.e4)
69 {fEtMinJet = etmin; fEtMaxJet = etmax;}
70 virtual void SetJetEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
71 {fEtaMinJet = etamin; fEtaMaxJet = etamax;}
72 virtual void SetJetReconstructionMode(Int_t mode = kCell) {fJetReconstruction = mode;}
73 virtual void SetJetPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
74 {fPhiMinJet = TMath::Pi()*phimin/180.; fPhiMaxJet = TMath::Pi()*phimax/180.;}
75 virtual void SetGammaEtaRange(Float_t etamin = -20., Float_t etamax = 20.)
76 {fEtaMinGamma = etamin; fEtaMaxGamma = etamax;}
77 virtual void SetGammaPhiRange(Float_t phimin = 0., Float_t phimax = 360.)
78 {fPhiMinGamma = TMath::Pi()*phimin/180.; fPhiMaxGamma = TMath::Pi()*phimax/180.;}
7ce1321b 79
ec2c406e 80 // Select jets with bremsstrahlung or pi0 going to PHOS or EMCAL
81 virtual void SetBremssInCalo(Bool_t b) {fBremssInCalo = b;}
82 virtual void SetPi0InCalo (Bool_t b) {fPi0InCalo = b;}
83 virtual void SetBremssPi0InPHOS(Bool_t b) {fBremssPi0InPHOS = b;}
84 virtual void SetBremssPi0InEMCAL(Bool_t b) {fBremssPi0InEMCAL = b;}
85 virtual void SetBremsPi0MinPt(Float_t pt) {fBremssPi0MinPt=pt;}
86
7ce1321b 87 // Trigger on a particle
88 virtual void SetTriggerParticle(Int_t particle = 0, Float_t etamax = 0.9)
89 {fTriggerParticle = particle; fTriggerEta = etamax;}
8d2cd130 90 // Set option for feed down from higher family
91 virtual void SetFeedDownHigherFamily(Bool_t opt) {
92 fFeedDownOpt = opt;
93 }
94 // Set option for selecting particles kept in stack according to flavor
95 // or to parent selection
96 virtual void SetStackFillOpt(StackFillOpt_t opt) {
97 fStackFillOpt = opt;
98 }
99 // Set fragmentation option
c125238c 100 virtual void SetFragmentation(Bool_t opt) {
8d2cd130 101 fFragmentation = opt;
102 }
103 // Set counting mode
c125238c 104 virtual void SetCountMode(CountMode_t mode) {
8d2cd130 105 fCountMode = mode;
106 }
b6bbf811 107 // Set quenching mode 0 = no, 1 = AM, 2 = IL
7ea3ea5b 108 virtual void SetQuench(Int_t flag = 0) {fQuench = flag;}
5fa4b20b 109 virtual void SetHadronisation(Int_t flag = 1) {fHadronisation = flag;}
110 virtual void SetReadFromFile(const Text_t *filname) {fFileName = filname; fReadFromFile = 1;}
ec2c406e 111
112 // Get interaction rate for pileup studies
9d7108a7 113 virtual void SetInteractionRate(Float_t rate,Float_t timewindow = 90.e-6);
114 virtual Float_t GetInteractionRate() const {return fInteractionRate;}
8d2cd130 115 // get cross section of process
116 virtual Float_t GetXsection() const {return fXsection;}
117 // get triggered jets
7184e472 118 void GetJets(Int_t& njets, Int_t& ntrig, Float_t jets[4][10]);
014a9521 119 void RecJetsUA1(Int_t& njets, Float_t jets[4][50]);
592f8307 120 void SetPycellParameters(Float_t etamax = 2., Int_t neta = 274, Int_t nphi = 432,
121 Float_t thresh = 0., Float_t etseed = 4.,
122 Float_t minet = 10., Float_t r = 1.);
123
5fa4b20b 124 void LoadEvent(AliStack* stack, Int_t flag = 0, Int_t reHadr = 0);
8d2cd130 125 // Getters
7184e472 126 virtual Process_t GetProcess() const {return fProcess;}
127 virtual StrucFunc_t GetStrucFunc() const {return fStrucFunc;}
128 virtual void GetPtHard(Float_t& ptmin, Float_t& ptmax) const
35346e8d 129 {ptmin = fPtHardMin; ptmax = fPtHardMax;}
7184e472 130 virtual Float_t GetEnergyCMS() const {return fEnergyCMS;}
131 virtual void GetNuclei(Int_t& a1, Int_t& a2) const
1a626d4e 132 {a1 = fAProjectile; a2 = fATarget;}
7184e472 133 virtual void GetJetEtRange(Float_t& etamin, Float_t& etamax) const
8d2cd130 134 {etamin = fEtaMinJet; etamax = fEtaMaxJet;}
7184e472 135 virtual void GetJetPhiRange(Float_t& phimin, Float_t& phimax) const
8d2cd130 136 {phimin = fPhiMinJet*180./TMath::Pi(); phimax = fPhiMaxJet*180/TMath::Pi();}
7184e472 137 virtual void GetGammaEtaRange(Float_t& etamin, Float_t& etamax) const
8d2cd130 138 {etamin = fEtaMinGamma; etamax = fEtaMaxGamma;}
7184e472 139 virtual void GetGammaPhiRange(Float_t& phimin, Float_t& phimax) const
8d2cd130 140 {phimin = fPhiMinGamma*180./TMath::Pi(); phimax = fPhiMaxGamma*180./TMath::Pi();}
141 //
ec2c406e 142 Bool_t IsInEMCAL(Float_t phi, Float_t eta);
143 Bool_t IsInPHOS(Float_t phi, Float_t eta);
144 //
8d2cd130 145 virtual void FinishRun();
146 Bool_t CheckTrigger(TParticle* jet1, TParticle* jet2);
aea21c57 147
0f6ee828 148 //Used in some processes to selected child properties
aea21c57 149 Bool_t CheckKinematicsOnChild();
8d2cd130 150
aea21c57 151
8d2cd130 152 // Assignment Operator
153 AliGenPythia & operator=(const AliGenPythia & rhs);
9d7108a7 154 void GetSubEventTime();
cf57b268 155 void AddHeader(AliGenEventHeader* header);
156
8d2cd130 157 protected:
158 // adjust the weight from kinematic cuts
7184e472 159 void AdjustWeights() const;
f913ec4f 160 Int_t GenerateMB();
161 void MakeHeader();
9d7108a7 162 void GeneratePileup();
8d2cd130 163 Process_t fProcess; //Process type
164 StrucFunc_t fStrucFunc; //Structure Function
165 Float_t fEnergyCMS; //Centre of mass energy
166 Float_t fKineBias; //!Bias from kinematic selection
167 Int_t fTrials; //!Number of trials for current event
168 Int_t fTrialsRun; //!Number of trials for run
169 Float_t fQ; //Mean Q
170 Float_t fX1; //Mean x1
171 Float_t fX2; //Mean x2
f913ec4f 172 Float_t fEventTime; //Time of the subevent
173 Float_t fInteractionRate; //Interaction rate (set by user)
9d7108a7 174 Float_t fTimeWindow; //Time window for pileup events (set by user)
175 Int_t fCurSubEvent; //Index of the current sub-event
176 TArrayF *fEventsTime; //Subevents time for pileup
8d2cd130 177 Int_t fNev; //Number of events
178 Int_t fFlavorSelect; //Heavy Flavor Selection
179 Float_t fXsection; //Cross-section
180 AliPythia *fPythia; //!Pythia
181 Float_t fPtHardMin; //lower pT-hard cut
182 Float_t fPtHardMax; //higher pT-hard cut
183 Float_t fYHardMin; //lower y-hard cut
184 Float_t fYHardMax; //higher y-hard cut
8d2cd130 185 Int_t fGinit; //initial state gluon radiation
186 Int_t fGfinal; //final state gluon radiation
5fa4b20b 187 Int_t fHadronisation; //hadronisation
188 Int_t fNpartons; //Number of partons before hadronisation
189 Int_t fReadFromFile; //read partons from file
7ea3ea5b 190 Int_t fQuench; //Flag for quenching
8d2cd130 191 Float_t fPtKick; //Transverse momentum kick
192 Bool_t fFullEvent; //!Write Full event if true
193 AliDecayer *fDecayer; //!Pointer to the decayer instance
194 Int_t fDebugEventFirst; //!First event to debug
195 Int_t fDebugEventLast; //!Last event to debug
196 Float_t fEtMinJet; //Minimum et of triggered Jet
197 Float_t fEtMaxJet; //Maximum et of triggered Jet
198 Float_t fEtaMinJet; //Minimum eta of triggered Jet
199 Float_t fEtaMaxJet; //Maximum eta of triggered Jet
200 Float_t fPhiMinJet; //Minimum phi of triggered Jet
201 Float_t fPhiMaxJet; //Maximum phi of triggered Jet
202 Int_t fJetReconstruction; //Jet Reconstruction mode
203 Float_t fEtaMinGamma; // Minimum eta of triggered gamma
204 Float_t fEtaMaxGamma; // Maximum eta of triggered gamma
205 Float_t fPhiMinGamma; // Minimum phi of triggered gamma
206 Float_t fPhiMaxGamma; // Maximum phi of triggered gamma
592f8307 207 Float_t fPycellEtaMax; // Max. eta for Pycell
208 Int_t fPycellNEta; // Number of eta bins for Pycell
209 Int_t fPycellNPhi; // Number of phi bins for Pycell
210 Float_t fPycellThreshold; // Pycell threshold
211 Float_t fPycellEtSeed; // Pycell seed
212 Float_t fPycellMinEtJet; // Pycell min. jet et
213 Float_t fPycellMaxRadius; // Pycell cone radius
8d2cd130 214 StackFillOpt_t fStackFillOpt; // Stack filling with all particles with
215 // that flavour or only with selected
216 // parents and their decays
217 Bool_t fFeedDownOpt; // Option to set feed down from higher
218 // quark families (e.g. b->c)
7ce1321b 219 Bool_t fFragmentation; // Option to activate fragmentation by Pythia
220 Bool_t fSetNuclei; // Flag indicating that SetNuclei has been called
221 Bool_t fNewMIS; // Flag for the new multipple interactions scenario
222 Bool_t fHFoff; // Flag for switching heafy flavor production off
223 Int_t fTriggerParticle; // Trigger on this particle ...
224 Float_t fTriggerEta; // .. within |eta| < fTriggerEta
8d2cd130 225 //
5fa4b20b 226 CountMode_t fCountMode; // Options for counting when the event will be finished.
227 AliGenPythiaEventHeader* fHeader; //! Event header
228 AliRunLoader* fRL; //! Run Loader
2bcdbef3 229 const Text_t* fFileName; //! Name of file to read from
e5c87a3d 230
8d2cd130 231 // fCountMode = kCountAll --> All particles that end up in the
232 // stack are counted
233 // fCountMode = kCountParents --> Only selected parents are counted
234 // fCountMode = kCountTrackabless --> Only particles flagged for tracking
235 // are counted
236 //
ec2c406e 237
238 Bool_t fBremssInCalo ; // Option ask for Bremsstrahlung in calorimeters acceptance
239 Bool_t fPi0InCalo ; // Option ask for Pi0 in calorimeters acceptance
240 Bool_t fBremssPi0InEMCAL ; // Option ask for Bremss or Pi0 in calorimeters EMCAL acceptance
241 Bool_t fBremssPi0InPHOS ; // Option ask for Bremss or Pi0 in calorimeters PHOS acceptance
242 Float_t fBremssPi0MinPt ; // Minimum momentum of Bremsstrahlung or Pi0
243 //Calorimeters eta-phi acceptance
244 Float_t fPHOSMinPhi ;
245 Float_t fPHOSMaxPhi ;
246 Float_t fPHOSEta ;
247 Float_t fEMCALMinPhi ;
248 Float_t fEMCALMaxPhi ;
249 Float_t fEMCALEta ;
250
e5c87a3d 251 ClassDef(AliGenPythia,5) // AliGenerator interface to Pythia
8d2cd130 252};
253#endif
254
255
256
257
258