]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenSlowNucleons.h
ALIROOT-5836 AliESDpid not respecting the AliVTrack interface (patch from Mihaela)
[u/mrichter/AliRoot.git] / EVGEN / AliGenSlowNucleons.h
1 #ifndef ALIGENSLOWNUCLEONS_H
2 #define ALIGENSLOWNUCLEONS_H
3 /* Copyright(c) 198-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 //
8 //  Generator for slow nucleons in pA interactions. 
9 //  Source is modelled by a relativistic Maxwell distributions.
10 //  Original code by  Ferenc Sikler  <sikler@rmki.kfki.hu>
11 //  This class: andreas.morsch@cern.ch
12 //
13 #include "AliGenerator.h"
14 class AliSlowNucleonModel;
15 class TH2F;
16 class TH1F;
17 class TF1;
18
19 class AliGenSlowNucleons : public AliGenerator
20 {
21 public:
22     AliGenSlowNucleons();
23     AliGenSlowNucleons(Int_t npart);
24     virtual ~AliGenSlowNucleons();
25     virtual void Init();
26     virtual void FinishRun();
27     virtual void Generate();
28     virtual void SetPmax(Float_t pmax = 10.) {fPmax = pmax;}
29     virtual void SetNominalCmsEnergy(Float_t energy = 14000.) {fCMS = energy;}
30     virtual void SetTarget(Int_t a = 208, Int_t z = 82) {fATarget = a; fZTarget = z;}
31     virtual void SetTarget(TString s, Int_t a, Int_t z) {AliGenerator::SetTarget(s, a, z);}
32     virtual void SetProtonDirection(Float_t dir = 1.);
33     virtual void SetCharge(Int_t c = 1) {fCharge = c;}
34     virtual void SetTemperature(Double_t t1 = 0.04, Double_t t2 = 0.004)
35         {fTemperatureG = t1; fTemperatureB = t2;}
36     virtual void SetBetaSource(Double_t b1 = 0.05, Double_t b2 = 0.)
37         {fBetaSourceG = b1; fBetaSourceB = b2;}
38     //
39     virtual void SetSlowNucleonModel(AliSlowNucleonModel* model) 
40         {fSlowNucleonModel = model;}
41     virtual Bool_t NeedsCollisionGeometry() const {return kTRUE;}
42     virtual void   SetCollisionGeometry(AliCollisionGeometry* geom)
43         {fCollisionGeometry = geom;}
44     virtual void   SetDebug(Int_t flag = 0) {fDebug = flag;}
45     virtual void   SetNumbersOfSlowNucleons(Int_t ngp, Int_t ngn, Int_t nbp, Int_t nbn)
46         {fNgp = ngp; fNgn = ngn; fNbp = nbp; fNbn = nbn;}
47     //
48     // Added by Chiara to take into account angular distribution 4 gray tracks
49     virtual void   SetThetaDist(Int_t flag=0) {fThetaDistribution = flag;}
50     //
51     virtual void   SetBeamCrossingAngle(Float_t crossAngle) {fBeamCrossingAngle = crossAngle;}
52     virtual void   SetBeamDivergence(Float_t divergence) {fBeamDivergence = divergence;}
53     //
54     virtual Int_t  GetNGrayProtons()   {return fNgp;}
55     virtual Int_t  GetNGrayNeutrons()  {return fNgn;}
56     virtual Int_t  GetNBlackProtons()  {return fNbp;}
57     virtual Int_t  GetNBlackNeutrons() {return fNbn;}    
58     //
59     virtual void   SetModelSmear(Int_t imode) {fSmearMode=imode;}
60     
61  protected:
62     void     GenerateSlow(Int_t charge, Double_t T, Double_t beta, Float_t* q, Float_t &theta);
63     Double_t Maxwell(Double_t m, Double_t p, Double_t t);
64     void     Lorentz(Double_t m, Double_t beta, Float_t* q);
65     void     BeamCrossDivergence(Int_t iwhat, Float_t *pLab);;
66     void     AddAngle(Double_t theta1, Double_t phi1, Double_t theta2,
67                         Double_t phi2, Double_t *angle);
68     void     SetProcessID(Int_t nt, UInt_t process);
69  protected:
70     Float_t  fCMS;             // Center of mass energy
71     Double_t fMomentum;        // Target nucleus momentum
72     Double_t fBeta;            // Target nucleus beta
73     Float_t  fPmax;            // Maximum slow nucleon momentum
74     Int_t    fCharge;          // Slow nucleon charge
75     Float_t  fProtonDirection; // Direction of the proton
76     Float_t  fTemperatureG;    // Source Temperature for gray nucleons
77     Float_t  fBetaSourceG;     // Source beta for gray nucleons
78     Float_t  fTemperatureB;    // Source Temperature for black nucleons
79     Float_t  fBetaSourceB;     // Source beta for black nucleons
80     Int_t    fNgp;             // Number of gray  protons
81     Int_t    fNgn;             // Number of gray  neutrons
82     Int_t    fNbp;             // Number of black protons
83     Int_t    fNbn;             // Number of black neutrons
84     Int_t    fDebug;           // Debug flag
85     TH2F*    fDebugHist1;      // Histogram for debugging
86     TH2F*    fDebugHist2;      // Histogram for debugging
87     // Added by Chiara to take into account angular distribution 4 gray tracks
88     Int_t    fThetaDistribution;// 0 -> flat dist., 1 -> fwd. peaked distribution
89     TH1F*    fCosThetaGrayHist; // Histogram for debugging
90     TF1*     fCosTheta;         // Function for non-uniform cos(theta) distribution
91     //
92     Float_t  fBeamCrossingAngle; // beam crossing angle (in radians)
93     Float_t  fBeamDivergence;    // beam divergence     (in radians)
94     Float_t  fBeamDivEvent;      // beam divergence     (in radians)
95     //
96     Int_t    fSmearMode;         // 0=Skler (no smear), =1 smearing Ncoll, =2 smearing Nslow
97     //
98     AliSlowNucleonModel* fSlowNucleonModel; // The slow nucleon model
99
100     enum {kGrayProcess = 200, kBlackProcess = 300};
101
102  private:
103     AliGenSlowNucleons(const AliGenSlowNucleons &sn);
104     AliGenSlowNucleons & operator=(const AliGenSlowNucleons & rhs);
105
106     ClassDef(AliGenSlowNucleons,4) // Slow Nucleon Generator
107 };
108 #endif
109
110
111
112
113
114
115