Phi range set consistently to 0 ... 360.
[u/mrichter/AliRoot.git] / macros / Config_gener.C
CommitLineData
f4417773 1enum gentype_t {hijing, hijingParam, gun, box, pythia,
11a136ef 2 param1, param2, param3, param4,
395b2e02 3 cocktail, fluka, halo, ntuple, scan, doublescan};
916c29ab 4
11a136ef 5gentype_t gentype=param4;
916c29ab 6
cbc87b10 7Int_t ntracks=1;
916c29ab 8
9void Config()
10{
11
c8921088 12 // libraries required by geant321
13 gSystem->Load("libgeant321");
14
b9d0a01d 15new TGeant3("C++ Interface to Geant3");
916c29ab 16
17//=======================================================================
18// Create the output file
19
20TFile *rootfile = new TFile("galice.root","recreate");
21rootfile->SetCompressionLevel(2);
22TGeant3 *geant3 = (TGeant3*)gMC;
23
11a136ef 24//
25// Set External decayer
26 AliDecayer* decayer = new AliDecayerPythia();
27 decayer->SetForceDecay(kAll);
28 decayer->Init();
29 gMC->SetExternalDecayer(decayer);
30
916c29ab 31//=======================================================================
32// ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
33geant3->SetTRIG(1); //Number of events to be processed
34geant3->SetSWIT(4,10);
35geant3->SetDEBU(0,0,1);
36//geant3->SetSWIT(2,2);
37geant3->SetDCAY(1);
38geant3->SetPAIR(1);
39geant3->SetCOMP(1);
40geant3->SetPHOT(1);
41geant3->SetPFIS(0);
42geant3->SetDRAY(0);
43geant3->SetANNI(1);
44geant3->SetBREM(1);
45geant3->SetMUNU(1);
46geant3->SetCKOV(1);
47geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
48geant3->SetLOSS(2);
49geant3->SetMULS(1);
50geant3->SetRAYL(1);
51geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
52geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
53geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
54Float_t cut = 1.e-3; // 1MeV cut by default
55Float_t tofmax = 1.e10;
56// GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
57geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax);
58//
59//=======================================================================
60// ************* STEERING parameters FOR ALICE SIMULATION **************
61// --- Specify event type to be tracked through the ALICE setup
62// --- All positions are in cm, angles in degrees, and P and E in GeV
63
64 switch(gentype)
65 {
66 case gun:
67//*********************************************
68// Example for Fixed Particle Gun
69//*********************************************
70 AliGenFixed *gener = new AliGenFixed(ntracks);
71 gener->SetMomentum(50);
72 gener->SetPhi(180.);
73 gener->SetTheta(5.);
74 gener->SetOrigin(0,0,0); //vertex position
75 gener->SetPart(13); //GEANT particle type
76 break;
77 case box:
78//*********************************************
79// Example for Moving Particle Gun *
80//*********************************************
81 AliGenBox *gener = new AliGenBox(ntracks);
82 gener->SetMomentumRange(3,4);
83 gener->SetPhiRange(0,360);
84 gener->SetThetaRange(90, 180. );
85 gener->SetOrigin(0,0,0);
86 //vertex position
87 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
88 gener->SetPart(5); //GEANT particle type
89 break;
90 case scan:
91//*********************************************
92// Scanning on a grid *
93//*********************************************
94 AliGenScan *gener = new AliGenScan(-1);
95 gener->SetMomentumRange(4,4);
96 gener->SetPhiRange(0,360);
97 gener->SetThetaRange(9,9);
98 //vertex position
99 gener->SetSigma(6,6,0); //Sigma in (X,Y,Z) (cm) on IP position
100 gener->SetPart(5);
101 gener->SetRange(20, -100, 100, 20, -100, 100, 1, 500, 500);
102 break;
103
50ea53d9 104 case hijingParam:
916c29ab 105 AliGenHIJINGpara *gener = new AliGenHIJINGpara(ntracks);
106 gener->SetMomentumRange(0,999);
107 gener->SetPhiRange(0,360);
108 gener->SetThetaRange(2,10);
109 gener->SetOrigin(0,0,0); //vertex position
110 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
111 break;
50ea53d9 112 case hijing:
50ea53d9 113 AliGenHijing *gener = new AliGenHijing(-1);
114// centre of mass energy
115 gener->SetEnergyCMS(5500);
116// reference frame
117 gener->SetReferenceFrame("CMS ");
118// projectile
119 gener->SetProjectile("A ", 208, 82);
120 gener->SetTarget ("A ", 208, 82);
121// impact parameter range
122 gener->SetImpactParameterRange(0, 3.);
123// evaluate cross section before run
124 gener->SetEvaluate(1);
125// tell hijing to keep the full parent child chain
126 gener->KeepFullEvent();
127// enable jet quenching
128 gener->SetJetQuenching(1);
129// enable shadowing
130 gener->SetShadowing(1);
131// neutral pion and heavy particle decays switched off
132 gener->SetDecaysOff(1);
133// trigger
134 gener->SetTrigger(0);
135// kinematic selection
136 gener->SetSelectAll(0);
137// momentum range
138 gener->SetMomentumRange(0,999);
139// phi range
0ac28de4 140 gener->SetPhiRange(0,360);
50ea53d9 141// theta range
142 gener->SetThetaRange(0,180.);
143// select flavor (0: no, 4: charm+beauty, 5:beauty)
144 gener->SetFlavor(4);
145//
146 gener->SetOrigin(0., 0.0 ,0);
147 gener->SetSigma(0,0,5.3);
aee8290b 148 gener->SetVertexSmear(kPerEvent);
50ea53d9 149// no tracking
150 gener->SetTrackingFlag(0);
d6249ec3 151 break;
152
916c29ab 153 case pythia:
154//********************************************
155// Example for Charm Production with Pythia *
156//********************************************
e417bd32 157 AliGenPythia *gener = new AliGenPythia(-1);
158// final state kinematic cuts
916c29ab 159 gener->SetMomentumRange(0,999);
0ac28de4 160 gener->SetPhiRange(0, 360);
916c29ab 161 gener->SetThetaRange(0., 180.);
162 gener->SetYRange(-10,10);
163 gener->SetPtRange(0,100);
e417bd32 164// vertex position and smearing
165 gener->SetOrigin(0,0,0); // vertex position
166 gener->SetVertexSmear(kPerEvent);
167 gener->SetSigma(0,0,5.6); // Sigma in (X,Y,Z) (cm) on IP position
168// Structure function
169// DO_Set_1
170// GRV_LO
171// GRV_HO
172// MRS_D_minus
173// MRS_D0
174// MRS_G
175// CTEQ_2pM
176// CTEQ_4M
15fbf104 177 gener->SetStrucFunc(kGRVHO);
e417bd32 178// Select corection for nuclear structure functions
179// gener->SetNuclei(208,208);
180//
181// Process type
182// charm, beauty, charm_unforced, beauty_unforced, jpsi, jpsi_chi, mb
11a136ef 183 gener->SetProcess(kPyBeauty);
e417bd32 184//
185// Pt transfer of the hard scattering
186 gener->SetPtHard(0.,5.);
187// Decay type (semielectronic, semimuonic, nodecay)
11a136ef 188 gener->SetForceDecay(kSemiElectronic);
e417bd32 189// Centre of mass energy
916c29ab 190 gener->SetEnergyCMS(5500.);
e417bd32 191// No Tracking
192 gener->SetTrackingFlag(0);
193 break;
395b2e02 194
195 case param1:
916c29ab 196//*******************************************************
395b2e02 197// Example for J/psi Production from Parameterisation
198// using default library (AliMUONlib)
916c29ab 199//*******************************************************
395b2e02 200 AliGenParam *gener =
11a136ef 201 new AliGenParam(ntracks, AliGenMUONlib::kUpsilon);
916c29ab 202 gener->SetMomentumRange(0,999);
395b2e02 203 gener->SetPtRange(0,999);
0ac28de4 204 gener->SetPhiRange(0, 360);
916c29ab 205 gener->SetYRange(2.5,4);
395b2e02 206 gener->SetCutOnChild(1);
207 gener->SetChildThetaRange(2,9);
916c29ab 208 gener->SetOrigin(0,0,0); //vertex position
395b2e02 209 gener->SetSigma(0,0,5.3); //Sigma in (X,Y,Z) (cm) on IP position
11a136ef 210 gener->SetForceDecay(kDiMuon);
395b2e02 211 gener->SetTrackingFlag(0);
212 break;
213
214 case param2:
215//*******************************************************
216// Example for Omega Production from Parameterisation
217// specifying library.
218//*******************************************************
11a136ef 219 AliGenParam *gener = new AliGenParam(1000,new AliGenPHOSlib(),
220 AliGenPHOSlib::kOmega);
221 gener->SetWeighting(kNonAnalog);
222 gener->SetForceDecay(kNoDecay);
395b2e02 223 gener->SetPtRange(0,100);
224 gener->SetThetaRange(45,135);
225 gener->SetTrackingFlag(0);
226 break;
227
228 case param3:
229//*******************************************************
230// Example for Upsilon Production from Parameterisation
231// specifying library.
232// GSI style
233//*******************************************************
11a136ef 234 AliGenParam *gener = new AliGenParam(1000,new AliGenGSIlib(),
235 AliGenGSIlib::kUpsilon, "MUON");
395b2e02 236 gener->SetMomentumRange(0,999);
237 gener->SetPtRange(0,999);
0ac28de4 238 gener->SetPhiRange(0, 360);
395b2e02 239 gener->SetYRange(2.5,4);
916c29ab 240 gener->SetCutOnChild(1);
395b2e02 241 gener->SetChildThetaRange(2,9);
242 gener->SetOrigin(0,0,0); //vertex position
243 gener->SetSigma(0,0,5.3); //Sigma in (X,Y,Z) (cm) on IP position
11a136ef 244 gener->SetForceDecay(kDiMuon);
395b2e02 245 gener->SetTrackingFlag(0);
246 break;
247
248 case param4:
249//*******************************************************
250// Example for Omega Production from Parameterisation
251// specifying library.
252// The alternative way.
253//*******************************************************
254 AliGenLib* Lib=new AliGenPHOSlib();
11a136ef 255 Int_t iOmega = AliGenPHOSlib::kOmega;
256 AliGenParam *gener = new AliGenParam(50, iOmega,
257 Lib->GetPt(iOmega, ""),
258 Lib->GetY (iOmega, ""),
259 Lib->GetIp(iOmega, ""));
260 gener->SetWeighting(kNonAnalog);
261 gener->SetForceDecay(kNoDecay);
395b2e02 262 gener->SetTrackingFlag(0);
916c29ab 263 break;
264
265 case fluka:
266//*******************************************************
267// Example for a FLUKA Boundary Source *
268//*******************************************************
269 AliGenFLUKAsource *gener = new AliGenFLUKAsource(-1);
1aa4f403 270 gener->SetFileName("$(ALICE_ROOT)/data/all32.root");
916c29ab 271 gener->SetPartFlag(9);
272 gener->SetAgeMax(1.e-5);
273// 31.7 events
274 gener->SetFraction(0.0315);
275// gener->SetFraction(0.75*0.0315);
276 rootfile->cd();
277// gener->SetPartFlag(10);
278 gener->SetMomentumRange(0,999);
279 gener->SetPhiRange(0,360);
280 gener->SetThetaRange(0., 180.);
281 gener->SetAgeMax(1.e-5);
282
283// 31.7 events
284// gener->SetFraction(0.0315);
285 break;
286
287 case ntuple:
288//*******************************************************
289// Example for reading from a external file *
290//*******************************************************
291 AliGenExtFile *gener = new AliGenExtFile(-1);
292 gener->SetFileName("$(ALICE_ROOT)/data/dtujet93.root");
aee8290b 293 gener->SetVertexSmear(kPerEvent);
916c29ab 294 gener->SetTrackingFlag(1);
295 break;
296
297 case halo:
298//*******************************************************
299// Example for Tunnel Halo Source *
300//*******************************************************
301 AliGenHalo *gener = new AliGenHalo(ntracks);
302 gener->SetFileName("/h1/morsch/marsip/marsip5.mu");
303 break;
304
305 case cocktail:
306//*******************************************************
307// Example for a Cocktail *
308//*******************************************************
309
310 AliGenCocktail *gener = new AliGenCocktail();
311
312 gener->SetPhiRange(0,360);
313 gener->SetYRange(2.5,4);
314 gener->SetThetaRange(2,9);
315 gener->SetPtRange(0,10);
316 gener->SetOrigin(0,0,0); //vertex position
317 gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
318 gener->SetMomentumRange(0,999);
319
320 AliGenParam *jpsi = new AliGenParam(1,jpsi_p);
3e7b17bf 321 jpsi->SetForceDecay(dimuon);
916c29ab 322 jpsi->SetCutOnChild(1);
323
324
325 AliGenFLUKAsource *bg = new AliGenFLUKAsource(-1);
326 bg->AddFile("$(ALICE_ROOT)/data/all32.root");
327 rootfile->cd();
328 bg->SetPartFlag(9);
329 bg->SetAgeMax(1.e-5);
330// 31.7 events
331// gener->SetFraction(0.0315);
332 bg->SetFraction(0.01*0.0315);
333
334 gener->AddGenerator(jpsi,"J/Psi", 1);
335 gener->AddGenerator(bg,"Background",1);
336
337 break;
338 }
339
340// Activate this line if you want the vertex smearing to happen
341// track by track
342//
aee8290b 343// gener->SetVertexSmear(kPerTrack);
916c29ab 344
345gener->Init();
346
347gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field)
348
349Int_t iMAG=1;
916c29ab 350
351//=================== Alice BODY parameters =============================
352AliBODY *BODY = new AliBODY("BODY","Alice envelop");
353
354
355if(iMAG) {
356//=================== MAG parameters ============================
357// --- Start with Magnet since detector layouts may be depending ---
358// --- on the selected Magnet dimensions ---
359AliMAG *MAG = new AliMAG("MAG","Magnet");
360}
916c29ab 361}