]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenParam.cxx
1. i need to know pointer to parent inputhandler (In case i want to access
[u/mrichter/AliRoot.git] / EVGEN / AliGenParam.cxx
index 506347f5e663cc4ff4ca7a89faa14dd57545dd0d..f989ab94df772c163444a3473dd09449895a4e95 100644 (file)
@@ -69,7 +69,7 @@ ClassImp(AliGenParam)
 // Default constructor
 }
 //____________________________________________________________
-AliGenParam::AliGenParam(Int_t npart, AliGenLib * Library,  Int_t param, char* tname)
+AliGenParam::AliGenParam(Int_t npart, AliGenLib * Library,  Int_t param, const char* tname)
     :AliGenMC(npart),
      fPtParaFunc(Library->GetPt(param, tname)),
      fYParaFunc (Library->GetY (param, tname)),
@@ -186,7 +186,7 @@ void AliGenParam::Init()
   */
   //End_Html
     char name[256];
-    sprintf(name, "pt-parameterisation for %s", GetName());
+    snprintf(name, 256, "pt-parameterisation for %s", GetName());
     
     if (fPtPara) fPtPara->Delete();
     fPtPara = new TF1(name, fPtParaFunc, fPtMin, fPtMax,0);
@@ -196,15 +196,15 @@ void AliGenParam::Init()
     
     fPtPara->SetNpx(npx);
 
-    sprintf(name, "y-parameterisation  for %s", GetName());
+    snprintf(name, 256, "y-parameterisation  for %s", GetName());
     if (fYPara) fYPara->Delete();
     fYPara  = new TF1(name, fYParaFunc, fYMin, fYMax, 0);
     gROOT->GetListOfFunctions()->Remove(fYPara);
 
     
-    sprintf(name, "pt-for-%s", GetName());
+    snprintf(name, 256, "pt-for-%s", GetName());
     TF1 ptPara(name ,fPtParaFunc, 0, 15, 0);
-    sprintf(name, "y-for-%s", GetName());
+    snprintf(name, 256, "y-for-%s", GetName());
     TF1 yPara(name, fYParaFunc, -6, 6, 0);
 
 //
@@ -377,7 +377,7 @@ void AliGenParam::Generate()
              
              if (np >1) {
                  decayed = kTRUE;
-                 TParticle* iparticle =  (TParticle *) particles->At(0);
+                 TParticle* iparticle =  0;
                  Int_t ipF, ipL;
                  for (i = 1; i<np ; i++) {
                      trackIt[i] = 1;