1 #include "AliGenHalo.h"
2 #include "AliGenMUONlib.h"
5 #include <TDirectory.h>
10 AliGenHalo::AliGenHalo()
14 fTitle="Halo from LHC Tunnel";
15 // Set the default file
16 fFileName="~/marsip/marsip5.mu";
23 AliGenHalo::AliGenHalo(Int_t npart)
27 fTitle="Halo from LHC Tunnel";
28 // Set the default file
29 fFileName="~/marsip/marsip5.mu";
36 //____________________________________________________________
37 AliGenHalo::~AliGenHalo()
41 //____________________________________________________________
42 void AliGenHalo::Init()
45 //____________________________________________________________
46 void AliGenHalo::Generate()
48 AliMC* pMC = AliMC::GetMC();
49 FILE *fp = fopen(fFileName,"r");
51 printf("\n File %s opened for reading ! \n ", fFileName);
53 printf("\n Opening of file %s failed ! \n ", fFileName);
56 // MARS particle codes
57 const Int_t imars[12]={0,14, 13, 8, 9, 11, 12, 5, 6, 1, 3, 2};
59 Float_t polar[3]= {0,0,0};
62 Float_t ekin, wgt, tx, ty, tz, txy;
63 Float_t amass, charge, tlife;
66 Int_t ipart, itrtyp, ncols, nt;
72 ncols = fscanf(fp,"%i %f %f %f %f %f %f",
74 &origin[0], &origin[1],
78 if (fNpart !=-1 && nread > fNpart) break;
80 pMC->Gfpart(ipart, name, itrtyp,
81 amass, charge, tlife);
82 p0=sqrt(ekin*ekin + 2.*amass);
84 txy=TMath::Sqrt(tx*tx+ty*ty);
88 tz=-TMath::Sqrt(1.-txy);
94 gAlice->SetTrack(1,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
97 gAlice->SetTrack(1,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);