]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenBeamGas.cxx
Extra header added to the list
[u/mrichter/AliRoot.git] / EVGEN / AliGenBeamGas.cxx
index e91e3135708b7f0db07c0692de53dbbec39dd59e..753acb3f602d325cfdb0e6e69fbbc61d62d647e8 100644 (file)
 // Generator to simulate beam gas interactions.
 // At present single interactions are read from an external file. 
 // Several interactions are combined in one event.
-
+// By default the vertex is smeared between +/- 20 m
+// Author: andreas.morsch@cern.ch
 
 #include "AliGenBeamGas.h"
-#include "AliRun.h"
+#include "AliGenReader.h"
 
 #include <TParticle.h>
-#include <TFile.h>
-#include <TTree.h>
 
 
- ClassImp(AliGenBeamGas)
+ClassImp(AliGenBeamGas)
 
 AliGenBeamGas::AliGenBeamGas()
-  :AliGenExtFile()
+    :AliGenExtFile(), 
+     fInteractions(1)
 {
 //  Constructor
 //
-    fInteractions = 1;
     fOsigma[0] =    0.;
     fOsigma[1] =    0.;
     fOsigma[2] = 2000.;
 }
 
-AliGenBeamGas::AliGenBeamGas(const AliGenBeamGas & ExtFile)
-{
-// copy constructor
-}
 //____________________________________________________________
 
 AliGenBeamGas::~AliGenBeamGas()
@@ -84,7 +79,9 @@ void AliGenBeamGas::Generate()
 //    beam 1 or 2
 //      
       Float_t ibeam = (random[1] < 0.5) ? -1. : 1.;
-      
+
+      // Interaction time
+      Float_t time = origin[2]/TMath::Ccgs()*ibeam;
 //
 //    Read next event
 //      
@@ -108,7 +105,7 @@ void AliGenBeamGas::Generate()
          Int_t idpart     = iparticle->GetPdgCode();
          Int_t decayed    = iparticle->GetFirstDaughter();
          Int_t doTracking = fTrackIt && (decayed < 0) && (TMath::Abs(idpart) > 10);
-         PushTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
+         PushTrack(doTracking,-1,idpart,p,origin,polar,time,kPPrimary,nt);
          KeepTrack(nt);
       } // track loop
       nInt++;
@@ -120,16 +117,6 @@ void AliGenBeamGas::Generate()
 }
 
 
-//AliGenBeamGas& AliGenBeamGas::operator=(const  AliGenBeamGas& rhs)
-//{
-// Assignment operator
-//    return *this;
-//}
-
-
-
-
-