]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPHIC/AliGenTPHIC.cxx
Standard cuts for (di-)muon analysis (Diego)
[u/mrichter/AliRoot.git] / TPHIC / AliGenTPHIC.cxx
index bc8574001fbc0c0519ec0da720fefe7ab21212e1..9f3ea1514f74aabfe02dad50c306309769762c78 100644 (file)
 
 /* $Id$ */
 
-/*
-$Log$
-Revision 1.1.2.1  2003/05/20 17:27:07  hristov
-Merging with v3-09-09
-
-Revision 1.1  2003/05/09 09:18:11  hristov
-Adding TPHIC
-
-*/
-
 // Event generator of two-photon processes
 // in ultra-peripheral ion collisions.
 // 5 two-photon process are implemented, see comments to SetProcess().
@@ -66,6 +56,8 @@ Adding TPHIC
 #include <TParticle.h>
 #include <TParticlePDG.h>
 #include <TDatabasePDG.h>
+#include <TClonesArray.h>
+
 #include "AliPythia.h"
 #include "AliRun.h"
 #include <AliGenTPHIC.h>
@@ -76,7 +68,15 @@ ClassImp(AliGenTPHIC)
 
 //------------------------------------------------------------
 
-AliGenTPHIC::AliGenTPHIC()
+AliGenTPHIC::AliGenTPHIC() :
+  AliGenMC(),
+  fTPHICgen(0x0),
+  fPythia(0x0),
+  fParticles(0x0),
+  fEvent(-1),
+  fDebug(0),
+  fDebugEventFirst(-1),
+  fDebugEventLast(-1)
 {
   // Constructor: create generator instance,
   // create particle array
@@ -100,13 +100,6 @@ AliGenTPHIC::AliGenTPHIC()
   SetKfOnium   ();
 }
 
-//____________________________________________________________
-AliGenTPHIC::AliGenTPHIC(const AliGenTPHIC & gen)
-{
-  // copy constructor
-  gen.Copy(*this);
-}
-
 //____________________________________________________________
 AliGenTPHIC::~AliGenTPHIC()
 {
@@ -137,8 +130,10 @@ void AliGenTPHIC::Generate()
   // The event differectial cross section is assigned as a weight
   // to each track of the event.
 
-  Float_t polar[3]= {0,0,0};
-  Float_t origin0[3],origin[3];
+  Float_t polar[3]   = {0,0,0};
+  Float_t origin0[3] = {0,0,0};
+  Float_t time0 = 0.;
+  Float_t origin[3]  = {0,0,0};
   Float_t p[3], tof;
   Double_t weight;
 
@@ -156,13 +151,18 @@ void AliGenTPHIC::Generate()
     Info("Generate()","one event is produced");
 
   Int_t j;
-  for (j=0;j<3;j++) origin[j]=fOrigin[j];
+  for (j=0;j<3;j++) origin0[j]=fOrigin[j];
+  time0 = fTimeOrigin;
   if(fVertexSmear==kPerEvent) {
     Rndm(random,6);
     for (j=0;j<3;j++) {
       origin0[j]+=fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
        TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
     }
+    Rndm(random,2);
+    time0 += fOsigma[2]/TMath::Ccgs()*
+      TMath::Cos(2*random[0]*TMath::Pi())*
+      TMath::Sqrt(-2*TMath::Log(random[1]));
   }
 
   Int_t ip;
@@ -182,10 +182,10 @@ void AliGenTPHIC::Generate()
     origin[2] = origin0[2]+iparticle->Vz()/10.;
     kf = CheckPDGCode(iparticle->GetPdgCode());
     iparent = -1;
-    tof     = kconv*iparticle->T();
+    tof     = time0 + kconv*iparticle->T();
     if (ks == 1) trackIt = 1;
     else         trackIt = 0;
-    SetTrack(fTrackIt*trackIt,iparent,kf,p,origin,polar,tof,kPPrimary,nt,weight,ks);
+    PushTrack(fTrackIt*trackIt,iparent,kf,p,origin,polar,tof,kPPrimary,nt,weight,ks);
     KeepTrack(nt); 
 
     if (fDebug == 2)
@@ -368,20 +368,20 @@ void AliGenTPHIC::SetProcess       (Int_t   proc  )
 {
   // Get 4-momentum of the first recoil nucleus after
   // the 2-photon process.
-  return TLorentzVector(fTPHICgen->GetPTAG1(1),
+  return TLorentzVector(fTPHICgen->GetPTAG1(0),
+                       fTPHICgen->GetPTAG1(1),
                        fTPHICgen->GetPTAG1(2),
-                       fTPHICgen->GetPTAG1(3),
-                       fTPHICgen->GetPTAG1(4));
+                       fTPHICgen->GetPTAG1(3));
 }
 //____________________________________________________________
   TLorentzVector AliGenTPHIC::MomentumRecNucl2()
 {
   // Get 4-momentum of the first recoil nucleus after
   // the 2-photon process.
-  return TLorentzVector(fTPHICgen->GetPTAG2(1),
+  return TLorentzVector(fTPHICgen->GetPTAG2(0),
+                       fTPHICgen->GetPTAG2(1),
                        fTPHICgen->GetPTAG2(2),
-                       fTPHICgen->GetPTAG2(3),
-                       fTPHICgen->GetPTAG2(4));
+                       fTPHICgen->GetPTAG2(3));
 }
 //____________________________________________________________
   Float_t AliGenTPHIC::GetXSectionCurrent()