]> git.uio.no Git - u/mrichter/AliRoot.git/blob - test/vmctest/gun/genGunConfig.C
Separate syswatch for sim. and rec.
[u/mrichter/AliRoot.git] / test / vmctest / gun / genGunConfig.C
1 /// $Id$
2 //
3 // AliRoot Configuration for gun vmctest
4 //
5 // Extracted from G3 specific Config.C in test/gun.
6 // by I. Hrivnacova, IPN Orsay
7
8 Float_t EtaToTheta(Float_t arg);
9
10 AliGenerator* genGunConfig()
11 {
12   cout << "Running genGunConfig.C ... " << endl;
13
14   //=======================================================================
15   // Event generator
16   //=======================================================================
17
18   // The cocktail iitself
19
20   AliGenCocktail *gener = new AliGenCocktail();
21   gener->SetPhiRange(0, 360);
22   // Set pseudorapidity range from -8 to 8.
23   Float_t thmin = EtaToTheta(8);   // theta min. <---> eta max
24   Float_t thmax = EtaToTheta(-8);  // theta max. <---> eta min 
25   gener->SetThetaRange(thmin,thmax);
26   gener->SetOrigin(0, 0, 0);  //vertex position
27   gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
28
29
30   // Particle guns for the barrel part (taken from RichConfig)
31
32   AliGenFixed *pG1=new AliGenFixed(1);
33   pG1->SetPart(kProton);
34   pG1->SetMomentum(2.5);
35   pG1->SetTheta(109.5-3);
36   pG1->SetPhi(10);
37   gener->AddGenerator(pG1,"g1",1);
38   
39   AliGenFixed *pG2=new AliGenFixed(1);
40   pG2->SetPart(kPiPlus);
41   pG2->SetMomentum(1.0);
42   pG2->SetTheta( 90.0-3);
43   pG2->SetPhi(10);
44   gener->AddGenerator(pG2,"g2",1);
45
46   AliGenFixed *pG3=new AliGenFixed(1);
47   pG3->SetPart(kPiMinus);
48   pG3->SetMomentum(1.5);
49   pG3->SetTheta(109.5-3);
50   pG3->SetPhi(30);
51   gener->AddGenerator(pG3,"g3",1);
52   
53   AliGenFixed *pG4=new AliGenFixed(1);
54   pG4->SetPart(kKPlus);
55   pG4->SetMomentum(0.7);
56   pG4->SetTheta( 90.0-3);
57   pG4->SetPhi(30);
58   gener->AddGenerator(pG4,"g4",1);
59   
60   AliGenFixed *pG5=new AliGenFixed(1);
61   pG5->SetPart(kKMinus);
62   pG5->SetMomentum(1.0);
63   pG5->SetTheta( 70.0-3);
64   pG5->SetPhi(30);
65   gener->AddGenerator(pG5,"g5",1);
66   
67   AliGenFixed *pG6=new AliGenFixed(1);
68   pG6->SetPart(kProtonBar);
69   pG6->SetMomentum(2.5);
70   pG6->SetTheta( 90.0-3);
71   pG6->SetPhi(50);
72   gener->AddGenerator(pG6,"g6",1);
73   
74   AliGenFixed *pG7=new AliGenFixed(1);
75   pG7->SetPart(kPiMinus);
76   pG7->SetMomentum(0.7);
77   pG7->SetTheta( 70.0-3);
78   pG7->SetPhi(50);
79   gener->AddGenerator(pG7,"g7",1);
80
81   // Electrons for TRD
82
83   AliGenFixed *pG8=new AliGenFixed(1);
84   pG8->SetPart(kElectron);
85   pG8->SetMomentum(1.2);
86   pG8->SetTheta( 95.0);
87   pG8->SetPhi(190);
88   gener->AddGenerator(pG8,"g8",1);
89
90   AliGenFixed *pG9=new AliGenFixed(1);
91   pG9->SetPart(kPositron);
92   pG9->SetMomentum(1.2);
93   pG9->SetTheta( 85.0);
94   pG9->SetPhi(190);
95   gener->AddGenerator(pG9,"g9",1);
96
97   // PHOS
98
99   AliGenBox *gphos = new AliGenBox(1);
100   gphos->SetMomentumRange(10,11.);
101   gphos->SetPhiRange(270.5,270.7);
102   gphos->SetThetaRange(90.5,90.7);
103   gphos->SetPart(kGamma);
104   gener->AddGenerator(gphos,"GENBOX GAMMA for PHOS",1);
105
106   // EMCAL
107
108   AliGenBox *gemcal = new AliGenBox(1);
109   gemcal->SetMomentumRange(10,11.);
110   gemcal->SetPhiRange(90.5,199.5);
111   gemcal->SetThetaRange(90.5,90.7);
112   gemcal->SetPart(kGamma);
113   gener->AddGenerator(gemcal,"GENBOX GAMMA for EMCAL",1);
114
115   // MUON
116   AliGenBox * gmuon1 = new AliGenBox(1);
117   gmuon1->SetMomentumRange(20.,20.1);
118   gmuon1->SetPhiRange(0., 360.);         
119   gmuon1->SetThetaRange(171.000,178.001);
120   gmuon1->SetPart(kMuonMinus);           // Muons
121   gener->AddGenerator(gmuon1,"GENBOX MUON1",1);
122
123   AliGenBox * gmuon2 = new AliGenBox(1);
124   gmuon2->SetMomentumRange(20.,20.1);
125   gmuon2->SetPhiRange(0., 360.);         
126   gmuon2->SetThetaRange(171.000,178.001);
127   gmuon2->SetPart(kMuonPlus);           // Muons
128   gener->AddGenerator(gmuon2,"GENBOX MUON1",1);
129
130   //TOF
131   AliGenFixed *gtof=new AliGenFixed(1);
132   gtof->SetPart(kProton);
133   gtof->SetMomentum(2.5);
134   gtof->SetTheta(95);
135   gtof->SetPhi(340);
136   gener->AddGenerator(gtof,"Proton for TOF",1);
137
138   //FMD1
139   AliGenFixed *gfmd1=new AliGenFixed(1);
140   gfmd1->SetPart(kGamma);
141   gfmd1->SetMomentum(25);
142   gfmd1->SetTheta(1.8);
143   gfmd1->SetPhi(10);
144   gener->AddGenerator(gfmd1,"Gamma for FMD1",1);
145   
146   //FMD2i
147   AliGenFixed *gfmd2i=new AliGenFixed(1);
148   gfmd2i->SetPart(kPiPlus);
149   gfmd2i->SetMomentum(1.5);
150   gfmd2i->SetTheta(7.3);
151   gfmd2i->SetPhi(20);
152   gener->AddGenerator(gfmd2i,"Pi+ for FMD2i",1);
153   
154   //FMD2o
155   AliGenFixed *gfmd2o=new AliGenFixed(1);
156   gfmd2o->SetPart(kPiMinus);
157   gfmd2o->SetMomentum(1.5);
158   gfmd2o->SetTheta(16.1);
159   gfmd2o->SetPhi(30);
160   gener->AddGenerator(gfmd2o,"Pi- for FMD2o",1);
161   
162   //FMD3o
163   AliGenFixed *gfmd3o=new AliGenFixed(1);
164   gfmd3o->SetPart(kPiPlus);
165   gfmd3o->SetMomentum(1.5);
166   gfmd3o->SetTheta(163.9);
167   gfmd3o->SetPhi(40);
168   gener->AddGenerator(gfmd3o,"Pi+ for FMD3o",1);
169   
170   //FMD3i
171   AliGenFixed *gfmd3i=new AliGenFixed(1);
172   gfmd3i->SetPart(kPiMinus);
173   gfmd3i->SetMomentum(1.5);
174   gfmd3i->SetTheta(170.5);
175   gfmd3i->SetPhi(50);
176   gener->AddGenerator(gfmd3i,"Pi- for FMD3i",1);
177   
178   gener->Init();
179   
180   return gener;
181   
182   cout << "Running genGunConfig.C finished ... " << endl;
183 }
184
185 Float_t EtaToTheta(Float_t arg){
186   return (180./TMath::Pi())*2.*atan(exp(-arg));
187 }