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 //-------------------------------------------------------------------------
20 // Lego generator in Phi - Z bins
22 //-------------------------------------------------------------------------
24 #include "AliLegoGeneratorPhiZ.h"
27 ClassImp(AliLegoGeneratorPhiZ)
30 //___________________________________________
31 void AliLegoGeneratorPhiZ::Generate()
33 // Create a geantino with kinematics corresponding to the current bins
39 const Int_t kMpart = 0;
40 Float_t orig[3], pmom[3];
41 Float_t t, cosp, sinp;
42 if (fCoor1Bin==-1) fCoor1Bin=fNCoor1;
43 // Prepare for next step
44 if(fCoor1Bin>=fNCoor1-1)
45 if(fCoor2Bin>=fNCoor2-1) {
46 Warning("Generate","End of Lego Generation");
50 printf("Generating rays in Phi-bin:%d\n",fCoor2Bin);
53 fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
54 fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
56 Float_t phi = fCurCoor2*TMath::Pi()/180.;
58 cosp = TMath::Cos(phi);
59 sinp = TMath::Sin(phi);
66 orig[0] = orig[1] = orig[2] = 0;
69 Float_t dalicz = 3000;
71 t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
75 if (TMath::Abs(orig[2]) > fZMax) return;
78 Float_t polar[3]={0.,0.,0.};
80 gAlice->SetTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);