Pile-up time window taken into account. Needed for correc simualtion of
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 May 2006 12:24:45 +0000 (12:24 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 May 2006 12:24:45 +0000 (12:24 +0000)
beam-gas.

THijing/AliGenHijing.cxx

index fb09ce8..2a8e8b9 100644 (file)
@@ -309,9 +309,15 @@ void AliGenHijing::Generate()
              pSelected[i] = 1;
          } // selected
       } // particle loop final state
+
 //
-// Write particles to stack
+//    Time of the interactions
+      Float_t tInt = 0.;
+      if (fPileUpTimeWindow > 0.) tInt = fPileUpTimeWindow * (2. * gRandom->Rndm() - 1.);
+
 //
+// Write particles to stack
+
       for (i = 0; i<np; i++) {
          TParticle *  iparticle = (TParticle *) fParticles->At(i);
          Bool_t  hasMother   = (iparticle->GetFirstMother()     >=0);
@@ -325,7 +331,9 @@ void AliGenHijing::Generate()
              origin[0] = origin0[0]+iparticle->Vx()/10;
              origin[1] = origin0[1]+iparticle->Vy()/10;
              origin[2] = origin0[2]+iparticle->Vz()/10;
-             tof = kconv*iparticle->T();
+             tof = kconv * iparticle->T() + sign * origin0[2] / 3.e10;
+             if (fPileUpTimeWindow > 0.) tof += tInt;
+             
              imo = -1;
              TParticle* mother = 0;
              if (hasMother) {
@@ -334,8 +342,7 @@ void AliGenHijing::Generate()
                  imo = (mother->GetPdgCode() != 92) ? newPos[imo] : -1;
              } // if has mother   
              Bool_t tFlag = (fTrackIt && !hasDaughter);
-             PushTrack(tFlag,imo,kf,p,origin,polar,
-                      tof,kPNoProcess,nt, 1., ks);
+             PushTrack(tFlag,imo,kf,p,origin,polar,tof,kPNoProcess,nt, 1., ks);
 
              
              KeepTrack(nt);