]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenBeamGas.cxx
Introducing the interaction time into the aliroot generators. In case of gaussian...
[u/mrichter/AliRoot.git] / EVGEN / AliGenBeamGas.cxx
index 7591626fadbde5aaa32eab77a1f060737c214aa5..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)
 
 AliGenBeamGas::AliGenBeamGas()
-    :AliGenExtFile()
+    :AliGenExtFile(), 
+     fInteractions(1)
 {
 //  Constructor
 //
-    fInteractions = 1;
     fOsigma[0] =    0.;
     fOsigma[1] =    0.;
     fOsigma[2] = 2000.;
 }
 
-AliGenBeamGas::AliGenBeamGas(const AliGenBeamGas & beamgas):
-    AliGenExtFile(beamgas)
-{
-// Copy constructor
-    beamgas.Copy(*this);
-}
 //____________________________________________________________
 
 AliGenBeamGas::~AliGenBeamGas()
@@ -86,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
 //      
@@ -110,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++;
@@ -123,16 +118,5 @@ void AliGenBeamGas::Generate()
 
 
 
-void AliGenBeamGas::Copy(AliGenBeamGas&) const
-{
-    //
-    // Copy 
-    //
-    Fatal("Copy","Not implemented!\n");
-}
-
-
-
-