Transition to NewIO
[u/mrichter/AliRoot.git] / MUON / AliMUONFactory.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 ////////////////////////////////////////////////////////////
17 //  Factory for muon chambers, segmentations and response //
18 ////////////////////////////////////////////////////////////
19
20 /* $Id$ */
21
22 #include "AliMUONFactory.h"
23 #include "AliMUON.h"
24 #include "AliMUONChamber.h"
25 #include "AliMUONResponseV0.h"
26 #include "AliMUONResponseTrigger.h"
27 #include "AliMUONSegmentationV0.h"
28 #include "AliMUONSegmentationV01.h"
29 #include "AliMUONSegmentationV02.h"
30 #include "AliMUONSegmentationV04.h"
31 #include "AliMUONSegmentationV05.h"
32 #include "AliMUONSegmentationSlat.h"
33 #include "AliMUONSegmentationSlatN.h"
34 #include "AliMUONSegmentationTrigger.h"
35 #include "AliMUONSegmentationTriggerX.h"
36 #include "AliMUONSegmentationTriggerY.h"
37
38 ClassImp(AliMUONFactory)
39
40 //__________________________________________________________________________
41 AliMUONFactory::AliMUONFactory()
42   : TObject(),
43     fMUON(0),
44     fResponse0(0)
45 {
46 //
47 }
48
49 //__________________________________________________________________________
50 AliMUONFactory::~AliMUONFactory()
51 {
52 //
53 }
54
55 //__________________________________________________________________________
56 void AliMUONFactory::BuildCommon() 
57 {
58 //
59 // Construct the default response.
60 //
61
62         // Default response: 5 mm of gas
63         fResponse0 = new AliMUONResponseV0;
64         fResponse0->SetSqrtKx3AndDeriveKx2Kx4(0.7131); // sqrt(0.5085)
65         fResponse0->SetSqrtKy3AndDeriveKy2Ky4(0.7642); // sqrt(0.5840)
66         fResponse0->SetPitch(0.25); // anode-cathode distance
67         fResponse0->SetSigmaIntegration(10.);
68         fResponse0->SetChargeSlope(50);
69         fResponse0->SetChargeSpread(0.18, 0.18);
70         fResponse0->SetMaxAdc(4096);
71         fResponse0->SetZeroSuppression(6);
72 }       
73         
74 //__________________________________________________________________________
75 void AliMUONFactory::BuildStation1() 
76 {
77 //--------------------------------------------------------
78 // Configuration for Chamber TC1/2  (Station 1) ----------           
79 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
81         // Response for 4 mm of gas (station 1)
82         // automatic consistency with width of sensitive medium in CreateGeometry ????
83         AliMUONResponseV0* responseSt1 = new AliMUONResponseV0;
84         // Mathieson parameters from L.Kharmandarian's thesis, page 190
85         responseSt1->SetSqrtKx3AndDeriveKx2Kx4(0.7000); // sqrt(0.4900)
86         responseSt1->SetSqrtKy3AndDeriveKy2Ky4(0.7550); // sqrt(0.5700)
87         responseSt1->SetPitch(0.20); // anode-cathode distance
88         responseSt1->SetSigmaIntegration(10.);
89         // ChargeSlope larger to compensate for the smaller anode-cathode distance
90         // and keep the same most probable ADC channel for mip's
91         responseSt1->SetChargeSlope(62.5); 
92         // assumed proportionality to anode-cathode distance for ChargeSpread
93         responseSt1->SetChargeSpread(0.144, 0.144);
94         responseSt1->SetMaxAdc(4096);
95         responseSt1->SetZeroSuppression(6);
96         
97         //--------------------------------------------------------
98         // Configuration for Chamber TC1/2  (Station 1) ----------           
99
100         Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5};
101         Int_t   nseg1[4]={4, 4, 2, 1};
102 //
103         Int_t chamber=1;
104 //      ^^^^^^^^^^^^^^^^
105         fMUON->SetNsec(chamber-1,2);
106 //
107         AliMUONSegmentationV01 *seg11=new AliMUONSegmentationV01(4);
108         
109         seg11->SetSegRadii(rseg1);
110         seg11->SetPadSize(2.4, 0.4); // smaller pad size
111         seg11->SetDAnod(0.20); // smaller distance between anode wires
112         seg11->SetPadDivision(nseg1);
113         
114         fMUON->SetSegmentationModel(chamber-1, 1, seg11);
115         
116         AliMUONSegmentationV02 *seg12=new AliMUONSegmentationV02(4);
117         seg12->SetSegRadii(rseg1); 
118         seg12->SetPadSize(0.6, 1.6); // smaller pad size
119         seg12->SetDAnod(0.20); // smaller distance between anode wires
120         seg12->SetPadDivision(nseg1);
121         
122         fMUON->SetSegmentationModel(chamber-1, 2, seg12);
123         
124         fMUON->SetResponseModel(chamber-1, responseSt1); // special response        
125         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
126         
127         chamber=2;
128 //      ^^^^^^^^^
129 //
130         fMUON->SetNsec(chamber-1,2);
131 //
132         AliMUONSegmentationV01 *seg21=new AliMUONSegmentationV01(4);
133         seg21->SetSegRadii(rseg1);
134         seg21->SetPadSize(2.4, 0.4); // smaller pad size
135         seg21->SetDAnod(0.20); // smaller distance between anode wires
136         seg21->SetPadDivision(nseg1);
137         fMUON->SetSegmentationModel(chamber-1, 1, seg21);
138 //
139         AliMUONSegmentationV02 *seg22=new AliMUONSegmentationV02(4);
140         seg22->SetSegRadii(rseg1); 
141         seg22->SetPadSize(0.6, 1.6); // smaller pad size
142         seg22->SetDAnod(0.20); // smaller distance between anode wires
143         seg22->SetPadDivision(nseg1);
144         fMUON->SetSegmentationModel(chamber-1, 2, seg22);
145         
146         fMUON->SetResponseModel(chamber-1, responseSt1); // special response
147         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
148         
149 }
150
151 //__________________________________________________________________________
152 void AliMUONFactory::BuildStation2() 
153 {
154 //
155 //--------------------------------------------------------
156 // Configuration for Chamber TC3/4 (Station 2) -----------
157 ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158 // Float_t rseg2[4]={23.5, 87.7, 122.4, 122.5};
159
160         Float_t rseg2[4]={23.5, 53.5, 90.5, 122.5};       
161         Int_t   nseg2[4]={4, 4, 2, 1};
162 //
163         Int_t chamber=3;
164 //      ^^^^^^^^^^^^^^^^
165         fMUON->SetNsec(chamber-1,2);
166 //
167         AliMUONSegmentationV01 *seg31=new AliMUONSegmentationV01(4);
168         seg31->SetSegRadii(rseg2);
169         seg31->SetPadSize(3.0, 0.5);
170         seg31->SetDAnod(3.0/3./4);
171         seg31->SetPadDivision(nseg2);
172         fMUON->SetSegmentationModel(chamber-1, 1, seg31);
173 //
174         AliMUONSegmentationV02 *seg32=new AliMUONSegmentationV02(4);
175         seg32->SetSegRadii(rseg2); 
176         seg32->SetPadSize(0.75, 2.0);
177         seg32->SetPadDivision(nseg2);
178         seg32->SetDAnod(3.0/3./4);
179         
180         fMUON->SetSegmentationModel(chamber-1, 2, seg32);
181         
182         fMUON->SetResponseModel(chamber-1, fResponse0);     
183         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
184         
185         chamber=4;
186 //      ^^^^^^^^^
187 //
188         fMUON->SetNsec(chamber-1,2);
189 //
190         AliMUONSegmentationV01 *seg41=new AliMUONSegmentationV01(4);
191         seg41->SetSegRadii(rseg2);
192         seg41->SetPadSize(3.0, 0.5);
193         seg41->SetDAnod(3.0/3./4);
194         seg41->SetPadDivision(nseg2);
195         fMUON->SetSegmentationModel(chamber-1, 1, seg41);
196 //
197         AliMUONSegmentationV02 *seg42=new AliMUONSegmentationV02(4);
198         seg42->SetSegRadii(rseg2); 
199         seg42->SetPadSize(0.75, 2.0);
200         seg42->SetPadDivision(nseg2);
201         seg42->SetDAnod(3.0/3./4);
202         
203         fMUON->SetSegmentationModel(chamber-1, 2, seg42);
204         
205         fMUON->SetResponseModel(chamber-1, fResponse0);     
206         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
207 }       
208         
209         
210 //__________________________________________________________________________
211 void AliMUONFactory::BuildStation3() 
212 {
213 //--------------------------------------------------------
214 // Configuration for Chamber TC5/6  (Station 3) ----------          
215 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
216
217         Int_t   nseg3[4]={4, 4, 2, 1};
218         Int_t   npcb5[36] = {0,0,2,0,
219                              0,0,3,0,
220                              0,1,3,0,
221                              0,2,2,0,
222                              0,1,2,0, 
223                              0,2,2,0, 
224                              0,1,3,0, 
225                              0,0,3,0,
226                              0,0,2,0};
227         
228         Float_t shift = 1.5/2.;
229         Float_t xpos5[9]    = {2., 2., 2., 2.,33., 2., 2., 2., 2.};
230         Float_t ypos5       = -(20.+4.*(40.-2.*shift));
231         
232         Int_t chamber=5;
233         fMUON->SetNsec(chamber-1,2);
234         AliMUONSegmentationSlat *seg51=new AliMUONSegmentationSlat(4);
235         seg51->SetNSlats(9); 
236         seg51->SetShift(shift);  
237         seg51->SetNPCBperSector(npcb5); 
238         seg51->SetSlatXPositions(xpos5);
239         seg51->SetSlatYPosition(ypos5);
240         seg51->SetPadSize(10.,0.5);
241         seg51->SetDAnod(0.25);
242         seg51->SetPadDivision(nseg3);
243         fMUON->SetSegmentationModel(chamber-1, 1, seg51);
244         
245         AliMUONSegmentationSlatN *seg52=new AliMUONSegmentationSlatN(4);
246         seg52->SetNSlats(9); 
247         seg52->SetShift(shift);  
248         seg52->SetNPCBperSector(npcb5); 
249         seg52->SetSlatXPositions(xpos5);
250         seg52->SetSlatYPosition(ypos5);
251         seg52->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
252         seg52->SetDAnod(0.25);
253         seg52->SetPadDivision(nseg3);
254         fMUON->SetSegmentationModel(chamber-1, 2, seg52);
255         fMUON->SetResponseModel(chamber-1, fResponse0);      
256         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
257         
258         chamber=6;
259         fMUON->SetNsec(chamber-1,2);
260         AliMUONSegmentationSlat *seg61=new AliMUONSegmentationSlat(4);
261         seg61->SetNSlats(9); 
262         seg61->SetShift(shift);  
263         seg61->SetNPCBperSector(npcb5); 
264         seg61->SetSlatXPositions(xpos5);
265         seg61->SetSlatYPosition(ypos5);
266         seg61->SetPadSize(10.,0.5);
267         seg61->SetDAnod(0.25);
268         seg61->SetPadDivision(nseg3);
269         fMUON->SetSegmentationModel(chamber-1, 1, seg61);
270         
271         AliMUONSegmentationSlatN *seg62=new AliMUONSegmentationSlatN(4);
272         seg62->SetNSlats(9); 
273         seg62->SetShift(shift);  
274         seg62->SetNPCBperSector(npcb5); 
275         seg62->SetSlatXPositions(xpos5);
276         seg62->SetSlatYPosition(ypos5);
277         seg62->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
278         seg62->SetDAnod(0.25);
279         seg62->SetPadDivision(nseg3);
280         fMUON->SetSegmentationModel(chamber-1, 2, seg62);
281         fMUON->SetResponseModel(chamber-1, fResponse0);      
282         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
283 }
284
285         
286 //__________________________________________________________________________
287 void AliMUONFactory::BuildStation4() 
288 {
289 //--------------------------------------------------------
290 // Configuration for Chamber TC7/8  (Station 4) ----------           
291 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
292
293         Int_t   nseg4[4]={4, 4, 2, 1};
294         
295         Int_t chamber=7;
296 //      ^^^^^^^^^^^^^^^^
297         
298         fMUON->SetNsec(chamber-1,2);
299 //
300         AliMUONSegmentationSlat *seg71=new AliMUONSegmentationSlat(4);
301         Float_t shift = 1.5/2.;
302         Int_t npcb7[44] = {0,0,0,3,
303                            0,0,2,2,
304                            0,0,3,2,
305                            0,2,2,1,
306                            0,2,2,1,
307                            0,1,2,1, 
308                            0,2,2,1, 
309                            0,2,2,1, 
310                            0,0,3,2, 
311                            0,0,2,2, 
312                            0,0,0,3};
313         Float_t xpos7[11]   = {2., 2., 2., 2., 2., 40.5, 2., 2., 2., 2., 2.};
314         Float_t ypos7       = -(20.+5.*(40.-2.*shift));
315         
316         seg71->SetNSlats(11);  
317         seg71->SetShift(shift);  
318         seg71->SetNPCBperSector(npcb7); 
319         seg71->SetSlatXPositions(xpos7);
320         seg71->SetSlatYPosition(ypos7);
321         
322         seg71->SetPadSize(10.,0.5);
323         seg71->SetDAnod(0.25);
324         seg71->SetPadDivision(nseg4);
325         fMUON->SetSegmentationModel(chamber-1, 1, seg71);
326         
327         AliMUONSegmentationSlatN *seg72=new AliMUONSegmentationSlatN(4);
328         
329         fMUON->SetSegmentationModel(chamber-1, 2, seg72);
330         seg72->SetNSlats(11);  
331         seg72->SetShift(shift);   
332         seg72->SetNPCBperSector(npcb7); 
333         seg72->SetSlatXPositions(xpos7);
334         seg72->SetSlatYPosition(ypos7);
335         seg72->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
336         seg72->SetDAnod(0.25);
337         seg72->SetPadDivision(nseg4);
338         
339         fMUON->SetResponseModel(chamber-1, fResponse0);     
340         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
341         
342         chamber=8;
343 //      ^^^^^^^^^
344         fMUON->SetNsec(chamber-1,2);
345 //
346         AliMUONSegmentationSlat *seg81=new AliMUONSegmentationSlat(4);
347         
348         seg81->SetNSlats(11);  
349         seg81->SetShift(shift);  
350         seg81->SetNPCBperSector(npcb7); 
351         seg81->SetSlatXPositions(xpos7);
352         seg81->SetSlatYPosition(ypos7);
353         seg81->SetPadSize(10.,0.5);
354         seg81->SetDAnod(0.25);
355         seg81->SetPadDivision(nseg4);
356         fMUON->SetSegmentationModel(chamber-1, 1, seg81);
357         
358         AliMUONSegmentationSlat *seg82=new AliMUONSegmentationSlatN(4);
359         
360         fMUON->SetSegmentationModel(chamber-1, 2, seg82);
361         seg82->SetNSlats(11);  
362         seg82->SetShift(shift);  
363         seg82->SetNPCBperSector(npcb7); 
364         seg82->SetSlatXPositions(xpos7);
365         seg82->SetSlatYPosition(ypos7);
366         seg82->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
367         seg82->SetDAnod(0.25);
368         seg82->SetPadDivision(nseg4);
369         
370         fMUON->SetResponseModel(chamber-1, fResponse0);     
371         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
372 }
373
374 //__________________________________________________________________________
375 void AliMUONFactory::BuildStation5() 
376 {       
377 //--------------------------------------------------------
378 // Configuration for Chamber TC9/10  (Station 5) ---------           
379 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
380
381         Int_t chamber=9;
382 //      ^^^^^^^^^^^^^^^^
383
384         fMUON->SetNsec(chamber-1,2);
385 //
386         AliMUONSegmentationSlat *seg91=new AliMUONSegmentationSlat(4);
387
388         Int_t   nseg4[4]={4, 4, 2, 1};
389         Float_t shift = 1.5/2.;
390         Int_t   npcb9[52] = {0,0,0,3,
391                              0,0,0,4,
392                              0,0,2,3,
393                              0,0,3,3,
394                              0,2,2,2,
395                              0,2,2,2,
396                              0,1,2,2, 
397                              0,2,2,2, 
398                              0,2,2,2, 
399                              0,0,3,3, 
400                              0,0,2,3, 
401                              0,0,0,4, 
402                              0,0,0,3};   
403         
404         Float_t xpos9[13]   = {2., 2., 2., 2., 2., 2., 40.5, 2., 2., 2., 2., 2., 2.};
405         Float_t ypos9       = -(20.+6.*(40.-2.*shift));
406         
407         seg91->SetNSlats(13);  
408         seg91->SetShift(shift);  
409         seg91->SetNPCBperSector(npcb9); 
410         seg91->SetSlatXPositions(xpos9);
411         seg91->SetSlatYPosition(ypos9);
412         seg91->SetPadSize(10.,0.5);
413         seg91->SetDAnod(0.25);
414         seg91->SetPadDivision(nseg4);
415         fMUON->SetSegmentationModel(chamber-1, 1, seg91);
416         
417         AliMUONSegmentationSlatN *seg92=new AliMUONSegmentationSlatN(4);
418         
419         fMUON->SetSegmentationModel(chamber-1, 2, seg92);
420         seg92->SetNSlats(13);  
421         seg92->SetShift(shift);   
422         seg92->SetNPCBperSector(npcb9); 
423         seg92->SetSlatXPositions(xpos9);
424         seg92->SetSlatYPosition(ypos9);
425         seg92->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
426         seg92->SetDAnod(0.25);
427         seg92->SetPadDivision(nseg4);
428         
429         fMUON->SetResponseModel(chamber-1, fResponse0);     
430         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
431         
432         chamber=10;
433 //      ^^^^^^^^^
434         fMUON->SetNsec(chamber-1,2);
435 //
436         AliMUONSegmentationSlat *seg101=new AliMUONSegmentationSlat(4);
437         
438         seg101->SetNSlats(13);  
439         seg101->SetShift(shift);  
440         seg101->SetNPCBperSector(npcb9); 
441         seg101->SetSlatXPositions(xpos9);
442         seg101->SetSlatYPosition(ypos9);
443         seg101->SetPadSize(10.,0.5);
444         seg101->SetDAnod(0.25);
445         seg101->SetPadDivision(nseg4);
446         fMUON->SetSegmentationModel(chamber-1, 1, seg101);
447         
448         AliMUONSegmentationSlatN *seg102=new AliMUONSegmentationSlatN(4);
449         
450         fMUON->SetSegmentationModel(chamber-1, 2, seg102);
451         seg102->SetNSlats(13);  
452         seg102->SetShift(shift);   
453         seg102->SetNPCBperSector(npcb9); 
454         seg102->SetSlatXPositions(xpos9);
455         seg102->SetSlatYPosition(ypos9);
456         seg102->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
457         seg102->SetDAnod(0.25);
458         seg102->SetPadDivision(nseg4);
459         
460         fMUON->SetResponseModel(chamber-1, fResponse0);     
461         fMUON->Chamber(chamber-1).SetChargeCorrel(0.11); // 11% charge spread
462 }
463
464 //__________________________________________________________________________
465 void AliMUONFactory::BuildStation6() 
466 {       
467 //--------------------------------------------------------
468 // Configuration for Trigger Stations -------------------- 
469 //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
470
471 // Cluster-size off
472         AliMUONResponseTrigger* responseTrigger0 =  new AliMUONResponseTrigger;
473 // Cluster-size on  
474 // AliMUONResponseTriggerV1* responseTrigger0 =  new AliMUONResponseTriggerV1;
475  
476         Int_t chamber=11;
477         fMUON->SetNsec(chamber-1,2);
478         AliMUONSegmentationTriggerX *seg111=new AliMUONSegmentationTriggerX;
479         fMUON->SetSegmentationModel(chamber-1, 1, seg111);
480         AliMUONSegmentationTriggerY *seg112=new AliMUONSegmentationTriggerY;
481         fMUON->SetSegmentationModel(chamber-1, 2, seg112);
482         
483         fMUON->SetResponseModel(chamber-1, responseTrigger0);      
484         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
485         
486  
487         chamber=12;
488         fMUON->SetNsec(chamber-1,2);
489         AliMUONSegmentationTriggerX *seg121=new AliMUONSegmentationTriggerX;
490         fMUON->SetSegmentationModel(chamber-1, 1, seg121);
491         AliMUONSegmentationTriggerY *seg122=new AliMUONSegmentationTriggerY;
492         fMUON->SetSegmentationModel(chamber-1, 2, seg122);
493         
494         fMUON->SetResponseModel(chamber-1, responseTrigger0);
495         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
496         
497         chamber=13;
498         fMUON->SetNsec(chamber-1,2);
499         AliMUONSegmentationTriggerX *seg131=new AliMUONSegmentationTriggerX;
500         fMUON->SetSegmentationModel(chamber-1, 1, seg131);
501         AliMUONSegmentationTriggerY *seg132=new AliMUONSegmentationTriggerY;
502         fMUON->SetSegmentationModel(chamber-1, 2, seg132);
503         fMUON->SetResponseModel(chamber-1, responseTrigger0);      
504         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
505         
506         chamber=14;
507         fMUON->SetNsec(chamber-1,2);
508         AliMUONSegmentationTriggerX *seg141=new AliMUONSegmentationTriggerX;
509         fMUON->SetSegmentationModel(chamber-1, 1, seg141);
510         AliMUONSegmentationTriggerY *seg142=new AliMUONSegmentationTriggerY;
511         fMUON->SetSegmentationModel(chamber-1, 2, seg142);
512         
513         fMUON->SetResponseModel(chamber-1, responseTrigger0); 
514         fMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes
515 }       
516
517 //__________________________________________________________________________
518 void AliMUONFactory::Build(AliMUON* where, const char* what) 
519 {
520 //
521 // Construct MUON from chambers, segmentation and responses
522 //
523
524     fMUON = where;
525     char tmp[20];
526     strcpy(tmp, what);
527
528     if (strcmp(tmp, "default")==0) {
529       // Set default parameters
530       fMUON->SetIshunt(0);
531       fMUON->SetMaxStepGas(0.1);
532       fMUON->SetMaxStepAlu(0.1);
533
534       // Build all stations
535       BuildCommon();
536       BuildStation1();
537       BuildStation2();
538       BuildStation3();
539       BuildStation4();
540       BuildStation5();
541       BuildStation6();
542     } 
543     else {
544       if(fMUON->GetDebug()) {
545         printf("\nAliMUONFactory: --------AliMUONFactory------------------------------");
546         printf("\nAliMUONFactory:  Non default version of MUON selected               ");
547         printf("\nAliMUONFactory:  You have to construct yourself the MUON elements !!");       
548         printf("\nAliMUONFactory: ----------------------------------------------------");
549       }
550     }
551 }
552
553 //__________________________________________________________________________
554 void AliMUONFactory::BuildStation(AliMUON* where, Int_t stationNumber) 
555 {
556 //
557 // Construct MUON from chambers, segmentation and responses
558 //
559 // Version 0
560 //
561 // First define the number of planes that are segmented (1 or 2) by a call
562 // to SetNsec.
563 // Then chose for each chamber (chamber plane) the segmentation
564 // and response model.
565 // They should be equal for the two chambers of each station. In a future
566 // version this will be enforced.
567 //
568
569     fMUON = where;
570     if (!fResponse0) BuildCommon(); 
571     
572     switch (stationNumber) {    
573       case 1:  BuildStation1(); break;
574       case 2:  BuildStation2(); break;
575       case 3:  BuildStation3(); break;
576       case 4:  BuildStation4(); break;
577       case 5:  BuildStation5(); break;
578       case 6:  BuildStation6(); break;
579     
580       default: Fatal("Build", "Wrong station number");
581     }  
582 }