]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug #73877. After a consultation with the author the generator is fixed in the same...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Aug 2011 14:48:06 +0000 (14:48 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Aug 2011 14:48:06 +0000 (14:48 +0000)
TAmpt/AliGenAmpt.cxx
TAmpt/AliGenAmpt.h

index b4a0d0f29eb51b86e3bec1c1597cdb255e3c610f..02ee244b38d00952e999022f9f9d8126d2cb62a3 100644 (file)
@@ -73,7 +73,6 @@ AliGenAmpt::AliGenAmpt()
     fLHC(kFALSE),
     fRandomPz(kFALSE),
     fNoHeavyQuarks(kFALSE),
-    fEventTime(0.),
     fIsoft(4),
     fNtMax(150),
     fIpop(1),
@@ -126,7 +125,6 @@ AliGenAmpt::AliGenAmpt(Int_t npart)
     fLHC(kFALSE),
     fRandomPz(kFALSE),
     fNoHeavyQuarks(kFALSE),
-    fEventTime(0.),
     fIsoft(1),
     fNtMax(150),
     fIpop(1),
@@ -235,6 +233,7 @@ void AliGenAmpt::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;
 
@@ -249,11 +248,13 @@ void AliGenAmpt::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;
   } 
 
   Float_t sign = (fRandomPz && (Rndm() < 0.5))? -1. : 1.;
@@ -373,6 +374,7 @@ void AliGenAmpt::Generate()
     fVertex[0] = origin0[0];
     fVertex[1] = origin0[1];   
     fVertex[2] = origin0[2];
+    fTime = time0;
       
     // First select parent particles
     for (Int_t i = 0; i < np; i++) {
@@ -440,11 +442,6 @@ void AliGenAmpt::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
     for (Int_t i = 0; i<np; i++) {
       TParticle *iparticle = (TParticle *) fParticles.At(i);
@@ -459,16 +456,8 @@ void AliGenAmpt::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) {
@@ -666,7 +655,7 @@ void AliGenAmpt::MakeHeader()
   fHeader->SetTrials(fTrials);
   // Event Vertex
   fHeader->SetPrimaryVertex(fVertex);
-  fHeader->SetInteractionTime(fEventTime);
+  fHeader->SetInteractionTime(fTime);
 
   fCollisionGeometry = fHeader;
   AddHeader(fHeader);
index dd06eff9ec8d2fb413416b550c422463c43833a0..1b1909f5479047e3ffa1304f92d610a301f10914 100644 (file)
@@ -126,7 +126,6 @@ class AliGenAmpt : public AliGenMC
     Int_t                    fLHC;             // Assume LHC as lab frame
     Bool_t                   fRandomPz;        // Randomise sign of pz event by event
     Bool_t                   fNoHeavyQuarks;   // If true no heavy quarks are produced
-    Float_t                  fEventTime;       // The event time
     Int_t                    fIsoft;           // ISOFT (D=1): select Default AMPT or String Melting
     Int_t                    fNtMax;           // NTMAX: number of timesteps (D=150)
     Int_t                    fIpop;            // (D=1,yes;0,no) flag for popcorn mechanism(netbaryon stopping)
@@ -148,6 +147,6 @@ class AliGenAmpt : public AliGenMC
     // check if stable
     Bool_t Stable(TParticle*  particle) const;
 
-    ClassDef(AliGenAmpt, 3) // AliGenerator interface to Ampt
+    ClassDef(AliGenAmpt, 4) // AliGenerator interface to Ampt
 };
 #endif