]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THijing/AliGenHijing.cxx
True npart interfaced to HIJING (header)
[u/mrichter/AliRoot.git] / THijing / AliGenHijing.cxx
index d6b87a172954764624284ebeca4a96cbf419e3b0..aa1a28f2134be740be14056440cede44eeb9d300 100644 (file)
@@ -45,7 +45,7 @@ AliGenHijing::AliGenHijing()
      fKeep(0),
      fQuench(1),
      fShadowing(1),
-     fDecaysOff(1),
+     fDecaysOff(3),
      fTrigger(0),     
      fEvaluate(0),
      fSelectAll(0),
@@ -74,7 +74,6 @@ AliGenHijing::AliGenHijing()
      fLHC(kFALSE),
      fRandomPz(kFALSE),
      fNoHeavyQuarks(kFALSE),
-     fEventTime(0.),
      fHeader(AliGenHijingEventHeader("Hijing"))
 {
   // Constructor
@@ -90,7 +89,7 @@ AliGenHijing::AliGenHijing(Int_t npart)
      fKeep(0),
      fQuench(1),
      fShadowing(1),
-     fDecaysOff(1),
+     fDecaysOff(3),
      fTrigger(0),     
      fEvaluate(0),
      fSelectAll(0),
@@ -119,7 +118,6 @@ AliGenHijing::AliGenHijing(Int_t npart)
      fLHC(kFALSE),
      fRandomPz(kFALSE),
      fNoHeavyQuarks(kFALSE),
-     fEventTime(0.),
      fHeader(AliGenHijingEventHeader("Hijing"))
 {
 // Default PbPb collisions at 5. 5 TeV
@@ -222,6 +220,7 @@ void AliGenHijing::Generate()
   Float_t polar[3]    =   {0,0,0};
   Float_t origin[3]   =   {0,0,0};
   Float_t origin0[3]  =   {0,0,0};
+  Float_t time0 = 0.;
   Float_t p[3];
   Float_t tof;
 
@@ -238,10 +237,12 @@ void AliGenHijing::Generate()
   fTrials = 0;
   
   for (j = 0;j < 3; j++) origin0[j] = fOrigin[j];
+  time0 = fTimeOrigin;
 
   if(fVertexSmear == kPerEvent) {
       Vertex();
       for (j=0; j < 3; j++) origin0[j] = fVertex[j];
+      time0 = fTime;
   } 
 
 
@@ -280,15 +281,14 @@ void AliGenHijing::Generate()
       
 //      Get event vertex
 //
-      TParticle *  iparticle = (TParticle *) fParticles.At(0);
       fVertex[0] = origin0[0];
       fVertex[1] = origin0[1]; 
       fVertex[2] = origin0[2];
-      
+      fTime = time0;
 //
 //      First select parent particles
 //
-
+      TParticle *  iparticle = 0;
       for (i = 0; i < np; i++) {
          iparticle = (TParticle *) fParticles.At(i);
 
@@ -355,11 +355,6 @@ void AliGenHijing::Generate()
          } // selected
       } // particle loop final state
 
-//
-//    Time of the interactions
-      Float_t tInt = 0.;
-      if (fPileUpTimeWindow > 0.) tInt = fPileUpTimeWindow * (2. * gRandom->Rndm() - 1.);
-
 //
 // Write particles to stack
 
@@ -376,16 +371,8 @@ void AliGenHijing::Generate()
              origin[0] = origin0[0]+iparticle->Vx()/10;
              origin[1] = origin0[1]+iparticle->Vy()/10;
              origin[2] = origin0[2]+iparticle->Vz()/10;
-             fEventTime = 0.;
-             
-             if (TestBit(kVertexRange)) {
-                 fEventTime = sign * origin0[2] / 2.99792458e10;
-                 tof = kconv * iparticle->T() + fEventTime;
-             } else {
-                 tof = kconv * iparticle->T();
-                 fEventTime = tInt;
-                 if (fPileUpTimeWindow > 0.) tof += tInt;
-             }
+             tof = time0+kconv * iparticle->T();
+
              imo = -1;
              TParticle* mother = 0;
              if (hasMother) {
@@ -439,13 +426,19 @@ void AliGenHijing::EvaluateCrossSections()
 
     printf("\n Projectile Radius (fm): %f \n",fHijing->GetHIPR1(34));
     printf("\n Target     Radius (fm): %f \n",fHijing->GetHIPR1(35));    
+    printf("\n Inelastic and total cross section (mb) %f %f \n",fHijing->GetHINT1(12), fHijing->GetHINT1(13));    
     Int_t i;
     Float_t oldvalue= 0.;
 
     Float_t* b   = new Float_t[kMax];
     Float_t* si1 = new Float_t[kMax];    
     Float_t* si2 = new Float_t[kMax];    
-    
+    for (i = 0; i < kMax; i++){
+      b[i] = 0.;
+      si1[i] = 0.;
+      si2[i] = 0.;
+    }
+
     for (i = 0; i < kMax; i++)
     {
        Float_t xb  = bMin+i*kdib;
@@ -488,7 +481,7 @@ void AliGenHijing::EvaluateCrossSections()
     fDnDb      = new TGraph(i, b, si2);
 }
 
-Bool_t AliGenHijing::DaughtersSelection(TParticle* iparticle)
+Bool_t AliGenHijing::DaughtersSelection(const TParticle* iparticle)
 {
 //
 // Looks recursively if one of the daughters has been selected
@@ -540,7 +533,7 @@ Bool_t AliGenHijing::SelectFlavor(Int_t pid)
     return res;
 }
 
-Bool_t AliGenHijing::Stable(TParticle*  particle) const
+Bool_t AliGenHijing::Stable(const TParticle*  particle) const
 {
 // Return true for a stable particle
 //
@@ -570,6 +563,7 @@ void AliGenHijing::MakeHeader()
     fHeader.SetSpectators(fProjectileSpecn, fProjectileSpecp,
                          fTargetSpecn,fTargetSpecp);
     fHeader.SetReactionPlaneAngle(fHijing->GetHINT1(20));
+    fHeader.SetTrueNPart(fHijing->GetNPART());
 
 // 4-momentum vectors of the triggered jets.
 //
@@ -598,7 +592,7 @@ void AliGenHijing::MakeHeader()
     fHeader.SetTrials(fTrials);
 // Event Vertex
     fHeader.SetPrimaryVertex(fVertex);
-    fHeader.SetInteractionTime(fEventTime);
+    fHeader.SetInteractionTime(fTime);
     AddHeader(&fHeader);
     fCollisionGeometry = &fHeader;
 }