]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THijing/THijing.cxx
changing msg to aliinfo
[u/mrichter/AliRoot.git] / THijing / THijing.cxx
index 93e1a45f1ece22ddc2618d2293fd43af3fe9b59c..5868245be0aa2dfa9d9032e8d12a789d814da91a 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                                                                    //
 //****************************************************************************//
 
 
-#include "THijing.h"
-#include "TObjArray.h"
+#include <TClonesArray.h>
+#include <TObjArray.h>
+#include <TParticle.h>
+#include <TROOT.h>
+
 #include "Hcommon.h"
-#include "TParticle.h"
-#include "TROOT.h"
+#include "THijing.h"
 
 #ifndef WIN32
 # define hijset hijset_
@@ -36,6 +55,7 @@
 # define profile profile_
 # define rluget_hijing rluget_hijing_
 # define rluset_hijing rluset_hijing_
+# define lulist_hijing lulist_hijing_
 # define type_of_call
 #else
 # define hijset HIJSET
@@ -43,6 +63,7 @@
 # define profile PROFILE
 # define rluget_hijing RLUGET_HIJING
 # define rluset_hijing RLUSET_HIJING
+# define lulist_hijing LULIST_HIJING
 # define type_of_call _stdcall
 #endif
 
@@ -58,6 +79,7 @@ extern "C" void type_of_call hijing(const char *, Float_t  &,
 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);
+extern "C" void type_of_call lulist_hijing(Int_t &);
 
 #else
 #endif
@@ -66,30 +88,43 @@ extern "C" void type_of_call rluset_hijing(Int_t & lfn, Int_t & move);
 
 ClassImp(THijing)
 
-THijing::THijing() : TGenerator("Hijing","Hijing")
+
+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")
+                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.
-      fEfrm=efrm;
-      fFrame=frame;
-      fProj=proj;
-      fTarg=targ;
-      fIap=iap;
-      fIzp=izp;
-      fIat=iat;
-      fIzt=izt;
-      fBmin=bmin;
-      fBmax=bmax;
 }
 
 //______________________________________________________________________________
@@ -127,11 +162,12 @@ TObjArray* THijing::ImportParticles(Option_t *option)
 //
                nump++;
                TParticle* p = new TParticle(
-                   HIMAIN2.katt[0][i], HIMAIN2.katt[1][i] ,
+                   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);
            }
        }
@@ -150,11 +186,12 @@ TObjArray* THijing::ImportParticles(Option_t *option)
            }
            
            TParticle* p = new TParticle(
-               HIMAIN2.katt[0][i], HIMAIN2.katt[1][i], iParent,
+               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);
        }
     }
@@ -192,7 +229,7 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
            nump++;
            new(particlesR[i]) TParticle(
                  HIMAIN2.katt[0][i] ,
-                 HIMAIN2.katt[1][i] ,
+                 HIMAIN2.katt[3][i] ,
                  -1 ,
                  -1,
                  -1,
@@ -208,6 +245,7 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
                  HIMAIN2.vatt[2][i] ,
                  HIMAIN2.vatt[3][i] 
                  );
+           particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
          }
       }
   }
@@ -226,7 +264,7 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
 
          new(particlesR[i]) TParticle(
              HIMAIN2.katt[0][i] ,
-             HIMAIN2.katt[1][i] ,
+             HIMAIN2.katt[3][i] ,
              iParent,
              -1,
              -1,
@@ -242,6 +280,7 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
              HIMAIN2.vatt[2][i] ,
              HIMAIN2.vatt[3][i]
              );
+         particlesR[i]->SetUniqueID(HIMAIN2.katt[1][i]);
       }
   }
   return nump;
@@ -1093,9 +1132,9 @@ void THijing::SetPARJ(Int_t key, Float_t parm)
     if ( key < 1 || key > 200) {
        printf("ERROR in THijing::SetPARJ(key,parm):\n");
        printf("      key=%i is out of range [1..200]\n",key);
+    } else {
+      LUDAT1_HIJING.parj[key-1] = parm;
     }
-    
-    LUDAT1_HIJING.parj[key-1] = parm;
 }
 
 
@@ -1105,12 +1144,42 @@ void THijing::SetMSTJ(Int_t key, Int_t parm)
     if ( key < 1 || key > 200) {
        printf("ERROR in THijing::SetMSTJ(key,parm):\n");
        printf("      key=%i is out of range [1..200]\n",key);
+    } else {
+      LUDAT1_HIJING.mstj[key-1] = parm;
     }
-    
-    LUDAT1_HIJING.mstj[key-1] = parm;
 }
 
+void  THijing::SetMDCY(Int_t key1, Int_t key2, Int_t   parm)
+{
+  // Set value of array MDCY
+  if ( key1 < 1 || key1 > 500) {
+    printf("ERROR in THijing::SetMDCY(key1, key2, parm):\n");
+    printf("      key1=%i is out of range [1..200]\n", key1);
+  } else if ( key2 < 1 || key2 > 3) {
+    printf("ERROR in THijing::SetMDCY(key1, key2, parm):\n");
+    printf("      key2=%i is out of range [1..200]\n", key2);
+  } else {
+    LUDAT3_HIJING.mdcy[key2-1][key1-1] = parm;
+  }
+  
+}
+
+Int_t THijing::GetMDCY(Int_t key1, Int_t key2) 
+{
+  // Get value of array MDCY
+  if ( key1 < 1 || key1 > 500) {
+    printf("ERROR in THijing::GetMDCY(key1, key2, parm):\n");
+    printf("      key1=%i is out of range [1..200]\n", key1);
+    return -1;
+  } else if ( key2 < 1 || key2 > 3) {
+    printf("ERROR in THijing::GetMDCY(key1, key2, parm):\n");
+    printf("      key2=%i is out of range [1..200]\n", key2);
+    return -1;
+  } else {
+    return (LUDAT3_HIJING.mdcy[key2-1][key1-1]);
+  }
 
+}
 //====================== access to Hijing subroutines =========================
 
 
@@ -1217,3 +1286,8 @@ void  THijing::Rluset(Int_t lfn, Int_t move)
   rluset_hijing(lfn, move);
 }
 
+void  THijing::Pylist(Int_t flag)
+{
+// call lulist
+  lulist_hijing(flag);
+}