X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVGEN%2FAliGenHalo.cxx;h=7f914866a040bcb259409cd0b3b4e1b016e1e047;hb=56d4723979f163f5fdb63c66bdaf9e2da058e8dc;hp=d1530450a7635f2369e3c42994ae88452fb66956;hpb=886b6f7342e357a2c0ffa88df944a470082fa498;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVGEN/AliGenHalo.cxx b/EVGEN/AliGenHalo.cxx index d1530450a76..7f914866a04 100644 --- a/EVGEN/AliGenHalo.cxx +++ b/EVGEN/AliGenHalo.cxx @@ -13,32 +13,30 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.4 1999/09/29 09:24:14 fca -Introduction of the Copyright and cvs Log +/* $Id$ */ -*/ +// Read background particles from a boundary source +// Very specialized generator to simulate background from beam halo. +// The input file is a text file specially prepared +// for this purpose. +// Author: andreas.morsch@cern.ch + +#include + +#include +#include #include "AliGenHalo.h" -#include "AliGenMUONlib.h" -#include "AliMC.h" #include "AliRun.h" -#include "AliPDG.h" -#include -#include -#include -#include -#include - ClassImp(AliGenHalo) - AliGenHalo::AliGenHalo() - :AliGenerator(-1) +ClassImp(AliGenHalo) + +AliGenHalo::AliGenHalo() + :AliGenerator(-1) { +// Constructor fName="Halo"; fTitle="Halo from LHC Tunnel"; - // Set the default file - fFileName="~/marsip/marsip5.mu"; // // Read all particles fNpart=-1; @@ -48,38 +46,48 @@ Introduction of the Copyright and cvs Log AliGenHalo::AliGenHalo(Int_t npart) :AliGenerator(npart) { +// Constructor fName="Halo"; fTitle="Halo from LHC Tunnel"; - // Set the default file - fFileName="~/marsip/marsip5.mu"; // // Read all particles fNpart=-1; fp=0; } +AliGenHalo::AliGenHalo(const AliGenHalo & Halo) + :AliGenerator(Halo) +{ +// Copy constructor + Halo.Copy(*this); +} + + //____________________________________________________________ AliGenHalo::~AliGenHalo() { +// Destructor } //____________________________________________________________ void AliGenHalo::Init() -{} +{ +// Initialisation +} //____________________________________________________________ void AliGenHalo::Generate() { - FILE *fp = fopen(fFileName,"r"); +// Generate from input file + fp = fopen(fFileName,"r"); if (fp) { - printf("\n File %s opened for reading ! \n ", fFileName); + printf("\n File %s opened for reading ! \n ", (char*) &fFileName); } else { - printf("\n Opening of file %s failed ! \n ", fFileName); + printf("\n Opening of file %s failed ! \n ", (char*) &fFileName); } // // MARS particle codes - // const Int_t imars[12]={0,14, 13, 8, 9, 11, 12, 5, 6, 1, 3, 2}; - const Int_t imars[12]={0,kProton,kNeutron,kPiPlus,kPiMinus,kKPlus,kKMinus, + const Int_t kmars[12]={0,kProton,kNeutron,kPiPlus,kPiMinus,kKPlus,kKMinus, kMuonPlus,kMuonMinus,kGamma,kElectron,kPositron}; Float_t polar[3]= {0,0,0}; @@ -101,7 +109,7 @@ void AliGenHalo::Generate() if (ncols < 0) break; nread++; if (fNpart !=-1 && nread > fNpart) break; - ipart = imars[ipart]; + ipart = kmars[ipart]; amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass(); p0=sqrt(ekin*ekin + 2.*amass); @@ -115,16 +123,34 @@ void AliGenHalo::Generate() p[1]=p0*ty; p[2]=p0*tz; fParentWeight=wgt; - gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight); + PushTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight); +// PushTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight); origin[2]=-origin[2]; p[2]=-p[2]; - gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight); + PushTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight); +// PushTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight); origin[2]=-origin[2]; p[2]=-p[2]; } } +AliGenHalo& AliGenHalo::operator=(const AliGenHalo& rhs) +{ +// Assignment operator + rhs.Copy(*this); + return *this; +} + + +void AliGenHalo::Copy(TObject&) const +{ + // + // Copy + // + Fatal("Copy","Not implemented!\n"); +} +