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.6.1 2002/06/10 14:57:41 hristov
21 Revision 1.2 2002/05/15 13:29:11 morsch
22 Use fOsigma[2] for vertex smearing. Default is 2000 cm.
24 Revision 1.1 2002/05/15 08:59:36 morsch
30 // Generator to simulate beam gas interactions.
31 // At present single interactions are read from an external file.
32 // Several interactions are combined in one event.
35 #include "AliGenBeamGas.h"
38 #include <TParticle.h>
43 ClassImp(AliGenBeamGas)
45 AliGenBeamGas::AliGenBeamGas()
56 AliGenBeamGas::AliGenBeamGas(const AliGenBeamGas & ExtFile)
60 //____________________________________________________________
62 AliGenBeamGas::~AliGenBeamGas()
68 //___________________________________________________________
69 void AliGenBeamGas::Init()
72 AliGenExtFile::Init();
76 void AliGenBeamGas::Generate()
80 Float_t polar[3] = {0,0,0};
81 Float_t origin[3] = {0,0,0};
87 while(nInt < fInteractions) {
93 origin[2] = 2. * fOsigma[2] * random[0] - fOsigma[2];
97 Float_t ibeam = (random[1] < 0.5) ? -1. : 1.;
102 Int_t nTracks = fReader->NextEvent();
104 // printf("\n No more events !!! !\n");
105 Warning("AliGenBeamGas::Generate",
106 "\nNo more events in external file!!!\n Last event may be empty or incomplete.\n");
111 // Stack filling loop
113 for (i = 0; i < nTracks; i++) {
114 TParticle* iparticle = fReader->NextParticle();
115 p[0] = iparticle->Px();
116 p[1] = iparticle->Py();
117 p[2] = iparticle->Pz() * ibeam;
119 Int_t idpart = iparticle->GetPdgCode();
120 Int_t decayed = iparticle->GetFirstDaughter();
121 Int_t doTracking = fTrackIt && (decayed < 0) && (TMath::Abs(idpart) > 10);
122 SetTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
128 SetHighWaterMark(nt);
134 //AliGenBeamGas& AliGenBeamGas::operator=(const AliGenBeamGas& rhs)
136 // Assignment operator