]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenHIJINGparaBa.cxx
New generator for the krypton runs of TPC (Marek)
[u/mrichter/AliRoot.git] / EVGEN / AliGenHIJINGparaBa.cxx
index 1fbae4289352a1f7f213e244b5e0d15e37ca03cd..1079a65dddb93f929e18ef04041ea358cdbc33df 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.1.4.1  2003/04/14 17:33:50  hristov
-Merging with v3-09-08 (part1)
+/* $Id$ */
 
-Revision 1.2  2003/01/14 10:50:18  alibrary
-Cleanup of STEER coding conventions
-
-Revision 1.1  2002/01/08 09:47:28  morsch
-HIJING parameterisation including baryons, first commit.
-
-*/
 ///////////////////////////////////////////////////////////////////
 // Parameterisation of pi, K, n and p eta and pt distributions   //
 // eta: according to HIJING (shadowing + quenching)              //
@@ -153,38 +143,38 @@ static Double_t etakac( Double_t *py, Double_t *)
 {
 // eta-distribution
 //____________________________________________________________
-    const Float_t p0 =  1.10343e+02;
-    const Float_t p1 =  1.73247e+01;
-    const Float_t p2 = -7.23808e+00;
-    const Float_t p3 =  4.48334e-01;
-    const Double_t y = TMath::Abs(*py);
+    const Float_t  kp0 =  1.10343e+02;
+    const Float_t  kp1 =  1.73247e+01;
+    const Float_t  kp2 = -7.23808e+00;
+    const Float_t  kp3 =  4.48334e-01;
+    const Double_t ky = TMath::Abs(*py);
 //
-    return (p0+p1*y+p2*y*y+p3*y*y*y)/20.;
+    return (kp0+kp1*ky+kp2*ky*ky+kp3*ky*ky*ky)/20.;
 }
 
 AliGenHIJINGparaBa::AliGenHIJINGparaBa()
-  :AliGenHIJINGpara()
+    :AliGenHIJINGpara(),
+     fPtba(0),
+     fETAba(0)
 {
     //
     // Default constructor
     //
     fName="HIGINGparaBa";
     fTitle="HIJING Parametrisation Particle Generator with Baryons";
-    fETAba = 0;
-    fPtba  = 0;
 }
 
 //_____________________________________________________________________________
 AliGenHIJINGparaBa::AliGenHIJINGparaBa(Int_t npart)
-  :AliGenHIJINGpara(npart)
+  :AliGenHIJINGpara(npart),
+     fPtba(0),
+     fETAba(0)
 {
   // 
   // Standard constructor
   //
     fName="HIGINGparaBa";
     fTitle="HIJING Parametrisation Particle Generator with Baryons";
-    fETAba = 0;
-    fPtba  = 0;
 }
 
 //_____________________________________________________________________________
@@ -214,35 +204,35 @@ void AliGenHIJINGparaBa::Init()
     fETAkac = new TF1("etakac",&etakac,etaMin,etaMax,0);
     fETAba  = new TF1("etabaryon",&etabaryon,etaMin,etaMax,0);
 
-    TF1 *etaPic0 = new TF1("etapic",&etapic,    -7, 7, 0);
-    TF1 *etaKac0 = new TF1("etakac",&etakac,    -7, 7, 0);
-    TF1 *etaBar0 = new TF1("etabar",&etabaryon, -7, 7, 0);
+    TF1 etaPic0("etapic(-7,7)",&etapic,    -7, 7, 0);
+    TF1 etaKac0("etakac(-7,7)",&etakac,    -7, 7, 0);
+    TF1 etaBar0("etabar(-7,7)",&etabaryon, -7, 7, 0);
     
-    TF1 *ptPic0  = new TF1("ptpi",  &ptpi,     0., 15., 0);
-    TF1 *ptKac0  = new TF1("ptka",  &ptka,     0., 15., 0);
-    TF1 *ptBar0  = new TF1("ptbar", &ptbaryon, 0., 15., 0);
+    TF1 ptPic0("ptpi(0,15)",  &ptpi,     0., 15., 0);
+    TF1 ptKac0("ptka(0,15)",  &ptka,     0., 15., 0);
+    TF1 ptBar0("ptbar(0,15)", &ptbaryon, 0., 15., 0);
 
-    Float_t intETApi  = etaPic0->Integral(-0.5, 0.5);
-    Float_t intETAka  = etaKac0->Integral(-0.5, 0.5);
-    Float_t intETAba  = etaBar0->Integral(-0.5, 0.5);
+    Float_t intETApi  = etaPic0.Integral(-0.5, 0.5);
+    Float_t intETAka  = etaKac0.Integral(-0.5, 0.5);
+    Float_t intETAba  = etaBar0.Integral(-0.5, 0.5);
 
     Float_t scalePi   = 6979./(intETApi/1.5);
     Float_t scaleKa   =  657./(intETAka/2.0);
     Float_t scaleBa   =  364./(intETAba/2.0);
 
 //  Fraction of events corresponding to the selected pt-range    
-    Float_t intPt    = (0.837*ptPic0->Integral(0, 15)+
-                       0.105*ptKac0->Integral(0, 15)+
-                        0.058*ptBar0->Integral(0, 15));
-    Float_t intPtSel = (0.837*ptPic0->Integral(fPtMin, fPtMax)+
-                       0.105*ptKac0->Integral(fPtMin, fPtMax)+
-                       0.058*ptBar0->Integral(fPtMin, fPtMax));
+    Float_t intPt    = (0.837*ptPic0.Integral(0, 15)+
+                       0.105*ptKac0.Integral(0, 15)+
+                        0.058*ptBar0.Integral(0, 15));
+    Float_t intPtSel = (0.837*ptPic0.Integral(fPtMin, fPtMax)+
+                       0.105*ptKac0.Integral(fPtMin, fPtMax)+
+                       0.058*ptBar0.Integral(fPtMin, fPtMax));
     Float_t ptFrac   = intPtSel/intPt;
 
 //  Fraction of events corresponding to the selected eta-range    
-    Float_t intETASel  = (scalePi*etaPic0->Integral(etaMin, etaMax)+
-                         scaleKa*etaKac0->Integral(etaMin, etaMax)+
-                         scaleBa*etaBar0->Integral(etaMin, etaMax));
+    Float_t intETASel  = (scalePi*etaPic0.Integral(etaMin, etaMax)+
+                         scaleKa*etaKac0.Integral(etaMin, etaMax)+
+                         scaleBa*etaBar0.Integral(etaMin, etaMax));
 //  Fraction of events corresponding to the selected phi-range    
     Float_t phiFrac    = (fPhiMax-fPhiMin)/2/TMath::Pi();
 
@@ -343,7 +333,7 @@ void AliGenHIJINGparaBa::Generate()
                        TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
                }
            }
-           SetTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
+           PushTrack(fTrackIt,-1,part,p,origin,polar,0,kPPrimary,nt,fParentWeight);
            break;
        } // while(1)
     } // Particle loop