]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliLegoGeneratorPhiZ.cxx
added the HCAL section and removed obsolete method
[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$
b9d0a01d 18Revision 1.5.10.1 2002/06/10 14:43:06 hristov
19Merged with v3-08-02
20
21Revision 1.7 2002/05/07 16:44:04 morsch
22Correct initialization of origin[2]. (Thanks to Angela Badala)
23
899c7749 24Revision 1.6 2002/05/03 12:18:24 morsch
25Print-out corrected.
26
39974533 27Revision 1.5 2001/05/16 14:57:22 alibrary
28New files for folders and Stack
29
9e1a0ddb 30Revision 1.4 2001/01/12 09:23:17 morsch
31Correct order of phi and z.
32
d55c1573 33Revision 1.3 2000/11/30 07:12:49 alibrary
34Introducing new Rndm and QA classes
35
65fb704d 36Revision 1.2 2000/10/27 11:40:01 morsch
37Error in printouts corrected
38
fa02caa3 39Revision 1.1 2000/10/27 08:13:02 morsch
40Lego generator for phi-z binning.
41
6872c613 42*/
43
44#include "AliLegoGeneratorPhiZ.h"
45#include "AliRun.h"
46
47ClassImp(AliLegoGeneratorPhiZ)
48
49
50//___________________________________________
51void AliLegoGeneratorPhiZ::Generate()
52{
53// Create a geantino with kinematics corresponding to the current bins
54// Here: Coor1 = Z
55// Coor2 = phi.
56
57 //
58 // Rootinos are 0
59 const Int_t kMpart = 0;
60 Float_t orig[3], pmom[3];
61 Float_t t, cosp, sinp;
62 if (fCoor1Bin==-1) fCoor1Bin=fNCoor1;
63 // Prepare for next step
64 if(fCoor1Bin>=fNCoor1-1)
65 if(fCoor2Bin>=fNCoor2-1) {
66 Warning("Generate","End of Lego Generation");
67 return;
68 } else {
69 fCoor2Bin++;
39974533 70 printf("Generating rays in Phi-bin:%d\n",fCoor2Bin);
6872c613 71 fCoor1Bin=0;
72 } else fCoor1Bin++;
6872c613 73 fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
74 fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
75
d55c1573 76 Float_t phi = fCurCoor2*TMath::Pi()/180.;
6872c613 77
78 cosp = TMath::Cos(phi);
79 sinp = TMath::Sin(phi);
80
81 pmom[0] = cosp;
82 pmom[1] = sinp;
83 pmom[2] = 0.;
84
85 // --- Where to start
86 orig[0] = orig[1] = orig[2] = 0;
d55c1573 87 orig[2] = fCurCoor1;
6872c613 88
89 Float_t dalicz = 3000;
90 if (fRadMin > 0) {
91 t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
899c7749 92 orig[0] += pmom[0]*t;
93 orig[1] += pmom[1]*t;
94 orig[2] += pmom[2]*t;
6872c613 95 if (TMath::Abs(orig[2]) > fZMax) return;
96 }
97
98 Float_t polar[3]={0.,0.,0.};
99 Int_t ntr;
9e1a0ddb 100 gAlice->SetTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
6872c613 101
102}