1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 // Read background particles from a boundary source
21 // Very specialized generator to simulate background from beam halo.
22 // The input file is a text file specially prepared
24 // Author: andreas.morsch@cern.ch
26 #include "AliGenHaloProtvino.h"
31 #include <TDatabasePDG.h>
34 ClassImp(AliGenHaloProtvino)
35 AliGenHaloProtvino::AliGenHaloProtvino()
40 fTitle="Halo from LHC Tunnel";
47 AliGenHaloProtvino::AliGenHaloProtvino(Int_t npart)
52 fTitle="Halo from LHC Tunnel";
59 AliGenHaloProtvino::AliGenHaloProtvino(const AliGenHaloProtvino & HaloProtvino)
65 //____________________________________________________________
66 AliGenHaloProtvino::~AliGenHaloProtvino()
71 //____________________________________________________________
72 void AliGenHaloProtvino::Init()
77 //____________________________________________________________
78 void AliGenHaloProtvino::Generate()
80 // Generate from input file
81 FILE *fp = fopen(fFileName,"r");
83 printf("\n File %s opened for reading ! \n ", (char*) &fFileName);
85 printf("\n Opening of file %s failed ! \n ", (char*) &fFileName);
88 Float_t polar[3]= {0,0,0};
91 Float_t ekin, wgt, tx, ty, tz, txy;
96 Int_t ipart, ncols, nt;
103 ncols = fscanf(fp,"%f %d %d %f %f %f %f %f %f",
104 &zPrimary, &inuc, &ipart, &wgt,
105 &ekin, &origin[0], &origin[1],
107 printf(" \n %f %d %d %f %f %f %f %f %f",
108 zPrimary, inuc, ipart, wgt,
109 ekin, origin[0], origin[1],
112 if (ncols < 0) break;
114 if (fNpart !=-1 && nread > fNpart) break;
118 amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass();
123 p0=sqrt(ekin*ekin + 2.*amass);
125 txy=TMath::Sqrt(tx*tx+ty*ty);
129 tz=-TMath::Sqrt(1.-txy);
136 // Origin: backtracking to tunnel entrance
138 Float_t zTunnelEntrance = -20.;
139 origin[2] = zTunnelEntrance;
140 Float_t dzBack = -1-zTunnelEntrance;
141 Float_t dsBack = -dzBack/tz;
143 origin[0]+=tx*dsBack;
144 origin[1]+=ty*dsBack;
151 fParentWeight=wgt*GassPressureWeight(zPrimary);
152 gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
154 // Assume particles come from two directions with same probability
155 origin[2]=-origin[2];
157 fParentWeight=wgt*GassPressureWeight(-zPrimary);
158 gAlice->SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
159 origin[2]=-origin[2];
165 AliGenHaloProtvino& AliGenHaloProtvino::operator=(const AliGenHaloProtvino& rhs)
167 // Assignment operator
172 Float_t AliGenHaloProtvino::GassPressureWeight(Float_t zPrimary)
174 // Return z-dependent gasspressure weight
180 # Title: README file for the sources of IR8 machine induced background
181 # Author: Vadim Talanov <Vadim.Talanov@cern.ch>
182 # Modified: 12-12-2000
186 There are three files, named ring.one.beta.[01,10,50].m, which
187 contain the lists of background particles, induced by proton losses
188 upstream of IP8 in the LHC ring one, for the beta* values of 1, 10
189 and 50 m, respectively.
193 Each line in the files contains the coordinates of particle track
194 crossing with the infinite plane, positioned at z=-1m, together with
195 the physical properties of corresponding particle, namely:
197 S - S coordinate of the primary interaction vertex, cm;
198 N - type of the gas nuclei at interaction, 1 is H, 2 - C and 3 - O;
199 I - particle ID in PDG particle numbering scheme;
201 E - particle kinetic energy, GeV;
202 X - x coordinate of the crossing point, cm;
203 Y - y coordinate of the crossing point, cm;
204 Dx - x direction cosine;
205 Dy - y direction cosine.
209 Each file is given per unity of linear density of proton inelastic
210 interactions with the gas nuclei, [1 inelastic interaction/m].
212 # ~/vtalanov/public/README.mib: the end.