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 **************************************************************************/
18 Revision 1.2 2001/06/14 12:15:27 morsch
19 Bugs corrected. SetSide() method added.
21 Revision 1.1 2001/01/23 15:04:33 morsch
22 Generator to read beam halo file from Protvino group.
26 // Read background particles from a boundary source
27 // Very specialized generator to simulate background from beam halo.
28 // The input file is a text file specially prepared
30 // Author: andreas.morsch@cern.ch
32 #include "AliGenHaloProtvino.h"
37 #include <TDatabasePDG.h>
40 ClassImp(AliGenHaloProtvino)
41 AliGenHaloProtvino::AliGenHaloProtvino()
45 printf("\n Calling Default Constructor");
47 fName = "HaloProtvino";
48 fTitle = "Halo from LHC Tunnel";
56 AliGenHaloProtvino::AliGenHaloProtvino(Int_t npart)
60 printf("\n Calling Constructor");
62 fTitle= "Halo from LHC Tunnel";
69 AliGenHaloProtvino::AliGenHaloProtvino(const AliGenHaloProtvino & HaloProtvino)
75 //____________________________________________________________
76 AliGenHaloProtvino::~AliGenHaloProtvino()
81 //____________________________________________________________
82 void AliGenHaloProtvino::Init()
85 fFile = fopen(fFileName,"r");
87 printf("\n File %s opened for reading, %p ! \n ", fFileName.Data(), fFile);
89 printf("\n Opening of file %s failed, %p ! \n ", fFileName.Data(), fFile);
93 //____________________________________________________________
94 void AliGenHaloProtvino::Generate()
96 // Generate from input file
98 Float_t polar[3]= {0,0,0};
101 Float_t ekin, wgt, tx, ty, tz, txy;
106 Int_t ipart, ncols, nt;
109 ncols = fscanf(fFile,"%f %d %d %f %f %f %f %f %f",
110 &zPrimary, &inuc, &ipart, &wgt,
111 &ekin, &origin[0], &origin[1],
114 printf(" \n %f %d %d %f %f %f %f %f %f",
115 zPrimary, inuc, ipart, wgt,
116 ekin, origin[0], origin[1],
119 if (ncols < 0) break;
122 if (fNpart !=-1 && nread > fNpart) break;
126 amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass();
131 p0=sqrt(ekin*ekin + 2.*amass);
133 txy=TMath::Sqrt(tx*tx+ty*ty);
137 tz=-TMath::Sqrt(1.-txy);
150 Float_t originP[3] = {0., 0., 0.};
151 originP[2] = zPrimary;
153 Float_t pP[3] = {0., 0., 0.};
157 originP[2] = -zPrimary;
158 origin[2] = -origin[2];
162 SetTrack(0,-1,kProton,pP,originP,polar,0,kPNoProcess,ntP);
164 fParentWeight=wgt*GassPressureWeight(zPrimary);
165 SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
166 SetHighWaterMark(nt);
169 // Assume particles come from two directions with same probability
171 origin[2]=-origin[2];
173 fParentWeight=wgt*GassPressureWeight(-zPrimary);
174 SetTrack(fTrackIt,ntP,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
175 origin[2]=-origin[2];
177 origin[2]=-origin[2];
182 AliGenHaloProtvino& AliGenHaloProtvino::operator=(const AliGenHaloProtvino& rhs)
184 // Assignment operator
189 Float_t AliGenHaloProtvino::GassPressureWeight(Float_t zPrimary)
191 // Return z-dependent gasspressure weight
193 Float_t weight = 500.;
195 if (zPrimary > 45000.) weight = 2.e4;
201 # Title: README file for the sources of IR8 machine induced background
202 # Author: Vadim Talanov <Vadim.Talanov@cern.ch>
203 # Modified: 12-12-2000
207 There are three files, named ring.one.beta.[01,10,50].m, which
208 contain the lists of background particles, induced by proton losses
209 upstream of IP8 in the LHC ring one, for the beta* values of 1, 10
210 and 50 m, respectively.
214 Each line in the files contains the coordinates of particle track
215 crossing with the infinite plane, positioned at z=-1m, together with
216 the physical properties of corresponding particle, namely:
218 S - S coordinate of the primary interaction vertex, cm;
219 N - type of the gas nuclei at interaction, 1 is H, 2 - C and 3 - O;
220 I - particle ID in PDG particle numbering scheme;
222 E - particle kinetic energy, GeV;
223 X - x coordinate of the crossing point, cm;
224 Y - y coordinate of the crossing point, cm;
225 Dx - x direction cosine;
226 Dy - y direction cosine.
230 Each file is given per unity of linear density of proton inelastic
231 interactions with the gas nuclei, [1 inelastic interaction/m].
233 # ~/vtalanov/public/README.mib: the end.