]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THijing/THijing.cxx
CASTOR removed.
[u/mrichter/AliRoot.git] / THijing / THijing.cxx
index 6b814b69ff2e2d2cba10985cecfe31c016364217..ba922c97b25cdb42436ecb21c417ea7b9336e20b 100644 (file)
 # 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
 
@@ -72,6 +76,11 @@ extern "C" float type_of_call profile(Float_t &);
 //                                   float &bmax, Long_t l_frame);
 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, 
@@ -233,6 +242,10 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
   TClonesArray &Particles = *particles;
   Particles.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++) {
          
@@ -240,10 +253,11 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
 //
 //  Use the common block values for the TParticle constructor
 //
-             new(Particles[i]) TParticle(
+           nump++;
+           new(Particles[i]) TParticle(
                  HIMAIN2.katt[0][i] ,
                  HIMAIN2.katt[1][i] ,
-                 HIMAIN2.katt[2][i] ,
+                 -1 ,
                  -1,
                  -1,
                  -1,
@@ -252,15 +266,17 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
                  HIMAIN2.patt[1][i] ,
                  HIMAIN2.patt[2][i] ,
                  HIMAIN2.patt[3][i] ,
-                 
-                 0,
-                 0,
-                 0,
-                 0);
+
+                 HIMAIN2.vatt[0][i] ,
+                 HIMAIN2.vatt[1][i] ,
+                 HIMAIN2.vatt[2][i] ,
+                 HIMAIN2.vatt[3][i] 
+                 );
          }
       }
   }
   else if (!strcmp(option,"All")) {
+      nump=numpart; 
       for (Int_t i = 0; i<=numpart; i++) {
 
          Int_t iParent = HIMAIN2.katt[2][i]-1;
@@ -274,7 +290,7 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
 
          new(Particles[i]) TParticle(
              HIMAIN2.katt[0][i] ,
-             HIMAIN2.katt[3][i] ,
+             HIMAIN2.katt[1][i] ,
              iParent,
              -1,
              -1,
@@ -285,13 +301,14 @@ Int_t THijing::ImportParticles(TClonesArray *particles, Option_t *option)
              HIMAIN2.patt[2][i] ,
              HIMAIN2.patt[3][i] ,
              
-             0,
-             0,
-             0,
-             0);
+             HIMAIN2.vatt[0][i] ,
+             HIMAIN2.vatt[1][i] ,
+             HIMAIN2.vatt[2][i] ,
+             HIMAIN2.vatt[3][i]
+             );
       }
   }
-  return numpart;
+  return nump;
 }
 
 //______________________________________________________________________________
@@ -565,9 +582,9 @@ Float_t  THijing::GetBB() const
 //______________________________________________________________________________
 Int_t THijing::GetKATT(Int_t key1, Int_t key2) const
 {
-   if ( key1<1 || key1>130000 ) {
+   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;
    }
 
@@ -583,7 +600,7 @@ 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 ) {
+   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;
@@ -598,6 +615,23 @@ 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
+{
+   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 ===============================
 
 //______________________________________________________________________________
@@ -1148,4 +1182,16 @@ Float_t  THijing::Profile(float 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);
+}