* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
-
-
-// Event generator that using an instance of type AliGenReader
-// reads particles from a file and applies cuts.
+/* $Id$ */
+//
+// 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()
//
// Interaction vertex
//
- origin[2] = 4000. * random[0] - 2000.;
+ origin[2] = 2. * fOsigma[2] * random[0] - fOsigma[2];
//
// 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
//
Int_t idpart = iparticle->GetPdgCode();
Int_t decayed = iparticle->GetFirstDaughter();
Int_t doTracking = fTrackIt && (decayed < 0) && (TMath::Abs(idpart) > 10);
- SetTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
+ PushTrack(doTracking,-1,idpart,p,origin,polar,time,kPPrimary,nt);
KeepTrack(nt);
} // track loop
nInt++;
}
-//AliGenBeamGas& AliGenBeamGas::operator=(const AliGenBeamGas& rhs)
-//{
-// Assignment operator
-// return *this;
-//}
-
-
-
-
-