]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliLegoGeneratorPhiZ.cxx
Introducing new Rndm and QA classes
[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$
65fb704d 18Revision 1.2 2000/10/27 11:40:01 morsch
19Error in printouts corrected
20
fa02caa3 21Revision 1.1 2000/10/27 08:13:02 morsch
22Lego generator for phi-z binning.
23
6872c613 24*/
25
26#include "AliLegoGeneratorPhiZ.h"
27#include "AliRun.h"
28
29ClassImp(AliLegoGeneratorPhiZ)
30
31
32//___________________________________________
33void AliLegoGeneratorPhiZ::Generate()
34{
35// Create a geantino with kinematics corresponding to the current bins
36// Here: Coor1 = Z
37// Coor2 = phi.
38
39 //
40 // Rootinos are 0
41 const Int_t kMpart = 0;
42 Float_t orig[3], pmom[3];
43 Float_t t, cosp, sinp;
44 if (fCoor1Bin==-1) fCoor1Bin=fNCoor1;
45 // Prepare for next step
46 if(fCoor1Bin>=fNCoor1-1)
47 if(fCoor2Bin>=fNCoor2-1) {
48 Warning("Generate","End of Lego Generation");
49 return;
50 } else {
51 fCoor2Bin++;
fa02caa3 52 printf("Generating rays in z-bin:%d\n",fCoor2Bin);
6872c613 53 fCoor1Bin=0;
54 } else fCoor1Bin++;
55
56 fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
57 fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
58
59 Float_t phi = fCurCoor1*TMath::Pi()/180.;
60
61 cosp = TMath::Cos(phi);
62 sinp = TMath::Sin(phi);
63
64 pmom[0] = cosp;
65 pmom[1] = sinp;
66 pmom[2] = 0.;
67
68 // --- Where to start
69 orig[0] = orig[1] = orig[2] = 0;
70 orig[2] = fCurCoor2;
71
72 Float_t dalicz = 3000;
73 if (fRadMin > 0) {
74 t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
75 orig[0] = pmom[0]*t;
76 orig[1] = pmom[1]*t;
77 orig[2] = pmom[2]*t;
78 if (TMath::Abs(orig[2]) > fZMax) return;
79 }
80
81 Float_t polar[3]={0.,0.,0.};
82 Int_t ntr;
65fb704d 83 gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
6872c613 84
85}