]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/Config.C
Add configuration of external decayer.
[u/mrichter/AliRoot.git] / macros / Config.C
1 void Config()
2 {
3
4 new AliGeant3("C++ Interface to Geant3");
5
6 //=======================================================================
7 //  Create the output file
8    
9 TFile *rootfile = new TFile("galice.root","recreate");
10 rootfile->SetCompressionLevel(2);
11 TGeant3 *geant3 = (TGeant3*)gMC;
12 //
13 // Set External decayer
14  AliDecayer* decayer = new AliDecayerPythia();
15  decayer->SetForceDecay(all);
16  decayer->Init();
17  gMC->SetExternalDecayer(decayer);
18 //
19 //
20 //=======================================================================
21 // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
22 geant3->SetTRIG(1); //Number of events to be processed 
23 geant3->SetSWIT(4,10);
24 geant3->SetDEBU(0,0,1);
25 //geant3->SetSWIT(2,2);
26 geant3->SetDCAY(1);
27 geant3->SetPAIR(1);
28 geant3->SetCOMP(1);
29 geant3->SetPHOT(1);
30 geant3->SetPFIS(0);
31 geant3->SetDRAY(0);
32 geant3->SetANNI(1);
33 geant3->SetBREM(1);
34 geant3->SetMUNU(1);
35 geant3->SetCKOV(1);
36 geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
37 geant3->SetLOSS(2);
38 geant3->SetMULS(1);
39 geant3->SetRAYL(1);
40 geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
41 geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
42 geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
43 geant3->SetERAN(5.e-7);
44
45 Float_t cut    = 1.e-3; // 1MeV cut by default
46 Float_t tofmax = 1.e10;
47 //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
48 geant3->SetCUTS(cut,cut, cut, cut, cut, cut,  cut,  cut, cut,  cut, tofmax);
49 //
50 //=======================================================================
51 // ************* STEERING parameters FOR ALICE SIMULATION **************
52 // --- Specify event type to be tracked through the ALICE setup
53 // --- All positions are in cm, angles in degrees, and P and E in GeV
54 AliGenHIJINGpara *gener = new AliGenHIJINGpara(50);
55 gener->SetMomentumRange(0,999);
56 gener->SetPhiRange(0,360);
57 gener->SetThetaRange(10,170);
58 gener->SetOrigin(0,0,0);        //vertex position
59 gener->SetSigma(0,0,0);         //Sigma in (X,Y,Z) (cm) on IP position
60 gener->Init();
61 // 
62 // Activate this line if you want the vertex smearing to happen
63 // track by track
64 //
65 //gener->SetVertexSmear(perTrack); 
66
67 gAlice->SetField(-999,2);    //Specify maximum magnetic field in Tesla (neg. ==> default field)
68
69 Int_t iMAG=1;
70 Int_t iITS=1;
71 Int_t iTPC=1;
72 Int_t iTOF=1;
73 Int_t iRICH=1;
74 Int_t iZDC=0;
75 Int_t iCASTOR=1;
76 Int_t iTRD=1;
77 Int_t iABSO=1;
78 Int_t iDIPO=1;
79 Int_t iHALL=1;
80 Int_t iFRAME=1;
81 Int_t iSHIL=1;
82 Int_t iPIPE=1;
83 Int_t iFMD=1;
84 Int_t iMUON=1;
85 Int_t iPHOS=1;
86 Int_t iPMD=1;
87 Int_t iSTART=0;
88
89 //=================== Alice BODY parameters =============================
90 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
91
92
93 if(iMAG) {
94 //=================== MAG parameters ============================
95 // --- Start with Magnet since detector layouts may be depending ---
96 // --- on the selected Magnet dimensions ---
97 AliMAG *MAG  = new AliMAG("MAG","Magnet");
98 }
99
100
101 if(iABSO) {
102 //=================== ABSO parameters ============================
103 AliABSO *ABSO  = new AliABSOv0("ABSO","Muon Absorber");
104 }
105
106 if(iDIPO) {
107 //=================== DIPO parameters ============================
108
109 AliDIPO *DIPO  = new AliDIPOv2("DIPO","Dipole version 2");
110 }
111
112 if(iHALL) {
113 //=================== HALL parameters ============================
114
115 AliHALL *HALL  = new AliHALL("HALL","Alice Hall");
116 }
117
118
119 if(iFRAME) {
120 //=================== FRAME parameters ============================
121
122 AliFRAME *FRAME  = new AliFRAMEv1("FRAME","Space Frame");
123
124 }
125
126 if(iSHIL) {
127 //=================== SHIL parameters ============================
128
129 AliSHIL *SHIL  = new AliSHILv0("SHIL","Shielding");
130 }
131
132
133 if(iPIPE) {
134 //=================== PIPE parameters ============================
135
136 AliPIPE *PIPE  = new AliPIPEv0("PIPE","Beam Pipe");
137 }
138
139
140 if(iITS) {
141 //=================== ITS parameters ============================
142 //
143 // EUCLID is a flag to output (=1) both geometry and media to two ASCII files 
144 // (called by default ITSgeometry.euc and ITSgeometry.tme) in a format
145 // understandable to the CAD system EUCLID. The default (=0) means that you 
146 // dont want to use this facility.
147 //
148 AliITS *ITS  = new AliITSv5("ITS","normal ITS");
149 ITS->SetEUCLID(0);
150 }
151
152
153 if(iTPC) {
154 //============================ TPC parameters ================================
155 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
156 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
157 // --- sectors are specified, any value other than that requires at least one 
158 // --- sector (lower or upper)to be specified!
159 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
160 // ---           sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
161 // --- SecLows - number of lower sectors specified (up to 6)
162 // --- SecUps - number of upper sectors specified (up to 12)
163 // --- Sens - sensitive strips for the Slow Simulator !!!
164 // --- This does NOT work if all S or L-sectors are specified, i.e.
165 // --- if SecAL or SecAU < 0
166 //
167 //
168 //-----------------------------------------------------------------------------
169
170   //  gROOT->LoadMacro("SetTPCParam.C");
171   //  AliTPCParam *param = SetTPCParam();
172   AliTPC *TPC  = new AliTPCv1("TPC","Default"); //v1 is default
173   //  TPC->SetParam(param); // pass the parameter object to the TPC
174
175 // set gas mixture
176
177   //TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.);
178   //TPC->SetSecAL(4);
179   //TPC->SetSecAU(4);
180   //TPC->SetSecLows(1,  2,  3, 19, 20, 21);
181   //TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1);
182   //TPC->SetSens(1);
183
184   //if (TPC->IsVersion()==1) param->Write(param->GetTitle());
185 }
186
187 if(iTOF) {
188 //=================== TOF parameters ============================
189 AliTOF *TOF  = new AliTOFv1("TOF","normal TOF");
190 }
191
192 if(iRICH) {
193 //=================== RICH parameters ===========================
194     AliRICH *RICH  = new AliRICHv1("RICH","normal RICH");
195     
196 }
197
198
199 if(iZDC) {
200 //=================== ZDC parameters ============================
201
202 AliZDC *ZDC  = new AliZDCv1("ZDC","normal ZDC");
203 }
204
205 if(iCASTOR) {
206 //=================== CASTOR parameters ============================
207
208 AliCASTOR *CASTOR  = new AliCASTORv1("CASTOR","normal CASTOR");
209 }
210
211 if(iTRD) {
212 //=================== TRD parameters ============================
213   
214   AliTRD *TRD  = new AliTRDv0("TRD","TRD fast simulator");
215   //TRD->SetHits();
216   
217   //AliTRD *TRD  = new AliTRDv1("TRD","TRD slow simulator");
218   //TRD->SetSensPlane(0);
219   //TRD->SetSensChamber(2);
220   //TRD->SetSensSector(17);
221   
222   // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
223   TRD->SetGasMix(1);
224   
225   // With hole in front of PHOS
226   TRD->SetPHOShole();
227   // With hole in front of RICH
228   TRD->SetRICHhole();
229 }
230
231 if(iFMD) {
232 //=================== FMD parameters ============================
233
234 AliFMD *FMD  = new AliFMDv1("FMD","normal FMD");
235 }
236
237 if(iMUON) {
238 //=================== MUON parameters ===========================
239
240 AliMUON *MUON  = new AliMUONv0("MUON","normal MUON");
241
242 }
243  
244 //=================== PHOS parameters ===========================
245
246 if(iPHOS) {
247   AliPHOS *PHOS  = new AliPHOSv1("PHOS","GPS2");
248 }
249
250
251 if(iPMD) {
252 //=================== PMD parameters ============================
253
254 AliPMD *PMD  = new AliPMDv0("PMD","normal PMD");
255 PMD->SetPAR(1., 1., 0.8, 0.02);
256 PMD->SetIN(6., 18., -580., 27., 27.);
257 PMD->SetGEO(0.0, 0.2, 4.);
258 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
259
260 }
261
262 if(iSTART) {
263 //=================== START parameters ============================
264 AliSTART *START  = new AliSTARTv0("START","START Detector");
265 }
266
267          
268 }