]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenParam.cxx
Unique names for functions enforced.
[u/mrichter/AliRoot.git] / EVGEN / AliGenParam.cxx
index 32191ad86951433b920d27b227f437aed1edc86b..4fefe48e44d9ac0ab398de6449cb036d3cd3b289 100644 (file)
 #include <TParticlePDG.h>
 #include <TDatabasePDG.h>
 #include <TLorentzVector.h>
+#include <TVirtualMC.h>
 
 #include <TF1.h>
 #include <TCanvas.h>
 #include <TH1.h>
+#include "AliMC.h"
 
 ClassImp(AliGenParam)
 
@@ -164,16 +166,22 @@ void AliGenParam::Init()
     <img src="picts/AliGenParam.gif">
   */
   //End_Html
-    fPtPara = new TF1("Pt-Parametrization",fPtParaFunc,fPtMin,fPtMax,0);
+    char name[256];
+    sprintf(name, "pt-parameterisation for %s", GetName());
+    
+    fPtPara = new TF1(name, fPtParaFunc, fPtMin, fPtMax,0);
 //  Set representation precision to 10 MeV
-    Int_t npx= Int_t((fPtMax-fPtMin)/fDeltaPt);
+    Int_t npx= Int_t((fPtMax - fPtMin) / fDeltaPt);
     
     fPtPara->SetNpx(npx);
+
+    sprintf(name, "y-parameterisation  for %s", GetName());
+    fYPara  = new TF1(name, fYParaFunc, fYMin, fYMax, 0);
     
-    fYPara  = new TF1("Y -Parametrization",fYParaFunc,fYMin,fYMax,0);
-    TF1* ptPara = new TF1("Pt-Parametrization",fPtParaFunc,0,15,0);
-    TF1* yPara  = new TF1("Y -Parametrization",fYParaFunc,-6,6,0);
+    sprintf(name, "pt-for-%s", GetName());
+    TF1 ptPara(name ,fPtParaFunc, 0, 15, 0);
+    sprintf(name, "y-for-%s", GetName());
+    TF1 yPara(name, fYParaFunc, -6, 6, 0);
 
 //
 // dN/dy| y=0
@@ -183,9 +191,9 @@ void AliGenParam::Init()
     fdNdy0=fYParaFunc(&y1,&y2);
 //
 // Integral over generation region
-    Float_t intYS  = yPara ->Integral(fYMin, fYMax);
-    Float_t intPt0 = ptPara->Integral(0,15);
-    Float_t intPtS = ptPara->Integral(fPtMin,fPtMax);
+    Float_t intYS  = yPara.Integral(fYMin, fYMax);
+    Float_t intPt0 = ptPara.Integral(0,15);
+    Float_t intPtS = ptPara.Integral(fPtMin,fPtMax);
     Float_t phiWgt=(fPhiMax-fPhiMin)/2./TMath::Pi();
     if (fAnalog == kAnalog) {
        fYWgt  = intYS/fdNdy0;
@@ -442,7 +450,7 @@ void AliGenParam::Generate()
          } // kinematic selection
          else  // nodecay option, so parent will be tracked by GEANT (pions, kaons, eta, omegas, baryons)
          {
-           gAlice->
+           gAlice->GetMCApp()->
                PushTrack(fTrackIt,-1,iPart,p,origin0,polar,0,kPPrimary,nt,wgtp);
             ipa++; 
          }
@@ -452,7 +460,7 @@ void AliGenParam::Generate()
   SetHighWaterMark(nt);
 }
 
-void AliGenParam::Draw()
+void AliGenParam::Draw( const char * /*opt*/)
 {
     //
     // Draw the pT and y Distributions