]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TEPEMGEN/AliGenEpEmv1.cxx
updated macros (with new cut values) for (anti-)proton-(anti-)lambda and lambda-...
[u/mrichter/AliRoot.git] / TEPEMGEN / AliGenEpEmv1.cxx
index f4a7f6addb6a90a3f5c2542a99e81e85b249bd95..78f24143ac4450a55d37aa4d66c28ff36c5123a4 100644 (file)
  *                                                                        *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.1  2002/11/06 10:26:45  hristov
-Event generator for e+e- pair production (Yu.Kharlov)
-
-*/
+/* $Id$ */
 
 // Event generator of single e+e- pair production in ultraperipheral PbPb collisions
 // at 5.5 TeV/nucleon.
@@ -84,20 +79,18 @@ ClassImp(AliGenEpEmv1)
 
 //------------------------------------------------------------
 
-AliGenEpEmv1::AliGenEpEmv1()
+AliGenEpEmv1::AliGenEpEmv1():
+  fMass(0),
+  fEpEmGen(0),
+  fDebug(0),
+  fEvent(0),
+  fHeader(AliGenEventHeader())
 {
   // Default constructor
   // Avoid zero pt
   if (fPtMin == 0) fPtMin = 1.E-04;
 }
 
-//____________________________________________________________
-AliGenEpEmv1::AliGenEpEmv1(const AliGenEpEmv1 & gen)
-{
-  // copy constructor
-  gen.Copy(*this);
-}
-
 //____________________________________________________________
 AliGenEpEmv1::~AliGenEpEmv1()
 {
@@ -114,7 +107,7 @@ void AliGenEpEmv1::Init()
   fMass = TDatabasePDG::Instance()->GetParticle(11)->Mass();
 
   SetMC(new TEpEmGen());
-  fEpEmGen = (TEpEmGen*) fgMCEvGen;
+  fEpEmGen = (TEpEmGen*) fMCEvGen;
   fEpEmGen ->Initialize(fYMin,fYMax,fPtMin,fPtMax);
   fEvent = 0;
 }
@@ -139,6 +132,7 @@ void AliGenEpEmv1::Generate()
 
   Float_t polar[3]= {0,0,0};
   Float_t origin[3];
+  Float_t time = 0.;
   Float_t p[3];
 
   Double_t ptElectron,ptPositron, phiElectron,phiPositron, mt;
@@ -153,12 +147,17 @@ void AliGenEpEmv1::Generate()
           yElectron,yPositron,xElectron,xPositron,phi12);
 
   for (j=0;j<3;j++) origin[j]=fOrigin[j];
+  time = fTimeOrigin;
   if(fVertexSmear==kPerEvent) {
     Rndm(random,6);
     for (j=0;j<3;j++) {
       origin[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
        TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
     }
+    Rndm(random,2);
+    time += fOsigma[2]/TMath::Ccgs()*
+      TMath::Cos(2*random[0]*TMath::Pi())*
+      TMath::Sqrt(-2*TMath::Log(random[1]));
   }
 
   Rndm(random,1);
@@ -175,7 +174,7 @@ void AliGenEpEmv1::Generate()
   id =  11;
   if (fDebug == 2)
     printf("id=%+3d, p = (%+11.4e,%+11.4e,%+11.4e) GeV\n",id,p[0],p[1],p[2]);
-  SetTrack(fTrackIt,-1, id,p,origin,polar,0,kPPrimary,nt,weight);
+  PushTrack(fTrackIt,-1, id,p,origin,polar,time,kPPrimary,nt,weight);
 
   // Produce positron
   mt = TMath::Sqrt(ptPositron*ptPositron + fMass*fMass);
@@ -185,12 +184,15 @@ void AliGenEpEmv1::Generate()
   id = -11;
   if (fDebug == 2)
     printf("id=%+3d, p = (%+11.4e,%+11.4e,%+11.4e) GeV\n",id,p[0],p[1],p[2]);
-  SetTrack(fTrackIt,-1, id,p,origin,polar,0,kPPrimary,nt,weight);
+  PushTrack(fTrackIt,-1, id,p,origin,polar,time,kPPrimary,nt,weight);
   
   fEvent++;
   if (fEvent%1000 == 0) {
     printf("=====> AliGenEpEmv1::Generate(): \n   Event %d, sigma=%f +- %f kb\n",
           fEvent,fEpEmGen->GetXsection(),fEpEmGen->GetDsection());
   }
+  fHeader.SetEventWeight(weight);
+  fHeader.SetInteractionTime(time);
+  AddHeader(&fHeader);
 }