]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FASTSIM/AliQuenchingWeights.h
Update quenching tables (Constantin Loizides).
[u/mrichter/AliRoot.git] / FASTSIM / AliQuenchingWeights.h
1 #ifndef ALIQUENCHINGWEIGHTS_H
2 #define ALIQUENCHINGWEIGHTS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //----------------------------------------------------------------------------
9 //     Implementation of the class to calculate the parton energy loss
10 //  Based on the "BDMPS" quenching weights by C.A.Salgado and U.A.Wiedemann
11 //
12 //  References:
13 //   C.A.Salgado and U.A.Wiedemann, Phys.Rev.D68 (2003) 014008 [hep-ph/0302184]
14 //   A.Dainese, Eur.Phys.J.C, in press, [nucl-ex/0312005]             
15 //
16 //            Origin:  C. Loizides   constantin.loizides@cern.ch
17 //                     A. Dainese    andrea.dainese@pd.infn.it            
18 //----------------------------------------------------------------------------
19
20 #include <TObject.h>
21 class TH1F;
22
23 class AliQuenchingWeights : public TObject {
24  public:
25   enum kECMethod {kDefault=0,kReweight=1};
26
27   AliQuenchingWeights();
28   AliQuenchingWeights(const AliQuenchingWeights& a);
29   virtual ~AliQuenchingWeights();
30
31   void Reset();
32   Int_t SampleEnergyLoss();
33   Double_t GetELossRandom(Int_t ipart, Double_t length, Double_t e=1.e6) const;
34   Double_t CalcQuenchedEnergy(Int_t ipart, Double_t length, Double_t e)  const;
35   Double_t GetELossRandom(Int_t ipart, TH1F *hell, Double_t e=1.e6) const;
36   Double_t CalcQuenchedEnergy(Int_t ipart, TH1F *hell, Double_t e)  const;
37
38   //multiple soft scattering approximation
39   Int_t InitMult(const Char_t *contall="$(ALICE_ROOT)/FASTSIM/data/cont_mult.all",
40                  const Char_t *discall="$(ALICE_ROOT)/FASTSIM/data/disc_mult.all"); 
41
42   //single hard scattering approximation
43   Int_t InitSingleHard(const Char_t *contall="$(ALICE_ROOT)/FASTSIM/data/cont_lin.all",
44                        const Char_t *discall="$(ALICE_ROOT)/FASTSIM/data/disc_lin.all"); 
45
46   Int_t CalcMult(Int_t ipart, Double_t rrrr,Double_t xxxx,
47                  Double_t &continuous,Double_t &discrete) const;
48   Int_t CalcMult(Int_t ipart, 
49                  Double_t w, Double_t qtransp, Double_t length,
50                  Double_t &continuous,Double_t &discrete) const;
51   Int_t CalcSingleHard(Int_t ipart, Double_t rrrr,Double_t xxxx,
52                        Double_t &continuous,Double_t &discrete) const;
53   Int_t CalcSingleHard(Int_t ipart, 
54                        Double_t w, Double_t mu, Double_t length,
55                        Double_t &continuous,Double_t &discrete) const;
56
57   Double_t CalcWC(Double_t q, Double_t l) const 
58     {return 0.5*q*l*l*fgkConvFmToInvGeV;}
59
60   Double_t CalcWCbar(Double_t mu, Double_t l) const 
61     {return 0.5*mu*mu*l*fgkConvFmToInvGeV;}
62
63   Double_t CalcWC(Double_t l) const 
64     {if(fMultSoft) return CalcWC(fQTransport,l);
65      else return CalcWCbar(fMu,l);}
66
67   Double_t CalcR(Double_t wc, Double_t l) const; 
68
69   Int_t CalcLengthMax(Double_t q) const
70     {Double_t l3max=fgkRMax/.5/q/fgkConvFmToInvGeV/fgkConvFmToInvGeV;
71      return (Int_t)TMath::Power(l3max,1./3.);} 
72
73   const TH1F* GetHisto(Int_t ipart,Int_t l) const;
74
75   void SetMu(Double_t m=1.) {fMu=m;}
76   void SetQTransport(Double_t q=1.) {fQTransport=q;}
77   void SetECMethod(kECMethod type=kDefault);
78   void SetLengthMax(Int_t l=20) {fLengthMax=l;}
79
80   Float_t GetMu()           const {return fMu;}
81   Float_t GetQTransport()   const {return fQTransport;}
82   Bool_t  GetECMethod()     const {return fECMethod;}
83   Bool_t  GetTablesLoaded() const {return fTablesLoaded;}
84   Bool_t  GetMultSoft()     const {return fMultSoft;}
85   Int_t   GetLengthMax()    const {return fLengthMax;}
86
87   TH1F* ComputeQWHisto (Int_t ipart,Double_t medval,Double_t length)  const; 
88   TH1F* ComputeQWHistoX(Int_t ipart,Double_t medval,Double_t length)  const; 
89   TH1F* ComputeELossHisto (Int_t ipart,Double_t medval,Double_t l,Double_t e=1.e6) const; 
90   TH1F* ComputeELossHisto (Int_t ipart,Double_t medval,TH1F *hEll,Double_t e=1.e6) const; 
91   
92   void PlotDiscreteWeights(Int_t len=4) const;
93   void PlotContWeights(Int_t itype,Int_t len) const;
94   void PlotContWeights(Int_t itype,Double_t medval) const;
95   void PlotAvgELoss(Int_t len ,Double_t e=1.e6) const;
96   void PlotAvgELoss(TH1F *hEll,Double_t e=1.e6) const;
97   void PlotAvgELossVsPt(Double_t medval,Int_t len) const;
98   void PlotAvgELossVsPt(Double_t medval,TH1F *hEll) const;
99
100  protected:
101   static const Double_t fgkConvFmToInvGeV; //conversion factor
102   static const Double_t fgkRMax; //max. tabled value of R
103   static Int_t fgCounter;//static instance counter
104   Int_t fInstanceNumber; //instance number of class
105
106   Bool_t fMultSoft;     //approximation type
107   Bool_t fECMethod;     //energy constraint method
108   Double_t fQTransport; //transport coefficient
109   Double_t fMu;         //Debye screening mass
110   Int_t fLengthMax;     //maximum length
111   Int_t fLengthMaxOld;  //maximum length used for histos
112
113   //discrete and cont part of quenching for
114   //both parton type and different lengths
115   TH1F ***fHistos; //!
116
117   // data strucs for tables
118   Double_t fxx[400];      //sampled energy quark
119   Double_t fxxg[400];     //sampled energy gluon
120   Double_t fdaq[34];      //discrete weight quark
121   Double_t fdag[34];      //discrete weight gluon
122   Double_t fcaq[34][261]; //continuous weights quarks
123   Double_t fcag[34][261]; //continuous weights gluons  
124   Double_t frrr[34];      //r value quark
125   Double_t frrrg[34];     //r value gluon
126   Bool_t fTablesLoaded;   //tables loaded
127
128   ClassDef(AliQuenchingWeights,1)    // Base class for Quenching Weights
129 };
130
131 #endif