]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/ConfigPPR.C
1bab270357c1402d017e9526396fa21c292cb3f7
[u/mrichter/AliRoot.git] / macros / ConfigPPR.C
1 void Config()
2 {
3   //
4   // Set Random Number seed
5   gRandom->SetSeed(12345);
6   
7   // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
8   new AliGeant3("C++ Interface to Geant3");
9
10   //=======================================================================
11   //  Create the output file
12    
13   TFile *rootfile = new TFile("galice.root","recreate");
14   rootfile->SetCompressionLevel(2);
15   TGeant3 *geant3 = (TGeant3*)gMC;
16
17   //
18   // Set External decayer
19   AliDecayer* decayer = new AliDecayerPythia();
20   decayer->SetForceDecay(kAll);
21   decayer->Init();
22   gMC->SetExternalDecayer(decayer);
23
24   //
25   //
26   //=======================================================================
27   // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
28   geant3->SetTRIG(1); //Number of events to be processed 
29   geant3->SetSWIT(4,10);
30   geant3->SetDEBU(0,0,1);
31   //geant3->SetSWIT(2,2);
32   geant3->SetDCAY(1);
33   geant3->SetPAIR(1);
34   geant3->SetCOMP(1);
35   geant3->SetPHOT(1);
36   geant3->SetPFIS(0);
37   geant3->SetDRAY(0);
38   geant3->SetANNI(1);
39   geant3->SetBREM(1);
40   geant3->SetMUNU(1);
41   geant3->SetCKOV(1);
42   geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
43   geant3->SetLOSS(2);
44   geant3->SetMULS(1);
45   geant3->SetRAYL(1);
46   geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
47   geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
48   geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
49   geant3->SetERAN(5.e-7);
50
51   Float_t cut    = 1.e-3; // 1MeV cut by default
52   Float_t tofmax = 1.e10;
53   //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
54   geant3->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   AliGenHIJINGpara *gener = new AliGenHIJINGpara(84210);
61   gener->SetMomentumRange(0,999);
62   gener->SetPhiRange(0,360);
63   //  gener->SetThetaRange(0.28,179.72);
64   gener->SetThetaRange(0.,180.);
65   gener->SetOrigin(0,0,0);        //vertex position
66   gener->SetSigma(0,0,0);         //Sigma in (X,Y,Z) (cm) on IP position
67   gener->Init();
68   // 
69   // Activate this line if you want the vertex smearing to happen
70   // track by track
71   //
72   //gener->SetVertexSmear(perTrack); 
73
74   gAlice->SetField(-999,2);    //Specify maximum magnetic field in Tesla (neg. ==> default field)
75
76   Int_t iABSO=1;
77   Int_t iCASTOR=1;
78   Int_t iDIPO=1;
79   Int_t iFMD=1;
80   Int_t iFRAME=1;
81   Int_t iHALL=1;
82   Int_t iITS=1;
83   Int_t iMAG=1;
84   Int_t iMUON=1;
85   Int_t iPHOS=1;
86   Int_t iPIPE=1;
87   Int_t iPMD=1;
88   Int_t iRICH=1;
89   Int_t iSHIL=1;
90   Int_t iSTART=1;
91   Int_t iTOF=1;
92   Int_t iTPC=1;
93   Int_t iTRD=1;
94   Int_t iZDC=1;
95
96   //=================== Alice BODY parameters =============================
97   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
98
99   if(iMAG) {
100     //=================== MAG parameters ============================
101     // --- Start with Magnet since detector layouts may be depending ---
102     // --- on the selected Magnet dimensions ---
103     AliMAG *MAG  = new AliMAG("MAG","Magnet");
104   }
105
106
107   if(iABSO) {
108     //=================== ABSO parameters ============================
109     AliABSO *ABSO  = new AliABSOv0("ABSO","Muon Absorber");
110   }
111
112   if(iDIPO) {
113     //=================== DIPO parameters ============================
114
115     AliDIPO *DIPO  = new AliDIPOv2("DIPO","Dipole version 2");
116   }
117
118   if(iHALL) {
119     //=================== HALL parameters ============================
120
121     AliHALL *HALL  = new AliHALL("HALL","Alice Hall");
122   }
123
124
125   if(iFRAME) {
126     //=================== FRAME parameters ============================
127
128     AliFRAME *FRAME  = new AliFRAMEv2("FRAME","Space Frame");
129
130   }
131
132   if(iSHIL) {
133     //=================== SHIL parameters ============================
134
135     AliSHIL *SHIL  = new AliSHILv0("SHIL","Shielding");
136   }
137
138
139   if(iPIPE) {
140     //=================== PIPE parameters ============================
141
142     AliPIPE *PIPE  = new AliPIPEv0("PIPE","Beam Pipe");
143   }
144
145
146   if(iITS) {
147
148 //=================== ITS parameters ============================
149     //
150     // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
151     // almost all other detectors. This involves the fact that the ITS geometry
152     // still has several options to be followed in parallel in order to determine
153     // the best set-up which minimizes the induced background. All the geometries
154     // available to date are described in the following. Read carefully the comments
155     // and use the default version (the only one uncommented) unless you are making
156     // comparisons and you know what you are doing. In this case just uncomment the
157     // ITS geometry you want to use and run Aliroot.
158     //
159     // Detailed geometries:         
160     //
161     //
162     //AliITS *ITS  = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
163     //
164     //AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
165     //
166     AliITSvPPRasymm *ITS  = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
167     ITS->SetMinorVersion(2);                                         // don't touch this parameter if you're not an ITS developer
168     ITS->SetReadDet(kFALSE);                                         // don't touch this parameter if you're not an ITS developer
169     ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det");  // don't touch this parameter if you're not an ITS developer
170     ITS->SetThicknessDet1(300.);   // detector thickness on layer 1 must be in the range [100,300]
171     ITS->SetThicknessDet2(300.);   // detector thickness on layer 2 must be in the range [100,300]
172     ITS->SetThicknessChip1(300.);  // chip thickness on layer 1 must be in the range [150,300]
173     ITS->SetThicknessChip2(300.);  // chip thickness on layer 2 must be in the range [150,300]
174     ITS->SetRails(1);              // 1 --> rails in ; 0 --> rails out
175     ITS->SetCoolingFluid(1);       // 1 --> water ; 0 --> freon
176     //
177     //AliITSvPPRsymm *ITS  = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
178     //ITS->SetMinorVersion(2);                                       // don't touch this parameter if you're not an ITS developer
179     //ITS->SetReadDet(kFALSE);                                       // don't touch this parameter if you're not an ITS developer
180     //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
181     //ITS->SetThicknessDet1(300.);   // detector thickness on layer 1 must be in the range [100,300]
182     //ITS->SetThicknessDet2(300.);   // detector thickness on layer 2 must be in the range [100,300]
183     //ITS->SetThicknessChip1(300.);  // chip thickness on layer 1 must be in the range [150,300]
184     //ITS->SetThicknessChip2(300.);  // chip thickness on layer 2 must be in the range [150,300]
185     //ITS->SetRails(1);              // 1 --> rails in ; 0 --> rails out
186     //ITS->SetCoolingFluid(1);       // 1 --> water ; 0 --> freon
187     //
188     //
189     // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful 
190     // for reconstruction !):
191     //                                                     
192     //
193     //AliITSvPPRcoarseasymm *ITS  = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
194     //ITS->SetRails(1);                // 1 --> rails in ; 0 --> rails out
195     //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
196     //
197     //AliITS *ITS  = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
198     //ITS->SetRails(1);                // 1 --> rails in ; 0 --> rails out
199     //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
200     //                      
201     //
202     //
203     // Geant3 <-> EUCLID conversion
204     // ============================
205     //
206     // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
207     // media to two ASCII files (called by default ITSgeometry.euc and
208     // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
209     // The default (=0) means that you dont want to use this facility.
210     //
211     ITS->SetEUCLID(0);  
212   }
213   
214
215   if(iTPC) {
216     //============================ TPC parameters ================================
217     // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
218     // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
219     // --- sectors are specified, any value other than that requires at least one 
220     // --- sector (lower or upper)to be specified!
221     // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
222     // ---           sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
223     // --- SecLows - number of lower sectors specified (up to 6)
224     // --- SecUps - number of upper sectors specified (up to 12)
225     // --- Sens - sensitive strips for the Slow Simulator !!!
226     // --- This does NOT work if all S or L-sectors are specified, i.e.
227     // --- if SecAL or SecAU < 0
228     //
229     //
230     //-----------------------------------------------------------------------------
231
232     //  gROOT->LoadMacro("SetTPCParam.C");
233     //  AliTPCParam *param = SetTPCParam();
234     AliTPC *TPC  = new AliTPCv2("TPC","Default");
235     // All sectors included 
236     TPC->SetSecAL(-1);
237     TPC->SetSecAU(-1);
238
239   }
240
241
242   if(iTOF) {
243     //=================== TOF parameters ============================
244     AliTOF *TOF  = new AliTOFv2("TOF","normal TOF");
245   }
246
247   if(iRICH) {
248     //=================== RICH parameters ===========================
249     AliRICH *RICH  = new AliRICHv1("RICH","normal RICH");    
250
251   }
252
253
254   if(iZDC) {
255     //=================== ZDC parameters ============================
256
257     AliZDC *ZDC  = new AliZDCv1("ZDC","normal ZDC");
258   }
259
260   if(iCASTOR) {
261     //=================== CASTOR parameters ============================
262
263     AliCASTOR *CASTOR  = new AliCASTORv1("CASTOR","normal CASTOR");
264   }
265
266   if(iTRD) {
267     //=================== TRD parameters ============================
268   
269     AliTRD *TRD  = new AliTRDv1("TRD","TRD slow simulator");
270   
271     // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
272     TRD->SetGasMix(1);
273   
274     // With hole in front of PHOS
275     TRD->SetPHOShole();
276     // With hole in front of RICH
277     TRD->SetRICHhole();
278     // Switch on TR
279     AliTRDsim *TRDsim = TRD->CreateTR();
280   }
281
282   if(iFMD) {
283     //=================== FMD parameters ============================
284
285     AliFMD *FMD  = new AliFMDv0("FMD","normal FMD");
286   }
287
288   if(iMUON) {
289     //=================== MUON parameters ===========================
290     AliMUON *MUON  = new AliMUONv1("MUON","default");
291   }
292  
293   //=================== PHOS parameters ===========================
294
295   if(iPHOS) {
296     AliPHOS *PHOS  = new AliPHOSv1("PHOS","GPS2");
297   }
298
299
300   if(iPMD) {
301     //=================== PMD parameters ============================
302
303     AliPMD *PMD  = new AliPMDv1("PMD","normal PMD");
304     PMD->SetPAR(1., 1., 0.8, 0.02);
305     PMD->SetIN(6., 18., -580., 27., 27.);
306     PMD->SetGEO(0.0, 0.2, 4.);
307     PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
308
309   }
310
311   if(iSTART) {
312     //=================== START parameters ============================
313     AliSTART *START  = new AliSTARTv1("START","START Detector");
314   }
315
316          
317 }