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