]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THijing/THijing.cxx
Add histos from all analyses to the output
[u/mrichter/AliRoot.git] / THijing / THijing.cxx
index 1d356ac6bedcac2b1ae3446ed25b3b261d55e164..58130406a1f148a27beca03f4411748b1c542050 100644 (file)
@@ -1,3 +1,20 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
 ////////////////////////////////////////////////////////////////////////////////
 //                                                                            //
 // THijing                                                                    //
 //                    Lawrence Berkeley Laboratory                           //
 //****************************************************************************//
 
-//*KEEP,THIJING.
-#include "THijing.h"
-//*KEEP,HCOMMON.
+
+#include <TClonesArray.h>
+#include <TObjArray.h>
+#include <TParticle.h>
+#include <TROOT.h>
+
 #include "Hcommon.h"
-//*KEEP,TMCParticle.
-//#include "TMCParticle.h"
-//*KEEP,TParticle,T=C++.
-#include "TParticle.h"
-//*KEND.
-
-//*KEEP,TCanvas.
-//#include "TCanvas.h"
-//*KEEP,TView.
-//#include "TView.h"
-//*KEEP,TROOT.
-#include "TROOT.h"
-//*KEEP,TPaveText.
-//#include "TPaveText.h"
-//*KEND.
+#include "THijing.h"
 
 #ifndef WIN32
 # define hijset hijset_
 # define hijing hijing_
+# define profile profile_
+# define rluget_hijing rluget_hijing_
+# define rluset_hijing rluset_hijing_
 # define type_of_call
 #else
 # define hijset HIJSET
 # define hijing HIJING
+# define profile PROFILE
+# define rluget_hijing RLUGET_HIJING
+# define rluset_hijing RLUSET_HIJING
 # define type_of_call _stdcall
 #endif
 
 #ifndef WIN32
-//extern "C" void type_of_call hijset(float &efrm, const char *frame, 
-//                                const char *proj, const char *targ,
-//                                int &iap, int &izp, int &iat,
-//                                int &izt, Long_t l_frame, 
-//                                Long_t l_proj, Long_t l_targ);
 extern "C" void type_of_call hijset(Float_t & , const char *, 
                                   const char *, const char *,
                                   Int_t & , Int_t &, Int_t &,
                                   Int_t &, const int, 
                                   const int, const int);
-//extern "C" void type_of_call hijing(const char *frame, float &bmin,
-//                                   float &bmax, Long_t l_frame);
-extern "C" void type_of_call hijing(const char *, Float_t &,
+extern "C" float type_of_call profile(Float_t &);
+extern "C" void type_of_call hijing(const char *, Float_t  &,
                                    Float_t &, const int);
+extern "C" void type_of_call rluget_hijing(Int_t & lfn, Int_t & move);
+
+extern "C" void type_of_call rluset_hijing(Int_t & lfn, Int_t & move);
+
 #else
-//extern "C" void type_of_call hijset(float &efrm, const char *frame, 
-//                                Long_t l_frame, const char *proj, 
-//                                Long_t l_proj,  const char *targ, 
-//                                Long_t l_targ,
-//                                int &iap, int &izp, int &iat,
-//                                int &izt);
-//extern "C" void type_of_call hijing(const char *frame, Long_t l_frame, 
-//                                float &bmin, float &bmax);
 #endif
 
-ClassImp(THijing)
 
-// void THijing::Streamer(TBuffer &R__b){}
-//______________________________________________________________________________
-THijing::THijing() : TGenerator("Hijing","Hijing")
-{
-// THijing constructor: creates a TClonesArray in which it will store all
-// particles. Note that there may be only one functional THijing object
-// at a time, so it's not use to create more than one instance of it.
 
-//    delete fParticles; // was allocated as TObjArray in TGenerator
+ClassImp(THijing)
 
-//    fParticles = new TClonesArray("TMCParticle",50);
 
+THijing::THijing(): 
+    TGenerator("Hijing","Hijing"),
+    fEfrm(5500.),
+    fFrame("CMS"),
+    fProj("A"),
+    fTarg("A"),
+    fIap(208),
+    fIzp(82),
+    fIat(208),
+    fIzt(82),
+    fBmin(0.),
+    fBmax(5.)
+{
+// Default constructor 
 }
 
 //______________________________________________________________________________
 THijing::THijing(Float_t efrm, const char *frame="CMS", 
-       const char *proj="A", const char *targ="A", Int_t iap=207, 
-       Int_t izp=82, Int_t iat=207, Int_t izt=82, Float_t bmin=0, 
-       Float_t bmax=20) : TGenerator("Hijing","Hijing")
-{
-// THijing constructor: creates a TClonesArray in which it will store all
-// particles. Note that there may be only one functional THijing object
+                const char *proj="A", const char *targ="A", 
+                Int_t iap=207, Int_t izp=82, Int_t iat=207, Int_t izt=82,
+                Float_t bmin=0, Float_t bmax=20): 
+    TGenerator("Hijing","Hijing"),
+    fEfrm(efrm),
+    fFrame(frame),
+    fProj(proj),
+    fTarg(targ),
+    fIap(iap),
+    fIzp(izp),
+    fIat(iat),
+    fIzt(izt),
+    fBmin(bmin),
+    fBmax(bmax)
+{
+// THijing constructor: 
+// Note that there may be only one functional THijing object
 // at a time, so it's not use to create more than one instance of it.
-
-//    delete fParticles; // was allocated as TObjArray in TGenerator
-
-//    fParticles = new TClonesArray("TMCParticle",50);
-
-      fEfrm=efrm;
-      fFrame=frame;
-      fProj=proj;
-      fTarg=targ;
-      fIap=iap;
-      fIzp=izp;
-      fIat=iat;
-      fIzt=izt;
-      fBmin=bmin;
-      fBmax=bmax;
 }
 
 //______________________________________________________________________________
 THijing::~THijing()
 {
-// Destroys the object, deletes and disposes all TMCParticles currently on list.
-
-//    if (fParticles) {
-//     fParticles->Delete();
-//      delete fParticles;
-//      fParticles = 0;
-//   }
+// Destructor
 }
 
-//______________________________________________________________________________
-//void THijing::Draw(Option_t *option)
-//{
-// Event display - not supported for THijing yet.
-
-//   if (!gPad) {
-//      if (!gROOT->GetMakeDefCanvas()) return;
-//      (gROOT->GetMakeDefCanvas())();
-//      gPad->GetCanvas()->SetFillColor(13);
-//   }
-
-//   static Float_t rbox = 1000;
-//   Float_t rmin[3],rmax[3];
-//   TView *view = gPad->GetView();
-//   if (!strstr(option,"same")) {
-//      if (view) { view->GetRange(rmin,rmax); rbox = rmax[2];}
-//      gPad->Clear();
-//   }
-
-//   AppendPad(option);
-
-//   view = gPad->GetView();
-//   //    compute 3D view
-//   if (view) {
-//      view->GetRange(rmin,rmax);
-//      rbox = rmax[2];
-//   } else {
-//      view = new TView(1);
-//      view->SetRange(-rbox,-rbox,-rbox, rbox,rbox,rbox );
-//   }
-
-//   TPaveText *pt = new TPaveText(-0.94,0.85,-0.25,0.98,"br");
-//   pt->AddText((char*)GetName());
-//   pt->AddText((char*)GetTitle());
-//   pt->SetFillColor(42);
-//   pt->Draw();
-//}
-
-//______________________________________________________________________________
-//TObjArray *THijing::ImportParticles(Option_t *)
-//{
-// Fills TClonesArray fParticles list with particles from common LUJETS.
-// Old contents of a list are cleared. This function should be called after
-// any change in common LUJETS, however GetParticles() method  calls it
-// automatically - user don't need to care about it. In case you make a call
-// to LuExec() you must call this method yourself to transfer new data from
-// common LUJETS to the fParticles list.
-//
-//   fParticles->Clear();
+
+TObjArray* THijing::ImportParticles(Option_t *option)
+{
 //
-//   Int_t numpart   = LUJETS.n;
-//   TClonesArray &a = *((TClonesArray*)fParticles);
+//  Default primary creation method. It reads the /HEPEVT/ common block which
+//  has been filled by the GenerateEvent method. If the event generator does
+//  not use the HEPEVT common block, This routine has to be overloaded by
+//  the subclasses.
+//  The function loops on the generated particles and store them in
+//  the TClonesArray pointed by the argument particles.
+//  The default action is to store only the stable particles (ISTHEP = 1)
+//  This can be demanded explicitly by setting the option = "Final"
+//  If the option = "All", all the particles are stored.
 //
-//   for (Int_t i = 0; i < numpart; i++) {
-//     new(a[i]) TMCParticle(LUJETS.k[0][i] ,
-//                           LUJETS.k[1][i] ,
-//                           LUJETS.k[2][i] ,
-//                           LUJETS.k[3][i] ,
-//                           LUJETS.k[4][i] ,
+    fParticles->Clear();
+    Int_t numpart = HIMAIN1.natt;
+    printf("\n THijing: HIJING stack contains %d particles.", numpart);
+    printf("\n THijing: Total energy:         %f           ", HIMAIN1.eatt);
+    printf("\n THijing: Number of hard scatterings: %d     ", HIMAIN1.jatt);
+    Int_t nump = 0;
+    if (!strcmp(option,"") || !strcmp(option,"Final")) {
+       for (Int_t i = 0; i < numpart; i++) {
+         
+           if (HIMAIN2.katt[3][i] == 1) {
 //
-//                           LUJETS.p[0][i] ,
-//                           LUJETS.p[1][i] ,
-//                           LUJETS.p[2][i] ,
-//                           LUJETS.p[3][i] ,
-//                           LUJETS.p[4][i] ,
+//  Use the common block values for the TParticle constructor
 //
-//                           LUJETS.v[0][i] ,
-//                           LUJETS.v[1][i] ,
-//                           LUJETS.v[2][i] ,
-//                           LUJETS.v[3][i] ,
-//                           LUJETS.v[4][i]);
-
-//   }
-//   return fParticles;
-//}
+               nump++;
+               TParticle* p = new TParticle(
+                   HIMAIN2.katt[0][i], HIMAIN2.katt[3][i] ,
+                   -1, -1, -1, -1,
+                   HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
+                   HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i] 
+                 );
+               p->SetUniqueID(HIMAIN2.katt[1][i]);
+               fParticles->Add(p);
+           }
+       }
+    }
+    else if (!strcmp(option,"All")) {
+       nump = numpart; 
+       for (Int_t i = 0; i < numpart; i++) {
+           
+           Int_t iParent = HIMAIN2.katt[2][i]-1;
+           
+           if (iParent >= 0) {
+               TParticle *mother = (TParticle*) (fParticles->UncheckedAt(iParent));       
+               mother->SetLastDaughter(i);
+               if (mother->GetFirstDaughter()==-1)
+                   mother->SetFirstDaughter(i);
+           }
+           
+           TParticle* p = new TParticle(
+               HIMAIN2.katt[0][i], HIMAIN2.katt[3][i], iParent,
+               -1, -1, -1,
+               HIMAIN2.patt[0][i], HIMAIN2.patt[1][i], HIMAIN2.patt[2][i], HIMAIN2.patt[3][i] ,
+               HIMAIN2.vatt[0][i], HIMAIN2.vatt[1][i], HIMAIN2.vatt[2][i], HIMAIN2.vatt[3][i]
+               );
+           p->SetUniqueID(HIMAIN2.katt[1][i]);
+           fParticles->Add(p);
+       }
+    }
+    return fParticles;
+}
 
-//______________________________________________________________________________
 Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
 {
 //
@@ -224,157 +209,198 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
 //  If the option = "All", all the particles are stored.
 //
   if (particles == 0) return 0;
-  TClonesArray &Particles = *particles;
-  Particles.Clear();
+  TClonesArray &particlesR = *particles;
+  particlesR.Clear();
   Int_t numpart = HIMAIN1.natt;
+  printf("\n THijing: HIJING stack contains %d particles.", numpart);
+  printf("\n THijing: Total energy:         %f           ", HIMAIN1.eatt);
+  printf("\n THijing: Number of hard scatterings: %d     ", HIMAIN1.jatt);
+  Int_t nump = 0;
   if (!strcmp(option,"") || !strcmp(option,"Final")) {
-    for (Int_t i = 0; i<=numpart; i++) {
-       if (HIMAIN2.katt[3][i] == 1) {
+      for (Int_t i = 0; i < numpart; i++) {
+         
+         if (HIMAIN2.katt[3][i] == 1) {
 //
 //  Use the common block values for the TParticle constructor
 //
-         new(Particles[i]) TParticle(
-                             HIMAIN2.katt[0][i] ,
-                             HIMAIN2.katt[1][i] ,
-                             HIMAIN2.katt[2][i] ,
-                             -1,
-                             -1,
-                             -1,
-
-                             HIMAIN2.patt[0][i] ,
-                             HIMAIN2.patt[1][i] ,
-                             HIMAIN2.patt[2][i] ,
-                             HIMAIN2.patt[3][i] ,
-
-                             0,
-                             0,
-                             0,
-                             0);
-       }
-    }
+           nump++;
+           new(particlesR[i]) TParticle(
+                 HIMAIN2.katt[0][i] ,
+                 HIMAIN2.katt[3][i] ,
+                 -1 ,
+                 -1,
+                 -1,
+                 -1,
+                 
+                 HIMAIN2.patt[0][i] ,
+                 HIMAIN2.patt[1][i] ,
+                 HIMAIN2.patt[2][i] ,
+                 HIMAIN2.patt[3][i] ,
+
+                 HIMAIN2.vatt[0][i] ,
+                 HIMAIN2.vatt[1][i] ,
+                 HIMAIN2.vatt[2][i] ,
+                 HIMAIN2.vatt[3][i] 
+                 );
+           particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
+         }
+      }
   }
   else if (!strcmp(option,"All")) {
-    for (Int_t i = 0; i<=numpart; i++) {
-         new(Particles[i]) TParticle(
-                             HIMAIN2.katt[0][i] ,
-                             HIMAIN2.katt[1][i] ,
-                             HIMAIN2.katt[2][i] ,
-                             -1,
-                             -1,
-                             -1,
-
-                             HIMAIN2.patt[0][i] ,
-                             HIMAIN2.patt[1][i] ,
-                             HIMAIN2.patt[2][i] ,
-                             HIMAIN2.patt[3][i] ,
-
-                             0,
-                             0,
-                             0,
-                             0);
-    }
+      nump = numpart; 
+      for (Int_t i = 0; i < numpart; i++) {
+
+         Int_t iParent = HIMAIN2.katt[2][i]-1;
+         
+         if (iParent >= 0) {
+             TParticle *mother = (TParticle*) (particlesR.UncheckedAt(iParent));          
+             mother->SetLastDaughter(i);
+             if (mother->GetFirstDaughter()==-1)
+                 mother->SetFirstDaughter(i);
+         }
+
+         new(particlesR[i]) TParticle(
+             HIMAIN2.katt[0][i] ,
+             HIMAIN2.katt[3][i] ,
+             iParent,
+             -1,
+             -1,
+             -1,
+             
+             HIMAIN2.patt[0][i] ,
+             HIMAIN2.patt[1][i] ,
+             HIMAIN2.patt[2][i] ,
+             HIMAIN2.patt[3][i] ,
+             
+             HIMAIN2.vatt[0][i] ,
+             HIMAIN2.vatt[1][i] ,
+             HIMAIN2.vatt[2][i] ,
+             HIMAIN2.vatt[3][i]
+             );
+         particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
+      }
   }
-  return numpart;
+  return nump;
 }
 
 //______________________________________________________________________________
 void THijing::SetEFRM(Float_t efrm)
 {
+// Set the centre of mass (CMS) or lab-energy (LAB)
    fEfrm=efrm;
 } 
 //______________________________________________________________________________
 void THijing::SetFRAME(const char* frame)
 {
+// Set the frame type ("CMS" or "LAB")
    fFrame=frame;
 } 
 //______________________________________________________________________________
 void THijing::SetPROJ(const char* proj)
 {
+// Set the projectile type
    fProj=proj;
 } 
 //______________________________________________________________________________
 void THijing::SetTARG(const char* targ)
 {
+// Set the target type
    fTarg=targ;
 } 
 //______________________________________________________________________________
 void THijing::SetIAP(Int_t iap)
 {
+// Set the projectile atomic number
    fIap=iap;
 } 
 //______________________________________________________________________________
 void THijing::SetIZP(Int_t izp)
 {
+// Set the projectile charge number
    fIzp=izp;
 } 
 //______________________________________________________________________________
 void THijing::SetIAT(Int_t iat)
 {
+// Set the target atomic number
    fIat=iat;
 } 
 //______________________________________________________________________________
 void THijing::SetIZT(Int_t izt)
 {
+// Set the target charge number
    fIzt=izt;
 } 
 //______________________________________________________________________________
 void THijing::SetBMIN(Float_t bmin)
 {
+// Set the minimum impact parameter
    fBmin=bmin;
 } 
 //______________________________________________________________________________
 void THijing::SetBMAX(Float_t bmax)
 {
+// Set the maximum impact parameter
    fBmax=bmax;
 } 
 //______________________________________________________________________________
 Float_t THijing::GetEFRM() const
 {
+// Get the centre of mass (CMS) or lab-energy (LAB)
    return fEfrm;
 } 
 //______________________________________________________________________________
 const char* THijing::GetFRAME() const
 {
+// Get the frame type ("CMS" or "LAB")
    return fFrame.Data();
 } 
 //______________________________________________________________________________
 const char* THijing::GetPROJ() const
 {
+// Get the projectile type
    return fProj;
 } 
 //______________________________________________________________________________
 const char* THijing::GetTARG() const
 {
+// Set the target type
    return fTarg;
 } 
 //______________________________________________________________________________
 Int_t THijing::GetIAP() const
 {
+// Get the projectile atomic number
    return fIap;
 } 
 //______________________________________________________________________________
 Int_t THijing::GetIZP() const
 {
+// Get the projectile charge number
    return fIzp;
 } 
 //______________________________________________________________________________
 Int_t THijing::GetIAT() const
 {
+// Get the target atomic number
    return fIat;
 } 
 //______________________________________________________________________________
 Int_t THijing::GetIZT() const
 {
+// Get the target charge number
    return fIzt;
 } 
 //______________________________________________________________________________
 Float_t THijing::GetBMIN() const
 {
+// Get the minimum impact parameter
    return fBmin;
 } 
 //______________________________________________________________________________
 Float_t THijing::GetBMAX() const
 {
+// Get the maximum impact parameter
    return fBmax;
 } 
 
@@ -383,6 +409,7 @@ Float_t THijing::GetBMAX() const
 //______________________________________________________________________________
 void THijing::SetHIPR1(Int_t key,Float_t value)
 {
+// Set the values of array HIPR1 in common HIPARNT
    if ( key<1 || key>100 ) {
       printf ("ERROR in THijing:SetHIPR1(key,value): \n ");
       printf ("      key=%i is out of range [1..100]!\n",key);
@@ -396,6 +423,7 @@ void THijing::SetHIPR1(Int_t key,Float_t value)
 //______________________________________________________________________________
 Float_t THijing::GetHIPR1(Int_t key) const
 {
+// Get the values of array HIPR1 in common HIPARNT
    if ( key<1 || key>100 ) {
       printf ("ERROR in THijing:GetHIPR1(key): \n ");
       printf ("      key=%i is out of range [1..100]!\n",key);
@@ -409,6 +437,7 @@ Float_t THijing::GetHIPR1(Int_t key) const
 //______________________________________________________________________________
 void THijing::SetIHPR2(Int_t key,Int_t value)
 {
+// Set the values of array HIPR2 in common HIPARNT
    if ( key<1 || key>50 ) {
       printf ("ERROR in THijing:SetIHPR2(key,value): \n ");
       printf ("      key=%i is out of range [1..50]!\n",key);
@@ -422,6 +451,7 @@ void THijing::SetIHPR2(Int_t key,Int_t value)
 //______________________________________________________________________________
 Int_t THijing::GetIHPR2(Int_t key) const
 {
+// Get the values of array HIPR2 in common HIPARNT
    if ( key<1 || key>50 ) {
       printf ("ERROR in THijing:GetIHPR2(key): \n ");
       printf ("      key=%i is out of range [1..50]!\n",key);
@@ -436,6 +466,7 @@ Int_t THijing::GetIHPR2(Int_t key) const
 //______________________________________________________________________________
 Float_t THijing::GetHINT1(Int_t key) const
 {
+// Get the values of array HINT1 in common HIPARNT
    if ( key<1 || key>100 ) {
       printf ("ERROR in THijing:GetHINT1(key): \n ");
       printf ("      key=%i is out of range [1..100]!\n",key);
@@ -450,6 +481,7 @@ Float_t THijing::GetHINT1(Int_t key) const
 //______________________________________________________________________________
 Int_t THijing::GetIHNT2(Int_t key) const
 {
+// Get the values of array HINT2 in common HIPARNT
    if ( key<1 || key>50 ) {
       printf ("ERROR in THijing:GetIHNT2(key): \n ");
       printf ("      key=%i is out of range [1..50]!\n",key);
@@ -466,7 +498,7 @@ Int_t THijing::GetIHNT2(Int_t key) const
 //______________________________________________________________________________
 Int_t  THijing::GetNATT() const
 {
-
+// Get the number of particles produces
    return HIMAIN1.natt;
 
 }
@@ -474,6 +506,7 @@ Int_t  THijing::GetNATT() const
 //______________________________________________________________________________
 Float_t  THijing::GetEATT() const
 {
+// Get total energy of particles
 
    return HIMAIN1.eatt;
 
@@ -482,6 +515,7 @@ Float_t  THijing::GetEATT() const
 //______________________________________________________________________________
 Int_t  THijing::GetJATT() const
 {
+// Get number of hard scatterings
 
    return HIMAIN1.jatt;
 
@@ -490,6 +524,7 @@ Int_t  THijing::GetJATT() const
 //______________________________________________________________________________
 Int_t  THijing::GetNT() const
 {
+// Get number of target participants
 
    return HIMAIN1.nt;
 
@@ -498,7 +533,7 @@ Int_t  THijing::GetNT() const
 //______________________________________________________________________________
 Int_t  THijing::GetNP() const
 {
-
+// Get number of projectile participants
    return HIMAIN1.np;
 
 }
@@ -507,13 +542,14 @@ Int_t  THijing::GetNP() const
 //______________________________________________________________________________
 Int_t  THijing::GetN0() const
 {
-
+// Get number of N-N collisions
    return HIMAIN1.n0;
 
 }
 //______________________________________________________________________________
 Int_t  THijing::GetN01() const
 {
+// Get number of N-wounded collisions
 
    return HIMAIN1.n01;
 
@@ -522,6 +558,7 @@ Int_t  THijing::GetN01() const
 //______________________________________________________________________________
 Int_t  THijing::GetN10() const
 {
+// Get number of wounded-N collisions
 
    return HIMAIN1.n10;
 
@@ -530,6 +567,7 @@ Int_t  THijing::GetN10() const
 //______________________________________________________________________________
 Int_t  THijing::GetN11() const
 {
+// Get number of wounded-wounded collisions
 
    return HIMAIN1.n11;
 
@@ -538,6 +576,7 @@ Int_t  THijing::GetN11() const
 //______________________________________________________________________________
 Float_t  THijing::GetBB() const
 {
+// Get impact parameter
 
    return HIMAIN1.bb;
 
@@ -548,9 +587,10 @@ Float_t  THijing::GetBB() const
 //______________________________________________________________________________
 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
 {
-   if ( key1<1 || key1>130000 ) {
+// Get values of array KATT in common HIMAIN2
+   if ( key1<1 || key1>200000 ) {
       printf("ERROR in THijing::GetKATT(key1,key2):\n");
-      printf("      key1=%i is out of range [1..130000]\n",key1);
+      printf("      key1=%i is out of range [1..200000]\n",key1);
       return 0;
    }
 
@@ -566,7 +606,8 @@ Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
 {
-   if ( key1<1 || key1>130000 ) {
+// Get values of array PATT in common HIMAIN2
+   if ( key1<1 || key1>200000 ) {
       printf("ERROR in THijing::GetPATT(key1,key2):\n");
       printf("      key1=%i is out of range [1..130000]\n",key1);
       return 0;
@@ -581,11 +622,30 @@ Float_t THijing::GetPATT(Int_t key1, Int_t key2) const
    return   HIMAIN2.patt[key2-1][key1-1];
 }
 
+Float_t THijing::GetVATT(Int_t key1, Int_t key2) const
+{
+// Get values of array VATT in common HIMAIN2
+   if ( key1<1 || key1>200000 ) {
+      printf("ERROR in THijing::GetVATT(key1,key2):\n");
+      printf("      key1=%i is out of range [1..130000]\n",key1);
+      return 0;
+   }
+
+   if ( key2<1 || key2>4 ) {
+      printf("ERROR in THijing::GetVATT(key1,key2):\n");
+      printf("      key2=%i is out of range [1..4]\n",key2);
+      return 0;
+   }
+   
+   return   HIMAIN2.vatt[key2-1][key1-1];
+}
+
 //====================== access to common HIJJET1 ===============================
 
 //______________________________________________________________________________
 Int_t THijing::GetNPJ(Int_t key) const
 {
+// Get values of array NPJ of common HIJJET1
    if ( key<1 || key>300 ) {
       printf("ERROR in THijing::GetNPJ(key):\n");
       printf("      key=%i is out of range [1..300]\n",key);
@@ -597,6 +657,7 @@ Int_t THijing::GetNPJ(Int_t key) const
 //______________________________________________________________________________
 Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
 {
+// Get values of array KFPJ in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetKFPJ(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -614,6 +675,7 @@ Int_t THijing::GetKFPJ(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
 {
+// Get values of array PJPX in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJPX(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -631,6 +693,7 @@ Float_t THijing::GetPJPX(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
 {
+// Get values of array PJPY in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJPY(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -648,6 +711,7 @@ Float_t THijing::GetPJPY(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
 {
+// Get values of array PJPZ in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJPZ(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -665,6 +729,7 @@ Float_t THijing::GetPJPZ(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
 {
+// Get values of array PJPE in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJPE(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -682,6 +747,7 @@ Float_t THijing::GetPJPE(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
 {
+// Get values of array PJPM in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJPM(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -699,6 +765,7 @@ Float_t THijing::GetPJPM(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Int_t THijing::GetNTJ(Int_t key) const
 {
+// Get values of array NTJ in common HIJJET1
    if ( key<1 || key>300 ) {
       printf("ERROR in THijing::GetNTJ(key):\n");
       printf("      key=%i is out of range [1..300]\n",key);
@@ -710,6 +777,7 @@ Int_t THijing::GetNTJ(Int_t key) const
 //______________________________________________________________________________
 Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
 {
+// Get values of array KFTJ in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetKFTJ(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -727,6 +795,7 @@ Int_t THijing::GetKFTJ(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
 {
+// Get values of array PJTX in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJTX(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -744,6 +813,7 @@ Float_t THijing::GetPJTX(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
 {
+// Get values of array PJTY in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJTY(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -761,6 +831,7 @@ Float_t THijing::GetPJTY(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
 {
+// Get values of array PJTZ in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJTZ(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -778,6 +849,7 @@ Float_t THijing::GetPJTZ(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
 {
+// Get values of array PJTE in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJTE(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -795,6 +867,7 @@ Float_t THijing::GetPJTE(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
 {
+// Get values of array PJTM in common HIJJET1
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPJTM(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -814,12 +887,14 @@ Float_t THijing::GetPJTM(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Int_t THijing::GetNSG() const
 {
+// Get value of NSG in common HIJJET2
    return HIJJET2.nsg;
 }
 
 //______________________________________________________________________________
 Int_t THijing::GetNJSG(Int_t key) const
 {
+// Get values of array NJSG in common HIJJET2
    if ( key<1 || key>900 ) {
       printf ("ERROR in THijing:GetNJSG(key): \n ");
       printf ("      key=%i is out of range [1..900]!\n",key);
@@ -833,6 +908,7 @@ Int_t THijing::GetNJSG(Int_t key) const
 //______________________________________________________________________________
 Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
 {
+// Get values of IASG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetIASG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -850,6 +926,7 @@ Int_t THijing::GetIASG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
 {
+// Get values of K1SG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetK1SG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -867,6 +944,7 @@ Int_t THijing::GetK1SG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
 {
+// Get values of K2SG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetK2SG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -884,6 +962,7 @@ Int_t THijing::GetK2SG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
 {
+// Get values of PXSG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetPXSG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -901,6 +980,7 @@ Float_t THijing::GetPXSG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
 {
+// Get values of PYSG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetPYSG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -918,6 +998,7 @@ Float_t THijing::GetPYSG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
 {
+// Get values of PZSG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetPZSG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -935,6 +1016,7 @@ Float_t THijing::GetPZSG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
 {
+// Get values of PESG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetPESG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -952,6 +1034,7 @@ Float_t THijing::GetPESG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
 {
+// Get values of PMSG in common HIJJET2
    if ( key1<1 || key1>900 ) {
       printf("ERROR in THijing::GetPMSG(key1):\n");
       printf("      key1=%i is out of range [1..900]\n",key1);
@@ -971,6 +1054,7 @@ Float_t THijing::GetPMSG(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
 {
+// Get values of array NFP in common HISTRNG
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetNFP(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -988,6 +1072,7 @@ Int_t THijing::GetNFP(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPP(Int_t key1, Int_t key2) const
 {
+// Get values of array PP in common HISTRNG
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPP(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -1005,6 +1090,7 @@ Float_t THijing::GetPP(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
 {
+// Get values of array NFT in common HISTRNG
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetNFT(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -1022,6 +1108,7 @@ Int_t THijing::GetNFT(Int_t key1, Int_t key2) const
 //______________________________________________________________________________
 Float_t THijing::GetPT(Int_t key1, Int_t key2) const
 {
+// Get values of array PT in common HISTRNG
    if ( key1<1 || key1>300 ) {
       printf("ERROR in THijing::GetPT(key1):\n");
       printf("      key1=%i is out of range [1..300]\n",key1);
@@ -1036,6 +1123,28 @@ Float_t THijing::GetPT(Int_t key1, Int_t key2) const
    return HISTRNG.pt[key2-1][key1-1];
 }
 
+void THijing::SetPARJ(Int_t key, Float_t parm) 
+{
+// Set values of array PARJ in common HISTRNG
+    if ( key < 1 || key > 200) {
+       printf("ERROR in THijing::SetPARJ(key,parm):\n");
+       printf("      key=%i is out of range [1..200]\n",key);
+    }
+    
+    LUDAT1_HIJING.parj[key-1] = parm;
+}
+
+
+void THijing::SetMSTJ(Int_t key, Int_t parm) 
+{
+// Set values of array MSTJ in common HISTRNG
+    if ( key < 1 || key > 200) {
+       printf("ERROR in THijing::SetMSTJ(key,parm):\n");
+       printf("      key=%i is out of range [1..200]\n",key);
+    }
+    
+    LUDAT1_HIJING.mstj[key-1] = parm;
+}
 
 
 //====================== access to Hijing subroutines =========================
@@ -1049,33 +1158,33 @@ void THijing::Initialize()
 // via SetEFRM, SetFRAME, SetPROJ, SetTARG, SetIAP, SetIZP, SetIAT, SetIZT      //
 //////////////////////////////////////////////////////////////////////////////////
 
-   if ( (!strcmp(fFrame.Data(), "CMS"  )) &&
-        (!strcmp(fFrame.Data(), "LAB"  ))){
+   if ( (!strcmp(fFrame.Data(), "CMS     "  )) &&
+        (!strcmp(fFrame.Data(), "LAB     "  ))){
       printf("WARNING! In THijing:Initialize():\n");
       printf(" specified frame=%s is neither CMS or LAB\n",fFrame.Data());
       printf(" resetting to default \"CMS\" .");
       fFrame="CMS";
    }
 
-   if ( (!strcmp(fProj.Data(), "A"     )) &&
-        (!strcmp(fProj.Data(), "P"     )) &&
-        (!strcmp(fProj.Data(), "PBAR"  ))){
+   if ( (!strcmp(fProj.Data(), "A       "     )) &&
+        (!strcmp(fProj.Data(), "P       "     )) &&
+        (!strcmp(fProj.Data(), "PBAR    "  ))){
       printf("WARNING! In THijing:Initialize():\n");
       printf(" specified projectile=%s is neither A, P or PBAR\n",fProj.Data());
       printf(" resetting to default \"A\" .");
       fProj="A";
    }
 
-   if ( (!strcmp(fTarg.Data(), "A"     )) &&
-        (!strcmp(fTarg.Data(), "P"     )) &&
-        (!strcmp(fTarg.Data(), "PBAR"  ))){
+   if ( (!strcmp(fTarg.Data(), "A       "     )) &&
+        (!strcmp(fTarg.Data(), "P       "     )) &&
+        (!strcmp(fTarg.Data(), "PBAR    "  ))){
       printf("WARNING! In THijing:Initialize():\n");
       printf(" specified target=%s is neither A, P or PBAR\n",fTarg.Data());
       printf(" resetting to default \"A\" .");
       fTarg="A";
    }
 
-
+   printf(" %s-%s at %f GeV \n",fProj.Data(),fTarg.Data(),fEfrm);
 
    Hijset(fEfrm,fFrame.Data(),fProj.Data(),fTarg.Data(),fIap,fIzp,fIat,fIzt);
 
@@ -1122,3 +1231,25 @@ void THijing::Hijing(const char *frame, float bmin, float bmax)
   hijing(frame, s1, bmin, bmax);
 #endif
 }
+
+
+Float_t  THijing::Profile(float b)
+{
+// Call HIJING routine PROFILE 
+  return profile(b);
+}
+
+
+void  THijing::Rluget(Int_t lfn, Int_t move)
+{
+// write seed to file
+  rluget_hijing(lfn, move);
+}
+
+
+void  THijing::Rluset(Int_t lfn, Int_t move)
+{
+// read seed from file 
+  rluset_hijing(lfn, move);
+}
+