]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - THijing/AliGenHijing.cxx
Introducing the interaction time into the aliroot generators. In case of gaussian...
[u/mrichter/AliRoot.git] / THijing / AliGenHijing.cxx
index e8bb091d0f72e036def5fb03fa83436aa28f0c96..915e8cf34baeb786f9594e08f74fbaccd822891c 100644 (file)
@@ -74,7 +74,6 @@ AliGenHijing::AliGenHijing()
      fLHC(kFALSE),
      fRandomPz(kFALSE),
      fNoHeavyQuarks(kFALSE),
-     fEventTime(0.),
      fHeader(AliGenHijingEventHeader("Hijing"))
 {
   // Constructor
@@ -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;
   } 
 
 
@@ -283,7 +284,7 @@ void AliGenHijing::Generate()
       fVertex[0] = origin0[0];
       fVertex[1] = origin0[1]; 
       fVertex[2] = origin0[2];
-      
+      fTime = time0;
 //
 //      First select parent particles
 //
@@ -354,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
 
@@ -375,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) {
@@ -603,7 +591,7 @@ void AliGenHijing::MakeHeader()
     fHeader.SetTrials(fTrials);
 // Event Vertex
     fHeader.SetPrimaryVertex(fVertex);
-    fHeader.SetInteractionTime(fEventTime);
+    fHeader.SetInteractionTime(fTime);
     AddHeader(&fHeader);
     fCollisionGeometry = &fHeader;
 }