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 //------------------------------------------------------------------------
19 // Lego generator in Eta bins
20 // Uses geantino rays to check the material distributions and detector's
23 //------------------------------------------------------------------------
25 #include "AliLegoGeneratorEta.h"
28 ClassImp(AliLegoGeneratorEta)
31 //___________________________________________
32 void AliLegoGeneratorEta::Generate()
34 // Create a geantino with kinematics corresponding to the current bins
40 const Int_t kMpart = 0;
41 Float_t orig[3], pmom[3];
42 Float_t t, cost, sint, cosp, sinp;
43 if (fCoor1Bin==-1) fCoor1Bin=fNCoor1;
44 // Prepare for next step
45 if(fCoor1Bin>=fNCoor1-1)
46 if(fCoor2Bin>=fNCoor2-1) {
47 Warning("Generate","End of Lego Generation");
51 printf("Generating rays in eta bin:%d\n",fCoor2Bin);
55 fCurCoor1 = (fCoor1Min+(fCoor1Bin+0.5)*(fCoor1Max-fCoor1Min)/fNCoor1);
56 fCurCoor2 = (fCoor2Min+(fCoor2Bin+0.5)*(fCoor2Max-fCoor2Min)/fNCoor2);
58 Float_t phi = fCurCoor1*TMath::Pi()/180.;
59 Float_t theta = 2.*TMath::ATan(TMath::Exp(-fCurCoor2));
62 cost = TMath::Cos(theta);
63 sint = TMath::Sin(theta);
64 cosp = TMath::Cos(phi);
65 sinp = TMath::Sin(phi);
72 orig[0] = orig[1] = orig[2] = 0;
73 Float_t dalicz = 3000;
75 t = PropagateCylinder(orig,pmom,fRadMin,dalicz);
79 if (TMath::Abs(orig[2]) > fZMax) return;
82 Float_t polar[3]={0.,0.,0.};
84 gAlice->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);