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