]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliLegoGeneratorPhiZ.cxx
Lego generator for phi-z binning.
[u/mrichter/AliRoot.git] / STEER / AliLegoGeneratorPhiZ.cxx
CommitLineData
6872c613 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/*
17$Log$
18*/
19
20#include "AliLegoGeneratorPhiZ.h"
21#include "AliRun.h"
22
23ClassImp(AliLegoGeneratorPhiZ)
24
25
26//___________________________________________
27void AliLegoGeneratorPhiZ::Generate()
28{
29// Create a geantino with kinematics corresponding to the current bins
30// Here: Coor1 = Z
31// Coor2 = phi.
32
33 //
34 // Rootinos are 0
35 const Int_t kMpart = 0;
36 Float_t orig[3], pmom[3];
37 Float_t t, cosp, sinp;
38 if (fCoor1Bin==-1) fCoor1Bin=fNCoor1;
39 // Prepare for next step
40 if(fCoor1Bin>=fNCoor1-1)
41 if(fCoor2Bin>=fNCoor2-1) {
42 Warning("Generate","End of Lego Generation");
43 return;
44 } else {
45 fCoor2Bin++;
46 printf("Generating rays in phi bin:%d\n",fCoor2Bin);
47 fCoor1Bin=0;
48 } else fCoor1Bin++;
49
50 fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
51 fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
52
53 Float_t phi = fCurCoor1*TMath::Pi()/180.;
54
55 cosp = TMath::Cos(phi);
56 sinp = TMath::Sin(phi);
57
58 pmom[0] = cosp;
59 pmom[1] = sinp;
60 pmom[2] = 0.;
61
62 // --- Where to start
63 orig[0] = orig[1] = orig[2] = 0;
64 orig[2] = fCurCoor2;
65
66 Float_t dalicz = 3000;
67 if (fRadMin > 0) {
68 t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
69 orig[0] = pmom[0]*t;
70 orig[1] = pmom[1]*t;
71 orig[2] = pmom[2]*t;
72 if (TMath::Abs(orig[2]) > fZMax) return;
73 }
74
75 Float_t polar[3]={0.,0.,0.};
76 Int_t ntr;
77 gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, "LEGO ray", ntr);
78
79}