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